diff mbox

Revert "KVM: MSI: Swap payload to native endianness"

Message ID 1475920590-17587-1-git-send-email-peterx@redhat.com
State New
Headers show

Commit Message

Peter Xu Oct. 8, 2016, 9:56 a.m. UTC
This reverts commit d07cc1f12d8e15c167857852c39190d770763824.

Original commit d07cc1f12d8e15c167857852c39190d770763824 should be
fixing some endianess issue for power, however at least in latest QEMU
I see that all the callers are treating MSIMessage as host endianess
already, so now we should not need this endianess switch any more.

Signed-off-by: Peter Xu <peterx@redhat.com>
---

 I am guessing Power (and BE hosts) is not using commit d07cc1f any
 more, otherwise this looks problematic and then I won't understand
 how it is working now.

 Please correct if I am wrong.

 kvm-all.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/kvm-all.c b/kvm-all.c
index efb5fe3..5ae6e97 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1196,7 +1196,7 @@  static KVMMSIRoute *kvm_lookup_msi_route(KVMState *s, MSIMessage msg)
     QTAILQ_FOREACH(route, &s->msi_hashtab[hash], entry) {
         if (route->kroute.u.msi.address_lo == (uint32_t)msg.address &&
             route->kroute.u.msi.address_hi == (msg.address >> 32) &&
-            route->kroute.u.msi.data == le32_to_cpu(msg.data)) {
+            route->kroute.u.msi.data == msg.data) {
             return route;
         }
     }
@@ -1211,7 +1211,7 @@  int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
     if (kvm_direct_msi_allowed) {
         msi.address_lo = (uint32_t)msg.address;
         msi.address_hi = msg.address >> 32;
-        msi.data = le32_to_cpu(msg.data);
+        msi.data = msg.data;
         msi.flags = 0;
         memset(msi.pad, 0, sizeof(msi.pad));
 
@@ -1233,7 +1233,7 @@  int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
         route->kroute.flags = 0;
         route->kroute.u.msi.address_lo = (uint32_t)msg.address;
         route->kroute.u.msi.address_hi = msg.address >> 32;
-        route->kroute.u.msi.data = le32_to_cpu(msg.data);
+        route->kroute.u.msi.data = msg.data;
 
         kvm_add_routing_entry(s, &route->kroute);
         kvm_irqchip_commit_routes(s);
@@ -1275,7 +1275,7 @@  int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev)
     kroute.flags = 0;
     kroute.u.msi.address_lo = (uint32_t)msg.address;
     kroute.u.msi.address_hi = msg.address >> 32;
-    kroute.u.msi.data = le32_to_cpu(msg.data);
+    kroute.u.msi.data = msg.data;
     if (kvm_msi_devid_required()) {
         kroute.flags = KVM_MSI_VALID_DEVID;
         kroute.u.msi.devid = pci_requester_id(dev);
@@ -1312,7 +1312,7 @@  int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
     kroute.flags = 0;
     kroute.u.msi.address_lo = (uint32_t)msg.address;
     kroute.u.msi.address_hi = msg.address >> 32;
-    kroute.u.msi.data = le32_to_cpu(msg.data);
+    kroute.u.msi.data = msg.data;
     if (kvm_msi_devid_required()) {
         kroute.flags = KVM_MSI_VALID_DEVID;
         kroute.u.msi.devid = pci_requester_id(dev);