* [tip:x86/asm] x86/msr: Set the return value to zero when native_rdmsr_safe() fails
[not found] <515fb611449a755312a476cfe11675906e7ddf6c.1459605520.git.luto@kernel.org>
@ 2016-04-13 11:46 ` tip-bot for Andy Lutomirski
0 siblings, 0 replies; only message in thread
From: tip-bot for Andy Lutomirski @ 2016-04-13 11:46 UTC (permalink / raw)
To: linux-tip-commits
Cc: boris.ostrovsky, akpm, kvm, peterz, torvalds, linux-kernel,
Xen-devel, bp, luto, hpa, pbonzini, tglx, arjan, mingo
Commit-ID: b828b79fcced0e66492590707649dbfaea6435e6
Gitweb: http://git.kernel.org/tip/b828b79fcced0e66492590707649dbfaea6435e6
Author: Andy Lutomirski <luto@kernel.org>
AuthorDate: Sat, 2 Apr 2016 07:01:40 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 13 Apr 2016 11:37:46 +0200
x86/msr: Set the return value to zero when native_rdmsr_safe() fails
This will cause unchecked native_rdmsr_safe() failures to return
deterministic results.
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: KVM list <kvm@vger.kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: xen-devel <Xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/515fb611449a755312a476cfe11675906e7ddf6c.1459605520.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/msr.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 00050c0..7dc1d8f 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -101,7 +101,10 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
asm volatile("2: rdmsr ; xor %[err],%[err]\n"
"1:\n\t"
".section .fixup,\"ax\"\n\t"
- "3: mov %[fault],%[err] ; jmp 1b\n\t"
+ "3: mov %[fault],%[err]\n\t"
+ "xorl %%eax, %%eax\n\t"
+ "xorl %%edx, %%edx\n\t"
+ "jmp 1b\n\t"
".previous\n\t"
_ASM_EXTABLE(2b, 3b)
: [err] "=r" (*err), EAX_EDX_RET(val, low, high)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-13 11:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <515fb611449a755312a476cfe11675906e7ddf6c.1459605520.git.luto@kernel.org>
2016-04-13 11:46 ` [tip:x86/asm] x86/msr: Set the return value to zero when native_rdmsr_safe() fails tip-bot for Andy Lutomirski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).