From patchwork Tue Dec 13 12:52:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 633510 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3056871pvb; Tue, 13 Dec 2022 04:53:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4K1QW8XK/R4zUWiVejKA6BT9GRgy40RfQIov5kUTx85L48S22ksJsjEx10Gj7z5fMl2cRX X-Received: by 2002:ac8:444a:0:b0:39c:da20:f6ff with SMTP id m10-20020ac8444a000000b0039cda20f6ffmr30754893qtn.35.1670936002914; Tue, 13 Dec 2022 04:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670936002; cv=none; d=google.com; s=arc-20160816; b=z5kyhfBI+lkwiBezj4hSpKeNZSi3woLw9XMpWEx+LK0/LidaHb1NagrI2wiS+0flPc 9hoS3XAlBf37WNmLVosQN+vwaZkK+f64j/dGmxqFItQk0Tive1WqzhYz/UJZF3A/euvK DnBZZITTHScM0y38W2thnS9HJ0SunHWuX+pfa4eGObREH4sefpLNfCjF+g8C47z1jvD8 8UK4j9auCU3hr0hFm77Amw2V9/LEKctkTxtzAL0SrQP6upJCMJl+c8EZnMR/EKIw30/l KC2USlfkqTh5RPlSnlZ1Wswxilli9pIkYtaMhL5ygqzmqOntcHLOu1eDLAc0llWc2bWk dGhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tV5dDqKeW0g9sIA7fe0a/By2zgJayPRpeDRbB0e1smc=; b=cNMUYOKK3ygjwSvDlqibccAkbfJ7na9Q9U4hAMw+bqWXdaYSVOWhAMRGWrfjqkLE8z swnfYhLP3y6srLE1rbhAdMFO2QMnoRO/396a3RwJVbmRXy/rV9krz6SC60j83ynmw4kT Evs807pnbPzuQ1Xi5uAJNijkCv24Cf7ZU46ZRrkFWBAUgZVcBERI9x4EnGuzg0qPkQU/ Ld2sc0+xp5FFjwlFoF45GkQztJQku6wxiyOuYp9FQGboUhic6oAXp5D6plgONpTiaYjR hvXzoeqNpnkcW6X1eVmpLoaZpcy8M1MxnsXBjwL1TGJ+VeHKX8wVXINYSTBD4MhQEtyM A55w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NwCxfj4W; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l26-20020ac84cda000000b003a69225c2bcsi6668271qtv.342.2022.12.13.04.53.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Dec 2022 04:53:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NwCxfj4W; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p54lr-00005a-Rx; Tue, 13 Dec 2022 07:52:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p54lq-0008WV-4Y for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:30 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p54ln-0002zK-Th for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:29 -0500 Received: by mail-wm1-x336.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso7901198wmo.1 for ; Tue, 13 Dec 2022 04:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tV5dDqKeW0g9sIA7fe0a/By2zgJayPRpeDRbB0e1smc=; b=NwCxfj4WCNtdnsgbLWI91hcX0HEh5S4lhhSXsLWyy2Wf9RcRlwRaQxMRWQOpqV2+QG bHIGRLggMoS3aGXMpew6zbSAULzSLrw2RTdv8zkJMoJMLt6aZ68xVx3HmWKUVMjOX4hK zZOI/aNnie7lOXaFvU5uN8YH0GEJHoX8js/2Y37mZzwPHp8NDeYm1jXnWyqkURHjtfsG Y9rpiUqh0AwV500L6ODruQzJmw+UeYtWE4P1tpW1zusyMZF0GiTvaQex/1FIvmWj5T0m ya5nSFNB5ZumK+PhCGC67KKCCL3JGkWFQ+ihU5/sK6Qi6mal3uHdTwbItlX7Z6Tyyg3l PF7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tV5dDqKeW0g9sIA7fe0a/By2zgJayPRpeDRbB0e1smc=; b=j2ACXyDBV7Wcmz6vkWN4SSYNVA2rDPdMjsM0S7H3xt2nX1Q58pvPo6fE71y0LgNi4M fI08u4BVgkZ08n4hbuT2QDheyBJAJAcxkdU8Z83mNJ1Kla7x1UStFGlj05BRhWx5S79P peR4W9vohZNxZPIX6FaOr3PMOD5LesPxJ0gqNOJrL9eYFjUVeojHuqZzZsbec9ZfkbRL DSxsQVnJIyCeLCKT3QynSwfRSZTxlpDn8uQAmKgL+1j/3AJy5r3FDumuhDljlPoGpJBH AIzCaDXMCPQBcVqy9Z06jxb74ncXFUQfJ6O9lygObrQk7OR5CdRyYndDZALn+aiyzIw4 iaPA== X-Gm-Message-State: ANoB5pmuKJxN1WCg43gWP8VZs0yKLivNYrwX7JeFMmxD/5bT7OPc9VEB EbMo5NKHNZBY3KLiooZoBhBheZgw2DJl0+Rkvuo= X-Received: by 2002:a05:600c:4e91:b0:3d1:dc6f:b1a4 with SMTP id f17-20020a05600c4e9100b003d1dc6fb1a4mr19595334wmq.5.1670935946097; Tue, 13 Dec 2022 04:52:26 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id 18-20020a05600c22d200b003c6bd12ac27sm12560385wmg.37.2022.12.13.04.52.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Dec 2022 04:52:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: Daniel Henrique Barboza , BALATON Zoltan , =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , David Gibson , Jason Wang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Greg Kurz , qemu-arm@nongnu.org, "Edgar E. Iglesias" , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32() Date: Tue, 13 Dec 2022 13:52:16 +0100 Message-Id: <20221213125218.39868-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221213125218.39868-1-philmd@linaro.org> References: <20221213125218.39868-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Assuming the developers of commits 2c50e26efd ("powerpc: Add a virtex5 ml507 refdesign board") and 4b387f9ee1 ("ppc: Add aCube Sam460ex board") were testing on a little-endian setup, they meant to use const_le32() instead of tswap32() here, since tswap32() depends on the host endianness. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/sam460ex.c | 3 ++- hw/ppc/virtex_ml507.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 4a22ce3761..88b1480138 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -15,6 +15,7 @@ #include "qemu/units.h" #include "qemu/datadir.h" #include "qemu/error-report.h" +#include "qemu/bswap.h" #include "qapi/error.h" #include "hw/boards.h" #include "sysemu/kvm.h" @@ -255,7 +256,7 @@ static void main_cpu_reset(void *opaque) /* Create a mapping for the kernel. */ mmubooke_create_initial_mapping(env, 0, 0); - env->gpr[6] = tswap32(EPAPR_MAGIC); + env->gpr[6] = const_le32(EPAPR_MAGIC); env->gpr[7] = (16 * MiB) - 8; /* bi->ima_size; */ } else { diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index 13cace229b..0f282ecaa7 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -38,6 +38,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/option.h" +#include "qemu/bswap.h" #include "hw/intc/ppc-uic.h" #include "hw/ppc/ppc.h" @@ -141,7 +142,7 @@ static void main_cpu_reset(void *opaque) /* Create a mapping for the kernel. */ mmubooke_create_initial_mapping(env, 0, 0); - env->gpr[6] = tswap32(EPAPR_MAGIC); + env->gpr[6] = const_le32(EPAPR_MAGIC); env->gpr[7] = bi->ima_size; }