From owner-svn-src-all@freebsd.org Wed Aug 9 17:02:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA82ADD14C5; Wed, 9 Aug 2017 17:02:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7A97D3F6; Wed, 9 Aug 2017 17:02:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 To: Dexuan Cui , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Cc: Yanmin Qiao , Hongjiang Zhang References: <201708050656.v756uk48076256@repo.freebsd.org> From: Jung-uk Kim Message-ID: <331d02b4-a315-70e5-7fe9-2e767554a148@FreeBSD.org> Date: Wed, 9 Aug 2017 13:02:42 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="icHEPANxVljk5Wmr1TTJ23MNwHXws8NnW" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2017 17:02:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --icHEPANxVljk5Wmr1TTJ23MNwHXws8NnW Content-Type: multipart/mixed; boundary="WDQBVTA42pmju0a29PpWBPQKg2FLjcBPJ"; protected-headers="v1" From: Jung-uk Kim To: Dexuan Cui , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Cc: Yanmin Qiao , Hongjiang Zhang Message-ID: <331d02b4-a315-70e5-7fe9-2e767554a148@FreeBSD.org> Subject: Re: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 References: <201708050656.v756uk48076256@repo.freebsd.org> In-Reply-To: --WDQBVTA42pmju0a29PpWBPQKg2FLjcBPJ Content-Type: multipart/mixed; boundary="------------370644EAE7D50A34E0B3E01F" Content-Language: en-US This is a multi-part message in MIME format. --------------370644EAE7D50A34E0B3E01F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/09/2017 00:09, Dexuan Cui wrote: > Hi jkim, > The patch breaks FreeBSD VM on Hyper-V. >=20 > identify_hypervisor() is moved from identify_cpu() to an earlier place,= but the global=20 > variable cpu_feature2 used by the function is still initialized in iden= tify_cpu(). >=20 > I'm not sure about the background of your patch. Can you please have a = look? Can you please test the attached patch? Jung-uk Kim --------------370644EAE7D50A34E0B3E01F Content-Type: text/x-patch; name="cpuid.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cpuid.diff" Index: sys/amd64/amd64/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/amd64/machdep.c (revision 322319) +++ sys/amd64/amd64/machdep.c (working copy) @@ -1537,6 +1537,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) =20 kmdp =3D init_ops.parse_preload_data(modulep); =20 + identify_cpu(); identify_hypervisor(); =20 /* Init basic tunables, hz etc */ @@ -1643,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) !=3D NULL) vty_set_preferred(VTY_VT); =20 - identify_cpu(); /* Final stage of CPU initialization */ + finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ initializecpucache(); =20 Index: sys/i386/include/md_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/include/md_var.h (revision 322319) +++ sys/i386/include/md_var.h (working copy) @@ -59,7 +59,6 @@ void doreti_popl_es(void) __asm(__STRING(doreti_po void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); -void finishidentcpu(void); void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); Index: sys/x86/include/x86_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/x86/include/x86_var.h (revision 322319) +++ sys/x86/include/x86_var.h (working copy) @@ -115,6 +115,7 @@ void cpu_probe_amdc1e(void); void cpu_setregs(void); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); +void finishidentcpu(void); void identify_cpu(void); void identify_hypervisor(void); void initializecpu(void); Index: sys/x86/x86/identcpu.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/x86/x86/identcpu.c (revision 322319) +++ sys/x86/x86/identcpu.c (working copy) @@ -1372,23 +1372,12 @@ fix_cpuid(void) return (false); } =20 -/* - * Final stage of CPU identification. - */ -#ifdef __i386__ +#ifdef __amd64__ void -finishidentcpu(void) -#else -void identify_cpu(void) -#endif { - u_int regs[4], cpu_stdext_disable; -#ifdef __i386__ - u_char ccr3; -#endif + u_int regs[4]; =20 -#ifdef __amd64__ do_cpuid(0, regs); cpu_high =3D regs[0]; ((u_int *)&cpu_vendor)[0] =3D regs[1]; @@ -1401,8 +1390,20 @@ identify_cpu(void) cpu_procinfo =3D regs[1]; cpu_feature =3D regs[3]; cpu_feature2 =3D regs[2]; +} #endif =20 +/* + * Final stage of CPU identification. + */ +void +finishidentcpu(void) +{ + u_int regs[4], cpu_stdext_disable; +#ifdef __i386__ + u_char ccr3; +#endif + cpu_vendor_id =3D find_cpu_vendor_id(); =20 if (fix_cpuid()) { --------------370644EAE7D50A34E0B3E01F-- --WDQBVTA42pmju0a29PpWBPQKg2FLjcBPJ-- --icHEPANxVljk5Wmr1TTJ23MNwHXws8NnW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlmLQDIACgkQfJ+WJvzb 8Ub0pwf/T59R175CWocqyBfEXVKgvQj0xzk5nJPTvbSNknVvbn+aLNbcJq0qPflj fskzMxqWw8rfSGwtkJke8Up1VMwKBybT1b73f7Bq7TrBlkcp6YX2frsMaALjqHtu Dbrgz3RCDx+P99Hz9+GzwNqrI2sg276IMX/QD9fPtBZo0estB+oDC07TrEBq0wYx lzE4LDwBInoWwLBCgYm1WZOE8va0iANycEDULGQd7vWgDA9CKhxgM9sjYn7w8ay1 emPpx5/0HcUEN1EC4yOHu7jqfqYH1SzEezbGzZ/zeH22HErGOrCncVRwW3f6bTEB A2XI0NeWiha/3llOYxy8/N6FRNYSjQ== =wIVS -----END PGP SIGNATURE----- --icHEPANxVljk5Wmr1TTJ23MNwHXws8NnW--