From nobody Sat May 18 18:58:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1670936003; cv=none; d=zohomail.com; s=zohoarc; b=Oe0V2rq1l1mN9iklvNYaGnjV8qgjK4I86Gk/iiSOBZAWVnumi3o3OI7LY/eFOYZjPkvQNkxeVLKknbe5iUdjMUNFYbOX6hmTvORokWv7+5hl6dOKFfd3IqSl7ene3HehXDLXH4AFvLtnJ6h3nfNzo6+9fqR4oBuDP/UZ5wSYEmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670936003; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tV5dDqKeW0g9sIA7fe0a/By2zgJayPRpeDRbB0e1smc=; b=NPL8Zjz/ZooqQv5LYH1b+dJC68m2MGTmH5CkcKZRCCgno7l3YHCJdDVOzzx1avxJVmdWt2sCv7sOvbKW3/0+Zyro2FIWBEGDmat31p7mqq0vDEPr6KQtM2wQbPb19NuymWQV1Kn364cHnax+Yh+2JLRQEf6id/wUA22LDH4wfj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1670936003334863.8533233923679; Tue, 13 Dec 2022 04:53:23 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AA0mqf7ZGadK9LQwOEYIQpatBgd093EgAqPVlMz83i53R1n60QgjRjkkXsHpy+7CPpi2Ki7tTj6E4A== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: Daniel Henrique Barboza , BALATON Zoltan , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alistair Francis , David Gibson , Jason Wang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Greg Kurz , qemu-arm@nongnu.org, "Edgar E. Iglesias" , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1670936006531100007 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=C3=A9 --- 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) =20 /* Create a mapping for the kernel. */ mmubooke_create_initial_mapping(env, 0, 0); - env->gpr[6] =3D tswap32(EPAPR_MAGIC); + env->gpr[6] =3D const_le32(EPAPR_MAGIC); env->gpr[7] =3D (16 * MiB) - 8; /* bi->ima_size; */ =20 } 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" =20 #include "hw/intc/ppc-uic.h" #include "hw/ppc/ppc.h" @@ -141,7 +142,7 @@ static void main_cpu_reset(void *opaque) =20 /* Create a mapping for the kernel. */ mmubooke_create_initial_mapping(env, 0, 0); - env->gpr[6] =3D tswap32(EPAPR_MAGIC); + env->gpr[6] =3D const_le32(EPAPR_MAGIC); env->gpr[7] =3D bi->ima_size; } =20 --=20 2.38.1 From nobody Sat May 18 18:58:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1670936044; cv=none; d=zohomail.com; s=zohoarc; b=huh9N2vSSdazHivx3C0Bqe1TPgRTxQNUl4U2dMdeM73MOBMKo+EnDHdrkGe2jrTLhZzOytChfIHMza1CXI5KaPzp14c9g5zXkahALdXXZK0I3/9Uu3+vt4AlAx/3aQQncxd/YtT6Kk37uzHoy8m+YRowfvNR5EohngbD9PYhgeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670936044; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9K2qPGrTReTYlsl4YSIfP//FNBSyIjWF7QnWmXpGYsA=; b=f2tn0o1jG7gY943QOrxWElQ5gxjAN3TEKMKUPgyfyQFkoXN+oPQq3R7uuS3hSTVNHFvxLy1vcUSd4gNd0qT2giQ5aq9TIX5D5jo9JDJy1INNx0hoPdwT78Xe0VlFpsnizhk20WRkfOhL1zk2iyd0eBC7zzKvGXzvaiysYYEG21E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1670936044300154.78761381389643; Tue, 13 Dec 2022 04:54:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p54lv-00006M-5n; Tue, 13 Dec 2022 07:52:35 -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 1p54lt-000060-Oe for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:33 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p54ls-0002yb-6r for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:33 -0500 Received: by mail-wm1-x32c.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so7890876wms.2 for ; Tue, 13 Dec 2022 04:52:31 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003c71358a42dsm17603605wmq.18.2022.12.13.04.52.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Dec 2022 04:52:30 -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=9K2qPGrTReTYlsl4YSIfP//FNBSyIjWF7QnWmXpGYsA=; b=yl5BCsoEDuxmjJkMLGADIVk+7r8BSL7oepnDFby7GNPpQfmQ5Bn+smmkNWKP7MY7nj CiCsBjoLiYR2B5BR/DQ2D2ziVZtoDFyQDJw5CcT9HrbV3cVjwevAC9DQYJtNxpBJWmDW qgw/WVDJhEt7ZK3FKPs6rJfcBSJbjP6N01bCBm56P3ru704eGUG02glHV194chqOhpoQ gtTSzLFX+XRxlAnO25y+QbyX/hw6j4SFRiQowJug01p5XQkGSuFCWlrRYfJ/cRy8saYc H3dTMZMz38AM4xGAXMO+0EGrukQLrdKiDssA0IIA02sd3JUpknCLHzUzpDcBe/ivAt3v vJ3Q== 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=9K2qPGrTReTYlsl4YSIfP//FNBSyIjWF7QnWmXpGYsA=; b=1sHjKEkFfIDi6B7wMJe/EzmLm9wWMNbT7uyhV6RBHYU5hFQfbFzhk7YnqALi8MmxOL O8zQZxKmS7vbJwca0H8ylnErdf9cKY6FzQ02No7pCv43acV8uzdRi455t9dLiFcMWfmy dTDp+epTCz+Msl6EWEyzH5RaJREk3ub9xKZFpSSsVK+OdM1lT5gv+ror+/mz0BRHN3Cg fRYWm6FPx56DBWLCf1wKvlxZG5gy0BmEVYywj/p4/wC8lgElo1EUpVqIHfLL8K62CTx+ 0O1eM7dQyDSJ8UGId7+jiMi0yLFGMwdmi9JIU2ffm8lq+DdkUCUbRu/UKtcQxBplpjIb 0jVA== X-Gm-Message-State: ANoB5pmjRE+N/ppvZq/1abYr7hQ6raGu5x+wRjTSrPCz2aWmOOFjbasa vPNsr2gl9tQi/hSNy21hEXc+7Q9cHUQIaX28/rU= X-Google-Smtp-Source: AA0mqf5i7uzOLLsF0oM44lU5HBiiTzazh0C7ReGXX9LYbBi9XR+7AIoiqtUfeiCSfZTn0pRfqmQj/Q== X-Received: by 2002:a05:600c:1e25:b0:3cf:9ac8:c4eb with SMTP id ay37-20020a05600c1e2500b003cf9ac8c4ebmr14901967wmb.24.1670935951219; Tue, 13 Dec 2022 04:52:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: Daniel Henrique Barboza , BALATON Zoltan , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alistair Francis , David Gibson , Jason Wang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Greg Kurz , qemu-arm@nongnu.org, "Edgar E. Iglesias" , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE) Date: Tue, 13 Dec 2022 13:52:17 +0100 Message-Id: <20221213125218.39868-3-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1670936045565100003 The tswap64() calls introduced in commit 4be21d561d ("pseries: savevm support for pseries machine") are used to store the HTAB in the migration stream (see savevm_htab_handlers) and are in big-endian format. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/spapr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 66b414d2e9..8b1d5689d2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -39,6 +39,7 @@ #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "qemu/log.h" +#include "qemu/bswap.h" #include "hw/fw-path-provider.h" #include "elf.h" #include "net/net.h" @@ -1357,10 +1358,10 @@ static bool spapr_get_pate(PPCVirtualHypervisor *vh= yp, PowerPCCPU *cpu, } =20 #define HPTE(_table, _i) (void *)(((uint64_t *)(_table)) + ((_i) * 2)) -#define HPTE_VALID(_hpte) (tswap64(*((uint64_t *)(_hpte))) & HPTE64_V_VAL= ID) -#define HPTE_DIRTY(_hpte) (tswap64(*((uint64_t *)(_hpte))) & HPTE64_V_HPT= E_DIRTY) -#define CLEAN_HPTE(_hpte) ((*(uint64_t *)(_hpte)) &=3D tswap64(~HPTE64_V_= HPTE_DIRTY)) -#define DIRTY_HPTE(_hpte) ((*(uint64_t *)(_hpte)) |=3D tswap64(HPTE64_V_H= PTE_DIRTY)) +#define HPTE_VALID(_hpte) (be64_to_cpu(*((uint64_t *)(_hpte))) & HPTE64_V= _VALID) +#define HPTE_DIRTY(_hpte) (be64_to_cpu(*((uint64_t *)(_hpte))) & HPTE64_V= _HPTE_DIRTY) +#define CLEAN_HPTE(_hpte) ((*(uint64_t *)(_hpte)) &=3D cpu_to_be64(~HPTE6= 4_V_HPTE_DIRTY)) +#define DIRTY_HPTE(_hpte) ((*(uint64_t *)(_hpte)) |=3D cpu_to_be64(HPTE64= _V_HPTE_DIRTY)) =20 /* * Get the fd to access the kernel htab, re-opening it if necessary --=20 2.38.1 From nobody Sat May 18 18:58:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1670936003; cv=none; d=zohomail.com; s=zohoarc; b=kbmgPmhsRSUvf35sCqTbf4nF1MmCb/QpssCcLTr7w8k2V5K36hMqLxWSYKXYglyyPSveP6g6WuvdIOPhq6rbRndtXz8OdSHYpZ64G0lA30DpbrKaOpP6hfKLgst8kcAV94tC22c/g22sAocDUByjZa1L2TIQNI0SljtRUQnHqJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670936003; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=El4Mo4XJqlmSIoO5ETLFqRzBXVBkfAvXj3HufFMLDB0=; b=AKoKgQUVEnuHosavmlKInoo4W1z9JZeQ5q6qU7/VHhCzmZcUbylExY9ehrQiSQQ1B0ujT6FH1d6WM7y/EON+qLXcO8XKdJzVN2LGnasm09YSavdJ1TCIlLnFLuEQiXU2i+942HlhKnR5kLQWEP3dDYZKXKx3QnVlBgHLpDwJJJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1670936003292814.8520439144875; Tue, 13 Dec 2022 04:53:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p54m9-00009T-SX; Tue, 13 Dec 2022 07:52:49 -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 1p54lz-00007y-UA for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:39 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p54ly-00030t-5V for qemu-devel@nongnu.org; Tue, 13 Dec 2022 07:52:39 -0500 Received: by mail-wm1-x335.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so7817662wma.1 for ; Tue, 13 Dec 2022 04:52:37 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g23-20020a05600c4c9700b003cf4ec90938sm12081630wmp.21.2022.12.13.04.52.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Dec 2022 04:52:36 -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=El4Mo4XJqlmSIoO5ETLFqRzBXVBkfAvXj3HufFMLDB0=; b=Qpt4z6KOyGfmVHof3B8vjj9lmGlhjItvat/UYcHjdmfNQMhgrsdL+VrzB0l/zmH//7 /6pcLu9hXSap6cUwQ4XaCougl+9jf3inXcaFwle4eP3ITO+LRPr7ZwwyUcClbOaZe8sb egtAnWT9nigfBN1gVL768oAzebQpbIlf3L5nRI6ihZGrO7wWCaxboEBbFGllo9vKFWXA Nhvm78YqDpdDSwpc1hRyMmcB71E9QAPs9rKCLDHtdI/qfAWdnMPGHsjmwwPx1bRW55yg 5DXA4WLqAP+geC1u4WbdH1YB2gQpZtUKu4yGi9QmSNAyCqFOAapU/86gfIGcf9OWKOKV kmWA== 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=El4Mo4XJqlmSIoO5ETLFqRzBXVBkfAvXj3HufFMLDB0=; b=r207RWyRrdyntB8WIaFG5ClTRCOsBZdrCP/fJga+hYsVslP1fBXJqxQpXWh3ORWylh CmbGnivigX7mzcK16f6yQumvW/zqS0XQTtNH6gU+U8NXpZz0aoLSI8ofdh7H2UXmNRYO T+TpyNuLxlQEvr6A+18OQkdN8Zr+d/Ob6/Du16UUafeu0Uh8Exd5jg5PnZcu8theghnN +GoEPRo2N+mXcviY2ZQE2K6r2hlC+3dThfy6ew9Xv45qFX3dXxnIcrETg4UIlY7KKVhT 8mCp4lvQoHgyvAp0zWDinPvjM8rcVfbCpjDrKW8ziadvFqgebTfEqnxLrO4TA0kDD1HY b+gg== X-Gm-Message-State: ANoB5pkj0JwmRzuokGYadRsWGg8zV0OFvX0aQfifOr2TfeDDNFbbb7yI V+HQcMvZmeeGHieKpADMqwOx9lmDCiZMpRE4zHk= X-Google-Smtp-Source: AA0mqf7ApUqHFBFm7LoMDf1EQaoDfANzrNkuntotfUoPT+dt5bjRmbgXASwlJMLJQi9SIR/eKR55Lg== X-Received: by 2002:a05:600c:538f:b0:3d1:d396:1ade with SMTP id hg15-20020a05600c538f00b003d1d3961ademr15602334wmb.9.1670935956487; Tue, 13 Dec 2022 04:52:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell Cc: Daniel Henrique Barboza , BALATON Zoltan , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alistair Francis , David Gibson , Jason Wang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Greg Kurz , qemu-arm@nongnu.org, "Edgar E. Iglesias" , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu() Date: Tue, 13 Dec 2022 13:52:18 +0100 Message-Id: <20221213125218.39868-4-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1670936005801100003 This partly revert commit d48751ed4f ("xilinx-ethlite: Simplify byteswapping to/from brams") which states the packet data is stored in big-endian. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/xilinx_ethlite.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 6e09f7e422..efe627d734 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -24,8 +24,8 @@ =20 #include "qemu/osdep.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "qom/object.h" -#include "cpu.h" /* FIXME should not use tswap* */ #include "hw/sysbus.h" #include "hw/irq.h" #include "hw/qdev-properties.h" @@ -102,8 +102,8 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) D(qemu_log("%s " TARGET_FMT_plx "=3D%x\n", __func__, addr * 4,= r)); break; =20 - default: - r =3D tswap32(s->regs[addr]); + default: /* Packet data */ + r =3D be32_to_cpu(s->regs[addr]); break; } return r; @@ -160,8 +160,8 @@ eth_write(void *opaque, hwaddr addr, s->regs[addr] =3D value; break; =20 - default: - s->regs[addr] =3D tswap32(value); + default: /* Packet data */ + s->regs[addr] =3D cpu_to_be32(value); break; } } --=20 2.38.1