summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2018-12-21 12:02:55 +0000
committerkettenis <kettenis@openbsd.org>2018-12-21 12:02:55 +0000
commitc751d6c2b935d525fd7612b717f37fa67e385ca6 (patch)
treefca1e83b3d5e164d7bb0ad8ba17e6bb171a9758f
parentDIOCIGETIFACES provides interfaces and groups, not drivers (diff)
downloadwireguard-openbsd-c751d6c2b935d525fd7612b717f37fa67e385ca6.tar.xz
wireguard-openbsd-c751d6c2b935d525fd7612b717f37fa67e385ca6.zip
Do PAT setup earlier such that mapping the framebuffer WC works at the
point where we remap it. ok deraadt@, mlarkin@
-rw-r--r--sys/arch/amd64/amd64/cpu.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index 0d1b11cd824..4b08c93bcaf 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.130 2018/10/23 17:51:32 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.131 2018/12/21 12:02:55 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -555,11 +555,6 @@ cpu_init(struct cpu_info *ci)
/* configure the CPU if needed */
if (ci->cpu_setup != NULL)
(*ci->cpu_setup)(ci);
- /*
- * We do this here after identifycpu() because errata may affect
- * what we do.
- */
- patinit(ci);
cr4 = rcr4() | CR4_DEFAULT;
if (ci->ci_feature_sefflags_ebx & SEFF0EBX_SMEP)
@@ -921,6 +916,8 @@ cpu_init_msrs(struct cpu_info *ci)
wrmsr(MSR_FSBASE, 0);
wrmsr(MSR_GSBASE, (u_int64_t)ci);
wrmsr(MSR_KERNELGSBASE, 0);
+
+ patinit(ci);
}
void
@@ -929,7 +926,7 @@ patinit(struct cpu_info *ci)
extern int pmap_pg_wc;
u_int64_t reg;
- if ((ci->ci_feature_flags & CPUID_PAT) == 0)
+ if ((cpu_feature & CPUID_PAT) == 0)
return;
/*
* Set up PAT bits.