Skip to contentSkip to conversation

KVM: Clarify KVM_ASSIGN_PCI_DEVICE documentation

PATCH Superseded Jan Kiszka 3 participants 6 messages Jun 2, 2011 – Jun 9, 2011

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 KVM: Clarify KVM_ASSIGN_PCI_DEVICE documentation

From: Jan Kiszka <[email protected]>

Neither host_irq nor the guest_msi struct are used anymore today. Tag the former, drop the latter to avoid confusion.

---
 Documentation/virtual/kvm/api.txt |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
Documentation/virtual/kvm/api.txt +1 -6
index 2bd06b0..7adc1ac 100644
@@ -1143,15 +1143,10 @@ Assigns an IRQ to a passed-through device.
 
 struct kvm_assigned_irq {
 	__u32 assigned_dev_id;
-	__u32 host_irq;
+	__u32 host_irq;		/* ignored (legacy field) */
 	__u32 guest_irq;
 	__u32 flags;
 	union {
-		struct {
-			__u32 addr_lo;
-			__u32 addr_hi;
-			__u32 data;
-		} guest_msi;
 		__u32 reserved[12];
 	};
 };
#1 lore raw
Quoted 21 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Neither host_irq nor the guest_msi struct are used anymore today. Tag the former, drop the latter to avoid confusion.

---
 Documentation/virtual/kvm/api.txt |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
Documentation/virtual/kvm/api.txt +1 -1
index 2bd06b0..7adc1ac 100644
@@ -1143,15 +1143,10 @@ Assigns an IRQ to a passed-through device.
 
 struct kvm_assigned_irq {
 	__u32 assigned_dev_id;
-	__u32 host_irq;
+	__u32 host_irq;		/* ignored (legacy field) */
 	__u32 guest_irq;

Documentation/virtual/kvm/api.txt Assigns an IRQ to a passed-through device. · line 1152

Quoted 10 lines
Documentation/virtual/kvm/api.txt +0 -5
 	__u32 flags;
 	union {
-		struct {
-			__u32 addr_lo;
-			__u32 addr_hi;
-			__u32 data;
-		} guest_msi;
 		__u32 reserved[12];
 	};
 };

Please update the kernel headers accordingly.

author
#2 lore raw

PATCH v2 1/1 KVM: Clarify KVM_ASSIGN_PCI_DEVICE documentation

From: Jan Kiszka <[email protected]>

Neither host_irq nor the guest_msi struct are used anymore today. Tag the former, drop the latter to avoid confusion.

---
 Documentation/virtual/kvm/api.txt |    7 +------
 include/linux/kvm.h               |    8 +-------
 2 files changed, 2 insertions(+), 13 deletions(-)
Documentation/virtual/kvm/api.txt +1 -6
index 2bd06b0..0ebe922 100644
@@ -1143,15 +1143,10 @@ Assigns an IRQ to a passed-through device.
 
 struct kvm_assigned_irq {
 	__u32 assigned_dev_id;
-	__u32 host_irq;
+	__u32 host_irq; /* ignored (legacy field) */
 	__u32 guest_irq;
 	__u32 flags;
 	union {
-		struct {
-			__u32 addr_lo;
-			__u32 addr_hi;
-			__u32 data;
-		} guest_msi;
 		__u32 reserved[12];
 	};
 };
include/linux/kvm.h +1 -7
index 55ef181..9c9ca7c 100644
@@ -773,20 +773,14 @@ struct kvm_assigned_pci_dev {
 
 struct kvm_assigned_irq {
 	__u32 assigned_dev_id;
-	__u32 host_irq;
+	__u32 host_irq; /* ignored (legacy field) */
 	__u32 guest_irq;
 	__u32 flags;
 	union {
-		struct {
-			__u32 addr_lo;
-			__u32 addr_hi;
-			__u32 data;
-		} guest_msi;
 		__u32 reserved[12];
 	};
 };
 
-
 struct kvm_assigned_msix_nr {
 	__u32 assigned_dev_id;
 	__u16 entry_nr;
Signature · 1 line
1.7.1
#3 lore raw
Quoted 22 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Neither host_irq nor the guest_msi struct are used anymore today. Tag the former, drop the latter to avoid confusion.

include/linux/kvm.h +1 -4
index 55ef181..9c9ca7c 100644
@@ -773,20 +773,14 @@ struct kvm_assigned_pci_dev {
 
  struct kvm_assigned_irq {
  	__u32 assigned_dev_id;
-	__u32 host_irq;
+	__u32 host_irq; /* ignored (legacy field) */
  	__u32 guest_irq;
  	__u32 flags;
  	union {
-		struct {
-			__u32 addr_lo;
-			__u32 addr_hi;

include/linux/kvm.h struct kvm_assigned_pci_dev { · line 786

Quoted 10 lines
include/linux/kvm.h +0 -3
-			__u32 data;
-		} guest_msi;
  		__u32 reserved[12];
  	};
  };
 
-
  struct kvm_assigned_msix_nr {
  	__u32 assigned_dev_id;
  	__u16 entry_nr;

Can we just drop a definition like this? When did we last use this?

(in fact I can't find when we *ever* used this)

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#4 lore raw
Quoted 29 lines · Avi Kivity
Quoted 28 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

Neither host_irq nor the guest_msi struct are used anymore today. Tag the former, drop the latter to avoid confusion.

include/linux/kvm.h +1 -6
index 55ef181..9c9ca7c 100644
@@ -773,20 +773,14 @@ struct kvm_assigned_pci_dev {
 
  struct kvm_assigned_irq {
      __u32 assigned_dev_id;
-    __u32 host_irq;
+    __u32 host_irq; /* ignored (legacy field) */
      __u32 guest_irq;
      __u32 flags;
      union {
-        struct {
-            __u32 addr_lo;
-            __u32 addr_hi;
-            __u32 data;
-        } guest_msi;
          __u32 reserved[12];
      };
  };
 
Quoted 9 lines

include/linux/kvm.h struct kvm_assigned_pci_dev { · line 786

Quoted 4 lines
include/linux/kvm.h +0 -1
-
  struct kvm_assigned_msix_nr {
      __u32 assigned_dev_id;
      __u16 entry_nr;

Can we just drop a definition like this? When did we last use this?

(in fact I can't find when we *ever* used this)

The kernel interface was present between in 2.6.29 only. The fact that we simply dropped that API (replacing it with the current one) indicates that no one was expecting this to be actually used.

I also do not find any traces of the old way of assigning MSIs in qemu-kvm.

Jan

#5 lore raw
Quoted 12 lines · Jan Kiszka
Quoted 5 lines

Can we just drop a definition like this? When did we last use this?

(in fact I can't find when we *ever* used this)

The kernel interface was present between in 2.6.29 only. The fact that we simply dropped that API (replacing it with the current one) indicates that no one was expecting this to be actually used.

I also do not find any traces of the old way of assigning MSIs in qemu-kvm.

Okay. There's some remote possibility that someone will pick up .29 and develop for it, but I think we can ignore that. Applied.

Signature · 1 line
error compiling committee.c: too many arguments to function