diff options
author | Peter Maydell | 2014-05-01 18:32:25 +0200 |
---|---|---|
committer | Peter Maydell | 2014-05-01 18:32:25 +0200 |
commit | c090c10dc4b85a9aa82277994576715ec2af1ed4 (patch) | |
tree | fa6aad0bd5e45e46df92d445609316c48a3355b6 /hw | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-2' into staging (diff) | |
parent | ppc: use kvm_vcpu_enable_cap() (diff) | |
download | qemu-c090c10dc4b85a9aa82277994576715ec2af1ed4.tar.gz qemu-c090c10dc4b85a9aa82277994576715ec2af1ed4.tar.xz qemu-c090c10dc4b85a9aa82277994576715ec2af1ed4.zip |
Merge remote-tracking branch 'remotes/cohuck/tags/kvm_cap_helpers' into staging
Add helpers for enabling kvm capabilities and convert the existing
s390x and ppc users to use them.
# gpg: Signature made Wed 30 Apr 2014 14:48:45 BST using RSA key ID C6F02FAF
# gpg: Can't check signature: public key not found
* remotes/cohuck/tags/kvm_cap_helpers:
ppc: use kvm_vcpu_enable_cap()
s390x: use kvm_vcpu_enable_cap()
kvm: add kvm_{vm,vcpu}_enable_cap
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/intc/openpic_kvm.c | 8 | ||||
-rw-r--r-- | hw/intc/xics_kvm.c | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index 6635407b8b..585ab4ff20 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -234,13 +234,9 @@ static void kvm_openpic_realize(DeviceState *dev, Error **errp) int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs) { KVMOpenPICState *opp = KVM_OPENPIC(d); - struct kvm_enable_cap encap = {}; - encap.cap = KVM_CAP_IRQ_MPIC; - encap.args[0] = opp->fd; - encap.args[1] = kvm_arch_vcpu_id(cs); - - return kvm_vcpu_ioctl(cs, KVM_ENABLE_CAP, &encap); + return kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_MPIC, 0, opp->fd, + kvm_arch_vcpu_id(cs)); } static Property kvm_openpic_properties[] = { diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index c93dae053d..09476ae34d 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -331,15 +331,11 @@ static void xics_kvm_cpu_setup(XICSState *icp, PowerPCCPU *cpu) if (icpkvm->kernel_xics_fd != -1) { int ret; - struct kvm_enable_cap xics_enable_cap = { - .cap = KVM_CAP_IRQ_XICS, - .flags = 0, - .args = {icpkvm->kernel_xics_fd, kvm_arch_vcpu_id(cs), 0, 0}, - }; ss->cs = cs; - ret = kvm_vcpu_ioctl(ss->cs, KVM_ENABLE_CAP, &xics_enable_cap); + ret = kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0, + icpkvm->kernel_xics_fd, kvm_arch_vcpu_id(cs)); if (ret < 0) { error_report("Unable to connect CPU%ld to kernel XICS: %s", kvm_arch_vcpu_id(cs), strerror(errno)); |