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: 860251 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp1976337wrq; Mon, 27 Jan 2025 03:56:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU2RVvHMJ5aRxIpbmxLxmyTC7L+hasM1pmb9DWvHuQjZg6ogoDuijdgaDrTCMfxqtBepx2MRg==@linaro.org X-Google-Smtp-Source: AGHT+IHIg5eG7JiIs6VqSNzWqregq1ge0tawuiCcB19ARCRMu+84GVapU827l4Yl0lpuhg6i46vJ X-Received: by 2002:a05:620a:17a3:b0:7b1:19f4:c6e0 with SMTP id af79cd13be357-7be63253f1amr6300062985a.51.1737978982653; Mon, 27 Jan 2025 03:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737978982; cv=none; d=google.com; s=arc-20240605; b=IQLAHdYZsfOs4VF9u1Fpbyqxjs7ey+QH6dNIiLZD+FvTuNTR6+xM4Bn+HdQ1EK1irt ASAdodIFhCH8EGrxDpwLQ90zK/Dets3cVYIvNBS+5vED3ldphTvadzF13B3DI/lfCnfn LNu1vFp6gkCVoIM9DhBmIBCNeScXN6D2wYIVRk7eJT2SmVtxB5jpeiIYObvDcY0iBZ+X mIcOmb8ELB7shTn40dXKT4t0SeKTtEv2gUk1obYO8zHz3elduP618jMlbyJn9jFIcUkk 3JgpxuQElUQV+X7OlkiwMrcH6S0bQKdNx60Xr3Dqjz3A9sU4Q3bdo3lOVVsHtueGdBtj acdg== 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=B4IS3z5t6aeYLZ7NAuHNel+nPJsLHRUkUZSl5ZYMkwc=; fh=UT36gCECAOtEsgOrSReymFda56t2Gj969DHeMwsi3As=; b=TsXp+2QEI/sXcgmuwPof3U1itOZVjCgkz5asiqtNbSU93ifML05DVTROlRI3hEVmRR l10OYYv2JIoxmN97V9Sn9efB1jZIglLor6pqNv2lPdWuWpwCaouuXcU8Zjnue5Cp0D9U QH/SUj4Ui4BCWr4TtIrLJ3TRaaWquM5UgTATluRNSvh4jlZWWAxL+MJc5tNRdkW3HFYo xqqBLWeTyWwd1As/v7ohd/74Up+MXk4PamJQSyPiwpjHy7ItX4NMoylrjyokUIFPTpUY Cc8O+jqTfU1Kk3CuZNdVNfO1UICsrxxTS5mMvyyMxwtrPQpWjvN/qt14g92KE1ig7njB 4mUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=knJHu9Sy; 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-7be9ae81acbsi943671885a.10.2025.01.27.03.56.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jan 2025 03:56:22 -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=knJHu9Sy; 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 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-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+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. 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;