diff options
author | Zhihui Zhang <zzhsuny@gmail.com> | 2013-12-30 15:56:29 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2014-01-08 16:01:40 -0500 |
commit | 2f0a6397dd3cac2fb05b46cad08c1d532c04d6b8 (patch) | |
tree | 2a68f99698169b20ed597e36bddfa9725275b712 /arch | |
parent | 171800328f6e2443e0e356de5b41fb7e0fff4448 (diff) |
KVM: VMX: check use I/O bitmap first before unconditional I/O exit
According to Table C-1 of Intel SDM 3C, a VM exit happens on an I/O instruction when
"use I/O bitmaps" VM-execution control was 0 _and_ the "unconditional I/O exiting"
VM-execution control was 1. So we can't just check "unconditional I/O exiting" alone.
This patch was improved by suggestion from Jan Kiszka.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Zhihui Zhang <zzhsuny@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9cc54842ae14..0abf8b783f19 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -6521,11 +6521,8 @@ static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, | |||
6521 | int size; | 6521 | int size; |
6522 | u8 b; | 6522 | u8 b; |
6523 | 6523 | ||
6524 | if (nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING)) | ||
6525 | return 1; | ||
6526 | |||
6527 | if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) | 6524 | if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) |
6528 | return 0; | 6525 | return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING); |
6529 | 6526 | ||
6530 | exit_qualification = vmcs_readl(EXIT_QUALIFICATION); | 6527 | exit_qualification = vmcs_readl(EXIT_QUALIFICATION); |
6531 | 6528 | ||