Skip to content

Commit

Permalink
[PATCH] KVM: Improve reporting of vmwrite errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avi Kivity authored and Linus Torvalds committed Jan 6, 2007
1 parent 37a7d8b commit e52de1b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,21 @@ static u64 vmcs_read64(unsigned long field)
#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)
{
u8 error;

asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0"
: "=q"(error) : "a"(value), "d"(field) : "cc" );
if (error)
printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n",
field, value, vmcs_read32(VM_INSTRUCTION_ERROR));
if (unlikely(error))
vmwrite_error(field, value);
}

static void vmcs_write16(unsigned long field, u16 value)
Expand Down

0 comments on commit e52de1b

Please sign in to comment.