From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>, Alex Williamson <alex.williamson@redhat.com>
Subject: [PATCH] qemu-kvm: Drop support for raw ioport access
Date: Tue, 29 May 2012 11:23:45 +0200 [thread overview]
Message-ID: <4FC495A1.8090306@siemens.com> (raw)
In-Reply-To: <4FC377AD.8060201@web.de>
No longer needed since device assignment stopped using it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
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
next prev parent reply other threads:[~2012-05-29 9:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-28 13:03 [RFC][PATCH] pci-assign: Drop support for raw ioport access Jan Kiszka
2012-05-28 14:06 ` Avi Kivity
2012-05-29 7:47 ` Jan Kiszka
2012-05-29 9:26 ` Avi Kivity
2012-05-29 13:47 ` Alex Williamson
2012-05-29 14:00 ` Avi Kivity
2012-05-29 9:23 ` Jan Kiszka [this message]
2012-05-29 13:51 ` Alex Williamson
2012-05-29 14:41 ` Alex Williamson
2012-05-29 15:45 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FC495A1.8090306@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox