diff options
author | Laurent Vivier <Laurent.Vivier@bull.net> | 2007-07-30 06:41:19 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:21 -0400 |
commit | e7d5d76cae970117affe07f809faf0f18bbac675 (patch) | |
tree | 3410ce6d12e1095affcd4e6f7fd36716587916c6 /drivers/kvm/vmx.c | |
parent | cebff02b11b02a81d21b6cc8390938dc9bdf0a12 (diff) |
KVM: Remove kvm_{read,write}_guest()
... in favor of the more general emulator_{read,write}_*.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index cc7ee3d484fb..f770f55d46cd 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "kvm.h" | 18 | #include "kvm.h" |
19 | #include "x86_emulate.h" | ||
19 | #include "vmx.h" | 20 | #include "vmx.h" |
20 | #include "segment_descriptor.h" | 21 | #include "segment_descriptor.h" |
21 | 22 | ||
@@ -1553,8 +1554,8 @@ static void inject_rmode_irq(struct kvm_vcpu *vcpu, int irq) | |||
1553 | return; | 1554 | return; |
1554 | } | 1555 | } |
1555 | 1556 | ||
1556 | if (kvm_read_guest(vcpu, irq * sizeof(ent), sizeof(ent), &ent) != | 1557 | if (emulator_read_std(irq * sizeof(ent), &ent, sizeof(ent), vcpu) != |
1557 | sizeof(ent)) { | 1558 | X86EMUL_CONTINUE) { |
1558 | vcpu_printf(vcpu, "%s: read guest err\n", __FUNCTION__); | 1559 | vcpu_printf(vcpu, "%s: read guest err\n", __FUNCTION__); |
1559 | return; | 1560 | return; |
1560 | } | 1561 | } |
@@ -1564,9 +1565,9 @@ static void inject_rmode_irq(struct kvm_vcpu *vcpu, int irq) | |||
1564 | ip = vmcs_readl(GUEST_RIP); | 1565 | ip = vmcs_readl(GUEST_RIP); |
1565 | 1566 | ||
1566 | 1567 | ||
1567 | if (kvm_write_guest(vcpu, ss_base + sp - 2, 2, &flags) != 2 || | 1568 | if (emulator_write_emulated(ss_base + sp - 2, &flags, 2, vcpu) != X86EMUL_CONTINUE || |
1568 | kvm_write_guest(vcpu, ss_base + sp - 4, 2, &cs) != 2 || | 1569 | emulator_write_emulated(ss_base + sp - 4, &cs, 2, vcpu) != X86EMUL_CONTINUE || |
1569 | kvm_write_guest(vcpu, ss_base + sp - 6, 2, &ip) != 2) { | 1570 | emulator_write_emulated(ss_base + sp - 6, &ip, 2, vcpu) != X86EMUL_CONTINUE) { |
1570 | vcpu_printf(vcpu, "%s: write guest err\n", __FUNCTION__); | 1571 | vcpu_printf(vcpu, "%s: write guest err\n", __FUNCTION__); |
1571 | return; | 1572 | return; |
1572 | } | 1573 | } |
@@ -1767,7 +1768,7 @@ static int get_io_count(struct kvm_vcpu *vcpu, unsigned long *count) | |||
1767 | u64 inst; | 1768 | u64 inst; |
1768 | gva_t rip; | 1769 | gva_t rip; |
1769 | int countr_size; | 1770 | int countr_size; |
1770 | int i, n; | 1771 | int i; |
1771 | 1772 | ||
1772 | if ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_VM)) { | 1773 | if ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_VM)) { |
1773 | countr_size = 2; | 1774 | countr_size = 2; |
@@ -1782,9 +1783,11 @@ static int get_io_count(struct kvm_vcpu *vcpu, unsigned long *count) | |||
1782 | if (countr_size != 8) | 1783 | if (countr_size != 8) |
1783 | rip += vmcs_readl(GUEST_CS_BASE); | 1784 | rip += vmcs_readl(GUEST_CS_BASE); |
1784 | 1785 | ||
1785 | n = kvm_read_guest(vcpu, rip, sizeof(inst), &inst); | 1786 | if (emulator_read_std(rip, &inst, sizeof(inst), vcpu) != |
1787 | X86EMUL_CONTINUE) | ||
1788 | return 0; | ||
1786 | 1789 | ||
1787 | for (i = 0; i < n; i++) { | 1790 | for (i = 0; i < sizeof(inst); i++) { |
1788 | switch (((u8*)&inst)[i]) { | 1791 | switch (((u8*)&inst)[i]) { |
1789 | case 0xf0: | 1792 | case 0xf0: |
1790 | case 0xf2: | 1793 | case 0xf2: |