diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-04-22 06:33:13 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:19:26 -0400 |
commit | ce7ddec4bbbc08f0c2901cc103773aed864b09fd (patch) | |
tree | d1cc4b3d0cd472ff30c3c796e6537dd41ec4e268 /arch/x86/kvm/vmx.c | |
parent | c2c63a493924e09a1984d1374a0e60dfd54fc0b0 (diff) |
KVM: x86: Allow marking an exception as reinjected
This patch adds logic to kvm/x86 which allows to mark an
injected exception as reinjected. This allows to remove an
ugly hack from svm_complete_interrupts that prevented
exceptions from being reinjected at all in the nested case.
The hack was necessary because an reinjected exception into
the nested guest could cause a nested vmexit emulation. But
reinjected exceptions must not intercept. The downside of
the hack is that a exception that in injected could get
lost.
This patch fixes the problem and puts the code for it into
generic x86 files because. Nested-VMX will likely have the
same problem and could reuse the code.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9f8532b1fa9a..875b785228f6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -919,7 +919,8 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) | |||
919 | } | 919 | } |
920 | 920 | ||
921 | static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, | 921 | static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, |
922 | bool has_error_code, u32 error_code) | 922 | bool has_error_code, u32 error_code, |
923 | bool reinject) | ||
923 | { | 924 | { |
924 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 925 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
925 | u32 intr_info = nr | INTR_INFO_VALID_MASK; | 926 | u32 intr_info = nr | INTR_INFO_VALID_MASK; |