mirror of https://gitee.com/openkylin/linux.git
[PATCH] KVM: Improve reporting of vmwrite errors
This will allow us to see the root cause when a vmwrite error happens. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
37a7d8b046
commit
e52de1b8cf
|
@ -152,15 +152,21 @@ static u64 vmcs_read64(unsigned long field)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static noinline void vmwrite_error(unsigned long field, unsigned long value)
|
||||||
|
{
|
||||||
|
printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n",
|
||||||
|
field, value, vmcs_read32(VM_INSTRUCTION_ERROR));
|
||||||
|
dump_stack();
|
||||||
|
}
|
||||||
|
|
||||||
static void vmcs_writel(unsigned long field, unsigned long value)
|
static void vmcs_writel(unsigned long field, unsigned long value)
|
||||||
{
|
{
|
||||||
u8 error;
|
u8 error;
|
||||||
|
|
||||||
asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0"
|
asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0"
|
||||||
: "=q"(error) : "a"(value), "d"(field) : "cc" );
|
: "=q"(error) : "a"(value), "d"(field) : "cc" );
|
||||||
if (error)
|
if (unlikely(error))
|
||||||
printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n",
|
vmwrite_error(field, value);
|
||||||
field, value, vmcs_read32(VM_INSTRUCTION_ERROR));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vmcs_write16(unsigned long field, u16 value)
|
static void vmcs_write16(unsigned long field, u16 value)
|
||||||
|
|
Loading…
Reference in New Issue