aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-02-22 12:39:30 -0500
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:23 -0400
commit46fc1477887c41c8e900f2c95485e222b9a54822 (patch)
treeef9d4d4b6fc32f3d6b4e77a87d1b47b6da455574 /drivers/kvm/svm.c
parent9a2bb7f486dc639a1cf2ad803bf2227f0dc0809d (diff)
KVM: Do not communicate to userspace through cpu registers during PIO
Currently when passing the a PIO emulation request to userspace, we rely on userspace updating %rax (on 'in' instructions) and %rsi/%rdi/%rcx (on string instructions). This (a) requires two extra ioctls for getting and setting the registers and (b) is unfriendly to non-x86 archs, when they get kvm ports. So fix by doing the register fixups in the kernel and passing to userspace only an abstract description of the PIO to be done. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 6787f11738cf..c35b8c83bf3f 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1037,6 +1037,7 @@ static int io_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1037 kvm_run->io.size = ((io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT); 1037 kvm_run->io.size = ((io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT);
1038 kvm_run->io.string = (io_info & SVM_IOIO_STR_MASK) != 0; 1038 kvm_run->io.string = (io_info & SVM_IOIO_STR_MASK) != 0;
1039 kvm_run->io.rep = (io_info & SVM_IOIO_REP_MASK) != 0; 1039 kvm_run->io.rep = (io_info & SVM_IOIO_REP_MASK) != 0;
1040 kvm_run->io.count = 1;
1040 1041
1041 if (kvm_run->io.string) { 1042 if (kvm_run->io.string) {
1042 unsigned addr_mask; 1043 unsigned addr_mask;
@@ -1056,6 +1057,7 @@ static int io_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1056 } 1057 }
1057 } else 1058 } else
1058 kvm_run->io.value = vcpu->svm->vmcb->save.rax; 1059 kvm_run->io.value = vcpu->svm->vmcb->save.rax;
1060 vcpu->pio_pending = 1;
1059 return 0; 1061 return 0;
1060} 1062}
1061 1063