From patchwork Fri Feb 1 00:56:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 10791647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5981D6C2 for ; Fri, 1 Feb 2019 00:57:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EA4D31C83 for ; Fri, 1 Feb 2019 00:57:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42FF831CAD; Fri, 1 Feb 2019 00:57:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EE76931C83 for ; Fri, 1 Feb 2019 00:57:44 +0000 (UTC) Received: from localhost ([127.0.0.1]:35150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpN9M-00089C-02 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 31 Jan 2019 19:57:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpN8g-0007pV-I6 for qemu-devel@nongnu.org; Thu, 31 Jan 2019 19:57:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpN8f-0006uK-3u for qemu-devel@nongnu.org; Thu, 31 Jan 2019 19:57:02 -0500 Received: from ozlabs.ru ([107.173.13.209]:53338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpN8d-0006tc-5r; Thu, 31 Jan 2019 19:57:00 -0500 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 1AC8BAE80011; Thu, 31 Jan 2019 19:56:24 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 11:56:22 +1100 Message-Id: <20190201005622.14716-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu] spapr_pci: Fix endianness in assigned-addresses property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , Michael Roth , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP reg->phys_hi and assigned->phys_hi are big endian but we do an extra byteswap anyway when copying reg->phys_hi to assigned->phys_hi. To make things slightly more messy, we also add a relocatable bit (b_n()) although in the right endianness. This fixes endianness of assigned->phys_hi. This is unlikely to produce any visible difference though as we should end up there only in the case of PCI hotplug and even then I am not sure if (d->io_regions[i].addr == PCI_BAR_UNMAPPED) == true. Signed-off-by: Alexey Kardashevskiy --- hw/ppc/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index b74f263..a174952 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -964,7 +964,7 @@ static void populate_resource_props(PCIDevice *d, ResourceProps *rp) } assigned = &rp->assigned[assigned_idx++]; - assigned->phys_hi = cpu_to_be32(reg->phys_hi | b_n(1)); + assigned->phys_hi = cpu_to_be32(be32_to_cpu(reg->phys_hi) | b_n(1)); assigned->phys_mid = cpu_to_be32(d->io_regions[i].addr >> 32); assigned->phys_lo = cpu_to_be32(d->io_regions[i].addr); assigned->size_hi = reg->size_hi;