aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2014-06-30 06:52:55 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-07-09 12:09:56 -0400
commit6cbc5f5a80a9ae5a80bc81efc574b5a85bfd4a84 (patch)
tree28fd708a956079f5fcb8cef3ff3bcd8c4c085e58 /arch/x86/kvm/svm.c
parent6493f1574e898b46370e2b2315836d76a1980f2c (diff)
KVM: nSVM: Set correct port for IOIO interception evaluation
Obtaining the port number from DX is bogus as a) there are immediate port accesses and b) user space may have changed the register content while processing the PIO access. Forward the correct value from the instruction emulator instead. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 1824949821f9..85d4458a0b35 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -4256,13 +4256,13 @@ static int svm_check_intercept(struct kvm_vcpu *vcpu,
4256 u64 exit_info; 4256 u64 exit_info;
4257 u32 bytes; 4257 u32 bytes;
4258 4258
4259 exit_info = (vcpu->arch.regs[VCPU_REGS_RDX] & 0xffff) << 16;
4260
4261 if (info->intercept == x86_intercept_in || 4259 if (info->intercept == x86_intercept_in ||
4262 info->intercept == x86_intercept_ins) { 4260 info->intercept == x86_intercept_ins) {
4263 exit_info |= SVM_IOIO_TYPE_MASK; 4261 exit_info = ((info->src_val & 0xffff) << 16) |
4262 SVM_IOIO_TYPE_MASK;
4264 bytes = info->dst_bytes; 4263 bytes = info->dst_bytes;
4265 } else { 4264 } else {
4265 exit_info = (info->dst_val & 0xffff) << 16;
4266 bytes = info->src_bytes; 4266 bytes = info->src_bytes;
4267 } 4267 }
4268 4268