Skip to contentSkip to conversation

header update request

PATCH Superseded Alexey Kardashevskiy 3 participants 7 messages Jun 6, 2013 – Jun 10, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover header update request

We need new headers for live migration and in-kernel interrupt controller support. However just copying new headers breaks PPC so dummy kvm_arch_init_irq_routing() is required as well.

Alexey Kardashevskiy (1):
linux-headers: Update to v3.10-rc4

Scott Wood (1):
KVM: PPC: Add dummy kvm_arch_init_irq_routing()

 linux-headers/asm-arm/kvm.h       |   12 ++---
 linux-headers/asm-mips/kvm.h      |   55 +++++++++++++++++++++++
 linux-headers/asm-mips/kvm_para.h |    1 +
 linux-headers/asm-powerpc/kvm.h   |   89 +++++++++++++++++++++++++++++++++++++
 linux-headers/asm-x86/kvm.h       |    1 -
 linux-headers/linux/kvm.h         |   42 ++++++++++++++---
 linux-headers/linux/vfio.h        |    1 +
 linux-headers/linux/vhost.h       |   28 ++++++++++++
 target-ppc/kvm.c                  |    4 ++
 9 files changed, 220 insertions(+), 13 deletions(-)
 create mode 100644 linux-headers/asm-mips/kvm.h
 create mode 100644 linux-headers/asm-mips/kvm_para.h
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 linux-headers: Update to v3.10-rc4

This adds symbols required for sPAPR live migration and in-kernel XICS interrupt controller.

---
 linux-headers/asm-arm/kvm.h       |   12 ++---
 linux-headers/asm-mips/kvm.h      |   55 +++++++++++++++++++++++
 linux-headers/asm-mips/kvm_para.h |    1 +
 linux-headers/asm-powerpc/kvm.h   |   89 +++++++++++++++++++++++++++++++++++++
 linux-headers/asm-x86/kvm.h       |    1 -
 linux-headers/linux/kvm.h         |   42 ++++++++++++++---
 linux-headers/linux/vfio.h        |    1 +
 linux-headers/linux/vhost.h       |   28 ++++++++++++
 8 files changed, 216 insertions(+), 13 deletions(-)
 create mode 100644 linux-headers/asm-mips/kvm.h
 create mode 100644 linux-headers/asm-mips/kvm_para.h
linux-headers/asm-arm/kvm.h +6 -6
index 023bfeb..c1ee007 100644
@@ -53,12 +53,12 @@
 #define KVM_ARM_FIQ_spsr	fiq_regs[7]
 
 struct kvm_regs {
-	struct pt_regs usr_regs;/* R0_usr - R14_usr, PC, CPSR */
-	__u32 svc_regs[3];	/* SP_svc, LR_svc, SPSR_svc */
-	__u32 abt_regs[3];	/* SP_abt, LR_abt, SPSR_abt */
-	__u32 und_regs[3];	/* SP_und, LR_und, SPSR_und */
-	__u32 irq_regs[3];	/* SP_irq, LR_irq, SPSR_irq */
-	__u32 fiq_regs[8];	/* R8_fiq - R14_fiq, SPSR_fiq */
+	struct pt_regs usr_regs;	/* R0_usr - R14_usr, PC, CPSR */
+	unsigned long svc_regs[3];	/* SP_svc, LR_svc, SPSR_svc */
+	unsigned long abt_regs[3];	/* SP_abt, LR_abt, SPSR_abt */
+	unsigned long und_regs[3];	/* SP_und, LR_und, SPSR_und */
+	unsigned long irq_regs[3];	/* SP_irq, LR_irq, SPSR_irq */
+	unsigned long fiq_regs[8];	/* R8_fiq - R14_fiq, SPSR_fiq */
 };
 
 /* Supported Processor Types */
linux-headers/asm-mips/kvm.h new file +55 -0

55 lines not on this page · raw message

linux-headers/asm-mips/kvm_para.h new file +1 -0
new file mode 100644
index 0000000..14fab8f
@@ -0,0 +1 @@
+#include <asm-generic/kvm_para.h>
linux-headers/asm-powerpc/kvm.h +89 -0

119 lines not on this page · raw message

linux-headers/asm-x86/kvm.h +0 -1
index a65ec29..5d9a303 100644
@@ -29,7 +29,6 @@
 #define __KVM_HAVE_PIT
 #define __KVM_HAVE_IOAPIC
 #define __KVM_HAVE_IRQ_LINE
-#define __KVM_HAVE_DEVICE_ASSIGNMENT
 #define __KVM_HAVE_MSI
 #define __KVM_HAVE_USER_NMI
 #define __KVM_HAVE_GUEST_DEBUG
linux-headers/linux/kvm.h +36 -6

76 lines not on this page · raw message

linux-headers/linux/vfio.h +1 -0
index e094121..7ec1864 100644
@@ -319,6 +319,7 @@ enum {
 	VFIO_PCI_INTX_IRQ_INDEX,
 	VFIO_PCI_MSI_IRQ_INDEX,
 	VFIO_PCI_MSIX_IRQ_INDEX,
+	VFIO_PCI_ERR_IRQ_INDEX,
 	VFIO_PCI_NUM_IRQS
 };
 
linux-headers/linux/vhost.h +28 -0
index 165a484..c656f61 100644
@@ -127,4 +127,32 @@ struct vhost_memory {
 /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
 #define VHOST_NET_F_VIRTIO_NET_HDR 27
 
+/* VHOST_SCSI specific definitions */
+
+/*
+ * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
+ *
+ * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
+ *            RFC-v2 vhost-scsi userspace.  Add GET_ABI_VERSION ioctl usage
+ * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target.
+ *            All the targets under vhost_wwpn can be seen and used by guset.
+ */
+
+#define VHOST_SCSI_ABI_VERSION	1
+
+struct vhost_scsi_target {
+	int abi_version;
+	char vhost_wwpn[224]; /* TRANSPORT_IQN_LEN */
+	unsigned short vhost_tpgt;
+	unsigned short reserved;
+};
+
+#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
+#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
+/* Changing this breaks userspace. */
+#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
+/* Set and get the events missed flag */
+#define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32)
+#define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32)
+
 #endif
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 KVM: PPC: Add dummy kvm_arch_init_irq_routing()

In reply to Alexey Kardashevskiy

From: Scott Wood <[email protected]>

The common KVM code insists on calling kvm_arch_init_irq_routing() as soon as it sees kernel header support for it (regardless of whether QEMU supports it). Provide a dummy function to satisfy this.

Unlike x86, PPC does not have one default irqchip, so there's no common code that we'd stick here. Even if you ignore the routes themselves, which even on x86 are not set up in this function, the initial XICS kernel implementation will not support IRQ routing, so it's best to leave even the general feature flags up to the specific irqchip code.

---
 target-ppc/kvm.c |    4 ++++
 1 file changed, 4 insertions(+)
target-ppc/kvm.c +4 -0
index 3ab2946..2bbc3b8 100644
@@ -1797,3 +1797,7 @@ int kvm_arch_on_sigbus(int code, void *addr)
 {
     return 1;
 }
+
+void kvm_arch_init_irq_routing(KVMState *s)
+{
+}
Signature · 1 line
1.7.10.4
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] KVM: PPC: Add dummy kvm_arch_init_irq_routing()

Quoted 23 lines · Alexey Kardashevskiy

From: Scott Wood <[email protected]>

The common KVM code insists on calling kvm_arch_init_irq_routing() as soon as it sees kernel header support for it (regardless of whether QEMU supports it). Provide a dummy function to satisfy this.

Unlike x86, PPC does not have one default irqchip, so there's no common code that we'd stick here. Even if you ignore the routes themselves, which even on x86 are not set up in this function, the initial XICS kernel implementation will not support IRQ routing, so it's best to leave even the general feature flags up to the specific irqchip code.

---
 target-ppc/kvm.c |    4 ++++
 1 file changed, 4 insertions(+)
target-ppc/kvm.c +0 -0
index 3ab2946..2bbc3b8 100644

target-ppc/kvm.c int kvm_arch_on_sigbus(int code, void *addr) · line 1803

Quoted 7 lines
target-ppc/kvm.c +4 -0
@@ -1797,3 +1797,7 @@ int kvm_arch_on_sigbus(int code, void *addr)
 {
     return 1;
 }
+
+void kvm_arch_init_irq_routing(KVMState *s)
+{
+}

This should come before the header update, to avoid breaking bisectability.

-Scott

#4 lore raw

Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/2] KVM: PPC: Add dummy kvm_arch_init_irq_routing()

In reply to Alexey Kardashevskiy
Quoted 11 lines · Alexey Kardashevskiy

From: Scott Wood <[email protected]>

The common KVM code insists on calling kvm_arch_init_irq_routing() as soon as it sees kernel header support for it (regardless of whether QEMU supports it). Provide a dummy function to satisfy this.

Unlike x86, PPC does not have one default irqchip, so there's no common code that we'd stick here. Even if you ignore the routes themselves, which even on x86 are not set up in this function, the initial XICS kernel implementation will not support IRQ routing, so it's best to leave even the general feature flags up to the specific irqchip code.

As Scott Wood already pointed out, this should come in before the actual header update, which is no problem. We'll have to deal with a new warning (-Wmissing-prototypes) which can be dealt with by wrapping this function into #ifdef KVM_CAP_IRQ_ROUTING .. #endif (I can add this).

But how about other architectures? Before, this function were only defined for x86, now it is defined for two arches - x86 and ppc. Aren't other arches need this as well?

Thanks,

/mjt

#5 lore raw

Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/2] KVM: PPC: Add dummy kvm_arch_init_irq_routing()

Quoted 13 lines · Michael Tokarev
Quoted 11 lines · Alexey Kardashevskiy

From: Scott Wood <[email protected]>

The common KVM code insists on calling kvm_arch_init_irq_routing() as soon as it sees kernel header support for it (regardless of whether QEMU supports it). Provide a dummy function to satisfy this.

Unlike x86, PPC does not have one default irqchip, so there's no common code that we'd stick here. Even if you ignore the routes themselves, which even on x86 are not set up in this function, the initial XICS kernel implementation will not support IRQ routing, so it's best to leave even the general feature flags up to the specific irqchip code.

Quoted 5 lines

As Scott Wood already pointed out, this should come in before the actual header update, which is no problem. We'll have to deal with a new warning (-Wmissing-prototypes) which can be dealt with by wrapping this function into #ifdef KVM_CAP_IRQ_ROUTING .. #endif (I can add this).

Ah. I'll repost it early next week.

Quoted 4 lines

But how about other architectures? Before, this function were only defined for x86, now it is defined for two arches - x86 and ppc. Aren't other arches need this as well?

Good point, will check (and fix if needed). Thanks!

Signature · 1 line
Alexey
#6 lore raw

Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/2] KVM: PPC: Add dummy kvm_arch_init_irq_routing()

In reply to Michael Tokarev
Quoted 15 lines · Michael Tokarev
Quoted 4 lines · Alexey Kardashevskiy

From: Scott Wood <[email protected]>

The common KVM code insists on calling kvm_arch_init_irq_routing() as soon as it sees kernel header support for it (regardless of

whether

Quoted 3 lines

QEMU supports it). Provide a dummy function to satisfy this.

Unlike x86, PPC does not have one default irqchip, so there's no

common

Quoted 1 line

code that we'd stick here. Even if you ignore the routes

themselves,

Quoted 3 lines

which even on x86 are not set up in this function, the initial XICS kernel implementation will not support IRQ routing, so it's best to leave even the general feature flags up to the specific irqchip

Quoted 7 lines

code.

As Scott Wood already pointed out, this should come in before the actual header update, which is no problem. We'll have to deal with a new warning (-Wmissing-prototypes) which can be dealt with by wrapping this function into #ifdef KVM_CAP_IRQ_ROUTING .. #endif (I can add this).

Why? I don't see where the prototype is guarded by that, and I don't see a warning when applying this patch to master...

Quoted 3 lines

But how about other architectures? Before, this function were only defined for x86, now it is defined for two arches - x86 and ppc. Aren't other arches need this as well?

Yes, it looks like KVM_CAP_IRQ_ROUTING is no longer conditionally defined, so all KVM architectures will need this (unless they provide a non-dummy version). Are weak functions acceptable in QEMU? I don't see any current examples.

-Scott