From patchwork Mon Jan 27 11:54:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 860254 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp1976421wrq; Mon, 27 Jan 2025 03:56:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUJwHBbtB92tQL/crA1ymrwcSQF2OctralTJdANQ0msYx6zCQCI74e52Z9Wv51dO6o9AsNy9g==@linaro.org X-Google-Smtp-Source: AGHT+IE4Ztv8do0pobg/kKwKp9Z2R/BWFIbw7+6souJkpemIZth420wlx42HWJLB8eL222qZLgch X-Received: by 2002:a05:6214:c8b:b0:6d8:a8e1:b57b with SMTP id 6a1803df08f44-6e1b220c591mr622589286d6.36.1737979000424; Mon, 27 Jan 2025 03:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737979000; cv=none; d=google.com; s=arc-20240605; b=he8tEWg09/UJVjBpJRIuW5D/cLOGVSAnx97+kLKFjr9uYKrJYTeSox+xlr2xEwTprS WKUc1Y2ip2GqcymrzcJ9GvrxHGnuq9I24ajSbVB56nBO4Hav2e/6AWNUH9WpKMTU5V+V dR+4SAZm2kHOtgyjd4zGvvm+YDZ0G5KarFOaagBZUFMMk+9bw5BwqzSLqPtRe4dxYex+ RXL2gw0pVIJ7G54Dxk1r1yWQbSWHmt4llldcTGJciBYZ8z90zy/meia1/wYi5TeFyrlC DWYvTw7zeNn5jnFNl/sBXbjRO4X3Lt7S/6nNN4KlfcLEB9+W7gzr8yisXyz/gq1jNn7j RW0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H4U+Bby0D2aGRLyzE2lLHHXc/1St8N4BxVIFjrIyGIc=; fh=UT36gCECAOtEsgOrSReymFda56t2Gj969DHeMwsi3As=; b=GhCB9kqaEwuHrNnjFYEefcx1RFkm/uD7GQ2O/oLA3CO5e9AWPXMxOdEWoL5FokFIJ5 TqXMojzMVLoAHE54vrhneGWH1kEd7cC8x6lJdXZmxT1u4zEyy84SOcsaGSXPRpSRMT1C pFhuue9faGbcBBVWJ5IYL4+SfCvKqogYvPmOXMV2fPxl0xBLnouCq9V2g5lvrvcpp9EL +PP968gVrbqYZv5fW7KNAWL6rrMWGx7D5121QIyOLLtZ7oKDwNP4htu8oBJZw0JXNbxF P4WriH9B0t1Axac7VeY4+mPJhE4DCJbgcPexP0BWFk2PGkPG8x5XYU5YBbXgYl4RrqLC ASCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rp0YXDrj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e205f0243dsi94146336d6.331.2025.01.27.03.56.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jan 2025 03:56:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rp0YXDrj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNhV-0006P6-J5; Mon, 27 Jan 2025 06:54: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 1tcNhU-0006OO-4h for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:44 -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 1tcNhR-0006rB-2u for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:43 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43635796b48so27492365e9.0 for ; Mon, 27 Jan 2025 03:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978878; x=1738583678; 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=H4U+Bby0D2aGRLyzE2lLHHXc/1St8N4BxVIFjrIyGIc=; b=rp0YXDrjA195qfunesIyzkSDjlV+dPgW5A77jn+DhpWGEidDti9y8XxEKq/jjORms+ HzKRTRxG0j4/WMatn+qg6eIjv9xlxIur9x481eiMYJQmWPQzn1SRgVBgTNYOsTWwzy4T Dn3etz7MxWRHHueHOeou3fKrlYTcO9nvE80GpgqDyX868O0lJMdihNv8MQxCLvJVoj4w r802cQo4namWeQmim6z7yYdza9zWoTu/4XTEtosC5OrUvGSOpwJc1CYWLqhgO5sbW4bA 9pNW+BPwYolWgLDohegdKTmwOOmYqWlXH0LKUqMrjAMaMK07mtqSu2iTcoakqNP5q9dk Biqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978878; x=1738583678; 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=H4U+Bby0D2aGRLyzE2lLHHXc/1St8N4BxVIFjrIyGIc=; b=WxvXb4bENott593djYTVO0JxLxgsgXA9ru3zkSW06ZlPNiWWnpTo6KFGGVr1RXTJmi Fa2Hn3uebgOcEZp+m5vtRcoj7S2O9tnCAmnKKuznLVrCwj+21LhoGx4JKuowGISB5vt6 7ZImh1nk0zK94GjHX0FrCsyGp5Inc6RtiZV5UCOlqrAEN/iaK4+K0F5j1AqJx2X9vQ+q 1ThELB8IAn90NA9s+o9NmaCSVb5ns0AvSfoSBCOK9qARsrOtbju3c9xJFt0FZXBS8qSo dT0jKoKOw/oM5/FjeG04ZxPybSPm6/3BExDVHibamPXnN2cwKMV7g3QUgB+v92Jjjm8r UhfA== X-Gm-Message-State: AOJu0YzWko6HOKZ0AxWbN946OG6yVykbW0PfMbqXiL7WLyJ+AZ2E4Xbh CfK9RUDSlyG9P+6iXyBYlD8QtuPOpcJa9sGjZyhV26MpDEDS3K/x+y4qaxKlM2jyNH8fec+VG0p zgmY= X-Gm-Gg: ASbGncvdJzosDeRHINKc1ABN+ILI9SqC46FafrqivCLY+EIpnIfE+84gEjNICjC0c/m tqYwi8267ey4vhb4GdYvCxGYhrwM/txA9XLpMTkgQbW5+XmCJuVG421MstegLxE0Rjs/eTIOwN2 iaEswZ1IVqgriI3f2LMXvhc52s54Qn/o8oigFALUFcb5kHa2pvUlvultXzDQOaA2Hdw8OmGBjEI t5PezMK1IZNmNiSklvc2L8HjO1eLEJ7z7FVp+VSxpX5auUr0e3S+w1g9kebYZrFi8aGg12UStk1 RPsm0llSSihmeca5enzFhFbLSOj3EzmPQ2Vi246R9R++r5cn9aopvIw= X-Received: by 2002:a05:600c:6d46:b0:434:92f8:54a8 with SMTP id 5b1f17b1804b1-438bcfd440dmr102138005e9.0.1737978878022; Mon, 27 Jan 2025 03:54:38 -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-438bd54c098sm131475935e9.31.2025.01.27.03.54.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:54:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Peter Maydell , Richard Henderson , Thomas Huth , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH 02/10] target: Set disassemble_info::endian value for big-endian targets Date: Mon, 27 Jan 2025 12:54:18 +0100 Message-ID: <20250127115426.51355-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250127115426.51355-1-philmd@linaro.org> References: <20250127115426.51355-1-philmd@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field for big-endian targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/hppa/cpu.c | 1 + target/m68k/cpu.c | 1 + target/openrisc/cpu.c | 1 + target/s390x/cpu.c | 1 + target/sparc/cpu.c | 1 + 5 files changed, 5 insertions(+) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index f2441d4d7fb..1bc5cd746ec 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -144,6 +144,7 @@ static int hppa_cpu_mmu_index(CPUState *cs, bool ifetch) static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) { info->mach = bfd_mach_hppa20; + info->endian = BFD_ENDIAN_BIG; info->print_insn = print_insn_hppa; } diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 5eac4a38c62..ff167aaea71 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -122,6 +122,7 @@ static void m68k_cpu_reset_hold(Object *obj, ResetType type) static void m68k_cpu_disas_set_info(CPUState *s, disassemble_info *info) { info->print_insn = print_insn_m68k; + info->endian = BFD_ENDIAN_BIG; info->mach = 0; } diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 0669ba2fd10..b81179bbbaa 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -83,6 +83,7 @@ static int openrisc_cpu_mmu_index(CPUState *cs, bool ifetch) static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info) { + info->endian = BFD_ENDIAN_BIG; info->print_insn = print_insn_or1k; } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 3bea014f9ee..972d265478d 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -243,6 +243,7 @@ static void s390_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { info->mach = bfd_mach_s390_64; info->cap_arch = CS_ARCH_SYSZ; + info->endian = BFD_ENDIAN_BIG; info->cap_insn_unit = 2; info->cap_insn_split = 6; } diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index e3b46137178..9fd222e4c82 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -106,6 +106,7 @@ static bool sparc_cpu_exec_interrupt(CPUState *cs, int interrupt_request) static void cpu_sparc_disas_set_info(CPUState *cpu, disassemble_info *info) { info->print_insn = print_insn_sparc; + info->endian = BFD_ENDIAN_BIG; #ifdef TARGET_SPARC64 info->mach = bfd_mach_sparc_v9b; #endif