From 573aaff30ec5eebef21a7346f62ef1dbf394544d Mon Sep 17 00:00:00 2001 From: Avi Kivity <avi@redhat.com> Date: Sun, 5 Dec 2010 14:23:54 -0200 Subject: [PATCH 2/2] KVM: VMX: Return 0 from a failed VMREAD RH-Author: Avi Kivity <avi@redhat.com> Message-id: <1291559034-31793-3-git-send-email-avi@redhat.com> Patchwork-id: 14224 O-Subject: [PATCH RHEL5.5.z 2/2] KVM: VMX: Return 0 from a failed VMREAD Bugzilla: 661397 RH-Acked-by: Marcelo Tosatti <mtosatti@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