No longer needed since device assignment stopped using it. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> --- Provided "pci-assign: Drop support for raw ioport access" is applied. qemu-kvm.c | 93 ----------------------------------------------------- qemu-kvm.h | 9 ----- target-i386/kvm.c | 18 ---------- 3 files changed, 0 insertions(+), 120 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 733cd04..133143c 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 ddf87a0..3ebbbb6 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 554a149..e74a9e4 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 -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html