From 575341ccc407b898a6601ac54b566d09d7595edf Mon Sep 17 00:00:00 2001 From: Avi Kivity <avi@redhat.com> Date: Sun, 5 Dec 2010 13:57:07 -0200 Subject: [PATCH 2/2] KVM: VMX: Return 0 from a failed VMREAD RH-Author: Avi Kivity <avi@redhat.com> Message-id: <1291557427-30665-3-git-send-email-avi@redhat.com> Patchwork-id: 14221 O-Subject: [PATCH RHEL5.6 RHEL5.5.z 2/2] KVM: VMX: Return 0 from a failed VMREAD Bugzilla: 608709 RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com> RH-Acked-by: Gleb Natapov <gleb@redhat.com> RH-Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Bugzilla: 608709 Upstream: kvm.git 494e4599 If we execute VMREAD during reboot we'll just skip over it. Instead of returning garbage, return 0, which has a much smaller chance of confusing the code. Otherwise we risk a flood of debug printk()s which block the reboot process if a serial console or netconsole is enabled. Signed-off-by: Avi Kivity <avi@redhat.com> --- arch/x86/kvm/vmx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- arch/x86/kvm/vmx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 1c67e4f..1131409 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -402,10 +402,10 @@ static inline void ept_sync_individual_addr(u64 eptp, gpa_t gpa) static unsigned long vmcs_readl(unsigned long field) { - unsigned long value; + unsigned long value = 0; asm volatile (__ex(ASM_VMX_VMREAD_RDX_RAX) - : "=a"(value) : "d"(field) : "cc"); + : "+a"(value) : "d"(field) : "cc"); return value; } -- 1.7.3.2