diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:27 -0500 |
commit | e52de1b8cf85aa2ccaaa253b4397c6d6cc0d4897 (patch) | |
tree | 70699f72b67d0d62a614248a935925c497847241 /drivers/kvm/vmx.c | |
parent | 37a7d8b046da6254718be1409140cd7bf3126f8f (diff) |
[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>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index ed3956739771..779d8fc07d31 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -152,15 +152,21 @@ static u64 vmcs_read64(unsigned long field) | |||
152 | #endif | 152 | #endif |
153 | } | 153 | } |
154 | 154 | ||
155 | static noinline void vmwrite_error(unsigned long field, unsigned long value) | ||
156 | { | ||
157 | printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n", | ||
158 | field, value, vmcs_read32(VM_INSTRUCTION_ERROR)); | ||
159 | dump_stack(); | ||
160 | } | ||
161 | |||
155 | static void vmcs_writel(unsigned long field, unsigned long value) | 162 | static void vmcs_writel(unsigned long field, unsigned long value) |
156 | { | 163 | { |
157 | u8 error; | 164 | u8 error; |
158 | 165 | ||
159 | asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0" | 166 | asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0" |
160 | : "=q"(error) : "a"(value), "d"(field) : "cc" ); | 167 | : "=q"(error) : "a"(value), "d"(field) : "cc" ); |
161 | if (error) | 168 | if (unlikely(error)) |
162 | printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n", | 169 | vmwrite_error(field, value); |
163 | field, value, vmcs_read32(VM_INSTRUCTION_ERROR)); | ||
164 | } | 170 | } |
165 | 171 | ||
166 | static void vmcs_write16(unsigned long field, u16 value) | 172 | static void vmcs_write16(unsigned long field, u16 value) |