public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/intel_rdt: use rdmsr_safe() to workaround AWS host issue
@ 2018-12-20 13:40 Vitaly Kuznetsov
  2018-12-20 16:17 ` Borislav Petkov
  0 siblings, 1 reply; 9+ messages in thread
From: Vitaly Kuznetsov @ 2018-12-20 13:40 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, Fenghua Yu, Reinette Chatre, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	Jan H . Schönherr, David Duncan

It was found that AWS x1 instances (Xen-based) lack xen.git commit
1f1d183d4900 (x86/HVM: don't give the wrong impression of WRMSR succeeding)
and because of that the wrmsr_safe() check in cache_alloc_hsw_probe()
doesn't help: the consequent rdmsr() blows up with

 unchecked MSR access error: RDMSR from 0xc90 at rIP:
   0xffffffff88c5bba3 (native_read_msr+0x3/0x30)

The issue should definitely get fixed on AWS side. We can, however, simply
workaround this in Linux and live happily after.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 arch/x86/kernel/cpu/intel_rdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
index 44272b7107ad..0acee6cd07a8 100644
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -213,7 +213,8 @@ static inline void cache_alloc_hsw_probe(void)
 
 	if (wrmsr_safe(IA32_L3_CBM_BASE, max_cbm, 0))
 		return;
-	rdmsr(IA32_L3_CBM_BASE, l, h);
+	if (rdmsr_safe(IA32_L3_CBM_BASE, &l, &h))
+		return;
 
 	/* If all the bits were set in MSR, return success */
 	if (l != max_cbm)
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-10 10:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-20 13:40 [PATCH] x86/intel_rdt: use rdmsr_safe() to workaround AWS host issue Vitaly Kuznetsov
2018-12-20 16:17 ` Borislav Petkov
2018-12-20 17:31   ` Vitaly Kuznetsov
     [not found]   ` <51dcb13a-4751-47f5-1e01-f6731a2c6f3c@intel.com>
     [not found]     ` <20521afe-09af-7acf-6f32-3f6e9a971091@intel.com>
2019-01-09 11:39       ` Borislav Petkov
2019-01-09 12:09         ` Vitaly Kuznetsov
2019-01-09 12:14           ` Borislav Petkov
2019-01-09 18:41             ` Tony Luck
2019-01-10 10:32               ` Vitaly Kuznetsov
2019-01-10 10:53                 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox