From nobody Fri Dec 19 04:38:27 2025 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=1733344063; cv=none; d=zohomail.com; s=zohoarc; b=aNrfpDaBoXueP5SFAf46Ig0Xr3M36roh5Q8E2TlkLZOzJzbzLeQGci+RQBPb2B6IhRqNdC8ZXxETkV7/aPICNZG2Y3LODK8Cl3+CoHcVUh+1cNsUDLHgrikVWWJXEeGgLkmrGqJRAatVcwatyekOHR30tfOU29c1jhOu1BQu1q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344063; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m1RIE5+ukFowaj7qHZ6IcTnrqgT2AW8n48ucXO2dhS0=; b=lPBMudgQBN28zfqEFbF9e/Jm/U1nPTjBnFO2T4VFCFVH8ms9afQMC+lBGm/rlt2kNgocZ1cq9YmktpT3TrcPe+6KCVm049ameDTADrK4S/65YXixXmnYvEdu2qEaGeKCbQZ3zWrC9XqZ1CIg3ktMaukMGSI6eo6GwBzrNM6b8Sg= 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 1733344063181775.2345684382472; Wed, 4 Dec 2024 12:27:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvwx-0007RY-7g; Wed, 04 Dec 2024 15:26:19 -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 1tIvwv-0007QB-4N for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:17 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvws-0006ze-5l for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:16 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434a8640763so1429295e9.1 for ; Wed, 04 Dec 2024 12:26:13 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52a90a2sm34906725e9.36.2024.12.04.12.26.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733343972; x=1733948772; darn=nongnu.org; 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=m1RIE5+ukFowaj7qHZ6IcTnrqgT2AW8n48ucXO2dhS0=; b=GfVsU7IyO93eg5TienZnTWiud2BVDp961Au9iueryaXGHHxsSE5+OIgvy5aav+J6j0 iFj9ReTl9yIEFFwIcem7tWhUVlTJhb5w2LAZ1K0pNJFQ7lA8s7AY79Kd8Vg+dGafTNWP ECFJv/88555Zt31CvtFyDigvuV2yANIXIMIjJpLhiDf/36IYmECsZpvLKo/Fiyu+iwyj odCezX9IRqGbRLT7pYjCOrVw2hbwZFsrR0KejG9p49k6ylSkpNbPuDTjEoqmh1XH1DUr QCeD2fzXnpNfV2YNqPW+alwG854lOkVPMLw+ypdCRAUtx7HnYFBP2NAem4vXwWIOjqK2 NSWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733343972; x=1733948772; 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=m1RIE5+ukFowaj7qHZ6IcTnrqgT2AW8n48ucXO2dhS0=; b=WM+TiipOwhVN6v9i/jpFfOtuIWUlJCx1fhlGeBGsbUML3VQVTpK2Ufvm8ajRkdABYN FXjwVxm1WmrW5nnTYZyF++AYMD5+Pwhkpl/E8eY5sZIuM8ztCMu5Yuo3pIDEHauZxAqP sGbUt5uyxm5tWrTK33yrvetganswBTntgozui57y7g18Mfvw2fVfjJC/Oh3i9Ouji4yS MJxvQmuP/UEhubX9e2lrA+hbyqLjWR5VVbVtwUDycLNMoZ98Nh40CQKfqgw1hnqB22Vs fn0X1feyFGXPglqu+cdpUOmDVFgo8g0Sh0Z1AWEhtaLog7bUv8xVylXG9Zd9QJZEvpY+ BP0g== X-Gm-Message-State: AOJu0YwdfwPXjWmdKSLt5EtP2SK+iQJ0JcKJZyHVUgHL75BxPufXUMkv +e8HUR6GstnkBuadtRKpSm54EARqYb5qXIdQD9QB+ZiBItNq1CCWaB+arHh1qZkbY1JHzOHH8aN 1 X-Gm-Gg: ASbGncsrPUWmQxj8ubVBYVa71N4/9tPbNh1wKJo3apxWzg+6G44/ZTvohxhBq3nAbp7 B965HpQj0GkAUGhJM22PKfGaertK0JTjcA2Mt/++Xme9rvCDts24ugno2Fft5WBD4hYHUMsAeoR NxrhkjujVVp79sE07YYP1g3TB8606KVh+45r/35dS9pNNOtMg8jmUrVoI55w8i695+PUwdcTWKO v1qm9MbEcGXew5RkQG2SNYoskyMjZ/qUh/gzNVo0FYsmZuKrV1av3JQ+A8GwjmWBWrWINHCFTet e089PYpY+X9WLhz24mzFxtsw X-Google-Smtp-Source: AGHT+IGXhwpuvROhVg5Eagj4XtkzGHltgdEVnCyeX3LY5U9qfbLEMjF9256hEmEL1EeT6+IKKEYpGQ== X-Received: by 2002:a05:600c:3108:b0:434:9f78:17d2 with SMTP id 5b1f17b1804b1-434d0a1d675mr64752805e9.29.1733343972461; Wed, 04 Dec 2024 12:26:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 01/20] exec/tswap: Rename target_words_bigendian -> qemu_binary_is_bigendian Date: Wed, 4 Dec 2024 21:25:43 +0100 Message-ID: <20241204202602.58083-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1733344064611116600 target_words_bigendian() doesn't return whether a target vCPU expects data in big-endian order, but whether the *binary* has been compiled with big-endian flavor by default. Rename it appropriately to reduce confusion. Mechanical change doing: $ sed -i -e s/target_words_bigendian/qemu_binary_is_bigendian/ \ $(git grep -l target_words_bigendian) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/exec/tswap.h | 18 +++++++++--------- cpu-target.c | 2 +- disas/disas-common.c | 2 +- hw/core/cpu-sysemu.c | 2 +- hw/core/generic-loader.c | 2 +- hw/display/vga.c | 4 ++-- hw/virtio/virtio.c | 2 +- system/qtest.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index ecd4faef015..0113ff88fcc 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -11,15 +11,15 @@ #include "qemu/bswap.h" =20 /** - * target_words_bigendian: - * Returns true if the (default) endianness of the target is big endian, - * false otherwise. Note that in target-specific code, you can use - * TARGET_BIG_ENDIAN directly instead. On the other hand, common - * code should normally never need to know about the endianness of the - * target, so please do *not* use this function unless you know very well - * what you are doing! + * qemu_binary_is_bigendian: Returns QEMU binary default endianness + * + * Returns whether the QEMU binary is built for big endianness flavor + * by default. + * vCPUs use this flavor by default when their endianness is not specified. + * + * This is not a clear API so please do *not* use this function. */ -bool target_words_bigendian(void); +bool qemu_binary_is_bigendian(void); =20 /* * If we're in target-specific code, we can hard-code the swapping @@ -28,7 +28,7 @@ bool target_words_bigendian(void); #ifdef COMPILING_PER_TARGET #define target_needs_bswap() (HOST_BIG_ENDIAN !=3D TARGET_BIG_ENDIAN) #else -#define target_needs_bswap() (HOST_BIG_ENDIAN !=3D target_words_bigendian= ()) +#define target_needs_bswap() (HOST_BIG_ENDIAN !=3D qemu_binary_is_bigendi= an()) #endif /* COMPILING_PER_TARGET */ =20 static inline uint16_t tswap16(uint16_t s) diff --git a/cpu-target.c b/cpu-target.c index 499facf7747..ff8c55a810a 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -463,7 +463,7 @@ out: } #endif =20 -bool target_words_bigendian(void) +bool qemu_binary_is_bigendian(void) { return TARGET_BIG_ENDIAN; } diff --git a/disas/disas-common.c b/disas/disas-common.c index de61f6d8a12..7377de0715c 100644 --- a/disas/disas-common.c +++ b/disas/disas-common.c @@ -61,7 +61,7 @@ void disas_initialize_debug_target(CPUDebug *s, CPUState = *cpu) =20 s->cpu =3D cpu; s->info.print_address_func =3D print_address; - if (target_words_bigendian()) { + if (qemu_binary_is_bigendian()) { s->info.endian =3D BFD_ENDIAN_BIG; } else { s->info.endian =3D BFD_ENDIAN_LITTLE; diff --git a/hw/core/cpu-sysemu.c b/hw/core/cpu-sysemu.c index 2a9a2a4eb54..4b85face02b 100644 --- a/hw/core/cpu-sysemu.c +++ b/hw/core/cpu-sysemu.c @@ -129,7 +129,7 @@ bool cpu_virtio_is_big_endian(CPUState *cpu) if (cc->sysemu_ops->virtio_is_big_endian) { return cc->sysemu_ops->virtio_is_big_endian(cpu); } - return target_words_bigendian(); + return qemu_binary_is_bigendian(); } =20 GuestPanicInformation *cpu_get_crash_info(CPUState *cpu) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index ea8628b8926..abdd4c08a38 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -134,7 +134,7 @@ static void generic_loader_realize(DeviceState *dev, Er= ror **errp) s->cpu =3D first_cpu; } =20 - big_endian =3D target_words_bigendian(); + big_endian =3D qemu_binary_is_bigendian(); =20 if (s->file) { AddressSpace *as =3D s->cpu ? s->cpu->as : NULL; diff --git a/hw/display/vga.c b/hw/display/vga.c index 6dbbbf49073..6be02006000 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -2116,7 +2116,7 @@ static bool vga_endian_state_needed(void *opaque) * default one, thus ensuring backward compatibility for * migration of the common case */ - return s->big_endian_fb !=3D target_words_bigendian(); + return s->big_endian_fb !=3D qemu_binary_is_bigendian(); } =20 static const VMStateDescription vmstate_vga_endian =3D { @@ -2264,7 +2264,7 @@ bool vga_common_init(VGACommonState *s, Object *obj, = Error **errp) * into a device attribute set by the machine/platform to remove * all target endian dependencies from this file. */ - s->big_endian_fb =3D target_words_bigendian(); + s->big_endian_fb =3D qemu_binary_is_bigendian(); =20 vga_dirty_log_start(s); =20 diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f12c4aa81eb..b3dede476ed 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2248,7 +2248,7 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val) =20 static enum virtio_device_endian virtio_default_endian(void) { - if (target_words_bigendian()) { + if (qemu_binary_is_bigendian()) { return VIRTIO_DEVICE_ENDIAN_BIG; } else { return VIRTIO_DEVICE_ENDIAN_LITTLE; diff --git a/system/qtest.c b/system/qtest.c index 12703a20455..8675a0bd316 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -704,7 +704,7 @@ static void qtest_process_command(CharBackend *chr, gch= ar **words) qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "endianness") =3D=3D 0) { qtest_send_prefix(chr); - if (target_words_bigendian()) { + if (qemu_binary_is_bigendian()) { qtest_sendf(chr, "OK big\n"); } else { qtest_sendf(chr, "OK little\n"); --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344084; cv=none; d=zohomail.com; s=zohoarc; b=lvUXM/aGV8ulVIoUWbTGuuOdmmU1XekXC70zjRMB15NUdxxq6YQ/BjKrpjpztSRaKt0yRfN3yH/10zqPb9uLTc3OPwlF1W/cO6z9P/bNYZdrDlHntkmu7lTWz7+wLClBryBp0DDoYx6xim2ptYseEc9GvSO4g76GsXQpW2Wms+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344084; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DPV/ubcrZI2iapAPKTXZkCgfGpvNQPE7G4ysbpy5Jw0=; b=m1ddKX9iX2j9JlXgYaae0Tzb4vMiUsaoAKf9zFdirUyVlqsT2SIcbXlEkstwtkEtzRagGxe2LsFLpLcm78J9KvvoMnHvYgvGaE8RPZv5WYTjHGW8tuiTsK6lPUvqfkSMUE9cX3kHRg/YX1Qq5Ndp5gsEmKbDAm36ASiMpe6shUo= 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 1733344084629326.8671859312975; Wed, 4 Dec 2024 12:28:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvx0-0007TA-WD; Wed, 04 Dec 2024 15:26:23 -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 1tIvwz-0007SD-Rh for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:21 -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 1tIvwx-00070Z-HW for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:21 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-434aafd68e9so1520005e9.0 for ; Wed, 04 Dec 2024 12:26:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385faec0c9dsm6672009f8f.20.2024.12.04.12.26.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733343977; x=1733948777; darn=nongnu.org; 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=DPV/ubcrZI2iapAPKTXZkCgfGpvNQPE7G4ysbpy5Jw0=; b=dRqngvANIAybBI4plRQlxbGRt7LPEOiaCux0KvE/ZHgfjadcIpzfr0vJYNoYv20AaK /wZvLKovl491nwxERsQyNHincW8MTSAgH1bpoyFqa6Wsch/lUMGFjEZY/aAFsvKYXHVw dxCjmzXDOgGfmonYcPcLyjF7ncHNBnCJGTBuwVxkS0/cAHoIYnsVnCH3Ivdd3BPYeD2j 0Pd83NvnY49xelDwl3I8T8RBjRNUrDChC8wuQ4kYoIZTGQu0fEhduDxDAbgTtzpiS62o +2vlgpGt3n6H00hJYR4Z2kWeXqxwbVQryGLCgj6/2K+yxE8pEvlhDscguxfvj52uGaaj w2Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733343977; x=1733948777; 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=DPV/ubcrZI2iapAPKTXZkCgfGpvNQPE7G4ysbpy5Jw0=; b=sXbBkp6xWem9GcZkm1Sdr+5WCC6YGdnOzEMxZsVvJFoLdomkl/yTxRqdDz8O2WbTLF yYQKEPKH/79n+PHeyfGDEUWBQcz+a/3NXf7LehOnrjwiHhLe3fuk1Kfe3uZu9wH8Taai /68O2tHONU80G5kp18dCWR+kES+d3oW38pk8adWRc/YD/wVS4qV2q/IaMPWdV3cUWHI5 159tiQDRXZexXcVfvTQXjMZ8ctm6BQphJB04sp21rW2UB4yFbGmpjQXt8lLOdgI32ggr nfJEg8r96QBGri35fOfwcyV02Cat2H5/sT34n40xps6qek3w4YvJDb2x5TBWdNbkU2WC dHfw== X-Gm-Message-State: AOJu0YzBmGjh3A1c45EHJvTPH6nfIexZWtWlxtfpCocgF3DsjXBMeNEg YPgZNW+H0mzcDct1/UHcFta33bwjdf/4B3p2w0ULzklVmCMFngZD8qP9+U0UkgYTTQlOUH+iRPx o X-Gm-Gg: ASbGncuBb1D0qnQeUM6gWu7R6gyBBbk/am+3RVtWT04XCO27X6Z0CA26W99cZsLLHoT ze/2VJZkq7R+NQkXniT30FC9WXJZun19+Ie5TwC2xInoQjYtpNz0B2wMqVCK6dEq4+1+plr32VC m3SBCA4yyh95D+fI5rjNWxSbNhW4gTt5E2ovhBRcG3tgS/8T8Cd0GqPxm33xrZ9fMvK2lUPak56 W7qAgzsjAdXztnWBMOAsdg1tjYUQXbZQxG8GkFwT+AyR8CzN64mTr9McbDBByHtr4B6Y1GAIuZ7 DH+K2jIwhTAwJnchb6Oq/qBk X-Google-Smtp-Source: AGHT+IFeaA2c209Xgk6HxXqyhoIdq9s4nD1+pCKbz/xRkRw7GRhfUdt4Ky6Zy1ZjVBGrOnLx7SCaQA== X-Received: by 2002:a05:6000:698:b0:385:dea3:6059 with SMTP id ffacd0b85a97d-385fd429a01mr6525111f8f.49.1733343977503; Wed, 04 Dec 2024 12:26:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 02/20] hw/core/cpu: Introduce CPUClass::datapath_is_big_endian() handler Date: Wed, 4 Dec 2024 21:25:44 +0100 Message-ID: <20241204202602.58083-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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: 1733344086355116600 Introduce the CPUClass::datapath_is_big_endian() handler, which returns whether a vCPU expects data in memory to be in big endian order or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c3ca0babcb3..91c6581f814 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -105,6 +105,8 @@ struct SysemuCPUOps; * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @has_work: Callback for checking if there is work to do. + * @datapath_is_big_endian: Callback returning whether the vCPU expects + * memory data in big endian order. * @mmu_index: Callback for choosing softmmu mmu index; * may be used internally by memory_rw_debug without TCG. * @memory_rw_debug: Callback for GDB memory access. @@ -151,6 +153,7 @@ struct CPUClass { ObjectClass *(*class_by_name)(const char *cpu_model); void (*parse_features)(const char *typename, char *str, Error **errp); =20 + bool (*datapath_is_big_endian)(CPUState *cpu); bool (*has_work)(CPUState *cpu); int (*mmu_index)(CPUState *cpu, bool ifetch); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, @@ -750,7 +753,7 @@ int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attr= s); */ bool cpu_virtio_is_big_endian(CPUState *cpu); =20 -#endif /* CONFIG_USER_ONLY */ +#endif /* !CONFIG_USER_ONLY */ =20 /** * cpu_list_add: --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344355; cv=none; d=zohomail.com; s=zohoarc; b=fTVa8TuZJenfVLKc4YLbNaf8psAaoA9YwfXw0RPXcLE9Q/s1aT5rotD0u4WKBoTiXwb12e8KbNsAsQPaWyuNr7PJ+PYeAU2RcA3vor8kHK14yza8YokEzmePSk8gY5RNspfJdV7EKool+ZZbcG8YE95e6FHjeHEJqo/N02IfC5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344355; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NhKSMfIut/lDTwvjTF8AW4idKBvUZ60ritdW+EWnr7g=; b=T3NDo71550/oL2YXeqQPl8/V5M104MFbP4m9O41gPzxZ3l6uYs5BEmrsCqvVv1PsB1xiZXC40LaCktXFFr+9+FfLXEjCF+fgcb9aDtJiMdc4L/hnK+UeOndk+efcQp3vFLb2Hegqknq97LKwlRvanYlVDqpG15dvBgVAg6C5KUU= 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 1733344355920222.6634758066739; Wed, 4 Dec 2024 12:32:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvx7-0007W2-8F; Wed, 04 Dec 2024 15:26:29 -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 1tIvx5-0007UQ-0h for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:27 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvx2-00071h-FG for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:26 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385deda28b3so174399f8f.0 for ; Wed, 04 Dec 2024 12:26:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385d7611af2sm17657530f8f.22.2024.12.04.12.26.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733343982; x=1733948782; darn=nongnu.org; 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=NhKSMfIut/lDTwvjTF8AW4idKBvUZ60ritdW+EWnr7g=; b=gvOyf5t2epwIy3CQvNhQBPbIs2QT0OCLdG5TB6sIRX7CqUAisqIkGeUIHouTdo2IeW fbqmQ2uZLqUYObH9kMMTFYCYiLeN9PpYcVVmKYhN6BsYqdGffFg9F+/hEHr9MMI7ifc0 Kbnc7zP3ETRX7/ichdZKr9u+F4YB4CK4HzobDUVWXefcrQUzO6c0KUbx237oVj7xG9eY 98ZUD3QgJptFreeCWoW1BS9cuNF4yIFchPsRoOEVLdEqP75pOSsF+CTkS24O5y+LmDcK VBa2J9UILy5gfJ5Ln2X34F9rT8VBzZgZWhrlT4Qj51063gJO1tK+iRc4326enjpKgfav F2MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733343982; x=1733948782; 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=NhKSMfIut/lDTwvjTF8AW4idKBvUZ60ritdW+EWnr7g=; b=syIaGrGbngsTtp8I2MfOcyC16QLgM447EOlEJUb0ZD4aoxvJP1xu/7VZhDnlb22M5G ieQVrvzEMxfpyp+Ulaor2u8linieXBJ36463vfJxiCvHl/BmMqfULH6Ymt6Gdhoa5k41 MI85j/oKY7x4DFtXerXmE5V/XBzcsRA5YdQvqjiCOnd7TqmOfigeeGI9DPcjHT9bMMv7 6PAH0Gj/sBsXHlrCFSJQcYSTZe0tk6VN0GrRaBJulVV6KneDSPrvDxbpoSHyuV0FtMhu j1Nd5XOE7tEGRmG1UBFlaCDOoigAeSw5DGFknXtWEOHkcb6KhNhEO8cp0LXASTJZf37k 8sMQ== X-Gm-Message-State: AOJu0YzSF+2ZbqBb0rsgjnB0grLVum0TneQCeyZS5vl66nFgRgeFhTzx RjO+tm14L093QqsWdTqyqYKhxqFJlUhFuEPnqEiTu3vzrQEvY/F9UFyDm5Tbxzga/qDbLJtWkq5 k X-Gm-Gg: ASbGncuJCaycRL0OMaPFYUlubuR/KH9GXDKNLx2l6izYGt7lyQyMy9ovfQWfhsnusOP MBSnaxMmR4Lsmlax0v4DS29G4kRIalAH39EEmZmCtswwUFbXG9pawKRLitGf3AL+X/H0hKKpXCH GYTLW350TUmwiET1O5E4m+csqUAX1Q7Q0dOcdo8p+h81anW0KJA6wUx4s4OGb7TdxiNrH5IdH4d p7Q58xIPZy9EAez0RIUX7k50+lw73YL21HWeLMsD+jK9ZMen1gZWh3VA2o/9ezLcUP08etjVYhW 4IlpPB8vZbpKLwbFBQOmXUJb X-Google-Smtp-Source: AGHT+IFJ+SOgmlgPnyukKmZpFbfdSn4zZ5sGZ1LRydSUp9JlgocOPOE3nd3fyAnpHvKcXu5besp78g== X-Received: by 2002:a05:6000:4411:b0:385:ded5:86f0 with SMTP id ffacd0b85a97d-385fd3e797bmr3942400f8f.19.1733343982632; Wed, 04 Dec 2024 12:26:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 03/20] target/arm: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:45 +0100 Message-ID: <20241204202602.58083-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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: 1733344357847116600 arm_cpu_virtio_is_big_endian() already returns whether the data path is in big endian. Re-use that. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 6938161b954..3061b2ac18c 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1132,7 +1132,7 @@ static void arm_cpu_kvm_set_irq(void *opaque, int irq= , int level) #endif } =20 -static bool arm_cpu_virtio_is_big_endian(CPUState *cs) +static bool arm_cpu_datapath_is_big_endian(CPUState *cs) { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; @@ -2664,7 +2664,7 @@ static const struct SysemuCPUOps arm_sysemu_ops =3D { .asidx_from_attrs =3D arm_asidx_from_attrs, .write_elf32_note =3D arm_cpu_write_elf32_note, .write_elf64_note =3D arm_cpu_write_elf64_note, - .virtio_is_big_endian =3D arm_cpu_virtio_is_big_endian, + .virtio_is_big_endian =3D arm_cpu_datapath_is_big_endian, .legacy_vmsd =3D &vmstate_arm_cpu, }; #endif @@ -2709,6 +2709,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void = *data) &acc->parent_phases); =20 cc->class_by_name =3D arm_cpu_class_by_name; + cc->datapath_is_big_endian =3D arm_cpu_datapath_is_big_endian; cc->has_work =3D arm_cpu_has_work; cc->mmu_index =3D arm_cpu_mmu_index; cc->dump_state =3D arm_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344296; cv=none; d=zohomail.com; s=zohoarc; b=QkfTsUveN6DcP71Sjjg1jfURjv5ASdbqjXD9VXz13njuYpsFEmd9TaQrqzrpneKGg32HSk+9ux53tXtc1UN4hP2xdnxDTIAJ7dA+LyN99jS+DLIEBpK752rUQ3vjuA7NjpYxQIQ9W9nI7c6bZKUsnN7PmH3XxcQRnAKXQPflHd4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344296; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r6SfGh7GwB5WuWE7gr65NVDyXlneJEDYoQOKqsCWiWk=; b=mbp2BYIa867Yl3fpqpTGeAPld817Q/IwB2xHz3YYyR+36lFYAYf5VsVTiSqYWzgIyKu9NBezXukFfk38mXoJ6EPEKUuivx7CoOl1KnNc2SdLVvQW6Z7Gd3mKQuRloIi3bSEB99He+klsgydXFDVdRJgDQXmo1DaB0uxa17L/+s0= 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 1733344296603836.4878429788118; Wed, 4 Dec 2024 12:31:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvxD-0007Z7-C6; Wed, 04 Dec 2024 15:26: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 1tIvxA-0007Wv-R2 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:32 -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 1tIvx7-00072d-Ro for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:32 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-434a752140eso1302345e9.3 for ; Wed, 04 Dec 2024 12:26:29 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385dfb2d7e0sm16066857f8f.44.2024.12.04.12.26.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733343988; x=1733948788; darn=nongnu.org; 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=r6SfGh7GwB5WuWE7gr65NVDyXlneJEDYoQOKqsCWiWk=; b=sT0hZJDC+GwnGQlQVDh4fYQpoLq6MW1ldnlYoK3cSUxFKXPsAP/IYMRrnC3FqUQNkh NpVUxnTZox4Z9SEnKyJLsjNjivPPUOyNEd8MyEkRxV6n313r5PKGWtLR/gvbGKw2jMNc rf1mxdU3zEJlBqd0iROokOEhzLpTzE7/dXWus5vrqRfrXZsbk2VMjOUBuczuHL3w2mCB mbrz7G2Ur8xbot9vcZ6rcawkxpo42Hi4fmm7VU/yfPBUKJ1RoKS3AMM5rJhD7zx8NMYv Zd92TCeELqglX2OasuGl+anxG5rRDyU3t/ObbABb6D6rcfNmwtSU8VRCdnVp4tKFeWcB qDYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733343988; x=1733948788; 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=r6SfGh7GwB5WuWE7gr65NVDyXlneJEDYoQOKqsCWiWk=; b=ZDAaY/XpVPpV1BAGlRx/6IXfnELSqW2tUjUFvH2ES+KUgiX3IQQZHGvnFKuDQq35v1 Izz+IZBROBGxuk5E9uXrIUZQCObwrxz7KyUjmp8XEHN4+eYKGcuBAY5V+J+fDz98ANzV yeX5MlW99V89/K8WEImYcKAF88Rv7cKgSmdTnTNRKYQMTlKL1VuCTBvQohfzBqXQG/e5 0GaGeqEV35ZPuUF1MQfdRUjqWFBZIVwS2gd0PoIQ8cbIkSx7P8MLo6K9RxwKd1KTJiaI p3GswXgioo5lyUozgN4OppDNmipz9kbIX1x1HyPiy0fftTypYWD+LDtdxj0iK4+iOLcP K7wg== X-Gm-Message-State: AOJu0Yz8usSy51OGalV2ofDFOrIQKn71uHy+epR5jKcWXB/Gh7A+1hUO d51wjBDAEzsWncvS34RbChVA5adMCfAmd267Dq6r7DwV/svq4NKs9QH6+waGvWJ0oYZib2u2UC6 o X-Gm-Gg: ASbGncvbZKSRLVH4PhA+TaLq5Pp1h5elI2Q1xEKCtVReksKOgluVeixaTnYkzM3poek w8RKnJrEXbONoTNLYdBy6IcoXZTTrBSqp17MuViDrpnvkSwBxGlw939lxyirgJ72SxJJPCK11xI ZLvNHrbv1gFFw0QpqOnZ+5TfopJOVmv89KNLZWN4zSb5LbWx8aHgNqSOr2isdawJLOsJvGpKJus V51oSqCoWy/gc825fbGxJLs2Ce0VpFuiZvEQtUK7q4nJGSmyTIyd/LQnAKSRGlc03DbCrdTS/3S bxYMEu+STe/FAMyG9WQCHFnC X-Google-Smtp-Source: AGHT+IEOHgCnajvpNJwxbTXBPSEWnBrXE5gN7EA5gyH/dJhw50wp4GdKdH99KUQbUu1SHNqfDE4veQ== X-Received: by 2002:a05:600c:1c07:b0:434:942c:145f with SMTP id 5b1f17b1804b1-434d0a1cdb5mr64737145e9.29.1733343987773; Wed, 04 Dec 2024 12:26:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 04/20] target/ppc: Register CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:46 +0100 Message-ID: <20241204202602.58083-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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=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: 1733344297629116600 ppc_cpu_is_big_endian() already returns whether the data path is in big endian. Re-use that, exposing this helper for user emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/ppc/cpu_init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index efcb80d1c25..9650acb4850 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7285,15 +7285,15 @@ static void ppc_cpu_reset_hold(Object *obj, ResetTy= pe type) #endif } =20 -#ifndef CONFIG_USER_ONLY - -static bool ppc_cpu_is_big_endian(CPUState *cs) +static bool ppc_cpu_datapath_is_big_endian(CPUState *cs) { cpu_synchronize_state(cs); =20 return !FIELD_EX64(cpu_env(cs)->msr, MSR, LE); } =20 +#ifndef CONFIG_USER_ONLY + static bool ppc_get_irq_stats(InterruptStatsProvider *obj, uint64_t **irq_counts, unsigned int *nb_irqs) { @@ -7407,7 +7407,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops =3D { .get_phys_page_debug =3D ppc_cpu_get_phys_page_debug, .write_elf32_note =3D ppc32_cpu_write_elf32_note, .write_elf64_note =3D ppc64_cpu_write_elf64_note, - .virtio_is_big_endian =3D ppc_cpu_is_big_endian, + .virtio_is_big_endian =3D ppc_cpu_datapath_is_big_endian, .legacy_vmsd =3D &vmstate_ppc_cpu, }; #endif @@ -7455,6 +7455,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void = *data) &pcc->parent_phases); =20 cc->class_by_name =3D ppc_cpu_class_by_name; + cc->datapath_is_big_endian =3D ppc_cpu_datapath_is_big_endian; cc->has_work =3D ppc_cpu_has_work; cc->mmu_index =3D ppc_cpu_mmu_index; cc->dump_state =3D ppc_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344066; cv=none; d=zohomail.com; s=zohoarc; b=VckVqHtZxliLMrzzOvtUGbhxx53wsOLjKetSUxyMNsAE6MUiUcp8YRWZf4MRP1AVC3JyY8a2jp+fjF6hnKfU51yGAHpDCnANPXwH6zFiFLNni1OLJPyeyuWj24PKMbFyjOB3pp9BeTuYZW43zkCa7JqqbiM4zHZ7zAykUNXHjqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344066; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WMiVeD+NvW1fa7vIzwk9nB4EqLDwXQxpVEw4CRgejIU=; b=CrMnE+gP+ihhvM0sX9pN+eWZGrZh3WFSKbRk1SzQdxOo4w1d7ZpeUaJkbamKyCYnWsB20l9f3MPXydoeo9HKkCVc47LNgSU0aT4loRN9muZ2AyYaTKGiUF5A5L8/KbXTFnLoML+rQDn7LEoVPZtwi37qL6awHRC4q3zbkjn/nb4= 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 1733344066928347.1811825317302; Wed, 4 Dec 2024 12:27:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvxH-0007b0-BH; Wed, 04 Dec 2024 15:26:39 -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 1tIvxF-0007Ze-5y for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:37 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvxC-00073u-KK for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:36 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-385eaecc213so114942f8f.1 for ; Wed, 04 Dec 2024 12:26:34 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385f10a12dbsm10075187f8f.105.2024.12.04.12.26.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733343993; x=1733948793; darn=nongnu.org; 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=WMiVeD+NvW1fa7vIzwk9nB4EqLDwXQxpVEw4CRgejIU=; b=YBpmGZDfstLpjl/RN4Vx/k5ltxLmhf7FgupLyh4t7ipmqbUttxjZapBrKzGg+MMJpB bmsFzmT0j7kgmhyu951vi14v+vIVhAY5+c0PsBZ8agooqEbJYuaNRm15J8bQXFB40Dv7 owX3vlwpkcc2arFmlSZNE8b20Ev6aNpH7KeiGC5EPqUsalc49/OKstb/lNoYDEYINAOn 9nUIGphkw429GfOUwq+mJKLiqfHeiHLh0TGvKNQ2SOjip9zdSps5HWCO18ddVsI+h9yp I7YXU3aEenTVbCt81QTHqmslaY8b27oA/Mdufpz+OBRsgWpnQrRNqL/FCmMIhSMYeIpy UCCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733343993; x=1733948793; 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=WMiVeD+NvW1fa7vIzwk9nB4EqLDwXQxpVEw4CRgejIU=; b=iD3/lvzl4HKiHPq0jqakx+ZJTBMacv/fC3bb6DwfvvGkZYzM9Clu+sfkdK0eibhqMK 8mt8to3MtqvufMc7MlO6ZTj1v92y39FiqPWHWlzOZn5nF4UjGVFzgafOYKpycvpIUkY8 6+YyYxsoByBGJ/NPRTh5EGkPnVSqETkh4JSr6I0A4CgECG565DNVrdVEPkKDy9L0VtVf f5LKVrbzjhITQJzf2LUjfYscgUhvHoO8gQKieQGmJIsTqCmq3U8R/Ppw0XVlP42wqsz7 kCBNT/kaYQDLrCHsjY9RH4COpg40SY9DYQj6LzHzRHuJPC+D98JAYnNgWBrW7smHCNa0 sLgg== X-Gm-Message-State: AOJu0Yy9bkRhXMI9l5aGPhcDvRjbtkBcu3fhdD9p/eeoy9eMmtX3RmP4 w8YSAyBLO9zVIvK8dySBMDghtlLuZiyW1OhuiETpEBFs9N/hDOr5cXwQCK81khSCMtiKFJOF/RO J X-Gm-Gg: ASbGncuWG4e0/EvZRqqqjdioN6Gzcjng3YNi5BkhmKlaIVMrLtArs39OWz4OHc2J7Lk eaQ9fBgx0u2R+nOXjVjGg8v6AvfRXHH95Vpb9VfuPa4PyFHMwT1xVL8x2ig0IvWUB+TnB6hyabf NR764LzwOXEvvyekv2VW2sIXt5yavvNz3qxdt3K3CCfVXxeFbsvoA8z8bA3CEWoxRKVbo5KR5P8 HBKk0fuUkCFORmvCKu/ThK2f7TyQg2sk8H0AbOwTP7RRbgVZPf11oLPSuyhzGdNCOEVeaxKUvHe e7Rp6YhqVxXTUESFnx9Z+TKw X-Google-Smtp-Source: AGHT+IGWhwjv2J2oO67dFvzI2OUj4axL/zRmbmzFJFjahHejUxN3c+TpGi6RU4aHAiB2lykmP3GeYA== X-Received: by 2002:a05:6000:2cc:b0:385:e8e7:d09a with SMTP id ffacd0b85a97d-3861bb5a42bmr666212f8f.2.1733343992917; Wed, 04 Dec 2024 12:26:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 05/20] target/rx: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:47 +0100 Message-ID: <20241204202602.58083-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: 1733344068347116600 While on RX the endianness can be set at RESET, we do not implement that; only little endianness is used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/rx/cpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 65a74ce720f..391f3214168 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -27,6 +27,15 @@ #include "fpu/softfloat.h" #include "tcg/debug-assert.h" =20 +static bool rx_cpu_datapath_is_big_endian(CPUState *cs) +{ + /* + * Endianness is sampled via a pin at reset, + * but we don't implement that yet. + */ + return false; +} + static void rx_cpu_set_pc(CPUState *cs, vaddr value) { RXCPU *cpu =3D RX_CPU(cs); @@ -217,6 +226,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void = *data) &rcc->parent_phases); =20 cc->class_by_name =3D rx_cpu_class_by_name; + cc->datapath_is_big_endian =3D rx_cpu_datapath_is_big_endian; cc->has_work =3D rx_cpu_has_work; cc->mmu_index =3D riscv_cpu_mmu_index; cc->dump_state =3D rx_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344263; cv=none; d=zohomail.com; s=zohoarc; b=mhHhFkK8dY8d4lz0H2zjMrp8Lt5TClGKZ0ZBa3yyrltcLJ65TLCJnpuP7LyYuuvNKbpE8EFjuuBNvMM4mbBm//R2zupPqQRDI7MLZmBSDw5zmyroB92Xy+KXjAlOn5E0tu8gCyPb6FYjZpuPYaTN+hGUF+tKK8FRbM9l8rMyFNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344263; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HcqXxb9hdcFJ7l5TfHoNchwB1oNn7eM/DNMTs0fqYbc=; b=HVSGFWr3UgiJeFBLW38NpTeoEaJp7uhD1PbUD8ivUBZfd8cEa4fOoKt/tbXxYDQ7gPYs8EGWuEisfAtKTiqh1q/r9jgchnqCfvP92f+C6Q4jP2lHplPGh0qX8U/FRB6ZTWreFOQEbHFtMBZDEtjK3THefhVfAmzzTdLMW6A5IzQ= 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 1733344263406457.55964407148895; Wed, 4 Dec 2024 12:31:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvxN-0007gh-AZ; Wed, 04 Dec 2024 15:26:45 -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 1tIvxK-0007eR-4f for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:42 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvxH-00075C-PD for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:26:41 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385e87b25f0so836312f8f.0 for ; Wed, 04 Dec 2024 12:26:39 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385df74157asm16690526f8f.0.2024.12.04.12.26.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:26:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733343998; x=1733948798; darn=nongnu.org; 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=HcqXxb9hdcFJ7l5TfHoNchwB1oNn7eM/DNMTs0fqYbc=; b=huji3LWFMRoMtbSsB44ClNzKogtWW4RICRcnr75VI1gp3u/bmBfB1S/OOZp8J2V7qc 6Qd+zcA8GJGWSXhynrSp+WF1GSYxx5doiGV0K6HLEoLJnHutfDjVPg05dgrZ77v0kko8 6FvcmIe6i2nw8f1OhJDrIxnJmMmDq+/QKUKti17I3M+SWa47v7xh5VmToiljB6e0zdDF AtyVh/6OEICIYPqIPjTXFlHXeAiLdHGcU5Evvaqaw/k7zVpmYk85gzQOR213EykQOmtn 2rH0OlwxEflnm1YJSIB0Am3u9BgJtQzZWA1EoTrteKZM91XV9DubHzOnyuaROP78GEwe gKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733343998; x=1733948798; 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=HcqXxb9hdcFJ7l5TfHoNchwB1oNn7eM/DNMTs0fqYbc=; b=upRoH6UVX9VeTVBtXeQ/cylbHAmhHBAzPJGxaDHWfWZKW777mKgCfRCay1yBNrCAMf v5/8pFPGY2JD3F3ORA0EeLT3BGWdGQvpFdVAFeIOtpVufFDjecL3iU4wlWivCADrAJVZ 43DzBhsAytt6Yllc1Xwn9vB9nFZ4e5RurSkhl+Qq86dLxVb38grMkHXGg6E+c8F+FFM4 5EGHzS6/0ZRZPmeT6N+7tim95RuEYcK5EgkHGvqntQIbvtqqIMIjTTIIE7Yw7Cjk4Lwb 5BbYHM9c46iTGvKuhwsyvjr7hXPeQ5hUJC0BnPXEXcxb7G8xCjXNYMfRwumc6JUokYae K3dg== X-Gm-Message-State: AOJu0YwFi60EVM9FQagMT+RYGJdyhOZCqNKG5zt+WJtC9PXWnnNBekHV YgjSUPihE7bXmp20J4m9v5NrdL1j09Om2lQhErRClROR6hd6Y7rbmlLdjgmMhn5Ir4LWPaLlZTO 0 X-Gm-Gg: ASbGncvmgCqgJRaFDjPzZ9WXWwE8ZvTFLOS3mRPvp0/n3F5o6smCL66evvKQ+2bBPmn rc4NsYYFUxBCRUajx1UT6x1+JkTqOq7lDNyGLDtIUu3xGR8INPHu7lquPYYqpOT7ydl9mg7gqOf p4ualaTLc/5oDKdbSRW9ZOfj3HlRRx7qgDofvbHPs4gsVJt++MK9dDyrydWTHoDzHQHNw10sapm q7X4efHq283j3hWEOgF2uNhqeYg1gvgWYp4nzNvGKCyDDZHB9zcr8AsJF/ImGXyzMaMyNMXdfrH Ny9HNxzOTPgfNHd/WBEW/sKz X-Google-Smtp-Source: AGHT+IGzom8YBc2l6q0doPnVLmL9m17aIXaAPwIBHw1YDr4BhvjFN0i1tTry+zE/z0HeVpG+vkxmQA== X-Received: by 2002:a05:6000:2cc:b0:385:f138:97ac with SMTP id ffacd0b85a97d-3861bb5a565mr532650f8f.1.1733343998156; Wed, 04 Dec 2024 12:26:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 06/20] target/sparc: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:48 +0100 Message-ID: <20241204202602.58083-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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: 1733344265291116600 While the SPARC data endianness can be changed at runtime, we do not implement that; only big endianness is used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sparc/cpu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index dd7af86de73..de0386dbf64 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -688,6 +688,20 @@ static void sparc_cpu_dump_state(CPUState *cs, FILE *f= , int flags) qemu_fprintf(f, "\n"); } =20 +static bool sparc_cpu_datapath_is_big_endian(CPUState *cs) +{ +#if defined(TARGET_SPARC64) + /* + * SPARCv9 has a couple of PSTATE bits that set the endianness: + * Current Little Endian (PS_CLE) and Trap Little Endian (PS_TLE). + * We don't implement that yet. + */ + return true; +#else + return true; +#endif +} + static void sparc_cpu_set_pc(CPUState *cs, vaddr value) { SPARCCPU *cpu =3D SPARC_CPU(cs); @@ -958,6 +972,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void = *data) =20 cc->class_by_name =3D sparc_cpu_class_by_name; cc->parse_features =3D sparc_cpu_parse_features; + cc->datapath_is_big_endian =3D sparc_cpu_datapath_is_big_endian; cc->has_work =3D sparc_cpu_has_work; cc->mmu_index =3D sparc_cpu_mmu_index; cc->dump_state =3D sparc_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344250; cv=none; d=zohomail.com; s=zohoarc; b=KZagGgpNXLywghpj6yBS8c6LNLDs/Iq0YBcrrPZviYYVkCUvhid5V2ixHOc9TragVIjgBnzMYaQwdkCs/sq8sFoTpf1QhXeemFuUcdvO6Ep4d7PjGjlyryJz0hzdu5coZXVVFBavFurdaLfvc9nQ9T/byu24L1LSF8KGTeZbqPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344250; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CYgcsQiZUJ1Cl6dAvq/NYt2lHMXmmLs9dt69qfBSoSM=; b=col4tPaOpO53/+i6/R2iG90IdfSOhn4uo33VxQw087OX1RuJQnCC8zPwoBXLTqQ6uUvbD4qITD/UMjF7sE0qDMK+MiUleTKI77vhkkPGvzQIfHZszzTMB6ZnhVliQx/GjjjY1YY1E5K2BgMwbQm5C+KsghKgs4Q1+frDF5jVX1s= 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 1733344250150232.4548778399742; Wed, 4 Dec 2024 12:30:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvy4-0000CN-Jc; Wed, 04 Dec 2024 15:27:28 -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 1tIvy0-00007O-NV for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:25 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvxx-0008Pc-Uz for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:24 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-385de9f789cso130881f8f.2 for ; Wed, 04 Dec 2024 12:27:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385e49cd788sm13643172f8f.6.2024.12.04.12.27.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344040; x=1733948840; darn=nongnu.org; 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=CYgcsQiZUJ1Cl6dAvq/NYt2lHMXmmLs9dt69qfBSoSM=; b=h+JoFZKzpu9gSZc5hDJUoT9H4l1OxzrE+/9CuboSMA6jmPRKbDuLiVBuBd5qJ8YX9B Zl/72c+emeNclhwRQ0KlZAedOde2uRgAVGpMfPUXr9mj+fvsZf/N5og0xKvSw7f2CLjo iPWLKfaMWYiavpnhRRe8b/rTCvfs5iIUnyLn0OOJJv5Pf6kGQ5A6/oAIl1EHu3nNTl3n HeNtp/GV5c3SDfjrWE7eUQcTdvsSJRokhlBvcendyuLp9JtEfpaWnZUE4s9iy95GpjZu z6YJSpPoh9Xqj7Yrit2cFbkpvtbrRh9G/wPLdGPs66vQbSBa1jOF8VU9dZG5zd+0cd+v yLCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344040; x=1733948840; 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=CYgcsQiZUJ1Cl6dAvq/NYt2lHMXmmLs9dt69qfBSoSM=; b=GQ9XYfLl2NQu/zfEbGJgnOsGYPfQ209AJyxJd9uidiRk2wDWK4N3iWqn6AFFGeS2ZO BULl2zoGTTdNeIB/FDiMU+RkK5FfDSA1apV0XwFZ5K0seUdNmFCs3a7jCOaGPd5MVH4f tHaVczs5qJns/EyvkkDaNni831Byb7fyWCe2w+P+uQAqvr+yBVhs2voi3EIzax3TiCHq dsQfJfWj1tgNCS77ODA6DwQNc6Xz7SeFZqNAcAiFkInCsv/HotWSwsPFCr69J0cl0zTF 4JI3WTrNWl0NEigcX8BWpJQr6nNU+yhr3fSl7PfzrewKMf3B+RNO7l9musadLFf2nIln zC8A== X-Gm-Message-State: AOJu0YyYEQlTHXPqnPlUCyDb8SqNewMKQaGbPT8cbSOdGKmlArHv8eeV L4/fn+l8GiYTckHTgAyAuGoLrkGN0aVWn8UIjd+DjnF0jg7px2QCuCZEI6Ori2iXNcrq2NyWgcM e X-Gm-Gg: ASbGncvBsf4LDXj0XB1NxoYaNUEOB9KbR/zWRThSS1TH6sdBlLDlYhy294n3FCv+QTN JZcXASNbllYHhwv1Cl3FkFs01H/WnkRF7MxLXLoOaLYVSiO0QC9nM3iOn/Y4B6LFYwrIvcurR14 WucovC4Qp9PpRQOuBpKqk2kXd0JrzLXUyXRniUuwqvs+ZPh09fMQWAW12JmCnolGUlDLWL1vJe/ rk14RTYWqRXFVZwut5a26EuX//CaNhY9NTExklxd8jj3ViiaiQrFHAW4PW6wcXWjcCJuzzV9e8B 2/YjOf1EO0hICg+AD2vr+IV+ X-Google-Smtp-Source: AGHT+IES6IWDwM10SRQCYybARo6OEDntD5HB1a1zGV9qWqBypkoO2dssjpIRw+NSHmnqVoKSSH4lYw== X-Received: by 2002:a05:6000:1a86:b0:385:f527:be6d with SMTP id ffacd0b85a97d-385fd423e63mr7466801f8f.36.1733344040287; Wed, 04 Dec 2024 12:27:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 07/20] target/riscv: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:49 +0100 Message-ID: <20241204202602.58083-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: 1733344251232116600 While the RISC-V data endianness can be changed at runtime, we do not implement that. The current translation code assumes little-endian memory accesses (See commit a2f827ff4f4 "target/riscv: accessors to registers upper part and 128-bit load/store"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/cpu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f219f0c3b52..b31b9b3471d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -60,6 +60,22 @@ bool riscv_cpu_is_32bit(RISCVCPU *cpu) return riscv_cpu_mxl(&cpu->env) =3D=3D MXL_RV32; } =20 +static bool riscv_cpu_datapath_is_big_endian(CPUState *cs) +{ +#ifndef CONFIG_USER_ONLY + /* + * A couple of bits in MSTATUS set the endianness: + * - MSTATUS_UBE (User-mode), + * - MSTATUS_SBE (Supervisor-mode), + * - MSTATUS_MBE (Machine-mode) + * but we don't implement that yet. + */ + return false; +#else + return false; +#endif +} + /* Hash that stores general user set numeric options */ static GHashTable *general_user_opts; =20 @@ -2764,6 +2780,7 @@ static void riscv_cpu_common_class_init(ObjectClass *= c, void *data) &mcc->parent_phases); =20 cc->class_by_name =3D riscv_cpu_class_by_name; + cc->datapath_is_big_endian =3D riscv_cpu_datapath_is_big_endian; cc->has_work =3D riscv_cpu_has_work; cc->mmu_index =3D riscv_cpu_mmu_index; cc->dump_state =3D riscv_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344070; cv=none; d=zohomail.com; s=zohoarc; b=V0engyiSAxTU9l73ocT71/PbURsjL/LnwsAHFuwWqT57xeJ9meEU+FR0uzIQ3pRCyyPVcjaikADiubc93Y6UWNAtkNui2OhMTDQS5JYwMg7EtyaKxFZphJR0XnVSZrAOqX6aiBF6OiUUBLuOgE+vZPkJrkRiJmwVj/blRnwv3TE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344070; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IbFwYvNsoagTIF3RGxGTKY4/+lkaBIKwukflDbrm8ec=; b=WODj+4ESy2d/qkBbYLIDK7/kO02cAlqGwaD6HlE8g0WUkJ2Tpv35XrDoqEZeLIBI/SKqucoFCzzbzUQsPaNrxp2eggMd5fW0DnAy6kDySqdtPqVn/xpI0CpIb+F7KQLYd8ty+2r1qgEZK+lXc2GT1UnhDwnOu4pIJYWgTOpKdtw= 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 1733344070520578.1492963261688; Wed, 4 Dec 2024 12:27:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvy9-0000Os-Nc; Wed, 04 Dec 2024 15:27:33 -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 1tIvy6-0000HO-AW for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:30 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvy3-0008Rs-Q9 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:30 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43494a20379so1934995e9.0 for ; Wed, 04 Dec 2024 12:27:27 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d5272b78sm34941055e9.9.2024.12.04.12.27.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344046; x=1733948846; darn=nongnu.org; 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=IbFwYvNsoagTIF3RGxGTKY4/+lkaBIKwukflDbrm8ec=; b=oHBrfr6SsSMQbt/j6NX5wd20ZGGqyEI5YuWHRMKKgBYkc0pio5Ce00gY3VLUJ89gQg U/JzuvVTUwha3wWQYqXdi5UGPO6B3x/zd8IactEvSvybmy+gx9HtW37JODkuvmfFB/DD x5emvj/G3Z/QBlpQ2/AwWWC9svvg5P7Sh4bwQXrguY3AHGPSEFGJ2iskLwb6+3tQfqqK 4PHBDLYlWUZwlYSG/Dg7SiA3GlpL3VSYW+UZew1nlBfCsKo3tBLwov1jpl5Ero4ycld9 CFdhacWsEtPLMOFx7TaiG4DJM3KaVfOv5OnOtvOoyQlanmG/u99jDmUvg+q4fKPK9meQ h1+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344046; x=1733948846; 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=IbFwYvNsoagTIF3RGxGTKY4/+lkaBIKwukflDbrm8ec=; b=eLqnO3v4113ewNYwfGqKRb8Rx8K7CnYPm1TBCB//WAdsIF4Q01wpU+OyJCKcGIEEBZ T+Ve5LNEmnMwpF/jkOgu0d4o1qCe3WIPV+RXkW7J5eVMbRXjGbhPAUDga94AsIqEqJnV zNwuKNRsLpB8S2+u1iC7VEwyEsbCO3D4jevPDeRUjR/ueypcpmi3062lUwzCPrtar1td hgr3JcmAwzvcBsFBSVKPX+I5mEj2QFX0/OhJHGSGQCWSPYa5SK7679uh0MG7nB5dSD/R BVsSo42tgRGZpNoFYpBweWthikZiPo3S2Y7wicBY94B01n6d5YxiupFYLihQM4prgv35 24MQ== X-Gm-Message-State: AOJu0Yzgq90g+CvJhLtwYx2LTJ0wng8FgHwzSzBORy9Uh9D116BOinib oW4Kd3D9WCsqAz2smduTwyvRz8Up0kmFhPGkK9H/Fv+ITXqpJzvHQ/2PGNvvxcwqGMrbMYuIp8B t X-Gm-Gg: ASbGncuVojNYhdfDqYe0m8C91MBJqPK6g2W+yYBf3BnfIC01dhwwAWo2HYas3k8xuVs LzSDVfMVVLWsEtBqoSylgVXJhbR68p9lqqgUICroT1ykcTu7aE2gAAS67ZKSw0r0whfIURwJwEw ywGohKDMylH6NLXUk0P5d1pjNLQdE/SNOARKX4POLHoXSVyy/s7LhqHKxwck7aP95dSbb+j8wZe RM+9ed2AJP7qc6DvRc9GeX8MOxM9VnfYHbz82ibN9JHHjepMSxBaDIfa94Zpn6PZIZW1lwVEehk SR0Qgdjecht3F/3haYPETxIh X-Google-Smtp-Source: AGHT+IF0QYYY+bdmr+0sAzjLTUkGP9djfjiRtX1kSayuNI9VT4nEYz0b2lj96Y+Cs1hDyCe5O63MzQ== X-Received: by 2002:a05:600c:3594:b0:434:a7e3:db56 with SMTP id 5b1f17b1804b1-434d09abf4emr70062685e9.6.1733344046119; Wed, 04 Dec 2024 12:27:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 08/20] target/sh4: Expose CPUSH4State::little_endian property Date: Wed, 4 Dec 2024 21:25:50 +0100 Message-ID: <20241204202602.58083-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: 1733344072473116600 SH4 CPUs endianness is set with an external pin in a power-on reset. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/cpu.h | 6 ++++++ target/sh4/cpu.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index d928bcf0067..2502ddba102 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -198,6 +198,12 @@ typedef struct CPUArchState { /* Fields from here on are preserved over CPU reset. */ int id; /* CPU model */ =20 + /* + * The endian is set with an external pin in a power-on reset. + * The endian cannot be changed dynamically. + */ + bool little_endian; + /* The features that we should emulate. See sh_features above. */ uint32_t features; =20 diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 8f07261dcfd..f54005644c9 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -23,6 +23,7 @@ #include "qapi/error.h" #include "qemu/qemu-print.h" #include "cpu.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "exec/exec-all.h" #include "fpu/softfloat-helpers.h" @@ -231,6 +232,12 @@ static void superh_cpu_initfn(Object *obj) env->movcal_backup_tail =3D &(env->movcal_backup); } =20 +static Property superh_cpu_properties[] =3D { + DEFINE_PROP_BOOL("little-endian", SuperHCPU, + env.little_endian, !TARGET_BIG_ENDIAN), + DEFINE_PROP_END_OF_LIST(), +}; + #ifndef CONFIG_USER_ONLY static const VMStateDescription vmstate_sh_cpu =3D { .name =3D "cpu", @@ -270,6 +277,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void= *data) =20 device_class_set_parent_realize(dc, superh_cpu_realizefn, &scc->parent_realize); + device_class_set_props(dc, superh_cpu_properties); =20 resettable_class_set_parent_phases(rc, NULL, superh_cpu_reset_hold, NU= LL, &scc->parent_phases); --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344280; cv=none; d=zohomail.com; s=zohoarc; b=M3gyrBx9Ann5OT6cBAuS95BGtA2wRjhVwHjeDrSssZhYZH8CGcSDbUEZWlhTgq71LO8ixLZgvq69JsL/w9oY7EVEIsj4AR19YKFnF+NL2t1Fmz2GW4smJqg5rg04aILCD8NFFV9vuPatnAVO39eJpMRcBzEaJ5oOs8KMZhw3cVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344280; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0gEXG14yGHmTwK2PkgnJuKn3fmfO28N4tNUnsroDG+o=; b=nTGMO7ZGJ5gAzR6Z2XiHo/eMu6mwV2yj4DVB6E7aiU8qwQeow5nZCS7DUP8d8DQUs1xImb0kidihgGhvOTuXEv7a50mZMzTAf90PxZ3P6vfDlvMdsN7P/K1rVCF8QwJP2IABtPFBcPE8TxoHcu8MTkMd9s7+e5CyBLUO/cS2FFo= 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 1733344279952435.0809493137871; Wed, 4 Dec 2024 12:31:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyN-0000ew-LZ; Wed, 04 Dec 2024 15:27:47 -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 1tIvyB-0000RM-8V for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:37 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvy8-0000OB-V3 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:35 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-385dece873cso127814f8f.0 for ; Wed, 04 Dec 2024 12:27:32 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385d80a77a0sm17412914f8f.58.2024.12.04.12.27.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344051; x=1733948851; darn=nongnu.org; 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=0gEXG14yGHmTwK2PkgnJuKn3fmfO28N4tNUnsroDG+o=; b=Glp+Z1yU/0jga31NZn4x61NUaTQLfZabWAkdUbej0ntLhq01Qbg8L7rJYBeFC4S+s4 w1lZsmj15fGTG2Hhiput/kT/tkpeFmGEPUyxaEu0UJMNgmxpHj+sAAUJ58hARdlrAs6e sTTLvzt7tULHWHMwCHs3EtCbNAL4DNP8wRrb1M8Jmw8TKjpIMuiN3W7oFZ1le9vcA5mc xJYvkqdbWxjBHLdRQdLjJubx1zyxwT3YamIr3k+ZCZnUJrJRVHxzJqt2dsZFzBalyigJ e3liYxZX1yL2hhffiui1lOvLlvS8b4P9tLFikL3T8HU/4p/Oxm0d9aHdZnFisdmOIP5w 7NXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344051; x=1733948851; 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=0gEXG14yGHmTwK2PkgnJuKn3fmfO28N4tNUnsroDG+o=; b=LsWeJ1+KTxk5c8OLW5LdIGIO81sMIucQkol2aptbB/Ct5PM01CujemZYU6Jl0WjqHY IqeBbvlMQraNMXnv2c1lEB2RxjcR2A8s2KHr2DRmbvmgZ5udTckoNTx9J0mTnjvFVVdp oGv1WqqiabTn2Rma7KlygibZnCUtbI3+3nwG9sTLlimhTi/++fNI3IQTT4bH/ZXNzu2s 4DoueA4YNcQ6AnWtUIvHmVniQUZZc0xgjsF2i6XBVow1ZPG/WcxH9LricRpYksGWSz4k iJzz32tBBudbnzYDm5PDJ/IgWGECf0COB6rJXgmxy51XClu4AUEqzP21OMT/WWRifwCn 6pOQ== X-Gm-Message-State: AOJu0YxG7ARGxM8NB+tl8u0Pri4Dkl1FmunO5ldwzJ9yY7V/dtifNYcT rlgQ+mRZSI991NSpkVKlVV5fQ3SNakzOpaX3U4zag5xNmjwP60yLW0apP42DSo24tR68yxFm0+z r X-Gm-Gg: ASbGnctZO+XQI6yM9RuAfMSbj72s6Iv/Nqg3Ueu8Q3dCyoa9zZlCfSTw2/B/2YtK9T0 gQFEyImC4KeX3TmiBiNnUkZBqkKziQpJkO8102q8Xui9d/gduuAHMEDTEORCcfkd+nDZMXR+a+m KpHPpV5jMYoAVnm/6Hjld2YzS5pwRt+8Nqat+EKG4s+ZQcK5uBTprXnRretMHUzQP/1H301q/+3 mRRHOZyy0x8nvJP9e0kmyPu5MSWvUIKTzrhLx4UMGVWOLdZEobkmD3eomQrULnJXrkg63peCBk+ pAy8egvIW0yMwnv6P3FJmGDL X-Google-Smtp-Source: AGHT+IFXYVhD80X21fzRVCtI4Kv4SHZg7u65q+NnEYqhq4wJBmfcpp42XTcYcbdPKtSgLElOINMl1g== X-Received: by 2002:a05:6000:1885:b0:382:5010:c8de with SMTP id ffacd0b85a97d-38607c164f8mr4720969f8f.46.1733344051161; Wed, 04 Dec 2024 12:27:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 09/20] target/sh4: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:51 +0100 Message-ID: <20241204202602.58083-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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: 1733344281429116600 Implement SH4 datapath_is_big_endian() helper, returning the 'little_endian' property set at reset. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index f54005644c9..69108c1676e 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -29,6 +29,13 @@ #include "fpu/softfloat-helpers.h" #include "tcg/tcg.h" =20 +static bool superh_cpu_datapath_is_big_endian(CPUState *cs) +{ + SuperHCPU *cpu =3D SUPERH_CPU(cs); + + return !cpu->env.little_endian; +} + static void superh_cpu_set_pc(CPUState *cs, vaddr value) { SuperHCPU *cpu =3D SUPERH_CPU(cs); @@ -283,6 +290,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void= *data) &scc->parent_phases); =20 cc->class_by_name =3D superh_cpu_class_by_name; + cc->datapath_is_big_endian =3D superh_cpu_datapath_is_big_endian; cc->has_work =3D superh_cpu_has_work; cc->mmu_index =3D sh4_cpu_mmu_index; cc->dump_state =3D superh_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344351; cv=none; d=zohomail.com; s=zohoarc; b=K0Q+CEr6wm3sczOuEwo9q99HhbKAqyUaa04xRKxZEoNIyCpWrha7oQ6mWKeXz4SoOPRYm4AHzVHecOF1MFu0szvgdxPTC+HF2XC6Ru8HwxD5ru+OXiVoLOK9lI+mQp1WOc8+D5RZ/EgvEin6NsFBGt6awiPwUZnixknv0391EJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344351; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OthQd7angO3Yu/emzCL7LUH+S5aSARcEIzo6mzzFka8=; b=XgXcVZGXjqTkkZQ9p9aAKyf/XSuYKVjlAJKdNmrmZGVrxB7O6sDOs1AKcLvxqZq/BKzq/G9Npxl6iYrvR6xAc0E+Yu+Axy9nON6D7HXUdy6x4SgdYusrsr6udxHye6ckYlKvRVoAk1SlFTMOC0c7OB5pQ0qgFkmbcj9Ir906V+0= 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 1733344351091157.45708817031823; Wed, 4 Dec 2024 12:32:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyV-000143-8X; Wed, 04 Dec 2024 15:27:55 -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 1tIvyI-0000Uy-07 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:43 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyF-0000yX-DK for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434a044dce2so2129595e9.2 for ; Wed, 04 Dec 2024 12:27:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d527eeedsm35050045e9.19.2024.12.04.12.27.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344056; x=1733948856; darn=nongnu.org; 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=OthQd7angO3Yu/emzCL7LUH+S5aSARcEIzo6mzzFka8=; b=WELlmwSjK0NpqMScJxkhVgND5CiF3ZZMT06gjH3xL0GfW14TqaEcOd6rvpX/Y/gdPa RKPz/JqZEJ0Kk1+kafFhAp++PGO7e6Ev6cw8+UiNJAhUPUi1y5t65a9L2zi9uRuvNo/H qowrzPWJ/W7PgkipixJQ9vvfRKQSDGRUdOusLK/XeWUU07S0Rtw1MnFfFmX0YjcG91wb PmhqXw7pszkAnxetzR+yBzx5EzE/dIwZvMJfhZIA9gX7CD0iQaPyi9/flG1Nvjle4RVn 4Jt2HRAMI267sErj4dGb6STezc/HJwfFmeVb2mLGEPijioJGq2Sd5Ro2Nj6mKE35vbyl uHfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344056; x=1733948856; 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=OthQd7angO3Yu/emzCL7LUH+S5aSARcEIzo6mzzFka8=; b=e5XeoLKqhd4GTZGFCPmLHbjaJl6S6qX9bSZ4Yc38Wrj79EXiZDM0Kp3e48EcG2/q0u sKBqnl9sQPQmOarXy7O+lc1tAJvYjAnKKkFv66oxm8wmpWAOjFvSBE0I81HiKqCelE21 deklYdvX92y2i8dc71Fi4jEN3S9XqayTGDuLTG2RKNB4bJ2yFDKHJdJSE29QzPfEAl6t XK/hIeDfgxJIYuRW4RcNhsQmlcm5dUprCTGynGlfn9lOIMHNHVf5fE9nJxTEHJv77wXj W4VVG3kqfz3zWJTZ5amkmQzHL1S5Nio7K6KEO/fZhFjRq77xYl0Ofvr24SrzMyC9Ssvo pSLQ== X-Gm-Message-State: AOJu0YxTFIXpgirCUG+HHt6rKVS5drN5m8ZttsnJKaPRdYgfAnzJmZnI r44joyHRGVIjJCkNa68F4mxbA63BDAfGB6rp3sIO3OFWWlhQ7PBikBhQEP3ykb7oa3ySsDBcmpc F X-Gm-Gg: ASbGnctYCVjOxpPhS1RDzy3SK4UF0NDwHDnhS6p94mcB/A25uPpYVtIoqAFYNQgqrNu wEpIAIw4clR6SoxoxeU0RUftH4mn1sZ3hCLhOLTBXElqyvWsoMBb9OH/qwzTmivgN/Jh4zk3sv3 YMIQUVfhe1NIIkyil94tlFnXUE5Q9PGQlnhTSsA3dvZKKQ3kAs4Sc7qI4ixsveQSBqbMJ6G9BDN WFwT3M3liVMOFm3RLnPw2UplTztqX+pI5v1UkYpUrZ+8wRmGLv3aTlPzG9dezEfoWAh8OhEr9mI Y43Bh4UZ5OAsgRqi5oKyFaiD X-Google-Smtp-Source: AGHT+IGL1weHWkR4ZXBoHZExspgYdvLCkRNqGxIFbn/7+ohyglQiN1a7pmCzjsSY7fMDCBu9sIdPnQ== X-Received: by 2002:a05:600c:3103:b0:431:5c7b:e939 with SMTP id 5b1f17b1804b1-434d09d1d68mr81549135e9.18.1733344056242; Wed, 04 Dec 2024 12:27:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 10/20] target/microblaze: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:52 +0100 Message-ID: <20241204202602.58083-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1733344351860116600 Implement the MicroBlaze datapath_is_big_endian() handler, returning the value of the ENDI bit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/cpu.h | 2 ++ target/microblaze/cpu.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 3e5a3e5c605..dd6b61b34ba 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -412,6 +412,8 @@ void mb_tcg_init(void); /* Ensure there is no overlap between the two masks. */ QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK); =20 +bool mb_cpu_datapath_is_big_endian(CPUState *cs); + static inline void cpu_get_tb_cpu_state(CPUMBState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 710eb1146c1..3a0e5713415 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -26,6 +26,7 @@ #include "qapi/error.h" #include "cpu.h" #include "qemu/module.h" +#include "sysemu/hw_accel.h" #include "hw/qdev-properties.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" @@ -119,6 +120,15 @@ static bool mb_cpu_has_work(CPUState *cs) return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI= ); } =20 +bool mb_cpu_datapath_is_big_endian(CPUState *cs) +{ + MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); + + cpu_synchronize_state(cs); + + return !cpu->cfg.endi; +} + static int mb_cpu_mmu_index(CPUState *cs, bool ifetch) { CPUMBState *env =3D cpu_env(cs); @@ -447,6 +457,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *da= ta) &mcc->parent_phases); =20 cc->class_by_name =3D mb_cpu_class_by_name; + cc->datapath_is_big_endian =3D mb_cpu_datapath_is_big_endian; cc->has_work =3D mb_cpu_has_work; cc->mmu_index =3D mb_cpu_mmu_index; cc->dump_state =3D mb_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344286; cv=none; d=zohomail.com; s=zohoarc; b=AToiV1qQV9BY0rOZJ/SXSS3d+sFVIj6ATKJYKs86js1WyrRTtAT0VZ+SrES2FUjjdYzb5bCMPv3xv7jQiw96Yk9d2odmA352XcHPO2Q33EcdSIXWvHFwA9hYgZRdQubRb5uomJfPrulcnEt/UD1lu+LQwY3wIGAgAKzlhE2awy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344286; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zWutDH14OyliM2KY1fyQJ86hTSYSkrVk4NaKh8Buzj4=; b=fr11VT8CkQeyLd8u+1Ht1oj+MoRz+z4zyW6zmZW7k9No7DB17kAJWO1kAJY+3EWVIGU14RWrHWMsqqLX0MLw7YIVZYVAbigq2nDZ6XcfmaAv8+kl+EkmRiRBOSjDtALPkVVvV9aiCWN8EVllh2FcipLtFuwBHntJdgaGpb+WOZ0= 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 1733344286756381.5405585664811; Wed, 4 Dec 2024 12:31:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyW-00017H-FW; Wed, 04 Dec 2024 15:27:56 -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 1tIvyM-0000iP-8U for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:47 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyJ-0001Ks-K4 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:45 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-434aa472617so1353735e9.3 for ; Wed, 04 Dec 2024 12:27:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0dd4sm35612765e9.34.2024.12.04.12.27.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344062; x=1733948862; darn=nongnu.org; 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=zWutDH14OyliM2KY1fyQJ86hTSYSkrVk4NaKh8Buzj4=; b=DqEQNvciOkFoZV4ac9GQYzv3HLZTdD98nipn8uGlH398rnFrXG6IjWmLIWCSI7ck6C Tss6W0hSiTw/MC36E24hBHA1iTTdDG/DA5ZSuVa66Z+qRpDsjKnV+fcoCW+xrIM6tnW4 OJP/ajP07oxDhzVXy9O0Vg2jnARQ+pPbe5jweaV8MLilrUaiY+PtKpkEJ2dPa1Nj9Fj4 ozQv4bYd1q/miICbXBMEOmUkGNDY5XKhPyJvPCIEIemJkYpRAdUJkcP0Y1RDYs7goXfr nBNBLqP/lxmEwczRR8nYpNmL053crbQRC+Mn6Aejyn3++scB8/O3ZXiov46E6umBWQiK fBiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344062; x=1733948862; 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=zWutDH14OyliM2KY1fyQJ86hTSYSkrVk4NaKh8Buzj4=; b=oeGQrfxK089v3vXXKMZkPq7sMw9TnWlSveW+HWL78rPazpKvliH4aWFp0eYhbbmxNH o4oHhXsZagqU7P4PjqYPZUZ0AT5PbN61h0TgKXgjREp0tX8rbAa3jQ/LFnXEp5K+19RL PXcfzrLWvu0ty/kVjEGOTX2Tf9H4ZM1TFizo5c8BHs8TCaPXbbrTkW+CezIrpezAM0E6 /Rv1UUDXhko3OnRxvKnOoGmpU76rvD8RHV9ntPsSWpcupbE+OfVF8dn4KdhXqlhnXSFM +vAb7GfGfikfyhgdR7JuTxj5e+JqSxt6KDeRRJShE4vaDkJCPkrt69QuArjzOv/oImCJ h56w== X-Gm-Message-State: AOJu0YxqWRmCVmv0G1hskLhXrq0q9vytzrJj3aP8zFr159riRAAVO6cG 1qNla/8DX5x5rzCaUhFLjRg3t3ckibyBZ25eilR6BvTXQe67HRnvp4LGemzVyLbdpytG053Np8m p X-Gm-Gg: ASbGncvMOJk3I2UH150us3LFKWKdnmduuHickBZ5HM8bv6cx+oh0pPhoZe62Ux1KVe6 mp59zvf+o3tfuEEs3uOcnhzM2YOz1EOYL2CVl/fp7UfODUO1DvWLODRsym65/aOqdgiMgsoQriN iyDAKd7sa+9Gsf/4THtCc+XddU032t+LdVZfI16Clqm/ijjmHkNpszvoEf2WX9kkcs9aTYNArnN /TIja5h797ZSbaCtM9CDQQpfDgcxLCLUw2+t+ANQx7AIkjeS082NFr4KIHKoBd3WccZW8SrJoBq ljRjt1Van3DNrVD34d5tlTj7 X-Google-Smtp-Source: AGHT+IERrsgR2EegsKjGUlPd2gxFhYeU+ZCs7pMAENN4A6q2kGfKfkwC+dy29o1+ADoNHMpp5fQ2qA== X-Received: by 2002:a05:6000:a11:b0:382:4b52:ffcc with SMTP id ffacd0b85a97d-385fd370b69mr7242995f8f.0.1733344061965; Wed, 04 Dec 2024 12:27:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 11/20] target/mips: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:53 +0100 Message-ID: <20241204202602.58083-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: 1733344287477116600 Implement MIPS datapath_is_big_endian() handler using the already existing mips_env_is_bigendian() method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index d0a43b6d5c7..13d0ceaa8af 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -27,6 +27,7 @@ #include "internal.h" #include "kvm_mips.h" #include "qemu/module.h" +#include "sysemu/hw_accel.h" #include "sysemu/kvm.h" #include "sysemu/qtest.h" #include "exec/exec-all.h" @@ -132,6 +133,13 @@ static vaddr mips_cpu_get_pc(CPUState *cs) return cpu->env.active_tc.PC; } =20 +static bool mips_cpu_datapath_is_big_endian(CPUState *cs) +{ + cpu_synchronize_state(cs); + + return mips_env_is_bigendian(cpu_env(cs)); +} + static bool mips_cpu_has_work(CPUState *cs) { CPUMIPSState *env =3D cpu_env(cs); @@ -581,6 +589,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *d= ata) &mcc->parent_phases); =20 cc->class_by_name =3D mips_cpu_class_by_name; + cc->datapath_is_big_endian =3D mips_cpu_datapath_is_big_endian; cc->has_work =3D mips_cpu_has_work; cc->mmu_index =3D mips_cpu_mmu_index; cc->dump_state =3D mips_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344339; cv=none; d=zohomail.com; s=zohoarc; b=DBGg80o8mvLeVOzrW0MelVLI/dscO5SHvezSWGKWjXcYrknMb2BD6kh8vDF6bqwmAAzlnnV56EAuxn8Vh3nGWAJH0xivl3zyQS61Fp7FH9MmBbtd7gRXwDAdping0c3AHjbHJydElpR6KgsxsvvLY8bTGHzCuEmt/2JMEd2q3qk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344339; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NfTBm75o97Cz8/aU/8hyy/8ZcyfCCBeJMjQXzg2r+cU=; b=hL59SZ1CzkgO7Ifs+El8yEgTMBynKS27cc2qaCoU6NON8IjSGZY2LiWgYlmXCRpxnuntGawt6dy3C6AK5BS86e4grPR/C+N/7hW5sVsWM74Gpg6cQJ9+FWnHscJfdWD9DhUjlZ3Sb1uW5RCOGbT9OnyDPB0M7JCLaALkW/TbLV4= 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 1733344339568567.1116839871419; Wed, 4 Dec 2024 12:32:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyb-0001kl-7P; Wed, 04 Dec 2024 15:28:01 -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 1tIvyR-0000uP-5v for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:51 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyO-0001TL-J7 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:50 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-434a1639637so1987355e9.1 for ; Wed, 04 Dec 2024 12:27:48 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52aa0b4sm34940765e9.35.2024.12.04.12.27.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344067; x=1733948867; darn=nongnu.org; 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=NfTBm75o97Cz8/aU/8hyy/8ZcyfCCBeJMjQXzg2r+cU=; b=SqzBevB8p6YpDZUC18/k4mfzMsQOFPVYfWXFynLdgOnQpPBRBO3Y+kKuNnf+SMjXqW 2mklqPRFcdij8SWFl/3RyuY/IkYy6WGVd68mlNle7EBlomp6jZo+16tV09b4Dbe9euCL e0uIBwZe09PgyBsoa0Dq7kg1lTLi3SMdF1//kQXAkOAgNdgL6Kpo4i5hvr429g6FFKxP Bx+oSGgHvgNmuSO65lUbAYvGgkJf+HN+Kbov9wOqW3vitHHON4D+Hge0rZ2GSlBdI10p xsBiYFpvLQ2S5OYHofqonzDkZDgFN61IST4lsZ0qm6CM+QgU704VGLPuaA5XgO3Cqh/q 6EWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344067; x=1733948867; 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=NfTBm75o97Cz8/aU/8hyy/8ZcyfCCBeJMjQXzg2r+cU=; b=spyEbi7nY30Ixy0TZA9LN7GWvPIo6t52a+RQMVeFW93dpWKeeKz82Tz2MTX811VhyC SaIyRKxRrDNenS4Yj8pXw669/AXdOZs0gsewnzL3Q0QS5sUmvghSCLN/VwnV7BEjmhd8 1/wvHdb59LbcQQa8zoKfkwfRK5aeMjXoCs/2Htr6CNOGkWZTdA0WdbonsEbj9sUiaAum vOZs6MqGUMospH2HilXVX0HWh1N7zLsLlxQBUAEaSvNNxNqnOBpZOy7FTUxgCHNI/xde IgCT5BX4tWK7MiVRVE0Ey7lPW/U3ebpfskNYTjpkxpOZ17vQwi0rfzP+/m8yaTt/HIeE /RGQ== X-Gm-Message-State: AOJu0YxEzvIBLBxbw2UGVx4dr0db5tbU2wzWEbWJPD9NTXjMgKE3QGPs Yi+e6KY9JVtKPgewrqaiKHAn3OLm47Zafglukn72eDK/b0tchFcZizvfrBnER/byEk8nZlTOcOe n X-Gm-Gg: ASbGncuV4O9Eg+ytLMgJq2jmwYcOyCNU1RJFi2YvlgefipZEuV8Fy9IDG7whtEyR4c4 zd7KqT2NTv+rYGxaZhBIO0t7WahvDrhLd1QpjI0PPEimUg57zk+j5b5MAC/8zDm7xmSc1Vw1Okv oosYcilQva+InfLvKwzGqK3gfdFEfdnYUWV1fA971l/7rtFEEGd34xgFW8cpMqx6eS16e2UMGJU si3BwDAxjhdBemy5/U/ZlepMQay3zhzraOncnVh98G6OZ1KrQAFJu8hCd0+wKoNwi2mkbTGSQMG 7a+Zg5SeIHmG8E2FtEG1nfua X-Google-Smtp-Source: AGHT+IGpgeJ7vBsWVKm7NeyrMHf5JJDdtts2znjAq5L8tAOSmcAfKNrzgAbgdCPI0p5ekUE7haCsLg== X-Received: by 2002:a05:600c:4f08:b0:434:a754:661c with SMTP id 5b1f17b1804b1-434d09acef0mr65607085e9.7.1733344066970; Wed, 04 Dec 2024 12:27:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 12/20] target/xtensa: Implement xtensa_isa_is_big_endian() Date: Wed, 4 Dec 2024 21:25:54 +0100 Message-ID: <20241204202602.58083-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: 1733344341741116600 Xtensa internal fields are opaque, only accessible by the Xtensa libisa. Implement xtensa_isa_is_big_endian() to get vCPU endianness. This should be implemented in libisa, not QEMU, but I couldn't figure out where to contribute this. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/xtensa/xtensa-isa.h | 1 + target/xtensa/xtensa-isa.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/hw/xtensa/xtensa-isa.h b/include/hw/xtensa/xtensa-isa.h index a289531bdc8..1cb8e6ccb66 100644 --- a/include/hw/xtensa/xtensa-isa.h +++ b/include/hw/xtensa/xtensa-isa.h @@ -829,6 +829,7 @@ const char *xtensa_funcUnit_name(xtensa_isa isa, xtensa= _funcUnit fun); =20 int xtensa_funcUnit_num_copies(xtensa_isa isa, xtensa_funcUnit fun); =20 +bool xtensa_isa_is_big_endian(xtensa_isa isa); =20 #ifdef __cplusplus } diff --git a/target/xtensa/xtensa-isa.c b/target/xtensa/xtensa-isa.c index 630b4f9da1b..36eb4bcf3d4 100644 --- a/target/xtensa/xtensa-isa.c +++ b/target/xtensa/xtensa-isa.c @@ -1741,3 +1741,10 @@ int xtensa_funcUnit_num_copies(xtensa_isa isa, xtens= a_funcUnit fun) CHECK_FUNCUNIT(intisa, fun, XTENSA_UNDEFINED); return intisa->funcUnits[fun].num_copies; } + +bool xtensa_isa_is_big_endian(xtensa_isa isa) +{ + xtensa_isa_internal *intisa =3D (xtensa_isa_internal *)isa; + + return intisa->is_big_endian; +} --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344100; cv=none; d=zohomail.com; s=zohoarc; b=a2NQiPlfJM+UQkJW3SeHLDi6sOg3TDh1jBsEECBsA7tvQ4FIxyMF+rHqDMuKfkN4dgGzhVeXqmhlL5TppU7L6V8ucO49ttEZ5UjzTCVFhMOkfQSiAsNFhpX3v7bLBwyASZGfl4UlYTVLaVlY9iPwsOSeENVR142URemcPExuFuY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344100; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9GnnholsvXz5CZtkYpeYGZkC8DvPWibSAfIk7aKacnw=; b=b7jK0Ck66EYQUrdXcO4ZrvpUxxVvftKfORrJkZVAZZvslJFm+/VAwOdHEY3cI/TKNFOk3H9YBh1UwC6z/svr8n/LlrTaPsmCph2fsyG0cl2tc1D2GWidc5vg4ARHSh3bRqr16CN+PsqM5RkQMkhbMrC9GX6OgBArI1Vr9trhEqU= 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 1733344100715216.18927553874062; Wed, 4 Dec 2024 12:28:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyd-0001wS-Q0; Wed, 04 Dec 2024 15:28:03 -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 1tIvyW-0001Gx-V0 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:57 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyU-0001Ww-Fq for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:27:56 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434aa222d96so2393035e9.0 for ; Wed, 04 Dec 2024 12:27:54 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385e4617a61sm13704523f8f.3.2024.12.04.12.27.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344073; x=1733948873; darn=nongnu.org; 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=9GnnholsvXz5CZtkYpeYGZkC8DvPWibSAfIk7aKacnw=; b=uYyGvG58JlzTGx5rVpLPfZ2LrWGD8dsWbtsIn9C26NLQW1zvSJnEDYLmlzbE7oEpOc 5likb0GTJmdyxL/fyZw0+CXdL4HUE779RK9SPI2v+3hX18U0sGnmHhrYPsSnPD0z48gO CPqp9oPbSsYLmLy+CM3EXvDQJK1tCRoMf6ov+OPavCnDsQ/66A2OG8FWqcSt2+ApJBQo nbR5eq7qh/X1Twzxb8ABqe2WmEYPCz291Egwp/QPyoF2JYeaHbEWKBtFrp28O0A7IXd3 xRcu6EAlp8e44cVJ4HRC4zFEBJrPVfocg8RKlxRdXSzWyJHt9nny8stR1aj5lj0C11rv xKBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344073; x=1733948873; 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=9GnnholsvXz5CZtkYpeYGZkC8DvPWibSAfIk7aKacnw=; b=FtqNQ0Apnf22WADUpeEhJRH4w2dLnPqT2Kaoi2xsFu61feQVWayMq58IvkOAP0vraz oEj/sT5YDREtbPr2E2Zvf3Oj1j47kgXr0GqjCTrKzHcT0FcFGNzGQNHlM0jRdquDGcID G4xnNtTB5jVvxd0Q0WFUjylE5KFto3CpdWYsi3/34q4nEcmpIpbB0/hkpwXW0mJ825Il gyN0BiXe774p/LtX61NqERj+PG6j0OEtn7TDKd233Ysk3JwqpDbF3rQJGbuluq0ovYtA qpOEkREQAfmSUyyjSVbTQwRGSFxcmLt8fhVQTAutafQ5l4RjDac9BiPACxjAnf6Us+C8 C6Qw== X-Gm-Message-State: AOJu0YxEcn28y7IfCII51BqU906DsCpKp1S3njMxltK7UN6TEZCSWQq3 y0D462YkCrwZDHdF22B1bBi80WzsfFTOfgA7jbuXeqCATz1mM+BLmYNEV/WT7WuzO6jJ+pckbNy d X-Gm-Gg: ASbGncvV6vkI2tPyEPRItlMwOszsI5PH538BaE8HY7IY3XrO2Uf4DJ9KeE/FjcWgvW/ VJWJ31iJJSyMoJEkm13hs0g11ufE0nc3EiA1XdIdkuyDdA9QezvCd8htsxwTiBShHxs38tTXPsc ckZMrtkI7vWMCjARrqyJIJOMU8rhR/5zb2L7QyAEKn6fPcgH1HVajqQNjNy0W2jRElFLbySM1Gx NShyTUinzszvM3+HDrP9IgnjLH2hZabQhhZ+/8GdeTqukvNuze9UmtZ077+SHYgrGzt/ygRtSZb 7Y2mg23zb32/clnIMnGzz3AK X-Google-Smtp-Source: AGHT+IH75Gz0sW3RwRPCapXCchZl0B/o8f7tlDV3JT97opLeAMC3ypqemf6zEKrUgpubXhMZp4xpbQ== X-Received: by 2002:a05:600c:138a:b0:434:a684:984 with SMTP id 5b1f17b1804b1-434d09b2f31mr80379895e9.4.1733344072767; Wed, 04 Dec 2024 12:27:52 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 13/20] target/xtensa: Implement CPUClass::datapath_is_big_endian Date: Wed, 4 Dec 2024 21:25:55 +0100 Message-ID: <20241204202602.58083-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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: 1733344102345116600 Implement Xtensa datapath_is_big_endian() helper via libisa. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Other accesses to xtensa_isa_internal fields don't call cpu_synchronize_state(), and the libisa doesn't provide a way to switch endianness from translation code. Should we add a sync just in case? --- target/xtensa/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 6f9039abaee..7bf792fd0f4 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -40,6 +40,13 @@ #endif =20 =20 +static bool xtensa_cpu_datapath_is_big_endian(CPUState *cs) +{ + CPUXtensaState *env =3D cpu_env(cs); + + return xtensa_isa_is_big_endian(env->config->isa); +} + static void xtensa_cpu_set_pc(CPUState *cs, vaddr value) { XtensaCPU *cpu =3D XTENSA_CPU(cs); @@ -256,6 +263,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void= *data) &xcc->parent_phases); =20 cc->class_by_name =3D xtensa_cpu_class_by_name; + cc->datapath_is_big_endian =3D xtensa_cpu_datapath_is_big_endian; cc->has_work =3D xtensa_cpu_has_work; cc->mmu_index =3D xtensa_cpu_mmu_index; cc->dump_state =3D xtensa_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:27 2025 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=1733344256; cv=none; d=zohomail.com; s=zohoarc; b=mbK9uJe3nOfcPzTZJxto/fabx5tFyOhFZe5rDjUb4yyPX4qk5QVzsU3T6fTnWsqEd2l+aiNIw76cCqSyJgDcVMu82KTFJwFPay5+T/JDDjDEHVwqV8qFRadItgGCoKunECp/vi+nGfOrQHp/xX3TbTLvvLgpbj8lylLkV8HxXYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344256; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nkZKIsDoSM+ma8HKWntZmvOsZaSUYdAuJc6HKLqlim0=; b=BRFiuf8Cc4JvKN/p84RdDNb1wy7EaU9SEW2/JjikvptG3tN2iHH/8lxS3OWiJytSheqTsXojknOTv21XILQPtwT/8ZR/pBb48Oml+gM0a+7tDDDcWP249x09338zkL2DSQg9ETicKVG/ndD8y0M8XXVA2QiTNr7wlJhlx8vXzZQ= 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 1733344256815793.1620184783103; Wed, 4 Dec 2024 12:30:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyf-00023t-6B; Wed, 04 Dec 2024 15:28:05 -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 1tIvyc-0001uO-T3 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:03 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyZ-0001u8-OM for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:02 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-434a1639637so1989015e9.1 for ; Wed, 04 Dec 2024 12:27:59 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52cbd16sm34950775e9.41.2024.12.04.12.27.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:27:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344078; x=1733948878; darn=nongnu.org; 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=nkZKIsDoSM+ma8HKWntZmvOsZaSUYdAuJc6HKLqlim0=; b=Fuc/JnqIq+P3ZFsiJXKia+YbnDZNJXx2TMWxs+P4uPXgYocFq3FaoBEzPaJoas2g0m tGy165DtIyut5TOZ5373dHiLm4igInBSCTi60EgEScAQhZwfhDXvLo+z5q46hXG+2kUX KXj8kejMkXQs/BUD4k2rJjnqoNsRFGuS9xcmPmP3skdrioog0UKDQ1sl4kSQaZ1FW5h0 tbjvvEUYXZPgY7XMmmS+EU6oZbLPrWIWaaZL2a/s4nSGGsaPY4hnR++T6KMNn2jnQ4li HwM8+z4qIFH7j31UKjWFHxY8vbBGfIbDGZkvkSjbesPQXrozDi+6PUZ6lh8a9LR5IKcx faIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344078; x=1733948878; 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=nkZKIsDoSM+ma8HKWntZmvOsZaSUYdAuJc6HKLqlim0=; b=sEA9UZk7CenTC3IA4StxbN2n1IeXCPKhI3uPJZwe0b8uoWQDVt5eFzlenvPNnB/b6a cUmttjMf6inerv8k/D5EhxekdSMSo1hv80kVYK7XtqoVIoTyeuofdI0R4IZBujYl2l+i 0lhHXO1F/6eydIe8F5HTd/H5GaneDTl0T+op+gr59moEDQlOXDlKXv/BIFs+NupT8Jl4 3+hOg/QWonh1PfEgdRSwsREfqQyGJrOLQKR5W64848A9KcMON7W57smEK9vZTZx27xE3 jtciTkK6zspxqJq2LVYmcrZql1rD4fiQ5GK4RRiJbN5EVefzU55l8Nh6b3ZeoKq9Ylkk NupA== X-Gm-Message-State: AOJu0YyzS3tZjXgVXG+fk0OWzAfrcNaaLTGyv+PxWaDBHlhHnkJ9nIzm XQTNQQPtjy1KIf5OEvpIhuNYKX0MuUxfTddAUJn4SPMe+BdlcTpbZjzQtACyljC5u7ZFnqYbXfb r X-Gm-Gg: ASbGnctgHj8Xtjb4qK/iB/I3jqaZDUrtKLuaOG+nsB907B0QeNv6tkwQDgvbx1rAQ72 wgTuB8tC8hmKTE9mRNryo5HRChBBV7fWCy/l4olOuxaU23qfPpxOoqDj+if0/8rsNkAVm3bRpM+ jHcS3aFg+uklYwhmodGqEJU6ZIfdp6ngLfxdPnOpYkS6YrAO+uO9GSSUC9gsb3qwBizH8RRewm8 vFn6JRGB7g9lYJhtGBEaRqt080Ia/08HeTuAAQKuqTpPCUm15a6Mz6Fi69wStFIttZgIv4HhQvY rxSPTIl6BEwOqmigWTBD8d7+ X-Google-Smtp-Source: AGHT+IEQZCLaeqL3NJdNlkp69TPR8VsZwfrAUk0Iu/WBp1gm2bQ8hewWSnGHoj7rlbErdVRXO1pF/A== X-Received: by 2002:a05:600c:4748:b0:431:59ab:15cf with SMTP id 5b1f17b1804b1-434d09c37bcmr69319945e9.19.1733344078096; Wed, 04 Dec 2024 12:27:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 14/20] target: Implement CPUClass::datapath_is_big_endian (little-endian) Date: Wed, 4 Dec 2024 21:25:56 +0100 Message-ID: <20241204202602.58083-15-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: 1733344257418116600 For all targets which have endianness architecturally predefined as little endian (built using TARGET_BIG_ENDIAN=3Dn), their datapath_is_big_endian() handler simply returns %false. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/cpu.c | 6 ++++++ target/avr/cpu.c | 7 ++++++- target/i386/cpu.c | 6 ++++++ target/loongarch/cpu.c | 6 ++++++ target/tricore/cpu.c | 6 ++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 5d75c941f7a..ee844a4c455 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -27,6 +27,11 @@ #include "fpu/softfloat.h" =20 =20 +static bool alpha_cpu_datapath_is_big_endian(CPUState *cs) +{ + return false; +} + static void alpha_cpu_set_pc(CPUState *cs, vaddr value) { CPUAlphaState *env =3D cpu_env(cs); @@ -247,6 +252,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void = *data) &acc->parent_realize); =20 cc->class_by_name =3D alpha_cpu_class_by_name; + cc->datapath_is_big_endian =3D alpha_cpu_datapath_is_big_endian; cc->has_work =3D alpha_cpu_has_work; cc->mmu_index =3D alpha_cpu_mmu_index; cc->dump_state =3D alpha_cpu_dump_state; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 3132842d565..f32f1bee61f 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -159,6 +159,11 @@ static ObjectClass *avr_cpu_class_by_name(const char *= cpu_model) return object_class_by_name(cpu_model); } =20 +static bool avr_cpu_datapath_is_big_endian(CPUState *cs) +{ + return false; +} + static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags) { CPUAVRState *env =3D cpu_env(cs); @@ -230,7 +235,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *d= ata) &mcc->parent_phases); =20 cc->class_by_name =3D avr_cpu_class_by_name; - + cc->datapath_is_big_endian =3D avr_cpu_datapath_is_big_endian; cc->has_work =3D avr_cpu_has_work; cc->mmu_index =3D avr_cpu_mmu_index; cc->dump_state =3D avr_cpu_dump_state; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 3725dbbc4b3..f783d311579 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2008,6 +2008,11 @@ static char *x86_cpu_class_get_model_name(X86CPUClas= s *cc) return cpu_model_from_type(class_name); } =20 +static bool x86_cpu_datapath_is_big_endian(CPUState *cs) +{ + return false; +} + typedef struct X86CPUVersionDefinition { X86CPUVersion version; const char *alias; @@ -8588,6 +8593,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) =20 cc->class_by_name =3D x86_cpu_class_by_name; cc->parse_features =3D x86_cpu_parse_featurestr; + cc->datapath_is_big_endian =3D x86_cpu_datapath_is_big_endian; cc->has_work =3D x86_cpu_has_work; cc->mmu_index =3D x86_cpu_mmu_index; cc->dump_state =3D x86_cpu_dump_state; diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 57cc4f314bf..b9cf0091546 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -742,6 +742,11 @@ static ObjectClass *loongarch_cpu_class_by_name(const = char *cpu_model) return oc; } =20 +static bool loongarch_cpu_datapath_is_big_endian(CPUState *cs) +{ + return false; +} + void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags) { CPULoongArchState *env =3D cpu_env(cs); @@ -836,6 +841,7 @@ static void loongarch_cpu_class_init(ObjectClass *c, vo= id *data) &lacc->parent_phases); =20 cc->class_by_name =3D loongarch_cpu_class_by_name; + cc->datapath_is_big_endian =3D loongarch_cpu_datapath_is_big_endian; cc->has_work =3D loongarch_cpu_has_work; cc->mmu_index =3D loongarch_cpu_mmu_index; cc->dump_state =3D loongarch_cpu_dump_state; diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 1a261715907..ba53d83f662 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -29,6 +29,11 @@ static inline void set_feature(CPUTriCoreState *env, int= feature) env->features |=3D 1ULL << feature; } =20 +static bool tricore_cpu_datapath_is_big_endian(CPUState *cs) +{ + return false; +} + static const gchar *tricore_gdb_arch_name(CPUState *cs) { return "tricore"; @@ -191,6 +196,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void= *data) resettable_class_set_parent_phases(rc, NULL, tricore_cpu_reset_hold, N= ULL, &mcc->parent_phases); cc->class_by_name =3D tricore_cpu_class_by_name; + cc->datapath_is_big_endian =3D tricore_cpu_datapath_is_big_endian; cc->has_work =3D tricore_cpu_has_work; cc->mmu_index =3D tricore_cpu_mmu_index; =20 --=20 2.45.2 From nobody Fri Dec 19 04:38:28 2025 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=1733344166; cv=none; d=zohomail.com; s=zohoarc; b=MsWI+x4LLR3p8o+XCIOZOBWAlRn1fhMEerJOnQuFrCVVdPqYbTJwU9pKXSAWmK41i+U/fbovtl8XjaZF7zskFEhvsdrEWVsJ62Qt8Gv6f8jcE1PIS1wYQbswAzMNTDXWJHWEPwGPEHTh1ebgTdw3WROiAXC1gV2czjQYMItizqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344166; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9QewNS2KrXYFKBtSPrML3uVF3WnArNvnPbDN/XKhdgc=; b=K6ENFvZrziRPEL7V1UmrvYQz2W48U2ogdBEkylcXqUg+Xtpge7K1mbsnRNN6UJh8OndWk2xhBqc/AWnODmcx3vlRHM+7TEdf//c/gerjT+ICDS80kjq0djfBVYbnQJStMvHiBSsrvfXisfQPAIrTJCsgJysBDXoz82FCaCQwfYM= 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 17333441661151017.7116001499938; Wed, 4 Dec 2024 12:29:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyr-0002RH-ER; Wed, 04 Dec 2024 15:28:17 -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 1tIvyi-000298-1Q for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:08 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyf-0002GV-0Z for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:07 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4349cc45219so1875115e9.3 for ; Wed, 04 Dec 2024 12:28:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d526b158sm36718205e9.8.2024.12.04.12.28.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344083; x=1733948883; darn=nongnu.org; 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=9QewNS2KrXYFKBtSPrML3uVF3WnArNvnPbDN/XKhdgc=; b=zkLXT/c64uMGH6KoQQilbT/8TWzf8HL2stHfoI6fw/h/gWz/rbUOn79145ycxguHxg tzx0cH5x/CB+IEioYHkwGk1WN9mkIof1DS3n7NfBAbRPdGo4qZavZWmbo+cypYh+cLIo woGq8GmOB+1v2y6UOKu6QgEz3KiYvF6W8re13R8EmwbB4dTsLuJJ8e9stlfpFilxBg8C Oqn2Lae3nQ92+WaBuRkitAj7m8orJBvUW+OZvd4gsZBtuQOFJgtitYU2JsXfZC6BrpKh xtmGCYJoRbU/nJy8XPCtNaiW/alvumlyZa222Pv5aGhmECLQGiaPC5ux5I89VD4HXAbu s2ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344083; x=1733948883; 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=9QewNS2KrXYFKBtSPrML3uVF3WnArNvnPbDN/XKhdgc=; b=SIWegflf4qjc+rBvL7AKEo8gw87YWyQZB4TV0Fq/L8EI5jA7+hFs9sY3h4JX2uSBtL 2fTFxW4hLagX6kqeBaqe7bkzxr1jdtUiW6DMDmmbyOd32n9BqJRtpqYmBt9mSQkP5aFe ci6L6rGOJaWwyLaQJlq2HOuhGAkhfRyQMtvVQyRbbBreCsebLsrzNo0touPwZP7Oedik zAqHRxePvuztluKDRh2+c5Jv8CwaBVmkoOenKEAMOXt7qTOa04q3vF2Z2pKAZHb1GiB2 b0ccMENF7mQRIJd6DZlOUVw7Fo9hSsbSe06FilXbLX2dunrMBNNWG/BhWz0Q/KTMe79a 7O0Q== X-Gm-Message-State: AOJu0YzcDiHHx9IIi+fLUhVxDeCAyxVbAftXTsV5n4KtCszwst4WVEh0 Z34jer3k84JUXbkSJ8NL91eHYdv0MvzknvPdcBmGG4qzk1zdaCQchzJrro1hs/DDwPr9471DomB 7 X-Gm-Gg: ASbGncsyYCw+sxTJuGVWWefq3QDM1I9lJIxM0b+gt+WQbfWx5tqok/VEflzfgQE3+Sc MNBvvGkXfb8YofCfLi4/4vlcEnh63RAwJX8w9cJroeIcnMrWSXWTx2SFHPIEksIvGkvT69v7SdI iTMsxjbyrAhxJHK2aTDEeULINZ2q/Nr+mk9RSMI22Is3buXiTFoRKMKLSklj0t/IwE7oLkAnfX1 +ngtU7JLNlJf9KWFve5ZyMbNudyh1iMbU8SOeSfuW4+l1aHly1LoUyjWMcgeow0eXIwkARhlRMY VOQPUoqzrtjQ5/JYHJupS3/d X-Google-Smtp-Source: AGHT+IFxlGUUFIyfkFeZ4l8REFf4CCrkxe7SUkymjFY/EOIvnxUeAib+1bgksySbStfCRyrv1tvxHg== X-Received: by 2002:a05:600c:1ca2:b0:434:ba13:e52b with SMTP id 5b1f17b1804b1-434d0a14a83mr76478475e9.31.1733344083303; Wed, 04 Dec 2024 12:28:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 15/20] target: Implement CPUClass::datapath_is_big_endian (big-endian) Date: Wed, 4 Dec 2024 21:25:57 +0100 Message-ID: <20241204202602.58083-16-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: 1733344166847116600 For all targets which have endianness architecturally predefined as big endian (built using TARGET_BIG_ENDIAN=3Dy), their datapath_is_big_endian() handler simply returns %true. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Brian Cain --- target/hexagon/cpu.c | 6 ++++++ target/hppa/cpu.c | 6 ++++++ target/m68k/cpu.c | 6 ++++++ target/openrisc/cpu.c | 6 ++++++ target/s390x/cpu.c | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 020038fc490..6407ed80c59 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -245,6 +245,11 @@ void hexagon_debug(CPUHexagonState *env) hexagon_dump(env, stdout, CPU_DUMP_FPU); } =20 +static bool hexagon_cpu_datapath_is_big_endian(CPUState *cs) +{ + return true; +} + static void hexagon_cpu_set_pc(CPUState *cs, vaddr value) { cpu_env(cs)->gpr[HEX_REG_PC] =3D value; @@ -342,6 +347,7 @@ static void hexagon_cpu_class_init(ObjectClass *c, void= *data) &mcc->parent_phases); =20 cc->class_by_name =3D hexagon_cpu_class_by_name; + cc->datapath_is_big_endian =3D hexagon_cpu_datapath_is_big_endian; cc->has_work =3D hexagon_cpu_has_work; cc->dump_state =3D hexagon_dump_state; cc->set_pc =3D hexagon_cpu_set_pc; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index c38439c1800..8ccd224f2a4 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -203,6 +203,11 @@ static void hppa_cpu_initfn(Object *obj) cpu_hppa_put_psw(env, PSW_W); } =20 +static bool hppa_cpu_datapath_is_big_endian(CPUState *cs) +{ + return true; +} + static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) { g_autofree char *typename =3D g_strconcat(cpu_model, "-cpu", NULL); @@ -245,6 +250,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *= data) &acc->parent_realize); =20 cc->class_by_name =3D hppa_cpu_class_by_name; + cc->datapath_is_big_endian =3D hppa_cpu_datapath_is_big_endian; cc->has_work =3D hppa_cpu_has_work; cc->mmu_index =3D hppa_cpu_mmu_index; cc->dump_state =3D hppa_cpu_dump_state; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 5fe335558aa..52f8db41d5a 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -24,6 +24,11 @@ #include "migration/vmstate.h" #include "fpu/softfloat.h" =20 +static bool m68k_cpu_datapath_is_big_endian(CPUState *cs) +{ + return true; +} + static void m68k_cpu_set_pc(CPUState *cs, vaddr value) { M68kCPU *cpu =3D M68K_CPU(cs); @@ -571,6 +576,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *d= ata) &mcc->parent_phases); =20 cc->class_by_name =3D m68k_cpu_class_by_name; + cc->datapath_is_big_endian =3D m68k_cpu_datapath_is_big_endian; cc->has_work =3D m68k_cpu_has_work; cc->mmu_index =3D m68k_cpu_mmu_index; cc->dump_state =3D m68k_cpu_dump_state; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index b96561d1f26..16e39b43ec4 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -25,6 +25,11 @@ #include "fpu/softfloat-helpers.h" #include "tcg/tcg.h" =20 +static bool openrisc_cpu_datapath_is_big_endian(CPUState *cs) +{ + return true; +} + static void openrisc_cpu_set_pc(CPUState *cs, vaddr value) { OpenRISCCPU *cpu =3D OPENRISC_CPU(cs); @@ -257,6 +262,7 @@ static void openrisc_cpu_class_init(ObjectClass *oc, vo= id *data) &occ->parent_phases); =20 cc->class_by_name =3D openrisc_cpu_class_by_name; + cc->datapath_is_big_endian =3D openrisc_cpu_datapath_is_big_endian; cc->has_work =3D openrisc_cpu_has_work; cc->mmu_index =3D openrisc_cpu_mmu_index; cc->dump_state =3D openrisc_cpu_dump_state; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 514c70f3010..eda1e3b286f 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -44,6 +44,11 @@ #define CR0_RESET 0xE0UL #define CR14_RESET 0xC2000000UL; =20 +static bool s390_cpu_datapath_is_big_endian(CPUState *cs) +{ + return true; +} + #ifndef CONFIG_USER_ONLY static bool is_early_exception_psw(uint64_t mask, uint64_t addr) { @@ -390,6 +395,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *= data) &scc->parent_phases); =20 cc->class_by_name =3D s390_cpu_class_by_name, + cc->datapath_is_big_endian =3D s390_cpu_datapath_is_big_endian; cc->has_work =3D s390_cpu_has_work; cc->mmu_index =3D s390x_cpu_mmu_index; cc->dump_state =3D s390_cpu_dump_state; --=20 2.45.2 From nobody Fri Dec 19 04:38:28 2025 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=1733344353; cv=none; d=zohomail.com; s=zohoarc; b=UySOJ12X3nCe2mjghGJFhruq1G/VsLfzafBB7mOyh9qAEBWcrlQV1VROf6R8Hciq0E1AWzLVDW1mZSOejXNgsMEZhmepsqEoe+BtdKMYFaHSW1sQzND5L0ffoYoRg5ZrVY1eJ+T0C7YeYx3R9u1KRObDqapdr/nyFtwPXypiO30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344353; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GX0z7ED1fpqqEX0e3FNGIrRnTBaZqIcam5D8KFO/APw=; b=PH/9LpSNAXrqHdSKjP9bhOZYJDt4qXs+5eVVrdOKie2C7BpKl8jhav3D45TorGhObB8ahsJ7E+jSMO2N11fZc1kiEEfyZhbM5As18+705ra7ImwMRoeM7hiCc6ahxMvLNGJUxOUC04dtXivYSGye/O2uzoNXueBxKfXaQb0jcX4= 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 1733344353730849.4241358741265; Wed, 4 Dec 2024 12:32:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvyv-0002hf-39; Wed, 04 Dec 2024 15:28:21 -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 1tIvyp-0002ND-9e for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:15 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyn-0002cw-Jq for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:15 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4349e1467fbso1393715e9.1 for ; Wed, 04 Dec 2024 12:28:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0cfdsm36598115e9.33.2024.12.04.12.28.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344089; x=1733948889; darn=nongnu.org; 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=GX0z7ED1fpqqEX0e3FNGIrRnTBaZqIcam5D8KFO/APw=; b=TRTYqHQEIK04Y6ULZP4l0E5gbUgQjjF3PfhBSTltnjGYwpC/JHV4jAcApQSmXyCJCA W2zIRLb4VCipt856iw/ACgg71gUSPRwWnHC1+Tx4zFDQduIl98eO4zTbUOeazaEXemCW 4GSC/z5Sb46hTUkXyFbux52R0A9C4G8gk3Us45PaI4kpvQGIw8QJ1aK0m2PL9AYBj1pL J4MnDOsCtfS+GEk+m9/D0yx8wMazQlltqJfRMXxiFxFKKczrhCbvqAUu+XsLsTrHVWRL V6J4tFj9LWGNYLslLXxIvGiyHk9cJDPzKJ/kQgCnJh0EJhP/Tfgn4X97F0/fpA1eGWi7 SEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344089; x=1733948889; 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=GX0z7ED1fpqqEX0e3FNGIrRnTBaZqIcam5D8KFO/APw=; b=KmGuC4JZbcuWWhwwf59UaZwqa77BRgV7XNkxcSdo/Qzj7JD29xaH7J4iKpzP1Fn1j2 qhJNelo/OxsCM7oC5Hlb5/O6JnQZJZLJMLPFf2orLSWV6/T7VMyR3wo1lvMk7oaKwVzP zT0f+lE7Cc2/UXnZrMhzPB0628Roy8WrQLtZ+8x8zPvDOc4Md7WItmLlAX6kMg5JeBpz GuwZeXVcf6+0na+iJKUuv5Nospw/FiblPIZI9ECprS/+wRbgdtJuTSOZq61dznI2fq+N HNt/Q2M4NJQYOoF70EowCtT3lvPTNIF8miuIJjJNtTbL0Y7wDyibkbksDdnBqm2o98kF 2vlw== X-Gm-Message-State: AOJu0Yz5/EjUoVC6UysOrMPhSeBcGdDvI/TE9ktci9fLRCHrHnpybzgF IgPdO1/mqpZ6lCr0uocLUP0YxgHbTYs7Wn3HB//ZJ1AQZqgNyqedHpiSii6TJ2rdIdjH1dYwyaR C X-Gm-Gg: ASbGncvPH2h/HskpUMJmDGeu0dSohlHePZk5ozxnC09L4k+eraRbEvFafzFuAM6vN5G /nS/teTENSgMLuF1neXsoILJtusC0G9TJxnJ9zlB1oGcpotT+6+2TfNQPG+fLrKKRvM7bLRTVix IK7NSRM7zuYuO1qYxITBM/ZZRF5QMDaduhqggylAPliUtZkXZowu1SJxXE2WXAZEaZ4SXTTBdJC HeWaCktN6MghFPsXz6hjmEkIraA4sfmr6RJX9fI81jWmcdy7y6EN+iL8VLL+CySrpwUJ/7mZa+B Hx0+2bGuRqpxqgzC8c50gA3C X-Google-Smtp-Source: AGHT+IFQVlgKgXzi+WHSeKykqO09/qxwXPFKjgqPF3MN1t0t3YAGqhk0OGIb3lGnnbvtjy1rKap/lg== X-Received: by 2002:a05:600c:19d1:b0:434:a4a9:5d54 with SMTP id 5b1f17b1804b1-434d09bf794mr77784015e9.10.1733344089220; Wed, 04 Dec 2024 12:28:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 16/20] hw/core/cpu: Expose cpu_datapath_is_big_endian() method Date: Wed, 4 Dec 2024 21:25:58 +0100 Message-ID: <20241204202602.58083-17-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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: 1733344355867116600 All target implement their CPUClass::datapath_is_big_endian() helper, we can expose the generic cpu_datapath_is_big_endian() method. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 8 ++++++++ hw/core/cpu-common.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 91c6581f814..5c75fe3a842 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -611,6 +611,14 @@ extern __thread CPUState *current_cpu; extern bool mttcg_enabled; #define qemu_tcg_mttcg_enabled() (mttcg_enabled) =20 +/** + * cpu_datapath_is_big_endian: + * @cpu: The CPU whose state is to be inspected. + * + * Returns: %true if the CPU access data in big endian order, %false other= wise. + */ +bool cpu_datapath_is_big_endian(CPUState *cpu); + /** * cpu_paging_enabled: * @cpu: The CPU whose state is to be inspected. diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 09c79035949..92c0c4c6125 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -66,6 +66,13 @@ CPUState *cpu_create(const char *typename) return cpu; } =20 +bool cpu_datapath_is_big_endian(CPUState *cpu) +{ + CPUClass *cc =3D CPU_GET_CLASS(cpu); + + return cc->datapath_is_big_endian(cpu); +} + /* Resetting the IRQ comes from across the code base so we take the * BQL here if we need to. cpu_interrupt assumes it is held.*/ void cpu_reset_interrupt(CPUState *cpu, int mask) --=20 2.45.2 From nobody Fri Dec 19 04:38:28 2025 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=1733344275; cv=none; d=zohomail.com; s=zohoarc; b=T6rMfDB1E+1qlrrudC7G6s7G6G3PzcC48iSazjQjY3j10pYF673k+QGyy/QpSmDirGW+/AELrmaxgn7U0RKkTM0hGMYRAit7FYdY/Q1+S5mds2H11/ZUHdHBbXirkQ5t+METkhUV+YfK1QPDZvwHL9d6xf6PJWlWQpDgjIRc2H8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344275; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZYu2t8Q4K67n2tT9qceLBDjYsH4wW4eKuLgzo6hScDA=; b=G1qT7w4XxqefOTzvXbXORiNeGSr4O8R3hLIA8dbme58JzedoCZu/MWnDeSX4ElXnDaohG29DR4axiIE9iGVaqliEAf62PzGrKKgHCyBdD9TcdzhdGIGKy87+prPL/2GAmX/k2UA431H+GgNXiCkTZmrN98XkVWRyQ9at8HxiO2s= 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 1733344275285334.7446029901114; Wed, 4 Dec 2024 12:31:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvz0-0003AQ-2J; Wed, 04 Dec 2024 15:28:26 -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 1tIvyu-0002hZ-Dc for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:20 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyr-0003Af-T1 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:20 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385e1fcb0e1so94661f8f.2 for ; Wed, 04 Dec 2024 12:28:17 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d527e287sm35412065e9.12.2024.12.04.12.28.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344096; x=1733948896; darn=nongnu.org; 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=ZYu2t8Q4K67n2tT9qceLBDjYsH4wW4eKuLgzo6hScDA=; b=dYzfBRLRD0fTFjAs/fq+wBKrnGNAcuIsmmF9jx+5hXU9q1WJqKwu+BU22g+J5hz2bK wvTRrdWnfUpbFTG2A5u4fIPWDLH78sA+ILOFpplm95ziB+f6c9m4MUJ0lbaSQi3QO2hU JAXbkfqVeMHntqr95Uobu2aWWwBz2zUC1lEcpP5b7VZW4JhrdideLaZAspjQyoiG6uBq tMPahGblKgUttfwvDsR9DcejxlDwnLpPGUFANVb/HvQ6teM4/m2wpwt/P00+1flVF1cT GljokPxb88LLkfWcFLfJ1yPWyDfzWvxzkmZ1olLeRTajfv+Lq3pMuyhHcDoX4IdsA2Sp F4Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344096; x=1733948896; 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=ZYu2t8Q4K67n2tT9qceLBDjYsH4wW4eKuLgzo6hScDA=; b=f+wen5WAmiVTaxXjCTTQJadwLQ4McfiHy2c/MKZ/Ko47JItkgUedtj0sjaer7lmaXz +q9M4u/JUTJK5iZQKY6k19WxysVbSERNVt1Z+ilm7T9aqWc3LmCxgT1iNjmtPBgJveR9 nTwYRJvLFibQWtR8d+vdK3PP8KQioFYHmzagz1h67wRGjGTjoJeyomwePrs66umOmz+x 6Xq7z2gf4whjavAiFJrawmnT2ctAJPtF5GpUFdcnfAqYvzwmUvSWkmIC7s1RDrn17nAD TZXnuzHB8wVFoH4EObdqBNtj6ANUNipgrlEb6tg239zWu4Y4x65nm+XEICXxxwqVchsC coxA== X-Gm-Message-State: AOJu0Yw8sGEuBonTr7QDQOewkD27MNj8MIzVLU3iwV/paCd51e0ujDXy fip3CEb7bUC5T6gaSvHOqduYiCWYncvhkTueEHEJ9TeQUPvxZ7EO+F76I3Z6HrTy1+YJRYHhhu6 0 X-Gm-Gg: ASbGncspeikuK7QC1w1WP75wPBIGG8TSV64PhgZBd8+j47b+fhYYAGQFkFw4xvdCAZ2 ONBeeOwCE09bYOhOEqTWLY4zKbfkQewjM62Yooq1YOPyVanYYxFdFp5SOU07q+jr9ENRW/KJDi9 N3dMpruxGU/2kM7t8e5IwswEDbID10PwMXsmiklRybMQEw79+nELKKfxOPwwI6VeQQno+XksRR4 YIbKPMH/0Pyx0Z3R8jInqWBJi8K/TwIsKimpIkxXlROJibi54Wml3ajG/CheANYRnaJ1dUj6kmJ odGCZQEjDFz2XjIuGhWfZ8vb X-Google-Smtp-Source: AGHT+IF4snyZRj1x+fZto74C7GPyLBpTIZREW05o8Ez4NAPz1TUe9+xBdT4v+C8HGPWrLN9B4UYDYg== X-Received: by 2002:a05:6000:1acb:b0:385:fa2e:a354 with SMTP id ffacd0b85a97d-38607c23f80mr5121998f8f.47.1733344095986; Wed, 04 Dec 2024 12:28:15 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 17/20] disas: Use cpu_datapath_is_big_endian() Date: Wed, 4 Dec 2024 21:25:59 +0100 Message-ID: <20241204202602.58083-18-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: 1733344277393116600 Rather that using the binary endianness, use the vCPU one. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- disas/disas-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/disas/disas-common.c b/disas/disas-common.c index 7377de0715c..ef91c43449e 100644 --- a/disas/disas-common.c +++ b/disas/disas-common.c @@ -7,7 +7,6 @@ #include "disas/disas.h" #include "disas/capstone.h" #include "hw/core/cpu.h" -#include "exec/tswap.h" #include "disas-internal.h" =20 =20 @@ -61,7 +60,7 @@ void disas_initialize_debug_target(CPUDebug *s, CPUState = *cpu) =20 s->cpu =3D cpu; s->info.print_address_func =3D print_address; - if (qemu_binary_is_bigendian()) { + if (cpu_datapath_is_big_endian(cpu)) { s->info.endian =3D BFD_ENDIAN_BIG; } else { s->info.endian =3D BFD_ENDIAN_LITTLE; --=20 2.45.2 From nobody Fri Dec 19 04:38:28 2025 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=1733344343; cv=none; d=zohomail.com; s=zohoarc; b=NQBTNQlThRa/aduyMvjcSfo8pWroY72I4TYZR9avU/HaYw6HhB/NXBXmS8K+ml0JfqnBNFIoK+nQQGo3SOTy9akpGgscivk0X6ux/U8WWZQo/Ek5PQm8Xvx4AYvQmVwJEvm9yadQWXMk4Dj4IyMxHsimf3ShgXcaB5Xs7zK4Fcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344343; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+kCFZSFSFl2GPP7FnxAPq5KUTVvEzSw2EnjHpYSMwwc=; b=C9IbzBOH6XvD0Ylg4C/oYJH2K+pG1rLgSRndhL6Lektqs5+W/ZoR1D5rbxg/+K/ROZXaiBZkYm0o1INcnEqNGHUd++lqFpV12P9XAMJFTAddTeJQ4bHiDOxCTHBwqMm1QHeADL51vRUQhaoz5iKl0G9gYmEmSfpcGZL/BkxZ5ho= 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 1733344343083492.7988370337646; Wed, 4 Dec 2024 12:32:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvzW-0004NE-VH; Wed, 04 Dec 2024 15:28:59 -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 1tIvyz-0003BE-Re for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:25 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvyx-0003Ur-41 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:25 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-434ab114753so1474975e9.0 for ; Wed, 04 Dec 2024 12:28:22 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d526b375sm36220955e9.9.2024.12.04.12.28.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344101; x=1733948901; darn=nongnu.org; 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=+kCFZSFSFl2GPP7FnxAPq5KUTVvEzSw2EnjHpYSMwwc=; b=PTM+th+lByViOglR4dEWHAsKgVxSUueLcvOeIDvXbWY/hBirkZpWJ1wVQq379hpKbo 4nxiSau9O0FOUN/WW5X14hI/zFEvUlHc77ORhJAdkrxfd0zr3bmlykv2C8JgooYyJnyG LWc8DXjyYigwQ7RuXmbk+CDLBiBb2O93pWnPZmpCVFNH0g0gtsu2s+ADdF71Vp3dC7vf ZvH1MO5DAlg1Tc3MaGmtrSg74qDEhVDcwWeSzvnXlYX4LC8EXG+LF/Bzd8PD0m1cHLgh r2dfqhh+QI0SXOncQGKSk4tcEz2k4Y1y7XRsYDgC9cDm9jRvkEFHijZRx7XNfxN0Gjnh 85Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344101; x=1733948901; 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=+kCFZSFSFl2GPP7FnxAPq5KUTVvEzSw2EnjHpYSMwwc=; b=U4iIUF8hy2SjUexU1l/oKShqCirN+tCW0cUShx9HhoIZGpvNshZSn5Ncwg6lg2QpAm tamZuVaQP43Xjtg+WtG/sW1CSgkFYpnvc3pS+plzr+4D3ZZM3wU3WiGzVinyvUVZHhKL Kqz8sz1pDKy7DOms/PreGmWleZjplOu2Fd2ypT6dKfi0Rb/szTpeXfdyuL1XZ3gV+Nvv gZ0XLMXrQY4wwImsxcg4N1/HCaqE3L0zd676UBWKCI16gZDzA86Os1Qg4XBfZxG2mRa5 JGpvmKhAMYw2MhML1Hf2U3JuUfhC/6SF1QljBxOszC8D7KVQyxnDKjz8hZa6HRd6n3xM vFGw== X-Gm-Message-State: AOJu0YwEY/cLvVXYQ1q6mLKKkSIbhXi9ZukOrTE1hhM5eocW/+bhh4iP MeqGe6mXhBisNmlhVSJcyo2TvcXD8TGYk9gN4A9vymav27H+xgG0pQgB9s+PjVz5oYKzFsaB2am J X-Gm-Gg: ASbGncvQtuh7sorJV2fAgHDoczeQNd2mk1Gv97qJ6wISF8YJfjGIfzDKPV9NenPRwIU sOC5s7K7GJkV63BVIG38ek7AozgrVMFQwGR+4/MZrrwl9RXrnhDmtAlNhkJYZlvFPAwFaNXMoa5 IpM3qQ1uCS4PzjsVoV97+AemRHZLADpRUs51BKLWZFnykdPC1pdw7T29Ycr+PcuS7F4+W2K4BPC 2oFV81g6oRke8eKO8OPW1GlhYzLcX1UiWmx3K+L7ysEI7OjjQaN9PmqQhGxRfcLy03mLgRlDmJ7 BgPi/E12giJ7uGHZql9AFyud X-Google-Smtp-Source: AGHT+IEwlcXEYWoNFtl7tKT/Gy5FK8B2HE1HWe0k/S+rt7y9oWPFjlOgO3uZdR7sqNHOrOJdTTGk0w== X-Received: by 2002:a05:600c:4e8a:b0:426:616e:db8d with SMTP id 5b1f17b1804b1-434d09c8d82mr70145375e9.15.1733344101212; Wed, 04 Dec 2024 12:28:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 18/20] hw/core/generic-loader: Use cpu_datapath_is_big_endian() Date: Wed, 4 Dec 2024 21:26:00 +0100 Message-ID: <20241204202602.58083-19-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: 1733344343808116600 Rather that using the binary endianness, use the vCPU one. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/generic-loader.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index abdd4c08a38..7b3b5f06565 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -31,7 +31,6 @@ */ =20 #include "qemu/osdep.h" -#include "exec/tswap.h" #include "sysemu/dma.h" #include "sysemu/reset.h" #include "hw/boards.h" @@ -66,7 +65,6 @@ static void generic_loader_realize(DeviceState *dev, Erro= r **errp) { GenericLoaderState *s =3D GENERIC_LOADER(dev); hwaddr entry; - int big_endian; ssize_t size =3D 0; =20 s->set_pc =3D false; @@ -134,14 +132,13 @@ static void generic_loader_realize(DeviceState *dev, = Error **errp) s->cpu =3D first_cpu; } =20 - big_endian =3D qemu_binary_is_bigendian(); - if (s->file) { AddressSpace *as =3D s->cpu ? s->cpu->as : NULL; =20 if (!s->force_raw) { size =3D load_elf_as(s->file, NULL, NULL, NULL, &entry, NULL, = NULL, - NULL, big_endian, 0, 0, 0, as); + NULL, cpu_datapath_is_big_endian(s->cpu), + 0, 0, 0, as); =20 if (size < 0) { size =3D load_uimage_as(s->file, &entry, NULL, NULL, NULL,= NULL, --=20 2.45.2 From nobody Fri Dec 19 04:38:28 2025 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=1733344306; cv=none; d=zohomail.com; s=zohoarc; b=HWgv4OnsP29E2Xp37fpBUMhikgWVgBdrRftvEQukGLPNK/ll5fp8w85iL9D/CaZ4esloz//l8mEX5Kp88g5HrSsrje6VXm4aFg3nDGxoX4zimtPKqOUjCe46EHP7TjfMEGxl2UMN3d7o1OzwjD/tzjjkBd490TVfTNebzGnTxqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344306; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iGN5RJQrSmW9JWKBkRR1K+I3aJFNDNbHIDvyy4lFcWM=; b=XyCIoC4o90VB5zplZiBbF3QgpVIAJq+nmFYaeLFgLJzy5uTZD8sMwL3FzbMelxOeCEdqvrt5KzxTqkHryQPDLk0e6Acc9czZqRd8YzND4TjNDwBKGINVGODELeEg6SNRNoVGYmMbu7XnoHvOzj8tz6iJnXodZkiwLFyPMII7Q0w= 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 17333443067861009.1323897564538; Wed, 4 Dec 2024 12:31:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvzI-00049E-Aw; Wed, 04 Dec 2024 15:28:47 -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 1tIvz7-0003qt-MF for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:34 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIvz2-0003ZX-7V for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:30 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-385deda28b3so175831f8f.0 for ; Wed, 04 Dec 2024 12:28:27 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385dece67dasm16908928f8f.8.2024.12.04.12.28.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344106; x=1733948906; darn=nongnu.org; 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=iGN5RJQrSmW9JWKBkRR1K+I3aJFNDNbHIDvyy4lFcWM=; b=pIzrglZtozpJ2fOjAucVrt1WNYVu1lkujLAVwDF4TKcKB5HvtkAoqdntFkQEFMz8oB 6rrXrlcJtk2/RrszW0SVrlGYNzobwt5bcVIiAP28UcUjNf/DBVR7Avf3yZQ/JZGwQit5 hKRX/dadRY+n9tGznFnEhkX09c9LKYL6IL2DaErjc3AP96+mQV7iaclst+BDp2yvwb7Q reLWl8BIq/+tbHamWqCFvVCEljlFx3asiU9bzO3k0CIjYmWz+iMyP0ygtnr7kIf8o4bE 1betJPtga88SYQ+9p3o529wHoj/AHoNy/8jHYw19igkHqjTCaRJpcljKpT9VFWEsP9qD JvFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344106; x=1733948906; 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=iGN5RJQrSmW9JWKBkRR1K+I3aJFNDNbHIDvyy4lFcWM=; b=WIa3PQr5XP3e/8I/P3Tz46CiqJHSbeB+F6WRjUEpWjyLmZ9/BZZq+gTanGv5ND1p4x /Y7C3HtaXhTxcmtIdB+vDChXM1gFWbPRoGwmRQM9zO1qsDglIB/MVUluO3xgO7dpGrqP rvNKNi8Niqd5msdRfjjGyg8ounznX2SiKG/JUiKPctf1DFCq7PLVSkx5pBlykPvyAJLt vIaJKsA9tCJO86G9jrZ2STxY08SvM49XA3e6yfQdghs89CMx5dzCWf7bLF25AplnKW7Q 29TkiYTkekbAnf1fo/yglBTRNtdjjJbMpHeM3yuH4zUfMDbrWgDygeARx1u6Pf+blo+B fUig== X-Gm-Message-State: AOJu0Yybgpi2yyKvJJSw28PCvjbjxoiTXZOxSf3O16X/j2rXACqCYMin IQ6gz/VJOOCSJvY7frSJZ4K8hKOc8/PskZpTEswxyiDMRHwIo+YSNyH7JM3C36V0AqINPlgqY29 6 X-Gm-Gg: ASbGncuzSzz0QWcNdLRDUhLJMc7AuHLJ3H4oyvxarDthc3umVVRur35vPGHlLbr+kh0 zKr3A+QBtUoUWLu60/UZCXDCIFk12eKYSw5wwn1aKoH41kD6x/iqy3CpfZECQEEMx5d5tXlIXbC pFit2DEK1+Js+6wy1L1Z+0azjCZ5eTv1ggTPsGu1G7IIKKA6HDohutn9jl9IApPFCnSsyRJD4gB ImR7xzMXTWZSbZg2cWJsP9bYnmht+CHId4OkFCynXz5oYlIDP68sgdj66yBAGYz1puWkI78kgtw cF1x5OQwZ1ir2X5j2Jo2W4ek X-Google-Smtp-Source: AGHT+IH/S3fZHlZzX/kr27toW1RLb1QXyLYo9TNenewW3f4YqXZzcSdz11tH2a+Z9U2wX82Jhc7Nkg== X-Received: by 2002:a05:6000:1a87:b0:385:e4a7:df0a with SMTP id ffacd0b85a97d-385fd436393mr5816550f8f.54.1733344106323; Wed, 04 Dec 2024 12:28:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 19/20] hw/virtio: Use cpu_datapath_is_big_endian() Date: Wed, 4 Dec 2024 21:26:01 +0100 Message-ID: <20241204202602.58083-20-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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: 1733344307621116600 Rather that using the binary endianness, use the vCPU one. The target affected by this change are MIPS, MicroBlaze, SH-4 and Xtensa. SPARC, RISC-V and RX could be affected later if their CPUClass::datapath_is_big_endian() handler is fully implemented. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index b3dede476ed..c57845a16db 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2257,7 +2257,7 @@ static enum virtio_device_endian virtio_default_endia= n(void) =20 static enum virtio_device_endian virtio_current_cpu_endian(void) { - if (cpu_virtio_is_big_endian(current_cpu)) { + if (cpu_datapath_is_big_endian(current_cpu)) { return VIRTIO_DEVICE_ENDIAN_BIG; } else { return VIRTIO_DEVICE_ENDIAN_LITTLE; --=20 2.45.2 From nobody Fri Dec 19 04:38:28 2025 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=1733344282; cv=none; d=zohomail.com; s=zohoarc; b=a14m8iMCdujdnnW70oj1J0I5sxxpewzwkR715dF1BL0j8WCbjQlZWGdP/O790E9dvW8/2/wVp+ZJqwiRr59kJ0Ggi4JxLlEWtWLeZhfKc831HdrU2Sbgn8rH8KsUYBV8iKeLXpFmJvnSCyvIWjvcSXEMv7W0ZjhRHp7WYMHCrgg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733344282; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9cBEMnN1TXHS4bt02AxYmkT0i+FxThQSvcImr5g6Wp4=; b=OrOZ7brtzloEWRNTj8MoiMCAdXaPRUv3YwZpnjn4+9UQLiw8JExwmbIlPAMB+jNdlYXTXh2qQsojGYLUy1z6kQaNnQsfatJcCbgeIBmq6EpH+2K4yH8sQlUKkl4dKeEuACaEEWlX62un4ayRmWY9Ppxwn/aEH26NJyzhIZuJZAs= 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 1733344282787990.1439976225994; Wed, 4 Dec 2024 12:31:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIvzY-0004Xw-9U; Wed, 04 Dec 2024 15:29:02 -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 1tIvzA-000454-F4 for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:36 -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 1tIvz7-0003aX-GA for qemu-devel@nongnu.org; Wed, 04 Dec 2024 15:28:36 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-434a8b94fb5so1437235e9.0 for ; Wed, 04 Dec 2024 12:28:32 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d527252bsm36373915e9.2.2024.12.04.12.28.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Dec 2024 12:28:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733344111; x=1733948911; darn=nongnu.org; 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=9cBEMnN1TXHS4bt02AxYmkT0i+FxThQSvcImr5g6Wp4=; b=B2fGai38bUK9ei9o/LTCXZjWHaxGueoxQg66TYG+pnCxwED/Jpjf+C2Z3xKtsd7cOA KDjXUgaxx/IIdh+RLpqs9eZ6IH9fYZIXPYxHxcqPiC2gQ4B5/tHmJ/ITrwbMU8GscAtZ Z9zcNNRk8Hri/Mj8+CNz+ikCJYdZV+mGtFWY4imOG+n30a9x01isr0p/oFeR5OVGpGHB 1m5WS0JpY4z5/IjRytt2YoTT3TbMBBK/KBKkKNpG0rpYwOtLFKbAlZPPcYZawNtRtBJ8 EZgBtR/ID4TpJn83+3U4hg5qic8fNflpQ+gfSDFfHF+luH9w6pyY2/YkE0v9U0oqX9R9 yEnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733344111; x=1733948911; 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=9cBEMnN1TXHS4bt02AxYmkT0i+FxThQSvcImr5g6Wp4=; b=Dbddkf1ufvppFkFSa3neRiYHD1ZigfmJoL0hLo5vCaWbTOnEWjce+BRnLJP+Q4Gqxa OrBMiUNWjBZBSObW4+K36LP6p4gS13i85Nr7s7i57T+ARyCAMVNtoxiaT3zJMkHA69sl hztrL3hjCTaYfMPiXHzCnoPJrSIv09ShIJt2EssC9QgqoGTpt8SPa2NKkcHRsFvxdBg0 SvSlJzzTRvLohQ2lv6sRZWcibi9yB7pXx5H08fpN2aFCVhsoOv5qJ3ulGqz8ILkjNZJx n7vvu1tQ5u9NnDAkcq0in8ci49iXl3oXEzPNknz6rrgFrcqwkwBrtikUuUYN6ZCCoKoa SflA== X-Gm-Message-State: AOJu0YwR7sApB/8kYkbTQVxXgcYXVyGpKQuM7O4WTTa/0+3qnMheL9A2 bCdEO+Qi61vNLPamf3kb4gd127R/CYAfKgceuQWBJYKJr7Ge/ymkKaDkQIxNMunkVAwoO/J8CWi J X-Gm-Gg: ASbGnctcOeGNgIl5bhz0Xq7qiMv/cSKntVqAOnUhJowU4tk21+MpvPKDQReMPm9zFwz u1o6Ql3o2zVz5I6Y8Xw1t1UYJmKdeYCNIQjXvDf0B8jyG1Jiq6OP07hJ3fQNnMkkwr7/TphB7JJ yt2HTpvV8LVRB4FMz/95lsdvx0CPFk094SMUHBLqMhv1Gu9IedAuInfurvmLyYneeCAgIl35M8A k8ALX4BeeVIZXYCLNTqCIaUFaxr/VxCoGjvlqwpIGvCdiIXcF6Ch903YawkN66jOGNz5GVd2dtJ BEJdjIZkCNrVFv8hL2BIOrW8 X-Google-Smtp-Source: AGHT+IHGWG2XfrE5hUpZ7ULVvlqpIFSiR/ooFWD28XqCbbY4PtNRrd8I3XJJTwLLCVn1frQOSzVPFA== X-Received: by 2002:a05:600c:511b:b0:433:c463:62d7 with SMTP id 5b1f17b1804b1-434d927b5bemr5211385e9.4.1733344111609; Wed, 04 Dec 2024 12:28:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , "Michael S. Tsirkin" , Peter Maydell , Laurent Vivier , Mark Cave-Ayland , Alistair Francis , Anton Johansson , Zhao Liu , "Edgar E. Iglesias" , David Hildenbrand , qemu-s390x@nongnu.org, Max Filippov , Paolo Bonzini , Nicholas Piggin , qemu-arm@nongnu.org, Thomas Huth , qemu-riscv@nongnu.org, Alistair Francis , qemu-ppc@nongnu.org, Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 20/20] hw/core/cpu: Remove cpu_virtio_is_big_endian() Date: Wed, 4 Dec 2024 21:26:02 +0100 Message-ID: <20241204202602.58083-21-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241204202602.58083-1-philmd@linaro.org> References: <20241204202602.58083-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: 1733344283645116600 There are no more calls to cpu_virtio_is_big_endian(). Remove the method and the SysemuCPUOps::virtio_is_big_endian helpers altogether. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 9 --------- include/hw/core/sysemu-cpu-ops.h | 8 -------- hw/core/cpu-sysemu.c | 11 ----------- target/arm/cpu.c | 1 - target/ppc/cpu_init.c | 1 - 5 files changed, 30 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5c75fe3a842..21b49800f52 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -752,15 +752,6 @@ hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr ad= dr); */ int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs); =20 -/** - * cpu_virtio_is_big_endian: - * @cpu: CPU - - * Returns %true if a CPU which supports runtime configurable endianness - * is currently big-endian. - */ -bool cpu_virtio_is_big_endian(CPUState *cpu); - #endif /* !CONFIG_USER_ONLY */ =20 /** diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 24d003fe041..9806a2b7ecb 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -72,14 +72,6 @@ typedef struct SysemuCPUOps { */ int (*write_elf64_qemunote)(WriteCoreDumpFunction f, CPUState *cpu, DumpState *s); - /** - * @virtio_is_big_endian: Callback to return %true if a CPU which supp= orts - * runtime configurable endianness is currently big-endian. - * Non-configurable CPUs can use the default implementation of this me= thod. - * This method should not be used by any callers other than the pre-1.0 - * virtio devices. - */ - bool (*virtio_is_big_endian)(CPUState *cpu); =20 /** * @legacy_vmsd: Legacy state for migration. diff --git a/hw/core/cpu-sysemu.c b/hw/core/cpu-sysemu.c index 4b85face02b..458dde692ec 100644 --- a/hw/core/cpu-sysemu.c +++ b/hw/core/cpu-sysemu.c @@ -20,7 +20,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "exec/tswap.h" #include "hw/core/sysemu-cpu-ops.h" =20 bool cpu_paging_enabled(const CPUState *cpu) @@ -122,16 +121,6 @@ int cpu_write_elf64_note(WriteCoreDumpFunction f, CPUS= tate *cpu, return (*cc->sysemu_ops->write_elf64_note)(f, cpu, cpuid, opaque); } =20 -bool cpu_virtio_is_big_endian(CPUState *cpu) -{ - CPUClass *cc =3D CPU_GET_CLASS(cpu); - - if (cc->sysemu_ops->virtio_is_big_endian) { - return cc->sysemu_ops->virtio_is_big_endian(cpu); - } - return qemu_binary_is_bigendian(); -} - GuestPanicInformation *cpu_get_crash_info(CPUState *cpu) { CPUClass *cc =3D CPU_GET_CLASS(cpu); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 3061b2ac18c..0df6408ee73 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2664,7 +2664,6 @@ static const struct SysemuCPUOps arm_sysemu_ops =3D { .asidx_from_attrs =3D arm_asidx_from_attrs, .write_elf32_note =3D arm_cpu_write_elf32_note, .write_elf64_note =3D arm_cpu_write_elf64_note, - .virtio_is_big_endian =3D arm_cpu_datapath_is_big_endian, .legacy_vmsd =3D &vmstate_arm_cpu, }; #endif diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 9650acb4850..be0eea2ff2e 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7407,7 +7407,6 @@ static const struct SysemuCPUOps ppc_sysemu_ops =3D { .get_phys_page_debug =3D ppc_cpu_get_phys_page_debug, .write_elf32_note =3D ppc32_cpu_write_elf32_note, .write_elf64_note =3D ppc64_cpu_write_elf64_note, - .virtio_is_big_endian =3D ppc_cpu_datapath_is_big_endian, .legacy_vmsd =3D &vmstate_ppc_cpu, }; #endif --=20 2.45.2