Date: Fri, 24 Feb 2017 10:20:14 +0000 (UTC) From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314198 - in stable/11/sys: amd64/amd64 i386/i386 Message-ID: <201702241020.v1OAKEJb088950@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: royger Date: Fri Feb 24 10:20:13 2017 New Revision: 314198 URL: https://svnweb.freebsd.org/changeset/base/314198 Log: MFC r313871 x86: fix MTRR initialization if EARLY_AP_STARTUP is used Sponsored by: Citrix Systems R&D Modified: stable/11/sys/amd64/amd64/amd64_mem.c stable/11/sys/i386/i386/i686_mem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/amd64_mem.c ============================================================================== --- stable/11/sys/amd64/amd64/amd64_mem.c Fri Feb 24 09:30:51 2017 (r314197) +++ stable/11/sys/amd64/amd64/amd64_mem.c Fri Feb 24 10:20:13 2017 (r314198) @@ -609,6 +609,10 @@ amd64_mrinit(struct mem_range_softc *sc) u_int regs[4]; int i, nmdesc = 0, pabits; + if (sc->mr_desc != NULL) + /* Already initialized. */ + return; + mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -750,5 +754,6 @@ amd64_mem_drvinit(void *unused) return; } mem_range_softc.mr_op = &amd64_mrops; + amd64_mrinit(&mem_range_softc); } -SYSINIT(amd64memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, amd64_mem_drvinit, NULL); +SYSINIT(amd64memdev, SI_SUB_CPU, SI_ORDER_ANY, amd64_mem_drvinit, NULL); Modified: stable/11/sys/i386/i386/i686_mem.c ============================================================================== --- stable/11/sys/i386/i386/i686_mem.c Fri Feb 24 09:30:51 2017 (r314197) +++ stable/11/sys/i386/i386/i686_mem.c Fri Feb 24 10:20:13 2017 (r314198) @@ -588,6 +588,10 @@ i686_mrinit(struct mem_range_softc *sc) u_int regs[4]; int i, nmdesc = 0, pabits; + if (sc->mr_desc != NULL) + /* Already initialized. */ + return; + mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -716,5 +720,6 @@ i686_mem_drvinit(void *unused) return; } mem_range_softc.mr_op = &i686_mrops; + i686_mrinit(&mem_range_softc); } -SYSINIT(i686memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, i686_mem_drvinit, NULL); +SYSINIT(i686memdev, SI_SUB_CPU, SI_ORDER_ANY, i686_mem_drvinit, NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702241020.v1OAKEJb088950>