[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 34/52] KVM: Add helper to run KVM_CHECK_EXTENSION on vm
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 34/52] KVM: Add helper to run KVM_CHECK_EXTENSION on vm fd |
Date: |
Thu, 4 Sep 2014 19:20:22 +0200 |
We now can call KVM_CHECK_EXTENSION on the kvm fd or on the vm fd, whereas
the vm version is more accurate when it comes to PPC KVM.
Add a helper to make the vm version available that falls back to the non-vm
variant if the vm one is not available yet to stay compatible.
Signed-off-by: Alexander Graf <address@hidden>
---
include/sysemu/kvm.h | 2 ++
kvm-all.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 174ea36..d2000af 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -303,6 +303,8 @@ bool kvm_arch_stop_on_emulation_error(CPUState *cpu);
int kvm_check_extension(KVMState *s, unsigned int extension);
+int kvm_vm_check_extension(KVMState *s, unsigned int extension);
+
#define kvm_vm_enable_cap(s, capability, cap_flags, ...) \
({ \
struct kvm_enable_cap cap = { \
diff --git a/kvm-all.c b/kvm-all.c
index b240bf8..b1cf703 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -493,6 +493,19 @@ int kvm_check_extension(KVMState *s, unsigned int
extension)
return ret;
}
+int kvm_vm_check_extension(KVMState *s, unsigned int extension)
+{
+ int ret;
+
+ ret = kvm_vm_ioctl(s, KVM_CHECK_EXTENSION, extension);
+ if (ret < 0) {
+ /* VM wide version not implemented, use global one instead */
+ ret = kvm_check_extension(s, extension);
+ }
+
+ return ret;
+}
+
static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,
bool assign, uint32_t size, bool datamatch)
{
--
1.8.1.4
- [Qemu-ppc] [PULL 26/52] target-ppc: Bug Fix: rlwinm, (continued)
- [Qemu-ppc] [PULL 26/52] target-ppc: Bug Fix: rlwinm, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 33/52] target-ppc: Bug Fix: srad, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 25/52] ppc/spapr: Fix MAX_CPUS to 255, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 30/52] target-ppc: Bug Fix: mullw, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 37/52] PPC: mac_nvram: Remove unused functions, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 35/52] PPC: KVM: Use vm check_extension for pv hcall, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 29/52] target-ppc: Bug Fix: mullwo, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 44/52] target-ppc: Special Case of rlwimi Should Use Deposit, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 36/52] PPC: mac99: Fix core99 timer frequency, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 31/52] target-ppc: Bug Fix: mulldo OV Detection, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 34/52] KVM: Add helper to run KVM_CHECK_EXTENSION on vm fd,
Alexander Graf <=
- [Qemu-ppc] [PULL 28/52] target-ppc: Bug Fix: rlwimi, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 32/52] target-ppc: Bug Fix: srawi, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 43/52] spapr-vlan: Don't touch last entry in buffer list, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 42/52] spapr_pci: Fix config space corruption, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 48/52] target-ppc: Clean up mullwo, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 39/52] PPC: mac_nvram: Split NVRAM into OF and OSX parts, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 46/52] target-ppc: Optimize rlwnm MB=0 ME=31, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 49/52] target-ppc: Implement mulldo with TCG, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 52/52] hypervisor property clashes with hypervisor node, Alexander Graf, 2014/09/04
- [Qemu-ppc] [PULL 45/52] target-ppc: Optimize rlwinm MB=0 ME=31, Alexander Graf, 2014/09/04