Date: Mon, 12 Jan 2015 07:36:25 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277047 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/x86 Message-ID: <201501120736.t0C7aPxW043673@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jan 12 07:36:25 2015 New Revision: 277047 URL: https://svnweb.freebsd.org/changeset/base/277047 Log: For x86, read MAXPHYADDR, defined in SDM vol 3 4.1.4 Enumeration of Paging Features by CPUID as CPUID.80000008H:EAX[7:0], into variable cpu_maxphyaddr. Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/include/md_var.h head/sys/i386/i386/initcpu.c head/sys/i386/include/md_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Mon Jan 12 07:29:35 2015 (r277046) +++ head/sys/amd64/amd64/initcpu.c Mon Jan 12 07:36:25 2015 (r277047) @@ -78,6 +78,7 @@ u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ +u_int cpu_maxphyaddr; /* Max phys addr width in bits */ SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA RNG feature available in CPU"); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Jan 12 07:29:35 2015 (r277046) +++ head/sys/amd64/include/md_var.h Mon Jan 12 07:36:25 2015 (r277047) @@ -61,6 +61,7 @@ extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; +extern u_int cpu_maxphyaddr; extern char ctx_switch_xsave[]; extern u_int hv_high; extern char hv_vendor[]; Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Jan 12 07:29:35 2015 (r277046) +++ head/sys/i386/i386/initcpu.c Mon Jan 12 07:36:25 2015 (r277047) @@ -107,6 +107,7 @@ u_int cpu_mon_mwait_flags; /* MONITOR/MW u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ u_int cyrix_did; /* Device ID of Cyrix CPU */ +u_int cpu_maxphyaddr; /* Max phys addr width in bits */ SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA RNG feature available in CPU"); Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Jan 12 07:29:35 2015 (r277046) +++ head/sys/i386/include/md_var.h Mon Jan 12 07:36:25 2015 (r277047) @@ -61,6 +61,7 @@ extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; +extern u_int cpu_maxphyaddr; extern u_int cyrix_did; #if defined(I586_CPU) && !defined(NO_F00F_HACK) extern int has_f00f_bug; Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Mon Jan 12 07:29:35 2015 (r277046) +++ head/sys/x86/x86/identcpu.c Mon Jan 12 07:36:25 2015 (r277047) @@ -1393,7 +1393,10 @@ identify_cpu(void) } if (cpu_exthigh >= 0x80000008) { do_cpuid(0x80000008, regs); + cpu_maxphyaddr = regs[0] & 0xff; cpu_procinfo2 = regs[2]; + } else { + cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32; } #ifdef __i386__
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501120736.t0C7aPxW043673>