From patchwork Fri Jul 12 07:37:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 258711 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4CEB82C02AC for ; Fri, 12 Jul 2013 17:38:19 +1000 (EST) Received: from localhost ([::1]:42372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxXvk-0002qh-Qx for incoming@patchwork.ozlabs.org; Fri, 12 Jul 2013 03:38:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxXvV-0002qY-0E for qemu-devel@nongnu.org; Fri, 12 Jul 2013 03:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxXvU-0001Sq-03 for qemu-devel@nongnu.org; Fri, 12 Jul 2013 03:38:00 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:45878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxXvT-0001SX-Pa for qemu-devel@nongnu.org; Fri, 12 Jul 2013 03:37:59 -0400 Received: by mail-pa0-f51.google.com with SMTP id lf11so8764675pab.10 for ; Fri, 12 Jul 2013 00:37:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=zGhmrJug8AXnJTGPd16Ffl/gLokFig9qOYTH6j3ckvE=; b=kvC9nJ+rGG/+gEjZiwB10Rp2Zev9BLjaKtB3Huz3urYwA/ho2N/c3gO5eqJZ0aCUrA tV8hDTvQGGpo/TyXZUXCB3QzMpOT1s168c68rs07rHdcMdqg4MQ8zY+qk/GkexyfMa1T Yr5hve+seMZR7+bLLEpFRHtEDdN/e/iYstZpZPKui7ZR+1d/VJAaX6ame8ufxX9DexNL SOq5wEsA76+q4Krbmgh+YziFzAKmpO2eG8ZZ8YQ1IQgM1hxRpvO6k/wYXuvyIYZaM+oK tiomELFrbWYFhg9YDSKQIb1rRtnar4St1Zo3LdD/oC+AaQHAUlbV6JNk8sPM+47gT/5h MEEA== X-Received: by 10.68.232.225 with SMTP id tr1mr39818131pbc.143.1373614678896; Fri, 12 Jul 2013 00:37:58 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id pv5sm41777860pac.14.2013.07.12.00.37.55 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 00:37:57 -0700 (PDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Fri, 12 Jul 2013 17:37:19 +1000 Message-Id: <1373614639-15523-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.8.3.2 X-Gm-Message-State: ALoCoQlatK0d9Pppog3Aoau9fTl0K/g45K1oi/Lyit+3WaV2krS8fPWea6YHL7+FBx9CT8YmRLAy X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.51 Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , David Gibson Subject: [Qemu-devel] [PATCH] spapr-pci: change endianness for io ports space X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org sPAPR PHB emulates IO ports on PCI via a special memory region which routes all reads/writes further via cpu_in*/cpu_out* which are eventually processed by MemoryRegionOps implemented by devices. As devices normally take care of endianness themselves by setting correct MemoryRegionOps::endianness for their memory regions, it is better to set endianness in spapr_io_ops to NATIVE. Tested on sPAPR KVM with e1000, rtl8139, virtio-net. Signed-off-by: Alexey Kardashevskiy --- I would really appreciate if someone told me what exactly changed in QEMU and broke spapr-pci. It used to work... Thanks! --- 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 ca588aa..dfe4d04 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -472,7 +472,7 @@ static void spapr_io_write(void *opaque, hwaddr addr, } static const MemoryRegionOps spapr_io_ops = { - .endianness = DEVICE_LITTLE_ENDIAN, + .endianness = DEVICE_NATIVE_ENDIAN, .read = spapr_io_read, .write = spapr_io_write };