From nobody Mon Mar 2 11:03:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@rwth-aachen.de; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1772196987; cv=none; d=zohomail.com; s=zohoarc; b=jGR8FABuypufU7bQvyo/ENXpvrQrqACJxr/bF8Cc2z7EUDFph7YhxtmClfOA0YAyeYrxu4SAsrn7MBzgG4bImBjuxQ3lnUjJEkgpWkhj2xg4qlNKQmiNkChN9d9ew+A11XWUsSw+Jz+CZTbGcb10IF/9KU+KR1w+0qSBnsSkLL8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772196987; 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:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=qBR+FYi6HgFyJ/x6sux5DIGcQp0mcyczsh3kcKmnYcY=; b=BBVSToRTGjhwF+NdmLunH6x2k7gEs09zlnT5tGhZanWrECMf7CSUrlqFYO48+iOSjhy3zcXCzjwmcWid7mrLn9pUDxxDdYglICt2QKJVH7RkAVuegLdoitjtoNThE59rerCfPncpbsgbh98LWNswXq6BrkYR4NQg23FX1dZDzJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@rwth-aachen.de; 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 1772196987591672.0649447403249; Fri, 27 Feb 2026 04:56:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vvxNn-0001hS-EV; Fri, 27 Feb 2026 07:55:51 -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 1vvxNk-0001h4-UC for qemu-devel@nongnu.org; Fri, 27 Feb 2026 07:55:48 -0500 Received: from mail-out-2a.itc.rwth-aachen.de ([2a00:8a60:1:e501::5:45]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vvxNi-0002pd-Kx for qemu-devel@nongnu.org; Fri, 27 Feb 2026 07:55:48 -0500 Received: from rwthex-s2-a.rwth-ad.de ([134.130.26.154]) by mail-in-2a.itc.rwth-aachen.de with ESMTP; 27 Feb 2026 13:55:40 +0100 Received: from mkroening-air.local (134.99.235.10) by rwthex-s2-a.rwth-ad.de (2a00:8a60:1:e500::26:154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 27 Feb 2026 13:55:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rwth-aachen.de; i=@rwth-aachen.de; q=dns/txt; s=20240516-RWTH; t=1772196946; x=1803732946; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=AMtj2m8SFP9tKZDf3hfhp7mknmV7iDCsUsY+oYzTsx0=; b=l7CqAdaoBmuHTZpQC4acCh2IcHBDRcqvk1SJmxFOuqjwhheGQGiFoVPv 9E18rWl+RKFgPDIPbFHI7IGLhma6BTp2MKU00bPDupP1NYq9E614rNkkH py/1/LBUHbqXGrnW2jF+atjqmnmjZKeFecVKIErpd+dZsN81qSCXKEH4j VFet0pnhucx84PLDbjcdkby0G0KS0sW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5RokFuS+mb/9dEAQKpaKVeRZoiMLM0QKqkEqSh0ais7XBtJFAatko2nhc+RK9 Tl4ncfYpTEBY/eQwrRNC3G0JAklVUFO0OevzXFSKqV/xWWeG5fn660G4E3boeT0984vaVyi+ 8D0JxhTUwKR2uS14YixQ+JJup4cMsnTGNg27yQIITHxVZ7KQLjZXLnK6M8dx211j4ZUAureI sMVLzZiBPjCS0QUZhFOU8p4xrnu3ySjG9FbgAv9Sa4f5mHJ0A13lrv3N9fTe9qFbchSmEuCr STc4Hj5RxgTP9ySz3yJ/xpAg8eWwnylANxDTezQGvhChX/I3GsUNz4sTXyXjsCepnfgWdZzN BlBksYphe1onKCxdfHlXxy8pXKsuh8aUsBXVeog52ml0qfI7hzfA2EVQjNFbPQitck/Xzts0 UWG9/vwCDly9bGYV3+Z3rGTqzy0JG4SN2BqTSYAQBtD6dTlpow+phbOSN95F+iylNKdJN3r6 yqVsCgzl/AI14sCkb+k4VCCij7qqpWhohMJ2zg7l1mNtmtRDLNJraT0gbQHxZ6s9Lqkc2Q= IronPort-HdrOrdr: A9a23:nH/Snq1AWl1xZcZuoj4b7gqjBIMkLtp133Aq2lEZdPRUGvbo8/ xG+8576faUslgssR4b9OxoVJPrfZqYz+8W3WBzB9iftWvd2FdARbsKheDfKn/bak7DH4ZmpM FdmsNFZOEYY2IK6PoTt2KDYq4dKaG8gceVbLDlvg5QcT0= X-Talos-CUID: 9a23:67m1EWPn3pIwme5DBhR15hMSGeEfeHTW6UuKHFG4MUIyYejA X-Talos-MUID: 9a23:uY447Qri/eD6SedhUtoezzRAb91v5JuNMlgqvbo/nOW9ay50FyjI2Q== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.21,314,1763420400"; d="scan'208";a="177606919" Date: Fri, 27 Feb 2026 13:54:30 +0100 Subject: [PATCH v2 1/3] include/hw/core: Rename virtio_is_big_endian to internal_is_big_endian MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260227-semihosting-cpu-tswap-v2-1-cbdcdf39dd15@eonerc.rwth-aachen.de> References: <20260227-semihosting-cpu-tswap-v2-0-cbdcdf39dd15@eonerc.rwth-aachen.de> In-Reply-To: <20260227-semihosting-cpu-tswap-v2-0-cbdcdf39dd15@eonerc.rwth-aachen.de> To: CC: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , =?utf-8?q?Martin_Kr=C3=B6ning?= X-Mailer: b4 0.14.3 X-Originating-IP: [134.99.235.10] X-ClientProxiedBy: rwthex-s1-a.rwth-ad.de (2a00:8a60:1:e500::26:152) To rwthex-s2-a.rwth-ad.de (2a00:8a60:1:e500::26:154) 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:8a60:1:e501::5:45; envelope-from=martin.kroening@eonerc.rwth-aachen.de; helo=mail-out-2a.itc.rwth-aachen.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: =?utf-8?q?Martin_Kr=C3=B6ning?= From: =?utf-8?q?Martin_Kr=C3=B6ning?= via qemu development Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1772196991416158500 These functions are needed to do semihosting on CPUs that support runtime-configurable endiannes. This commit renames them and allows using them for semihosting, but makes sure to signal that these functions should not be used in other circumstances. Signed-off-by: Martin Kr=C3=B6ning --- hw/core/cpu-system.c | 6 +++--- hw/virtio/virtio.c | 2 +- include/hw/core/cpu.h | 4 ++-- include/hw/core/sysemu-cpu-ops.h | 6 +++--- target/arm/cpu.c | 4 ++-- target/ppc/cpu_init.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 4a91c3e8ec..273b9b7c22 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -127,10 +127,10 @@ int cpu_write_elf64_note(WriteCoreDumpFunction f, CPU= State *cpu, return (*cpu->cc->sysemu_ops->write_elf64_note)(f, cpu, cpuid, opaque); } =20 -bool cpu_virtio_is_big_endian(CPUState *cpu) +bool cpu_internal_is_big_endian(CPUState *cpu) { - if (cpu->cc->sysemu_ops->virtio_is_big_endian) { - return cpu->cc->sysemu_ops->virtio_is_big_endian(cpu); + if (cpu->cc->sysemu_ops->internal_is_big_endian) { + return cpu->cc->sysemu_ops->internal_is_big_endian(cpu); } return target_big_endian(); } diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e9d5532952..f6454971ab 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2317,7 +2317,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_internal_is_big_endian(current_cpu)) { return VIRTIO_DEVICE_ENDIAN_BIG; } else { return VIRTIO_DEVICE_ENDIAN_LITTLE; diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 7d2f4459d2..04e1f970ca 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -782,13 +782,13 @@ hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr a= ddr); int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs); =20 /** - * cpu_virtio_is_big_endian: + * cpu_internal_is_big_endian: * @cpu: CPU =20 * Returns %true if a CPU which supports runtime configurable endianness * is currently big-endian. */ -bool cpu_virtio_is_big_endian(CPUState *cpu); +bool cpu_internal_is_big_endian(CPUState *cpu); =20 /** * cpu_has_work: diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 877892373f..7b2d2d2610 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -77,13 +77,13 @@ 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 + * @internal_is_big_endian: Callback to return %true if a CPU which su= pports * 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. + * virtio devices and the semihosting interface. */ - bool (*virtio_is_big_endian)(CPUState *cpu); + bool (*internal_is_big_endian)(CPUState *cpu); =20 /** * @legacy_vmsd: Legacy state for migration. diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 7e3e84b4bb..98d09ac065 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -756,7 +756,7 @@ static void arm_cpu_set_irq(void *opaque, int irq, int = level) } } =20 -static bool arm_cpu_virtio_is_big_endian(CPUState *cs) +static bool arm_cpu_internal_is_big_endian(CPUState *cs) { ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; @@ -2299,7 +2299,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, + .internal_is_big_endian =3D arm_cpu_internal_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 3d932a5642..191f5726f6 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7480,7 +7480,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, + .internal_is_big_endian =3D ppc_cpu_is_big_endian, .legacy_vmsd =3D &vmstate_ppc_cpu, }; #endif --=20 Git-155)