mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
- Relax the PAT MSR programming which was unnecessarily using the MTRR
programming protocol of disabling the cache around the changes. The reason behind this is the current algorithm triggering a #VE exception for TDX guests and unnecessarily complicating things -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmXux8sACgkQEsHwGGHe VUodOw//diEAM3//Ht733soDDMYuc3pnLBgpIvEYtU7nvo7rVuNJASUny+WmQNVl Szm1ATl88I0H1t54CAdvd398csKlZPmsO/puu/sLiJrvmjXtH4raE/u9lFjpdBwo yoSbgb8v15No0JlszeE782rJfAHQ01FK7LbEuV0EKF3dx+KDZQPY8E+/LGVNeyh4 X7OWh2RJHUKENYxYgQBBuw2Hkm9HXIgyQiKe9eIrEwpHskCmZ/y8F8LazohVmw8L XqlUZFCmKPwHsLE44sWq5coXoN28RKZfQ2D7jvhts8AwwU1RRoFv5WgCXhFe0Rfe dPfLm93PvxxUYV0OHyCsKeJJkA8KH+vuXiaC1iw7Za6Ipkio1LzNAc/pxa/Q4x8Y dwOM+WI/OdXz8KHQAJlU37ZNGbnA/ETWumNN7SrqqxvKzUbjcjDwZqIqneFT0dg6 c5quB/fgj+lL1xXk9EDE4HrOkzLv3/ax449oLFkJ3JKfRRMAzQalRaTwjTh/hufM 7Eig3iNRN+G6bItXC6XoQjDBEEJP7LplXT8jNQkVbHyMg8WPPToxtJGXBnR73PQp q8+Iv3gLqM5EPqetdAtElVRhikmPHPqCdcBj47EHCoPFsQ1E9b72BUutDH0MVEG4 BIFCWQ4DS+3OXX/BZf7P5UOcPDcGkP+2PqbUmiBRB5I3174XQDQ= =nNC0 -----END PGP SIGNATURE----- Merge tag 'x86_mtrr_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 MTRR update from Borislav Petkov: - Relax the PAT MSR programming which was unnecessarily using the MTRR programming protocol of disabling the cache around the changes. The reason behind this is the current algorithm triggering a #VE exception for TDX guests and unnecessarily complicating things * tag 'x86_mtrr_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pat: Simplify the PAT programming protocol
This commit is contained in:
commit
bfdb395a7c
@ -1118,15 +1118,16 @@ static void cache_cpu_init(void)
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
cache_disable();
|
||||
|
||||
if (memory_caching_control & CACHE_MTRR)
|
||||
if (memory_caching_control & CACHE_MTRR) {
|
||||
cache_disable();
|
||||
mtrr_generic_set_state();
|
||||
cache_enable();
|
||||
}
|
||||
|
||||
if (memory_caching_control & CACHE_PAT)
|
||||
pat_cpu_init();
|
||||
|
||||
cache_enable();
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,8 @@ void pat_cpu_init(void)
|
||||
}
|
||||
|
||||
wrmsrl(MSR_IA32_CR_PAT, pat_msr_val);
|
||||
|
||||
__flush_tlb_all();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -296,13 +298,8 @@ void __init pat_bp_init(void)
|
||||
/*
|
||||
* Xen PV doesn't allow to set PAT MSR, but all cache modes are
|
||||
* supported.
|
||||
* When running as TDX guest setting the PAT MSR won't work either
|
||||
* due to the requirement to set CR0.CD when doing so. Rely on
|
||||
* firmware to have set the PAT MSR correctly.
|
||||
*/
|
||||
if (pat_disabled ||
|
||||
cpu_feature_enabled(X86_FEATURE_XENPV) ||
|
||||
cpu_feature_enabled(X86_FEATURE_TDX_GUEST)) {
|
||||
if (pat_disabled || cpu_feature_enabled(X86_FEATURE_XENPV)) {
|
||||
init_cache_modes(pat_msr_val);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user