diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index d181aab155..b8d4a2abba 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -448,6 +448,14 @@ static void __devinit init_amd(struct cpuinfo_x86 *c) } } + /* + * The way access filter has a performance penalty on some workloads. + * Disable it on the affected CPUs. + */ + if (c->x86 == 0x15 && c->x86_model >= 0x02 && c->x86_model < 0x20 && + !rdmsr_safe(MSR_AMD64_IC_CFG, value) && (value & 0x1e) != 0x1e) + wrmsr_safe(MSR_AMD64_IC_CFG, value | 0x1e); + amd_get_topology(c); /* Pointless to use MWAIT on Family10 as it does not deep sleep. */ diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h index 4c32481ae3..03f6f985b0 100644 --- a/xen/include/asm-x86/msr-index.h +++ b/xen/include/asm-x86/msr-index.h @@ -211,6 +211,7 @@ /* AMD64 MSRs */ #define MSR_AMD64_NB_CFG 0xc001001f +#define MSR_AMD64_IC_CFG 0xc0011021 #define MSR_AMD64_DC_CFG 0xc0011022 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT 46