diff options
author | royger <royger@FreeBSD.org> | 2017-02-24 10:20:13 +0000 |
---|---|---|
committer | royger <royger@FreeBSD.org> | 2017-02-24 10:20:13 +0000 |
commit | 51adcc4a230669adb28629d389347b1a4da040e1 (patch) | |
tree | 34d907566c5ed461af0a21c9fe72a192eb5e916b /sys | |
parent | ab9578f7175d93afabb4399b01039d613d26bdb8 (diff) | |
download | FreeBSD-src-51adcc4a230669adb28629d389347b1a4da040e1.zip FreeBSD-src-51adcc4a230669adb28629d389347b1a4da040e1.tar.gz |
MFC r313871
x86: fix MTRR initialization if EARLY_AP_STARTUP is used
Sponsored by: Citrix Systems R&D
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/amd64_mem.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/i686_mem.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c index aa8dc5c..315981d 100644 --- a/sys/amd64/amd64/amd64_mem.c +++ b/sys/amd64/amd64/amd64_mem.c @@ -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); diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index a7b8166..03e5b17 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -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); |