From patchwork Mon Jan 27 11:54:17 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: 13951276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 106D4C02188 for ; Mon, 27 Jan 2025 11:55:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNhP-0006MF-Bz; Mon, 27 Jan 2025 06:54: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 1tcNhN-0006L8-S1 for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:37 -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 1tcNhL-0006ph-6v for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:37 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-438a39e659cso27833005e9.2 for ; Mon, 27 Jan 2025 03:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978873; x=1738583673; 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=7sZoopH8al3/3onc9yLxoFWuzvX6JEuGgczZIUbC+S4=; b=abIzd0B60RSfWdG/DHBbanvWN1kf9hY0GLO9GakUEkZMWDWL5/9SxvtZa+gVKzN/B7 02fFc8llIecH4V/cF6v+Cvn77cNMkIIH3dcPJNzh4mpuhYf3tZHrgnzTo+iu0HdteN0u 1xqpwzJmE9+wDL9Szgu+lsqffmnVx/6fS1XXrwQZqKIz00O0uXYcgPxPgousZmH1uFpo LFy9uGdM+q74VeTK470KcyK+egv/NA23KXfLGZ+FzqiGDU18Yk48BQMy9xHYEd3OPINx R1BBGYESZaE2VqIUglmvvtEoZ/14S9Xk4EEF2wrs730iAlR9jB9U4guBEkjQcQEXDR5G tkaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978873; x=1738583673; 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=7sZoopH8al3/3onc9yLxoFWuzvX6JEuGgczZIUbC+S4=; b=r5wCf9gvgx+aXz/x3mV1kdHI6n63E3DPQQicFX8BwyF+AVV2Ck/pYfb6BQoHLQS3x5 YG7yPAU9G0q+/6mMse7Ej/xLjQbpfx9NCaF/5c3kcODkTIJuLDhTDpLPWmFcRo8zpxWb vNraKGWZYItIB5fNxsZTSgZE+qqjmkimUc5IK+U7IkebRzDZiWJXSUrIqWOa2Y9wi6gh bM2V7qnT75MKyVFHma/jmKx2r0PpclUIJ3uwbPxNXLtejjzfYJHINLa3IhnJ22EUmFkz 9dSR5QkReOC0mthfQbSzKu3/p/+we4H0V/DeZhg/1MF0HDE8NpG5408QuQc02DsOpZX4 NL+w== X-Gm-Message-State: AOJu0YzVlrrScUAfLHaku9Al3oz5mjeWksBGfT6kRHzru52IIlCWBI4L pfcvyZuSNZyrpE0Nk8CF7qjvQQCx/9aY1YKNeU9j5OOeJ4yCBpX8nMDu4M1/uCTq5LDp7h005j2 E33k= X-Gm-Gg: ASbGnctpOtdnT6b8fzCkPYfmiQ57pIJYu5QS2IcUTSFy7BTKqRn+218dp8ButbYvGzM P5rQaZMaGrgIYt3j9/lNcc7IoQLINRsyl5ANhdd3XHaNPMrvzb9/AZZc9eSLqhxDWCpYvw7BDP8 n0RW4WKR41hAe9FpZzwbawyi/Y/YGOj/MHNu+S/rXLZ0a4dzaOV0EOemIQMMrjzIEDTikHP93m9 xqYQF6+MJpGPzruJV4a442YliLmuiya9t2Zj5DWmamp+OP+1BX/rTc81lJmVLOLpdwoRNvcIh1A DUNdOp3Kd1zh0q8nLw1x1YBv1LXQ+lLi4ilnG9zFRBlAXnDow3h1VXw= X-Google-Smtp-Source: AGHT+IHxUZ8h05DGJm8h13ii6qJuyU/lf3cQ1mrWJMYlEb5HIf8MszFsdlUHfKEAQHHpau+bDefSZA== X-Received: by 2002:a5d:588f:0:b0:385:e961:6589 with SMTP id ffacd0b85a97d-38bf565f8b9mr33866086f8f.20.1737978873298; Mon, 27 Jan 2025 03:54:33 -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-38c2a1bbd93sm10882117f8f.76.2025.01.27.03.54.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:54:32 -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 01/10] target: Set disassemble_info::endian value for little-endian targets Date: Mon, 27 Jan 2025 12:54:17 +0100 Message-ID: <20250127115426.51355-2-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::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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field for little-endian targets. Note, there was no disas_set_info() handler registered for the TriCore target, so we implement one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/alpha/cpu.c | 1 + target/avr/cpu.c | 1 + target/hexagon/cpu.c | 1 + target/i386/cpu.c | 1 + target/loongarch/cpu.c | 1 + target/rx/cpu.c | 1 + target/tricore/cpu.c | 6 ++++++ 7 files changed, 12 insertions(+) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index da21f99a6ac..acf81fda371 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -85,6 +85,7 @@ static int alpha_cpu_mmu_index(CPUState *cs, bool ifetch) static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { + info->endian = BFD_ENDIAN_LITTLE; info->mach = bfd_mach_alpha_ev6; info->print_insn = print_insn_alpha; } diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 5a0e21465e5..2871d30540a 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -102,6 +102,7 @@ static void avr_cpu_reset_hold(Object *obj, ResetType type) static void avr_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { + info->endian = BFD_ENDIAN_LITTLE; info->mach = bfd_arch_avr; info->print_insn = avr_print_insn; } diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 238e63bcea4..a9beb9a1757 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -293,6 +293,7 @@ static void hexagon_cpu_reset_hold(Object *obj, ResetType type) static void hexagon_cpu_disas_set_info(CPUState *s, disassemble_info *info) { info->print_insn = print_insn_hexagon; + info->endian = BFD_ENDIAN_LITTLE; } static void hexagon_cpu_realize(DeviceState *dev, Error **errp) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1b9c11022c4..eecb6f54d9e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8343,6 +8343,7 @@ static void x86_disas_set_info(CPUState *cs, disassemble_info *info) X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; + info->endian = BFD_ENDIAN_LITTLE; info->mach = (env->hflags & HF_CS64_MASK ? bfd_mach_x86_64 : env->hflags & HF_CS32_MASK ? bfd_mach_i386_i386 : bfd_mach_i386_i8086); diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 227870e2856..cb9b9f909f3 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -617,6 +617,7 @@ static void loongarch_cpu_reset_hold(Object *obj, ResetType type) static void loongarch_cpu_disas_set_info(CPUState *s, disassemble_info *info) { + info->endian = BFD_ENDIAN_LITTLE; info->print_insn = print_insn_loongarch; } diff --git a/target/rx/cpu.c b/target/rx/cpu.c index d237d007023..f283315474c 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -160,6 +160,7 @@ static void rx_cpu_set_irq(void *opaque, int no, int request) static void rx_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { + info->endian = BFD_ENDIAN_LITTLE; info->mach = bfd_mach_rx; info->print_insn = print_insn_rx; } diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index eb794674c8d..49c18a0cd92 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -35,6 +35,11 @@ static const gchar *tricore_gdb_arch_name(CPUState *cs) return "tricore"; } +static void tricore_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) +{ + info->endian = BFD_ENDIAN_LITTLE; +} + static void tricore_cpu_set_pc(CPUState *cs, vaddr value) { cpu_env(cs)->PC = value & ~(target_ulong)1; @@ -201,6 +206,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) cc->gdb_num_core_regs = 44; cc->gdb_arch_name = tricore_gdb_arch_name; + cc->disas_set_info = tricore_cpu_disas_set_info; cc->dump_state = tricore_cpu_dump_state; cc->set_pc = tricore_cpu_set_pc; cc->get_pc = tricore_cpu_get_pc; 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: 13951281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9416FC02188 for ; Mon, 27 Jan 2025 11:56:40 +0000 (UTC) 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-Google-Smtp-Source: AGHT+IHm6JEkKlkhLd4ePz5IrtOmCODTX3fhUZHXMtkKVKfY5bVdq0FHYNd9L1TAxpvIBjXt3ymQ3g== 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 From patchwork Mon Jan 27 11:54:19 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: 13951285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23510C02188 for ; Mon, 27 Jan 2025 11:58:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNhY-0006TF-O9; Mon, 27 Jan 2025 06:54:48 -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 1tcNhW-0006RI-Us for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54: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 1tcNhU-0006sJ-M4 for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:46 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4368a293339so49782855e9.3 for ; Mon, 27 Jan 2025 03:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978883; x=1738583683; 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=TmODB2YqiSgFfw6mNPswT7QwXij2cXKU42PdskrrlVY=; b=nJopVp7Gc8ludZpwD4BxQ8sutpItSjeKSfdjYi4I2VHJwGoQ4u1Ct49QRT/n+gmGsP ffjHeURqxJ9tnKSbixhvGytXMbcXrZkqEnzQbvaypw+1r+D98yZDQFTVGBm/ziFh5jKE RiGyAG7Or77NCuTCIcRqwW3chaZUuBc0NhFj7fR0VETYNi7qUwuVUL+02UIykKyKc1Kc jq35ZAw1Ibq9Zpn3RlYKeVun/Xlw7OEQZlOM4546xCffwgDwfToA+f192+mpQYEx35Ek j7VLQuQGjYaamu6NuQodAnY51MuK/CqaP9D+628ja3glAeliPS2aW+IYUVir1QEbkufD jFlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978883; x=1738583683; 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=TmODB2YqiSgFfw6mNPswT7QwXij2cXKU42PdskrrlVY=; b=Kw9Sp1Wef5DkhUssT3SIjwvpp3Py9evkDG8HVYFfGT3OQgbMrbg9VTMjtVWnEKlBe7 E0Qdtk/qdJv9WqT56UIof8LaoYlpW0pXffTVdo2HN4YbZHTt01x05nJrny5CElrRlTJW 1socC63kn9MpGPVulWIAywoWu7/UCsi6+oN+dXLEq14FHzP1WNzRBHwJ8BMtrOy4d6rL g3LMOmzbqdE1hjxaC9XvPFFK+BG+8mhpbiKM2Zb9Fe3qUmZGshnLMv0lXQAiQ0tpDzwk LtKsOzNUKvNRlxC0jAw4lQ3iMffO7assJ6oQ7FC+QeT7f/b2b95EmPNjZH7hge9p15AI SWgg== X-Gm-Message-State: AOJu0Yx6YyS0Ubp/QhCjQ4m6+RSYH7n2VUzDvGvA5bw+IdciTPPfvpgj zWMztryjIUoA3445uS/G9cSV6BFfKVDuhb2L5wQ6gKKCPP2GkBrRSns8D7+npsRlbWeFb8fwtHo OQZQ= X-Gm-Gg: ASbGncsRkxt4/J8eisMNTz+6DBy858fnKDSwVsbAgQz8GcEWfaFeFwXi/f42zVAq1mt f6LV1GQiYWz41kFjzsHdUqtPktpMvp7uN5OuGIzBbwFmuOwm23ZRHgTMz6Xrk9SJJDZyxXmVK+H bzX+xCGpvpCmfhLcaYWEXRFa543qTDLyJJQD1qY5jTg5pjl+3dlsH3oZhcaTaetWfGchxNaluN0 pRE5MfSqg3WBZliwZOBgrMGuhPfZwb0kdi0PwYTZfvXL4PqMVn5JQA+YKvViWcCwN8v+DtI+ROE HK3EQVq12Hev31XNIILpQMgXFq/hyoj6XnA7LLVFm37NOxh6ayHPIes= X-Google-Smtp-Source: AGHT+IHfR9UBAxL5TKZlxz7d+HrYqLOdlINPy2KjaKBrQjBGU4MYj2SOphGtEV4tgHtMC3mTf1Ohow== X-Received: by 2002:a05:6000:1849:b0:38a:8888:c0b6 with SMTP id ffacd0b85a97d-38bf57bfcf5mr42398725f8f.51.1737978882716; Mon, 27 Jan 2025 03:54:42 -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-38c2a17d6f8sm10684291f8f.28.2025.01.27.03.54.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:54:42 -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 03/10] target/arm: Set disassemble_info::endian value in disas_set_info() Date: Mon, 27 Jan 2025 12:54:19 +0100 Message-ID: <20250127115426.51355-4-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::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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index f9fdf708653..9de8c799c77 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1220,6 +1220,8 @@ static void arm_disas_set_info(CPUState *cpu, disassemble_info *info) #else info->endian = BFD_ENDIAN_BIG; #endif + } else { + info->endian = BFD_ENDIAN_LITTLE; } info->flags &= ~INSN_ARM_BE32; #ifndef CONFIG_USER_ONLY From patchwork Mon Jan 27 11:54:20 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: 13951283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACB7FC0218A for ; Mon, 27 Jan 2025 11:57:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNhe-0006Wr-GX; Mon, 27 Jan 2025 06:54:54 -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 1tcNhb-0006Ud-O7 for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:51 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcNhZ-0006uk-Bl for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:51 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-385e27c75f4so3819358f8f.2 for ; Mon, 27 Jan 2025 03:54:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978887; x=1738583687; 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=0D0mBXBaLsDF4AjforVcC1QF9ut0pEK5UwN8hfEmGYc=; b=QlM9Fqn35rwC3hu59u9W0a5gJXM2fG3GboadZGAnC9qdmI7ahjeiAeMvXJpmU1G5eT yugwBkgwBUXIEStfxUrbBDizoL66xfhM1A2buDj008zOT9+78imocxebGASOKde+8WzN Mcyn//1Kg/7fQZQl9KfAvIAbinTV0hmKBaKS6TieY1HrbDH801P9AwdIfCOAe2D/AXlc 4vK3i8XG+mkOir2pGes9viqGbR0QJb6K2bXtYnQUYi+WQ4LWEQFQy3a8vd/GOxMMYA5u 68Z6gygGQyi/03PR0hAWi+17j62272dohX2F0qtgvEEtyB/vDzX3zUCsVKp+Bef0u5DM iMyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978887; x=1738583687; 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=0D0mBXBaLsDF4AjforVcC1QF9ut0pEK5UwN8hfEmGYc=; b=dDa+zJcPPqDL6KK/okunXzNidxQH+ImLWEGzNmzoeewkGIfNUXtKorbY9ENGgeu6sH DH47Dg/g55UXFYcS8ec5xL4F/aR0Xd4+z1nmdpZkfopHMVmAyRaYpDWBnX3OgwMZhuK4 K+cGL2nZwbmvwkXy29XdPxbFIMy4BtyU07enPTo36i9Irqu6j40OqhS+k5KCSrhELxpJ 7rZppZENFlO0xiyVHFM+YbbtYvqk6OUr1ByQc2cXvAXXttsbYAlAIIo8fJYHsPGuvIxf 9PrqqmE1GfK192gXWDfBExV3ywl5E/VLYKQhWzBuiEHFIWTd8xGYnbek51XmVgSo2pc9 n1QQ== X-Gm-Message-State: AOJu0YxrOnMl6i1UBwxNDHUelu2pbrN3N9lXPHqJQ140LAG8GYrTDEKW BM4HpXDchHOE69dc7iwa+2YD1T+Ukz45ZFf/+iELfaZAfSSD1/bGjHrM2s0zGxVonAO/pwOvngv +Bko= X-Gm-Gg: ASbGncu8ZAVj9qAPug/LZPJ4ub3OrgIPY/ym0p9QpRWFIUGFDYqcYi5XbRFIZGEYa8R m/zOCE5MSR2QzKPngUzlZ8aURlv02TWRnFaDe81tVbn48Y0WvCGLsM5TiUjyQgIiPuagEaAkogb RNtYyYQz6ueUyasCeeA+YciGARX9Q/wXQbWPgg3iP7qNQfCliuc49yJVRPiBin0Hlr1+l3rKYoB GqGc4YAw76MAP9V9SqmJ7Num7OTyjMZoF13L5m5XZ4S4XTRMbkG0Dzft60jXVBdNj8PYggSEG4W 54uHJHMMtBTEeVFyjO/7X+QtsiArwVb87FpaDTdiWNqLzvlIgJttGcg= X-Google-Smtp-Source: AGHT+IGPQFkUiA7e3qJST4WmTjeM+k06Yc2GvTtVflUzG9dWKVdEwTse05E8oxwLqW6eaJSSfEh1TQ== X-Received: by 2002:a05:6000:2af:b0:38c:3eab:2e17 with SMTP id ffacd0b85a97d-38c3eab2fd7mr3370033f8f.2.1737978887560; Mon, 27 Jan 2025 03:54:47 -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-38c2a188928sm10794589f8f.45.2025.01.27.03.54.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:54:46 -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 04/10] target/microblaze: Set disassemble_info::endian value in disas_set_info Date: Mon, 27 Jan 2025 12:54:20 +0100 Message-ID: <20250127115426.51355-5-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/microblaze/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 13d194cef88..7603d2e8f73 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -224,6 +224,11 @@ static void mb_disas_set_info(CPUState *cpu, disassemble_info *info) { info->mach = bfd_arch_microblaze; info->print_insn = print_insn_microblaze; +#if TARGET_BIG_ENDIAN + info->endian = BFD_ENDIAN_BIG; +#else + info->endian = BFD_ENDIAN_LITTLE; +#endif } static void mb_cpu_realizefn(DeviceState *dev, Error **errp) From patchwork Mon Jan 27 11:54:21 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: 13951277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5823C02188 for ; Mon, 27 Jan 2025 11:56:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNhh-0006bI-SA; Mon, 27 Jan 2025 06:54:57 -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 1tcNhg-0006YC-5Z for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:56 -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 1tcNhe-0006wc-0k for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:54:55 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-38a8b35e168so2801777f8f.1 for ; Mon, 27 Jan 2025 03:54:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978892; x=1738583692; 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=HOKaO4+JhkS19YUfs3qPtnMOdIHyEK0YrYWedLcqil4=; b=MwuihrdVUTVYfD2aL+chwflx0z4w5Fls6E9YR90Jl5N+mbIwFobMWfy50R2dG1PnbW 4vuflc1QlLY1vZm6yhms3cYX0ElkUJ6RhsRZcW5bWavBPG7Uu/N+/W8UjJYz18I5+z3/ 82cL7ZViRV8fvxA2fnvdZD9UnJrZlQCKnzdIT69fUbpPSjIapTQ39UN6agp8V72bzRYp +wrg4NcuioTJeto8tiNh39y+fyeHL5awuoncrKiQ0NlT+/ggzK73/VVbLGZ+k3wAEiNz 8Q8kBOd+z5mkQn/iSwg5M+xod5h9zj7WGsnb6VFCjB9xJj6ao1HuYuru529oLlVbTuBp rp4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978892; x=1738583692; 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=HOKaO4+JhkS19YUfs3qPtnMOdIHyEK0YrYWedLcqil4=; b=qv1gae8jWXLJRH3ggCIjK5nl6gaF44+OVG/qu40hMxMktRfyjaG5nVer1aNaBXSXXb x5OmyUQCwvoHGhBCLuceGk3ejeX+umAlx6Ym+8xyk3yScKSLwnJvnvYuhDvRpFmLVh0Y xGKkSoc4kZ+6gDj+foLXH1TuxkB2Y6OCReUAs3NA6ZK2UYY+xfSz/Hoxkhiz/1+8n20b X/858jBVU60v8678N0JrjlTSjlyQMBHDctxC+B2vekt2b6vzGqvohxfAAWaRP36YS/lr DGVO5imKOuyuG8fuK//htSxvr9jTiyPiE/hmsxKmdQYSvC+MnAsdjIUiIsV52JyJ0JVP 1fyA== X-Gm-Message-State: AOJu0YztO/P1P/blhxbuieKYG5nFiKIbmFeTj8XB5rv0bl3BMzbcOcTQ RyF0KdimumzauMvJ7hH69KP/BTjlNiPeE13nlOfRcqnSB4RD2msrvTV+qBMHt/lESatiM9rIet4 IaFM= X-Gm-Gg: ASbGnct5tsAPROiPjiC4n6Zu3ccbHd2r1HnLG81n6RRqrMggOG7nFsdev6Jud2B2hkx nNmSk+tBNQizavE0M53epWH86gSG6aH2OW0IBSmd/mSZEjaL4yCjgfkqr4+rMC67UqJJMXAWXq1 I2faqrqd8aTMRxWi6CoPaRi5Vdpg1JGicCAVcoa3Yzv7o4E26SsC4D+Ky5q+UU7o1ZNrDoO9pRE PQiaiNClRJbi34y6NsxuJBakuky8SNOBG3YLaGhNhUeyrqok55R5cLXnd2GNWewObmC9FgJExf9 GZlJzN9RvCUzRawUPBBXx0z8vlmN6uE7Hvzx5H3Kq7iWpYc/1LSXEPM= X-Google-Smtp-Source: AGHT+IFiTf3Yez4AfIDsimkGKAnF9uSNi9P+S1XvekK4mopdZR/kO2FDhmtpzg8yfuYCkxoyZnGEcg== X-Received: by 2002:a05:6000:1787:b0:385:f892:c8be with SMTP id ffacd0b85a97d-38c2b7cdabfmr11603137f8f.23.1737978892299; Mon, 27 Jan 2025 03:54:52 -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-38c2a17d865sm11029825f8f.38.2025.01.27.03.54.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:54:51 -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 05/10] target/mips: Set disassemble_info::endian value in disas_set_info() Date: Mon, 27 Jan 2025 12:54:21 +0100 Message-ID: <20250127115426.51355-6-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::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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/mips/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 0b267d2e507..f6d247b530f 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -429,12 +429,15 @@ static void mips_cpu_disas_set_info(CPUState *s, disassemble_info *info) { if (!(cpu_env(s)->insn_flags & ISA_NANOMIPS32)) { #if TARGET_BIG_ENDIAN + info->endian = BFD_ENDIAN_BIG; info->print_insn = print_insn_big_mips; #else + info->endian = BFD_ENDIAN_LITTLE; info->print_insn = print_insn_little_mips; #endif } else { info->print_insn = print_insn_nanomips; + info->endian = BFD_ENDIAN_LITTLE; } } From patchwork Mon Jan 27 11:54:22 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: 13951279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55E0CC0218A for ; Mon, 27 Jan 2025 11:56:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNiH-000793-BB; Mon, 27 Jan 2025 06:55: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 1tcNhl-0006ed-2J for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:01 -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 1tcNhj-0006xl-7j for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:00 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3862f32a33eso1981050f8f.3 for ; Mon, 27 Jan 2025 03:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978897; x=1738583697; 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=XtP8AqLeYQZjrWpkd4lk6XaR5TxrmGrkOXytBFmi5uw=; b=QREw+1H04fdQiHuHy/p+50Mg631LuJM9DrsDzccTtY+N1dEXTyptEBzhnx4SHAA5dM z8MQ6z3RXt05R5WUZ1SDiw4d0u/yVF0AfLEwlVKPEEslCjNuV3tiXqSyFNSXiLH5HSPg 6WdY9HP/YgcgAKtaR/EPjziOmT9wtLG2RYiIBPLLH5m4kBG7GqL/BjY3mIg3gxlEJ6kI F7Y3kBfopKcqtbFG13GWDGrcptWpOh1/Vyx+KxFL8yjrqisOg1zkQa5lW2YaSqTcSs0p gjEnYCcJT8Pg2LnxapkzCZd9AxrTPqL2u+7zzPWownJ8zEovRMWxAvRrwugZcAsFqT78 VsWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978897; x=1738583697; 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=XtP8AqLeYQZjrWpkd4lk6XaR5TxrmGrkOXytBFmi5uw=; b=gv7iTVICLmHNDxaZWtqOge4a7u6KWgf9UPDtmiLnfjCjCY7WuUxtqWtDPXJXb5uavr Y1Pfm98j7uAcY0slyqPXTrv+T9M61G52hWteuaDqxU5JddnUo58ft52Uforv+AMhod7m iG7LoQ8k6zfAIkVuTbnb27w1cmmpUTKtr+cprBGxIL/Eim9WCBhu0HX+HpAvRkKA6BDY 6I/UAAp4otzPFnqhuk1xsl+bispy07FkvrNKah26JrdN14/amr5C1D9bqf5seYDhTTY6 KOdtlfU8CWg4yJUYgDTFnCuykHRRTxsxYdw4XtjZ6isEImvTldmjc5ENiiMsNSS8tuaj JPAg== X-Gm-Message-State: AOJu0YxVk6Avx2o35O0xZDd8m1EkuelwuLeg3+xyFOuMYfdIbxdYrrBE 2bJLA4QZH6Dtlid5pucMF4KdKNvqV4ZMMHzHZA4d2ehWN8H+dPtFY87o2FzhTWiU5oxXtvgOnRC WVIU= X-Gm-Gg: ASbGncsVBJINsz1F4/oAVqgKHnb9m4XDMpmCGPBLyxCaHBh+ActPVl8ewjAIv3qQK1J e2st1YvTgCriSf0xx/SOy1IgW5va0FJybqkyosJazOKmnU3t9Qh/X8IChx8C4EYrXmOXovCRz5A 4pj7h5KAk2F0sJDEJqnK/XBbWYAUgyGRAQJ+B1JuSHJTQDrCm3xunwb7i919MOgMHYWmcLqib/O bGFRd14a9Z2IjaUCYRSIISxNcRyVK3NA1zyBtyKcmz/0XcrO65hVVd3RHNC44sF1sAx4UZ9/RfX rDzxicjL2aME7fokg4MA9opN61YTzW4RcShcqUiJjOKKBBt1V06rTxY= X-Google-Smtp-Source: AGHT+IFa1m9BSfeZPrSdjVs7GMwYclXXgrDCVXWFBsfY7RdZiaq5fBnntdwOIwihd6nMffLYLDKuYg== X-Received: by 2002:a05:6000:1111:b0:382:4926:98fa with SMTP id ffacd0b85a97d-38bf57a266amr29419753f8f.40.1737978897072; Mon, 27 Jan 2025 03:54:57 -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-38c2a1baf3esm11045471f8f.75.2025.01.27.03.54.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:54:56 -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 06/10] target/ppc: Set disassemble_info::endian value in disas_set_info() Date: Mon, 27 Jan 2025 12:54:22 +0100 Message-ID: <20250127115426.51355-7-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::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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/ppc/cpu_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index ed85448bc7d..c3263f26219 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7398,6 +7398,8 @@ static void ppc_disas_set_info(CPUState *cs, disassemble_info *info) if ((env->hflags >> MSR_LE) & 1) { info->endian = BFD_ENDIAN_LITTLE; + } else { + info->endian = BFD_ENDIAN_BIG; } info->mach = env->bfd_mach; if (!env->bfd_mach) { From patchwork Mon Jan 27 11:54:23 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: 13951278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97DEFC0218A for ; Mon, 27 Jan 2025 11:56:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNiW-0007j4-Fi; Mon, 27 Jan 2025 06:55:48 -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 1tcNhs-0006rj-Vi for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:22 -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 1tcNhn-0006zA-QA for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:06 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso27339155e9.1 for ; Mon, 27 Jan 2025 03:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978902; x=1738583702; 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=B4IS3z5t6aeYLZ7NAuHNel+nPJsLHRUkUZSl5ZYMkwc=; b=knJHu9SyuiZHxjrTdCFTk5xLIAODPj6854jIhzC/TQhm2RzIu/EE0qY+fnHPRekzuw BypN6mGXmoxhwK3Oyf4HDwyYWoSUPGNIYe9PPLOWuqGa7Un2ez2+vGTHUwlE1Hj/Cd61 80YSTPOEL1cqRhSbTtE9XTgjIIbVAeWJdU4oRGyFMnUK7PxqGiur5FwxhQY+d4xqcv75 bnZe6ZcMeiEfkBg0JqgByxje+sixQ7n7zQbgo+vcR9vMgM0p8Hi4Ado4YlUiUE7iYTZz zroleyWXpcKe8NJdl8O7/8IO6zugb7MUulvdM/vEEjNeHsjOgUCddqj7fvQ5vmBSwgSF p6Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978902; x=1738583702; 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=B4IS3z5t6aeYLZ7NAuHNel+nPJsLHRUkUZSl5ZYMkwc=; b=b4mrIabQR2Xsc4BWvb7zVevlYFY2+X50yWOTtrXS8oYY+pDZ9x03v1l8nVBtRmzex9 fDRYTt+beBJJ1oaxxrTk/9fTI4DLmn/IjzYyQlDZVHByCH1+X1Lxn57AKfuKSV7VoEEz Uig9avQoU8lt43EbA9olRuoP+7t7vXW3AmjueNFFLhcos7NNU52uiQqXyA0AnIyOtJBy 4aRwRxPr1vDBrpPFKN/+vw2He1cytBMmTYBOEKHeSh2yuktamzaKNR+2l97WNMlWluhc VwegXOhyZB/Tjq+LfFctRhumhA+e1XuVF4qkgD9QwBpZ0BgmxfCa31YXlnW4aSAhYJAE V33A== X-Gm-Message-State: AOJu0Yyc2vSDKHx/7WreUnTPAS1bIM8SnWhXaE9nO4DU4WuGxce5AQhx SBknutGjkbcbmv4N8ExsHsPCdQeZv+DaKWnssUIRJJgfL7iBzA+JwHbXgIw7/biWbFdCM2zM/9J GmKk= X-Gm-Gg: ASbGnctuzI2Vo5ZdKv413xbMSM9Mabiogli5b7PLYprRF1gSVCRgjIk3OyomJDOMj5X nvahiU6ZCAs8bGXDEScczCDsMFNrqI3bCXUUE7ZawDB0ICuVnIFoHd+16M5mP/+5CJ/c4jvZBsu L4D2l1IA1olSo1MVSCo9ns4uIxSqPp16RwhST1bHT/B9PQApmWXwSw9m/Apbm+3e/UZMoWsaJMk wdjkkBakXxXhyFTKsqEI+PUz8cj2eTtuISuyiZNLVpsZkSe7KmM/xVxKqzIpWFm1FlEVFaFMuHz TrbgUs4n66bqP5Fbmwh34ftg6CePZNO541xFGvcMZMQlv1grllGbhAg= X-Google-Smtp-Source: AGHT+IHET3rqSbR9s6dSwCNjBB9cODBqyhqFPWhEqy/MaP3DAHoJvFDTTKe8eo5it+0lahivn9T4jQ== X-Received: by 2002:a05:600c:3546:b0:434:fc5d:179c with SMTP id 5b1f17b1804b1-438b885f8ebmr162465155e9.13.1737978901751; Mon, 27 Jan 2025 03:55:01 -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-438bd48574csm130454235e9.9.2025.01.27.03.55.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:55:01 -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 07/10] target/riscv: Set disassemble_info::endian value in disas_set_info() Date: Mon, 27 Jan 2025 12:54:23 +0100 Message-ID: <20250127115426.51355-8-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::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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/riscv/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 3d4bd157d2c..b39a701d751 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1156,6 +1156,15 @@ static void riscv_cpu_disas_set_info(CPUState *s, disassemble_info *info) CPURISCVState *env = &cpu->env; info->target_info = &cpu->cfg; + /* + * 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. + */ + info->endian = BFD_ENDIAN_LITTLE; + switch (env->xl) { case MXL_RV32: info->print_insn = print_insn_riscv32; From patchwork Mon Jan 27 11:54:24 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: 13951280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35A4EC02188 for ; Mon, 27 Jan 2025 11:56:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNiN-0007YC-Hi; Mon, 27 Jan 2025 06:55: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 1tcNhv-0006xG-Hc for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:21 -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 1tcNhs-0007Al-ET for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:10 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361f796586so46942335e9.3 for ; Mon, 27 Jan 2025 03:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978906; x=1738583706; 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=JX3MnHembh04tcm3f0aOQ5qd9/M1w32l0pc1xIgIK0Y=; b=CRRuP110n/bB1EYG+advtZI+agZNuvNdW4Lp7K3IM3FHsVcPvhwF0DSV2YypkZj3db ddbGpDUZky1gOIF8IBQ3PhKFhspIjm9hnDyOLakJnO/PeC2UrnXmsPwsz67+KtgJ79mi hy3yOZTkRlSXyWm5US5ASxlX5D+idxObKplBa2LJRHd4xiVrIpiAeAzSqb0Pc6Q4o5Yy oR2c/+Dz/2HjddgAJ55ClmYkB4Y+4CnhLsdDI03R2t4tsj9+wJL+Ke0BbM1wzOPRpF8z ZjrarzDZ4wfY2OESQiJ01OzK/epaZDgJ8AfwOBO739T+xdwZnRJ6fWRW84n2hNEYfHPT SrMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978906; x=1738583706; 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=JX3MnHembh04tcm3f0aOQ5qd9/M1w32l0pc1xIgIK0Y=; b=eGjM6Hk65t1lkr2Wp9xzSdEdkLZ8WHKupDz03ogJ25vdEsBRoW1MTCBzvnOA1E/SLG YoXTOFgVNawS+9nmNzDzYH41ljJjWqKZNygoQ9dU+c3q2qzjtTpva8Xy5oDMHcxEDdTl QyOHXdS/WW6+j5o/SMxoJ/8xBVaKYTcGWPjaofu4tKyEpS3XPX6S4wy9mVHedf7ai+3g zqpWWpKL10DpAy/0uuTEuYHLFXQyw8W85V7AhxT2j8i5P1cnhidlfmt1NMFaNXHjyeyy B1N1SooIR+shCrZXqT2HaPPftmr6GzNouEmqV+WdZQ273pVVviJl68Yx95O7FXUhPd1P OkEQ== X-Gm-Message-State: AOJu0YzsSbWcEzVqaPjb/T9lKeM59e9NuSOurrFO9Zw4r2zffNTQTq8V y5Q2Ye9hm4lVDIiraBTHaFLRSTbHLD8MsI6+i5Epo0NQbwhWErQMmMEEp5jL8X1hpsV6Ot3SM01 yqL8= X-Gm-Gg: ASbGncsbjXi65EyxJDLp0OobQdyOKb5oJpzkayrLPyOrMye1/+GckPeFWL0fp0aj+Yu oYxm2bfK+Uwl1/bDnrWANCe41Uwecf9O2KpOjCv/A6np156ZVT2hWjh+Ft/mu0PRE4RMU4BkVi0 BSHX2WeRkkMbTNSA6MVvpynSKC9knQX1ksT+0pCg0FM+S0DRQbf5pW9pbBUQuQVABJ3+QuNePej mBlHv8BnYRJIj0c4/OjESqVAgHolge+8iX6IlQ/Je5N+DphPJIW2Sz/qQsERJH1wsJ0HlaKfryF E5dNwmBvBz5PXnQPptJSpJXqEpq/SZ5cW/vIbQIiAlzUyO56RlC7h6E= X-Google-Smtp-Source: AGHT+IHEKWMLADOTUxdUcPINuFaigL9xx0ARgt306pyjiDqEXE54xu4HJsnViYxjZfNPyNHQJpfPQQ== X-Received: by 2002:a05:600c:6c95:b0:438:a1f5:3e41 with SMTP id 5b1f17b1804b1-438a1f53fa6mr346012555e9.12.1737978906511; Mon, 27 Jan 2025 03:55:06 -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-438bd54bfa5sm128347995e9.25.2025.01.27.03.55.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:55:06 -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 08/10] target/sh4: Set disassemble_info::endian value in disas_set_info() Date: Mon, 27 Jan 2025 12:54:24 +0100 Message-ID: <20250127115426.51355-9-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::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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/sh4/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index e3c2aea1a64..9d3e6cb2fd7 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -134,6 +134,11 @@ static void superh_cpu_reset_hold(Object *obj, ResetType type) static void superh_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { +#if TARGET_BIG_ENDIAN + info->endian = BFD_ENDIAN_BIG; +#else + info->endian = BFD_ENDIAN_LITTLE; +#endif info->mach = bfd_mach_sh4; info->print_insn = print_insn_sh; } From patchwork Mon Jan 27 11:54:25 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: 13951282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 919DDC0218A for ; Mon, 27 Jan 2025 11:56:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNiK-0007LG-5a; Mon, 27 Jan 2025 06:55:36 -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 1tcNi2-0006yN-5D for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:22 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcNhz-0007CA-F3 for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:17 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-385f06d0c8eso2372382f8f.0 for ; Mon, 27 Jan 2025 03:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978911; x=1738583711; 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=rn2ReynSBdby37Nlff7xj1Nb5zVdrIwNIQImRA5QCJw=; b=ehKvFwhH+f/oRF2h5dbCqPg+durWCSfSarEasz9YZctCd/ZiQ6SgstO/r20zfbr+Bn 3V51KeCTTRG3BcSUW7zBycmeaGdF/or2GaKZZLnyRTkPreorBCbrrAHTZLOzmkgGm4yJ XDUvnLXFToFhoukdfVMkRIsJha2cn8K5UZhMvnT03p/W4bkVS1SJlul5M4hzzYE7uNc4 JZmvyakXWmGETP0Fi45/cQb+S5Uxg9BO3YdQCEknVkl4bwKo/zJ4xjYTE3jdiJdCXZp0 Bg5ktvqXFmqjtJ5AT83QhK2Mike1tD0sqYUxqRj56b7WTpcJGOmiBaQ/+NZ0cOSLDBtk 9mrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978911; x=1738583711; 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=rn2ReynSBdby37Nlff7xj1Nb5zVdrIwNIQImRA5QCJw=; b=H7eVWHRDAPpDQ5cfbnJyeqacYmf53Z2hIxH8tTf7jAdLK0EMbMgL2QcIjVycbtmfiE q2oQOD4iUAH0MWSDfvsaJ0orIwiOEUOVfLweON/Bcc6JyoCNlySFxvwn3OBq8aH7jXk+ BczPwy5K4D+zJ826Eb2Mmj793rY4nsK0pXvhtKvgoV0F09v5rFCqUhZZQ0I/5hXtpOY9 A7pTIrvOnaODJvlqxFU7GEhaoIKxIYDNfC4af3S8qGpuzAccMLbkA8pYgBLL4dZDrkm3 1FNvkMvCptk7kvjt7KKEJk/X4gbDwS0WS089rf5x7W4HXsKPDHg4aDN6sbVhMn032EO3 PY6A== X-Gm-Message-State: AOJu0YxEZ7knTnNgfXAKxOVVJMQrLdrZv8yYFdtwAutjqYH7h92Jcf57 5ubFG42ewr1KnhrYjtf32YDtfnnv++idptKHraw6UZAAr286mNF+8oP6jo3azg8LDg1WSX2lmuT oJSY= X-Gm-Gg: ASbGncsj6dLpER8AHQNHEBEogOG7J8N2Ud453OKmFOPPzlqQD2I/n2QsdQ75Doo8GdG lDGA8l5BoV2wQzs3JSsmMaspHNfapycNUchdEIp7poj8opSxc6RxYIzSJ/oEFb7j/DxNrHCIkW+ 8/sUb5aO6nULiM2SH0nxgu6p1aE5zFs8bKrbdDqJjRzvRqhFoCSiznB48E7igmowStRVUtekRbR emyIneB2y0WgBh4fjrdSJteVx63zun+GqjmOQkEP+YReh4kX2kCb8LGIzn1j4dRszfspYlRpENz ORQuHOr3il//eKrEVaQFa+vpaNHUhMjSOpdvdCk0/bOWc3GfGCsCH3A= X-Google-Smtp-Source: AGHT+IG0appsE+SO9dke28W7wykRckuQa5Du5b/UppbL4D5c8O3IybNWUnckdXh4XkAEBtIIIj1Bsg== X-Received: by 2002:a05:6000:1faa:b0:38a:6264:d13e with SMTP id ffacd0b85a97d-38bf566e21fmr33389791f8f.8.1737978911217; Mon, 27 Jan 2025 03:55:11 -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-38c2a188689sm10807831f8f.48.2025.01.27.03.55.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:55:10 -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 09/10] target/xtensa: Set disassemble_info::endian value in disas_set_info() Date: Mon, 27 Jan 2025 12:54:25 +0100 Message-ID: <20250127115426.51355-10-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have the CPUClass::disas_set_info() callback set the disassemble_info::endian field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/xtensa/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index efbfe73fcfb..bc170dbb5cc 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -159,6 +159,11 @@ static void xtensa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) info->private_data = cpu->env.config->isa; info->print_insn = print_insn_xtensa; +#if TARGET_BIG_ENDIAN + info->endian = BFD_ENDIAN_BIG; +#else + info->endian = BFD_ENDIAN_LITTLE; +#endif } static void xtensa_cpu_realizefn(DeviceState *dev, Error **errp) From patchwork Mon Jan 27 11:54:26 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: 13951284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A67DBC02188 for ; Mon, 27 Jan 2025 11:57:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcNiM-0007Wm-G8; Mon, 27 Jan 2025 06:55:38 -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 1tcNi6-0006ze-0n for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:25 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcNi1-0007D8-PL for qemu-devel@nongnu.org; Mon, 27 Jan 2025 06:55:21 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385f07cd1a4so4517926f8f.1 for ; Mon, 27 Jan 2025 03:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737978916; x=1738583716; 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=477b2+132Twzc6vm7x293Qvrvp4aEfDDM84pZnLDz7E=; b=A30Hdz7DgNSk/txVVLqyttURob1pvTspsV1OrXuq6BP+rrCMsb3cR3jCvHhAU5zXy0 2P+inoAUoI+vsj9Bo3yDQA+WBzhol+dIdi/PR3jRbo4VU3qkW9s9ewdS2c4I1Fx69UC3 2USRtgLzjJeD+uvUwesUBXpzyhHwbucQYMFUpzalUN5GbnqxB7CQSSaQtrhchCyOoPen 6aEUiysDCL/76HzS1aBlcukYqhsDGu0e89VLb19DIpSWEOnuE5eNsceBW/XudCd4PlFA 54nwvd6YrgqO7uxIDTGJqcD7Tfb1zKyh2quAbuona05YUXXh7TNNPUEE8+Wlt88+P4ci WRyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737978916; x=1738583716; 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=477b2+132Twzc6vm7x293Qvrvp4aEfDDM84pZnLDz7E=; b=ocZGBWulrDhIczlXs9aZMYEpFpmumQoFp6KumZLsJzAcWYQHgQwGvZiZH1Ez1UANJK At5XNFg1Hq6bNtBFcOEyOCCoXU/npMCUvttWXFfcMzntbynV1GeF2YpY5CyV/y75HdNU OmmNuZ2IumExKu+K0/dTRYVCtBfojjSBxF0GrX57wUxAJXcqASl7Yh9ZGlcjJLOvFRPj mS/6toQ16jA0UsDTXY/NSqPGxdTvWXNXYpqsWTGCZdnw3EVgB6zj/eZ/RNx332SqrCpG e018WuaknNXlwjyRYg9u4QJQ7sNw9cZpd8xmHL4S0gmzU7N06eYYv0HYIaLc43RqCegh lqkw== X-Gm-Message-State: AOJu0YyZy2/TNh6awpnmKdJJBerw0rxZ6HIKIaRWlNqzMbjswweZa5z2 oZCf99bSqniBRynTv4jJsDUCKHX5W8aL5qficFf7R2uDgH5ZkRlIPJcVK1VMGXHAvQs/cMylHe0 AyBc= X-Gm-Gg: ASbGncs/fWsJ7XvZIUBsc/Wa/QafHQXlbNifYJ05zYBZ9DQUCDI9LDo/JDM0jRnBajC rBEBFBjpr8K6+4UiBESWNJi3BNvgIpiIffgyG+4a90KiyJd8GJr5MBWdk9O+5jqYtqxdcLQIl50 7+IUQQpeP/WbxSkIfHAJU1V2S9RMZ4MnkPrGjwYTPuJ9y/A/8w9aKXbXxZ+6ezG+auSBCNVeiww q+AYEzKwlmjT6HzVr8EdyYFHDKUce84CfFtatsyPKMf32p+5uTiwnBMrRxPisOP1s+V8E6Onb7F y8c7v6M31xxZczJ133qjjIb+P8jcNPv6IXvp2yslpbwL7atYdoq5JZE= X-Google-Smtp-Source: AGHT+IGHWLmSvU1P39gqGXFnIhRl/32Yegnv45d7TusjfscIdD5eIgw0WV1HeMUXoBfBZqD4Icviow== X-Received: by 2002:a05:6000:1788:b0:385:ea2b:12cc with SMTP id ffacd0b85a97d-38bf56628e4mr37165113f8f.13.1737978915871; Mon, 27 Jan 2025 03:55:15 -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-38c2a1bbd93sm10884096f8f.76.2025.01.27.03.55.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 03:55:15 -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 10/10] disas: Remove target_words_bigendian() call in initialize_debug_target() Date: Mon, 27 Jan 2025 12:54:26 +0100 Message-ID: <20250127115426.51355-11-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org All CPUClass implementations must implement disas_set_info() which sets the disassemble_info::endian value. Ensure that by: 1/ assert disas_set_info() handler is not NULL 2/ set %endian to BFD_ENDIAN_UNKNOWN before calling the CPUClass::disas_set_info() handler, then assert %endian is not BFD_ENDIAN_UNKNOWN after the call. This allows removing the target_words_bigendian() call in disas/. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- disas/disas-common.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/disas/disas-common.c b/disas/disas-common.c index 57505823cb7..42e911e36be 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" @@ -61,15 +60,11 @@ void disas_initialize_debug_target(CPUDebug *s, CPUState *cpu) s->cpu = cpu; s->info.print_address_func = print_address; - if (target_words_bigendian()) { - s->info.endian = BFD_ENDIAN_BIG; - } else { - s->info.endian = BFD_ENDIAN_LITTLE; - } + s->info.endian = BFD_ENDIAN_UNKNOWN; - if (cpu->cc->disas_set_info) { - cpu->cc->disas_set_info(cpu, &s->info); - } + g_assert(cpu->cc->disas_set_info); + cpu->cc->disas_set_info(cpu, &s->info); + g_assert(s->info.endian != BFD_ENDIAN_UNKNOWN); } int disas_gstring_printf(FILE *stream, const char *fmt, ...)