Skip to contentSkip to conversation

kvm: add kvm_pv_unhalt

PATCH In review Andrew Jones 4 participants 7 messages Sep 18, 2013 – Sep 19, 2013

lore
Share & tools
lore
#0 lore raw

cover kvm: add kvm_pv_unhalt

pvticketlocks are in v3.12-rc1, teach qemu-kvm about it. Benchmarking is still in progress to determine if we can turn it on by default. So leaving it off for now.

Andrew Jones (2):
linux-headers: update to 3.12-rc1
qemu-kvm: paravirt: add feature kvm_pv_unhalt

 linux-headers/asm-x86/kvm_para.h |  1 +
 linux-headers/linux/kvm.h        |  1 +
 linux-headers/linux/kvm_para.h   |  1 +
 linux-headers/linux/vfio.h       | 38 ++++++++++++++++++++++++++++++++++++++
 target-i386/cpu.c                |  2 +-
 5 files changed, 42 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/2 linux-headers: update to 3.12-rc1

---
 linux-headers/asm-x86/kvm_para.h |  1 +
 linux-headers/linux/kvm.h        |  1 +
 linux-headers/linux/kvm_para.h   |  1 +
 linux-headers/linux/vfio.h       | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 41 insertions(+)
linux-headers/asm-x86/kvm_para.h +1 -0
index a1c3d72acd0eb..e41c5c1a28dae 100644
@@ -23,6 +23,7 @@
 #define KVM_FEATURE_ASYNC_PF		4
 #define KVM_FEATURE_STEAL_TIME		5
 #define KVM_FEATURE_PV_EOI		6
+#define KVM_FEATURE_PV_UNHALT		7
 
 /* The last 8 bits are used to indicate how to interpret the flags field
  * in pvclock structure. If no bits are set, all flags are ignored.
linux-headers/linux/kvm.h +1 -0
index 56fce1c400b14..13e890c53b110 100644
@@ -667,6 +667,7 @@ struct kvm_ppc_smmu_info {
 #define KVM_CAP_PPC_RTAS 91
 #define KVM_CAP_IRQ_XICS 92
 #define KVM_CAP_ARM_EL1_32BIT 93
+#define KVM_CAP_SPAPR_MULTITCE 94
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
linux-headers/linux/kvm_para.h +1 -0
index 7bdcf93c1dba4..2dff7838b4398 100644
@@ -19,6 +19,7 @@
 #define KVM_HC_MMU_OP			2
 #define KVM_HC_FEATURES			3
 #define KVM_HC_PPC_MAP_MAGIC_PAGE	4
+#define KVM_HC_KICK_CPU			5
 
 /*
  * hypercalls use architecture specific
linux-headers/linux/vfio.h +38 -0
index b42b9abd0e05a..17c58e0ede420 100644
@@ -324,6 +324,44 @@ enum {
 	VFIO_PCI_NUM_IRQS
 };
 
+/**
+ * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
+ *					      struct vfio_pci_hot_reset_info)
+ *
+ * Return: 0 on success, -errno on failure:
+ *	-enospc = insufficient buffer, -enodev = unsupported for device.
+ */
+struct vfio_pci_dependent_device {
+	__u32	group_id;
+	__u16	segment;
+	__u8	bus;
+	__u8	devfn; /* Use PCI_SLOT/PCI_FUNC */
+};
+
+struct vfio_pci_hot_reset_info {
+	__u32	argsz;
+	__u32	flags;
+	__u32	count;
+	struct vfio_pci_dependent_device	devices[];
+};
+
+#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO	_IO(VFIO_TYPE, VFIO_BASE + 12)
+
+/**
+ * VFIO_DEVICE_PCI_HOT_RESET - _IOW(VFIO_TYPE, VFIO_BASE + 13,
+ *				    struct vfio_pci_hot_reset)
+ *
+ * Return: 0 on success, -errno on failure.
+ */
+struct vfio_pci_hot_reset {
+	__u32	argsz;
+	__u32	flags;
+	__u32	count;
+	__s32	group_fds[];
+};
+
+#define VFIO_DEVICE_PCI_HOT_RESET	_IO(VFIO_TYPE, VFIO_BASE + 13)
+
 /* -------- API for Type1 VFIO IOMMU -------- */
 
 /**
Signature · 1 line
1.8.1.4
Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] linux-headers: update to 3.12-rc1

Quoted 1 line · Andrew Jones
Quoted 96 lines
---
 linux-headers/asm-x86/kvm_para.h |  1 +
 linux-headers/linux/kvm.h        |  1 +
 linux-headers/linux/kvm_para.h   |  1 +
 linux-headers/linux/vfio.h       | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 41 insertions(+)
linux-headers/asm-x86/kvm_para.h +1 -0
index a1c3d72acd0eb..e41c5c1a28dae 100644
@@ -23,6 +23,7 @@
 #define KVM_FEATURE_ASYNC_PF		4
 #define KVM_FEATURE_STEAL_TIME		5
 #define KVM_FEATURE_PV_EOI		6
+#define KVM_FEATURE_PV_UNHALT		7
 
 /* The last 8 bits are used to indicate how to interpret the flags field
  * in pvclock structure. If no bits are set, all flags are ignored.
linux-headers/linux/kvm.h +1 -0
index 56fce1c400b14..13e890c53b110 100644
@@ -667,6 +667,7 @@ struct kvm_ppc_smmu_info {
 #define KVM_CAP_PPC_RTAS 91
 #define KVM_CAP_IRQ_XICS 92
 #define KVM_CAP_ARM_EL1_32BIT 93
+#define KVM_CAP_SPAPR_MULTITCE 94
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
linux-headers/linux/kvm_para.h +1 -0
index 7bdcf93c1dba4..2dff7838b4398 100644
@@ -19,6 +19,7 @@
 #define KVM_HC_MMU_OP			2
 #define KVM_HC_FEATURES			3
 #define KVM_HC_PPC_MAP_MAGIC_PAGE	4
+#define KVM_HC_KICK_CPU			5
 
 /*
  * hypercalls use architecture specific
linux-headers/linux/vfio.h +38 -0
index b42b9abd0e05a..17c58e0ede420 100644
@@ -324,6 +324,44 @@ enum {
 	VFIO_PCI_NUM_IRQS
 };
 
+/**
+ * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
+ *					      struct vfio_pci_hot_reset_info)
+ *
+ * Return: 0 on success, -errno on failure:
+ *	-enospc = insufficient buffer, -enodev = unsupported for device.
+ */
+struct vfio_pci_dependent_device {
+	__u32	group_id;
+	__u16	segment;
+	__u8	bus;
+	__u8	devfn; /* Use PCI_SLOT/PCI_FUNC */
+};
+
+struct vfio_pci_hot_reset_info {
+	__u32	argsz;
+	__u32	flags;
+	__u32	count;
+	struct vfio_pci_dependent_device	devices[];
+};
+
+#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO	_IO(VFIO_TYPE, VFIO_BASE + 12)
+
+/**
+ * VFIO_DEVICE_PCI_HOT_RESET - _IOW(VFIO_TYPE, VFIO_BASE + 13,
+ *				    struct vfio_pci_hot_reset)
+ *
+ * Return: 0 on success, -errno on failure.
+ */
+struct vfio_pci_hot_reset {
+	__u32	argsz;
+	__u32	flags;
+	__u32	count;
+	__s32	group_fds[];
+};
+
+#define VFIO_DEVICE_PCI_HOT_RESET	_IO(VFIO_TYPE, VFIO_BASE + 13)
+
 /* -------- API for Type1 VFIO IOMMU -------- */
 
 /**
Signature · 1 line
1.8.1.4
Signature · 1 line
Eduardo
#3 lore raw

PATCH 2/2 qemu-kvm: paravirt: add feature kvm_pv_unhalt

In reply to Andrew Jones

I don't know yet if want this feature on by default, so for now I'm just adding support for "-cpu ...,+kvm_pv_unhalt".

---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +1 -1
index 42c5de034ecc8..89491e7b1fba1 100644
@@ -123,7 +123,7 @@ static const char *ext4_feature_name[] = {
 
 static const char *kvm_feature_name[] = {
     "kvmclock", "kvm_nopiodelay", "kvm_mmu", "kvmclock",
-    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", NULL,
+    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", "kvm_pv_unhalt",
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
Signature · 1 line
1.8.1.4
Reviewed-by on v1 2/2
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] qemu-kvm: paravirt: add feature kvm_pv_unhalt

Quoted 4 lines · Andrew Jones

I don't know yet if want this feature on by default, so for now I'm just adding support for "-cpu ...,+kvm_pv_unhalt".

Quoted 20 lines
---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +1 -1
index 42c5de034ecc8..89491e7b1fba1 100644
@@ -123,7 +123,7 @@ static const char *ext4_feature_name[] = {
 
 static const char *kvm_feature_name[] = {
     "kvmclock", "kvm_nopiodelay", "kvm_mmu", "kvmclock",
-    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", NULL,
+    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", "kvm_pv_unhalt",
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
Signature · 1 line
1.8.1.4
Signature · 1 line
Eduardo
Reviewed-by on v1 2/2
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] qemu-kvm: paravirt: add feature kvm_pv_unhalt

In reply to Andrew Jones

Am 18.09.2013 16:41, schrieb Andrew Jones:

Quoted 13 lines

I don't know yet if want this feature on by default, so for now I'm just adding support for "-cpu ...,+kvm_pv_unhalt".

---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +0 -0
index 42c5de034ecc8..89491e7b1fba1 100644

target-i386/cpu.c static const char *ext4_feature_name[] = { · line 129

Quoted 8 lines
target-i386/cpu.c +1 -1
@@ -123,7 +123,7 @@ static const char *ext4_feature_name[] = {
 
 static const char *kvm_feature_name[] = {
     "kvmclock", "kvm_nopiodelay", "kvm_mmu", "kvmclock",
-    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", NULL,
+    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", "kvm_pv_unhalt",
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,

Since there's linux-headers updates involved I can't take it through my qom-cpu queue. If Paolo can tweak the subject to "target-i386: Add paravirt CPU feature kvm_pv_unhalt" or so I'd be happy for this to go through his uq/master queue. (qemu-kvm no longer exists, all QEMU patches are about QEMU anyway and there's no discrete "paravirt" subsystem or precedent in qemu.git history.)

Patch itself is

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#6 lore raw

Re: [Qemu-devel] [PATCH 2/2] qemu-kvm: paravirt: add feature kvm_pv_unhalt

Il 18/09/2013 19:35, Andreas Färber ha scritto:

Quoted 30 lines

Am 18.09.2013 16:41, schrieb Andrew Jones:

Quoted 13 lines

I don't know yet if want this feature on by default, so for now I'm just adding support for "-cpu ...,+kvm_pv_unhalt".

---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +0 -0
index 42c5de034ecc8..89491e7b1fba1 100644

target-i386/cpu.c static const char *ext4_feature_name[] = { · line 129

Quoted 8 lines
target-i386/cpu.c +1 -1
@@ -123,7 +123,7 @@ static const char *ext4_feature_name[] = {
 
 static const char *kvm_feature_name[] = {
     "kvmclock", "kvm_nopiodelay", "kvm_mmu", "kvmclock",
-    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", NULL,
+    "kvm_asyncpf", "kvm_steal_time", "kvm_pv_eoi", "kvm_pv_unhalt",
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,

Since there's linux-headers updates involved I can't take it through my qom-cpu queue. If Paolo can tweak the subject to "target-i386: Add paravirt CPU feature kvm_pv_unhalt" or so I'd be happy for this to go through his uq/master queue. (qemu-kvm no longer exists, all QEMU patches are about QEMU anyway and there's no discrete "paravirt" subsystem or precedent in qemu.git history.)

Quoted 7 lines

Patch itself is

Regards,
Andreas

Will do.

Paolo