Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162798974
D6059.id15491.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
820 B
Referenced Files
None
Subscribers
None
D6059.id15491.diff
View Options
Index: sys/amd64/amd64/initcpu.c
===================================================================
--- sys/amd64/amd64/initcpu.c
+++ sys/amd64/amd64/initcpu.c
@@ -58,6 +58,7 @@
static void
init_amd(void)
{
+ uint64_t msr;
/*
* Work around Erratum 721 for Family 10h and 12h processors.
@@ -80,6 +81,20 @@
wrmsr(0xc0011029, rdmsr(0xc0011029) | 1);
break;
}
+
+ /*
+ * BIOS may configure Family 10h processors to convert WC+ cache type
+ * to CD. That can hurt performance of guest VMs using nested paging.
+ * The relevant MSR bit is not documented in the BKDG,
+ * the fix is borrowed from Linux.
+ */
+ if (CPUID_TO_FAMILY(cpu_id) == 0x10) {
+ if ((cpu_feature2 & CPUID2_HV) == 0) {
+ msr = rdmsr(0xc001102a);
+ msr &= ~((uint64_t)1 << 24);
+ wrmsr(0xc001102a, msr);
+ }
+ }
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 18, 12:52 AM (11 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35181909
Default Alt Text
D6059.id15491.diff (820 B)
Attached To
Mode
D6059: fix-up for configuration of AMD Family 10h processors borrowed from Linux
Attached
Detach File
Event Timeline
Log In to Comment