Date: Mon, 19 Jan 2015 10:52:55 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r277374 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/x86 Message-ID: <201501191052.t0JAqtbE048459@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jan 19 10:52:55 2015 New Revision: 277374 URL: https://svnweb.freebsd.org/changeset/base/277374 Log: MFC r277047: For x86, read MAXPHYADDR into variable cpu_maxphyaddr. Modified: stable/10/sys/amd64/amd64/initcpu.c stable/10/sys/amd64/include/md_var.h stable/10/sys/i386/i386/initcpu.c stable/10/sys/i386/include/md_var.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Mon Jan 19 07:29:28 2015 (r277373) +++ stable/10/sys/amd64/amd64/initcpu.c Mon Jan 19 10:52:55 2015 (r277374) @@ -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: stable/10/sys/amd64/include/md_var.h ============================================================================== --- stable/10/sys/amd64/include/md_var.h Mon Jan 19 07:29:28 2015 (r277373) +++ stable/10/sys/amd64/include/md_var.h Mon Jan 19 10:52:55 2015 (r277374) @@ -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 char kstack[]; extern char sigcode[]; Modified: stable/10/sys/i386/i386/initcpu.c ============================================================================== --- stable/10/sys/i386/i386/initcpu.c Mon Jan 19 07:29:28 2015 (r277373) +++ stable/10/sys/i386/i386/initcpu.c Mon Jan 19 10:52:55 2015 (r277374) @@ -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: stable/10/sys/i386/include/md_var.h ============================================================================== --- stable/10/sys/i386/include/md_var.h Mon Jan 19 07:29:28 2015 (r277373) +++ stable/10/sys/i386/include/md_var.h Mon Jan 19 10:52:55 2015 (r277374) @@ -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: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Mon Jan 19 07:29:28 2015 (r277373) +++ stable/10/sys/x86/x86/identcpu.c Mon Jan 19 10:52:55 2015 (r277374) @@ -1289,7 +1289,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?201501191052.t0JAqtbE048459>