From patchwork Thu Mar 6 15:47: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: 870851 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp334851wri; Thu, 6 Mar 2025 07:57:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8Xg7x3Lgy99iSqh1DLuNiT5DYr39UmEO3W7mt9QILPsFWbvjlSKgzunuRqBcbYvKsqD8fNA==@linaro.org X-Google-Smtp-Source: AGHT+IFNHCQOSCy7NzjliufHkzUhKoSCKhku8I8WT5KvtzbdTRPetOx3sZpT7eW801NgBgRy7I35 X-Received: by 2002:a05:620a:6a04:b0:7c3:d316:1d8e with SMTP id af79cd13be357-7c3d8ed8f4dmr1322282185a.53.1741276635873; Thu, 06 Mar 2025 07:57:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741276635; cv=none; d=google.com; s=arc-20240605; b=GLWC5sxtXp3dSMCFktUuhAn8D9ka/l90XjRBmcFyIzL8/4TyQsEpSO0eFDS93CZCCK TXJeIoEuRbnKFHF+DVFB3GYg8/gftd7g9WcAC/Thw5AvaJM1oqwl1pXHLopV8KNkLX71 UbOVlgBchOzTC5Z9qMw9gFfuoSnSTKD78fwgr1dKd5T36784jdQa0994+e7KhsZXeRWt fR2pkKU9WAQIaGotA6gFy3s7pZQ4vPViZWgCkrDXgjDy91rLUQIvBfw8dbaBG3ddqP+I 7CZm47AYUAEiXzpquCWGL+qNwRw6xJqfUTYMVvPrCZkj0muSumQja/xJ3jAZ/7z8SylT EuJQ== 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:to:from :dkim-signature; bh=Ry6/HgwBxYCoKXfN3GlNL4j5WQBtuJxwtVuKKIpyAK8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Mri7sImFx5hVt2OC2buz5c5ou0pHQCkW9bd5rEyRyV9Lno3L92aWSyYDmP7vZpk7E6 IXm5rFzcP5faBv1c9AQKKkT49Ke2IzOD5ZTyJKIIyMsBMQ/mXTV+6En5JbWv2UVkJq3l RRz+Wgzyh22VdC69tKZoBUK4q0jqifzChPH3uJDS/PJLAeqxcMP+rB1Ia1e7IzbNr9t5 PizBirAi8+N/UVoBV78rek4p4IsxLiSr9GoARf0YewTl04P5/19N4e6pc2IUgHHcTN3R C5XrDR6KE41esjtNtUF6NCQoyr4/evlfwnNu8V94Nd6sjJc947wDO2BvIyIiGk4qdFgR x+lQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o3TpJpR+; 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 af79cd13be357-7c3e54fc97bsi147352885a.239.2025.03.06.07.57.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Mar 2025 07:57:15 -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=o3TpJpR+; 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 1tqDVk-0004sF-7j; Thu, 06 Mar 2025 10:51: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 1tqDUP-0003hL-8b for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:50:27 -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 1tqDUM-0006gz-Im for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:50:24 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3912c09bea5so644473f8f.1 for ; Thu, 06 Mar 2025 07:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741276220; x=1741881020; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ry6/HgwBxYCoKXfN3GlNL4j5WQBtuJxwtVuKKIpyAK8=; b=o3TpJpR+rk3kqyNABZsa41b4IYAbS4RVtAyhEVdTSfGa7CoMx7WcCObYlCsMmW6bKK Mt3kzabmEWKYe9brMV+AOSdQ+LaUEXYLOJ2fOvXjVNKQ8ouoOXTJHN6G3kXGn2oH0lwl f46/UCn3ZQrDRk/Jzah+b3PGuABA4nUSxqNJyX0C8ummdyM8NMXq3lrUlNW4SByENHYi 9IxU7BBvj+Z0bOi8pJmys3T40xwogwGCVUq+Wt1Y2HtifO8rvKMqb1ORZquW2I8Q14Jw nSkpXjm8otrPuErCFXZmpbkK7ADHZp4uwqwp93Mq6Xw7d3iS0iVNtVtVSbPXigV62ZNJ MheQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741276220; x=1741881020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ry6/HgwBxYCoKXfN3GlNL4j5WQBtuJxwtVuKKIpyAK8=; b=dPglJy6bLg3LBhLzCplPTwkzf6eScOgzGMIl2W0o8T5KeGcPs/r4mGgH6tN01XX5l+ GstUwqOcR0spHoTH6FFkiKmt/Adz2gNFn3IVisS9TI9HrQ7My2IblQHCGr1u+z/LHKv8 8sruqPn8ap8lKhR40DTPgjcpsOGhOplJ3Q30p1vkLHyOaiF53qaWBXEa8o20xBGE8gwv XgZRRnd7O5wTWF4Bf8pm/b7SL/8vTjRtRgDyMVCo35FZQQlcyBi8kf3aEeNpzCl/4s5F t7xRAJTOKqxfo5HebtMwWmUA7bKnW9h6zZiv2lMGRjU/n/+v7blgf6ZuO+DBUM8Bz3Rn PqMA== X-Gm-Message-State: AOJu0Yx47LduexftVA0SdkDlX9JrejRXk6NkyvPpHWHn7UCI73abGzdM YmvaH7d2MQxjURcXBCMKi1XrOiGlmlOTIn0gKYbJNzzfyU5fwKgjzIB9Jn5bWRd+AybwgHXki5T m5UU= X-Gm-Gg: ASbGncsjz+kNcmRTa5PLikiKJoq9CJqId76YdC7tUF2Y7FKlWw77T69F1vRVkJ5GZSc jlpic0/V6iMaaj6OYpEuLgi1D2eYCrct8BLD1S4yXfZwaHL/C4w8FNtbe1K6UYy6kIl3YNGa25D LRYOVFnwvnlX3kb3TMl9aZgigJDNgc+bcTaLqQvqapuwl5renvKcmCb2uEExDQ37zW74CRwQ3rR go0EfacQK1fZTCdJEhGIWiYUq1wWUq6Fz0hfyIn0AdVSwHkiMQUs6fdjy3eVAD40dpP9uyzedLb hxnCw++0alYUZ4w/cYze0mFRXP/6qMKgaFaHMGo+PLS7BrIKzi6t59koipaINbQNCTIlqyTBu6g R5CZW587DhqqfRin4GjE= X-Received: by 2002:a05:6000:18ad:b0:391:1388:64b7 with SMTP id ffacd0b85a97d-3911f7c39c7mr6755696f8f.46.1741276220321; Thu, 06 Mar 2025 07:50:20 -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-3912bfdfad7sm2393099f8f.26.2025.03.06.07.50.19 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Mar 2025 07:50:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 36/54] target: Set disassemble_info::endian value for little-endian targets Date: Thu, 6 Mar 2025 16:47:18 +0100 Message-ID: <20250306154737.70886-37-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250306154737.70886-1-philmd@linaro.org> References: <20250306154737.70886-1-philmd@linaro.org> MIME-Version: 1.0 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=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+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 little-endian targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20250210212931.62401-2-philmd@linaro.org> --- 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 + 6 files changed, 6 insertions(+) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 57e41fcd784..2eabd7724df 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 0cd9b70938d..ab328485acc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8691,6 +8691,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 b4b82425b18..d2e739a029f 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -624,6 +624,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 17ede51cd11..1c40c8977e7 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -168,6 +168,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; }