From: Avi Kivity Date: Thu, 2 Dec 2010 15:55:23 +0000 (+0200) Subject: KVM: VMX: Return 0 from a failed VMREAD X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a295673aba42895997a6c1be87f467a7cfc0f332;p=openwrt%2Fstaging%2Fblogic.git KVM: VMX: Return 0 from a failed VMREAD 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 --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ab05ff68bcd7..f3693ca93982 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -565,10 +565,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; }