All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mce: use safe MSR accesses
@ 2015-03-11 22:09 jesse.larrew
  2015-03-11 22:47 ` Luck, Tony
  0 siblings, 1 reply; 4+ messages in thread
From: jesse.larrew @ 2015-03-11 22:09 UTC (permalink / raw)
  To: x86
  Cc: Joel Schopp, Tony Luck, Borislav Petkov, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, linux-edac, linux-kernel,
	Jesse Larrew

From: Jesse Larrew <jesse.larrew@amd.com>

When running as a guest under kvm, it's possible that the MSR
being accessed may not be implemented. All MSR accesses should
be prepared to handle exceptions.

Signed-off-by: Jesse Larrew <jesse.larrew@amd.com>
---
 arch/x86/kernel/cpu/mcheck/mce.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 61a9668ce..4151ba9 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1556,12 +1556,12 @@ static int __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
 				 wrmsrl(MSR_K7_HWCR, hwcr | BIT(18));
 
 			 for (i = 0; i < ARRAY_SIZE(msrs); i++) {
-				 rdmsrl(msrs[i], val);
+				 rdmsrl_safe(msrs[i], &val);
 
 				 /* CntP bit set? */
 				 if (val & BIT_64(62)) {
 					val &= ~BIT_64(62);
-					wrmsrl(msrs[i], val);
+					wrmsrl_safe(msrs[i], val);
 				 }
 			 }
 
-- 
1.9.1


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

end of thread, other threads:[~2015-03-12 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 22:09 [PATCH] mce: use safe MSR accesses jesse.larrew
2015-03-11 22:47 ` Luck, Tony
2015-03-12 17:20   ` Joel Schopp
2015-03-12 17:30     ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.