Received: from eggs.gnu.org ([2001:4830:134:3::10]:53980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsoMz-0008Bb-Rq for qemu-devel@nongnu.org; Sat, 08 Oct 2016 05:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsoMw-0006F0-Jl for qemu-devel@nongnu.org; Sat, 08 Oct 2016 05:56:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsoMw-0006EY-DB for qemu-devel@nongnu.org; Sat, 08 Oct 2016 05:56:38 -0400 From: Peter Xu Date: Sat, 8 Oct 2016 17:56:30 +0800 Message-Id: <1475920590-17587-1-git-send-email-peterx@redhat.com> Subject: [Qemu-devel] [PATCH] Revert "KVM: MSI: Swap payload to native endianness" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, agraf@suse.de, peterx@redhat.com 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 --- 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 --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); -- 2.7.4