summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-05-29 11:23:45 +0200
committerAvi Kivity <avi@redhat.com>2012-05-29 16:59:55 +0300
commitf9dc38843a540d8e5a5a851da260e5372a941f1c (patch)
tree03362e849a3ad5095d36a43cdd53190d8a5e911a
parent01b1e19e0b3b9511cdabbe129135024f6bf3087e (diff)
qemu-kvm: Drop support for raw ioport access
No longer needed since device assignment stopped using it. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--qemu-kvm.c93
-rw-r--r--qemu-kvm.h9
-rw-r--r--target-i386/kvm.c18
3 files changed, 0 insertions, 120 deletions
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 733cd04cb..133143cce 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -315,96 +315,3 @@ void kvm_arch_init_irq_routing(KVMState *s)
{
}
#endif
-
-#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
-typedef struct KVMIOPortRegion {
- unsigned long start;
- unsigned long size;
- int status;
- QLIST_ENTRY(KVMIOPortRegion) entry;
-} KVMIOPortRegion;
-
-static QLIST_HEAD(, KVMIOPortRegion) ioport_regions;
-
-static void do_set_ioport_access(void *data)
-{
- KVMIOPortRegion *region = data;
- bool enable = region->status > 0;
- int r;
-
- r = kvm_arch_set_ioport_access(region->start, region->size, enable);
- if (r < 0) {
- region->status = r;
- } else {
- region->status = 1;
- }
-}
-
-int kvm_add_ioport_region(unsigned long start, unsigned long size,
- bool is_hot_plug)
-{
- KVMIOPortRegion *region = g_malloc0(sizeof(KVMIOPortRegion));
- CPUArchState *env;
- int r = 0;
-
- region->start = start;
- region->size = size;
- region->status = 1;
- QLIST_INSERT_HEAD(&ioport_regions, region, entry);
-
- if (is_hot_plug) {
- for (env = first_cpu; env != NULL; env = env->next_cpu) {
- run_on_cpu(env, do_set_ioport_access, region);
- if (region->status < 0) {
- r = region->status;
- kvm_remove_ioport_region(start, size, is_hot_plug);
- break;
- }
- }
- }
- return r;
-}
-
-int kvm_remove_ioport_region(unsigned long start, unsigned long size,
- bool is_hot_unplug)
-{
- KVMIOPortRegion *region, *tmp;
- CPUArchState *env;
- int r = -ENOENT;
-
- QLIST_FOREACH_SAFE(region, &ioport_regions, entry, tmp) {
- if (region->start == start && region->size == size) {
- region->status = 0;
- }
- if (is_hot_unplug) {
- for (env = first_cpu; env != NULL; env = env->next_cpu) {
- run_on_cpu(env, do_set_ioport_access, region);
- }
- }
- QLIST_REMOVE(region, entry);
- g_free(region);
- r = 0;
- }
- return r;
-}
-#endif /* CONFIG_KVM_DEVICE_ASSIGNMENT */
-
-int kvm_update_ioport_access(CPUArchState *env)
-{
-#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
- KVMIOPortRegion *region;
- int r;
-
- assert(qemu_cpu_is_self(env));
-
- QLIST_FOREACH(region, &ioport_regions, entry) {
- bool enable = region->status > 0;
-
- r = kvm_arch_set_ioport_access(region->start, region->size, enable);
- if (r < 0) {
- return r;
- }
- }
-#endif /* CONFIG_KVM_DEVICE_ASSIGNMENT */
- return 0;
-}
diff --git a/qemu-kvm.h b/qemu-kvm.h
index ddf87a0f3..3ebbbb6e6 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -109,13 +109,4 @@ int kvm_assign_set_msix_entry(KVMState *s,
#endif /* CONFIG_KVM */
-int kvm_add_ioport_region(unsigned long start, unsigned long size,
- bool is_hot_plug);
-int kvm_remove_ioport_region(unsigned long start, unsigned long size,
- bool is_hot_unplug);
-
-int kvm_update_ioport_access(CPUArchState *env);
-int kvm_arch_set_ioport_access(unsigned long start, unsigned long size,
- bool enable);
-
#endif
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 554a1492e..e74a9e464 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -358,11 +358,6 @@ int kvm_arch_init_vcpu(CPUX86State *env)
uint32_t signature[3];
int r;
- r = kvm_update_ioport_access(env);
- if (r < 0) {
- return r;
- }
-
env->cpuid_features &= kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX);
i = env->cpuid_ext_features & CPUID_EXT_HYPERVISOR;
@@ -2034,16 +2029,3 @@ void kvm_arch_init_irq_routing(KVMState *s)
no_hpet = 1;
}
}
-
-#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
-#include <sys/io.h>
-
-int kvm_arch_set_ioport_access(unsigned long start, unsigned long size,
- bool enable)
-{
- if (ioperm(start, size, enable) < 0) {
- return -errno;
- }
- return 0;
-}
-#endif