From patchwork Mon Feb 10 21:29: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: 863858 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e42:0:b0:385:e875:8a9e with SMTP id r2csp1807597wrt; Mon, 10 Feb 2025 13:31:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxKuRyo/aB99MY+eYT1WaC57/Ko5e8rARCLmTvlQn6AC2fveelHLNAecNilmZ5MNCjbkLj2g==@linaro.org X-Google-Smtp-Source: AGHT+IFME50/lYxu+HTG4A9OdZvHeQnqVrMhJrVgNonCI6Gro8KQdWjAamydjokXSt3LszzZ4rJ5 X-Received: by 2002:a05:622a:148e:b0:462:b7c9:10e with SMTP id d75a77b69052e-471a1288c90mr12368611cf.13.1739223070604; Mon, 10 Feb 2025 13:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739223070; cv=none; d=google.com; s=arc-20240605; b=M46B/kohkFFI32X7uvcCoGRMogo6OduL01RSlVQExJ60HD3eil+wQo4I/d0wR/5jz2 KyK5VK5b+pZoKMVNxgcR/4l3b8VV6lZN+7A+1pELIwJGZW6GXFR8WkrgFfBlkdIi9EK4 HeKvRCrDw3ih7qJl0OTUDoUHmzfGTM+1als//sphwvB2XTmZBfMGnVEUpSMZFZLBIM/D pDXs5ju+6ErPVZuugvOK8Z4knGLK0fHOokKIRHuzbII+tnoy7OKuI6QDj+Dl1R7lYWsL Mpy6PGCiPGoX/GxzLvSfyqrJh/g10pdWjwaiyZXRMXCiPXYh1Cr5Sb/E3raIzlZWj7uz pRoA== 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=qcxWKPPyBgEMSe447dc/9VeQiSKl/TYrx71q+3sl0Qs=; fh=mM1ERsVQwgcKb3yo7TgbYZeCYb5iRr8ycQ/rB4WqrWI=; b=ldpHjy21Ijd2hWhzR0DDnWhdk8P6fELiyO41qH1ZITLmjQ9N4qvjBEdYsnTEYx91Ts M+PgrFg/Cm0U4Hs/T3lHfnCQMTCYUFedXVVF8+aHUlk9c/kQTemXklXM+lpeQGO+fnfk rjKhXKPpHaNx7ljlJpBZ5VsEZpTvg4AolZCfH0KnaQBm/b2koXNiszxJ2KEN/WIsaaIa NShHMSS8lPWQ7f5KenHdF3F0mEbj2Nu/+B1uCwHPg4/f26TzabCnxSGFotkiz6LlFuy1 hJTLaOful64nVSyWEzk5fQf/4jQ789u1+V9wGogUfbcTnrzMwl60s8lEai138jH/hMby x2FQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGCGHjw1; 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 d75a77b69052e-4714927b601si95804241cf.96.2025.02.10.13.31.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Feb 2025 13:31:10 -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=YGCGHjw1; 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 1thbLh-0003gH-8B; Mon, 10 Feb 2025 16:29:49 -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 1thbLg-0003eG-01 for qemu-devel@nongnu.org; Mon, 10 Feb 2025 16:29:48 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thbLd-0002AI-4u for qemu-devel@nongnu.org; Mon, 10 Feb 2025 16:29:47 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38dd0dc21b2so1745692f8f.2 for ; Mon, 10 Feb 2025 13:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739222983; x=1739827783; 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=qcxWKPPyBgEMSe447dc/9VeQiSKl/TYrx71q+3sl0Qs=; b=YGCGHjw1oU8pzBHCsyn13IzV3jCBNcFtL9Bh9SEMEqiNn2gjcVqhCw+gPAYzMyw8+8 9Hzc461zgTADb3ny9xFsZHLKteDQWXI3jdXgoWQRTjipIt5FVd3MFhdxqMPKN2N3ua4Q TvLzEeefOUB77jz+FtM7fN7t6PvOf8vTz11g7oBV9m2fMwVVYPhYycapxrogtL1vLIOj pjwaKKkPAQFnmf83ZndZ7a5Yi80/9lqQBp0tR7SGu//oPGJ0mksnJR7Isq16i2xKYBRE i5qwvWOZVpTa+R4Hpsb/FRrtuBxzlg8ZJzns+SH0aIIivvDFNJetmq2aTONrKFFUsXoR ww4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739222983; x=1739827783; 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=qcxWKPPyBgEMSe447dc/9VeQiSKl/TYrx71q+3sl0Qs=; b=ctg5TWhWd8B84bpUyAiGG5VEJ8ueTn8WFtN5Eib13ksv/gRZXe/Z/ChJYMXVx+Gwy/ goDdnibM/bb/YISTw9/uniIfLGyRZVeK6RE0hS4cHl3a4hKaC6q8POnRmohtb4pZT8ra VEuSJT7l3WEy1L5/LR1zwzPZ869KA4xrltDHyB6xLJ1MKPhfuGrytjzRbokeWPLnIg+d DrG7WGo7GorX975EcoARnHU/NMFv43U31zP1aAGh/g8nbby/ImxREKXHZHbV08jCcUFH PcSXCttgIh2sUi/jCDy9yxgxo4OIdcUNhXV+GlV1gfXOSyRM4tH9U+eOMmLsqToM7ctC v6vA== X-Gm-Message-State: AOJu0YzoQTUxZrIQ0suXvWyI6DEKTNr/e0yT9BAIK/U62Wn974tNmdIx pch9hSDTGGVU9HoG7RTosinO3WS2mBDjiEd6XtylCcFSP0BW1Uvh/FhpEmWB2WlQ20qomDU5KLk nbp8= X-Gm-Gg: ASbGncuCVc5ysfWP68+be/punZtuaezmWj9WOl5Xxkrr04SOwUIVKeEkv5LcZy3rLWy UbMuHLOAhV1EjYDZ2TMaIQnhRrdIo3BnApDG84R74dvv7w2vpW4mV/tAanBMbqwzPJVHOy4GCqe 6yst95sZ9y0yXr7GL3uV/WHKY6xJwK0UAm4V8WG7pLKqd2uG7Kr9dpxqo9J38NSa98ecLIvvJb4 jJIey1QyBNe2BWj7HCLncLfAhIeiKfdLKIr0cJOL4Dr7miZcSd14r56wFj/X2Gv0v0Pl53gZB9y TvXKkrncBTeSjd5F7p802becdfdUWiGWBMpB3rifZqAQXJX5U0I3nmalgFU6KneV1Q== X-Received: by 2002:a5d:670a:0:b0:38b:f44b:8663 with SMTP id ffacd0b85a97d-38dc93623b2mr8575658f8f.55.1739222983333; Mon, 10 Feb 2025 13:29:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dd8dee385sm6091870f8f.61.2025.02.10.13.29.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Feb 2025 13:29:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 02/10] target: Set disassemble_info::endian value for big-endian targets Date: Mon, 10 Feb 2025 22:29:22 +0100 Message-ID: <20250210212931.62401-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250210212931.62401-1-philmd@linaro.org> References: <20250210212931.62401-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Reviewed-by: Richard Henderson --- 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 4bb5cff624e..d15f8c9c217 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -150,6 +150,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 a74fab43a91..33c81928370 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