From patchwork Thu Oct 10 21:49:58 2024 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: 834169 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp519314wrd; Thu, 10 Oct 2024 14:51:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVynBoKC5MgBDoVU2D1Yp20ne4JWhKTAYGAZHWmWRHyMhndqE16GvlfoNu3Hr9vW+X2txIdmw==@linaro.org X-Google-Smtp-Source: AGHT+IE7JRim8t+pHyCegWp/maxP2GsAgN0RBOD7dGikFc5z6mD1sebiGcr5IN2/OP0G060rEE6u X-Received: by 2002:a05:622a:1b93:b0:457:cab4:6e4a with SMTP id d75a77b69052e-4604bc4dd81mr5330381cf.37.1728597073985; Thu, 10 Oct 2024 14:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728597073; cv=none; d=google.com; s=arc-20240605; b=Qp62mWAknMy3ehLUuL+Qr/LT5iT5bVkC3EsRp5fewdhC+snXLpb540ZciBpJqRjfdp uwxLBNeYMtv4Pmqzdx0w3ziBRUohIcYI6l6oHE/qShrlhcrgmCv3GUYZ2sDwxO1JPXmH WTq1XwErNKWr2kxYoCCdTRPQDFQA8EzXZN5TTEXlz2o/2FnSEp7sqNVgWBCcG3bVbnm0 chDfyRsN31JGO1CKWUfkeIyigqwoREBSHbGnuu3ErdwPcyBaQj0cy5KY+3ZmGJRdjIEd yIgko60YsfUGbyYdBys/KBCzcwL1ktNliPJphZshcBTQx0UucRo74HJZqijKGhT6PU09 ohDw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=y6VDUacv/t+N2b53bBz4BEo9jleuzzWeufmM8SdWIsc=; fh=iNOTYz49uoInsUbytoQk3tKGszPqK5WeiwnCnA2pNSc=; b=GW1S4IQLE/0SBgibAa4aCvUhife3BBOuxC6HRcmcrywnbiEV6o0igGl4qHO4MKFfz9 5cQmeHSkywm+idBrD6XRu/YtgFnUrq1wM2VW43uUz6D1C2q54SaqlPDrCWK058zDgiMT wTw7wQzgw0WMdneyjZZVqqr1xdhQrlIWz3RSVVbLIThMqHFAqTzGqFfoPbg74piYeZhA KTLhKFRMoSnCW+SN1SX1c1857rpRa1htfyzhYhVqW1CCZOysqIfe3xZ/zvNACmSIQodE HuHQa0g9l7jty3ZHSuFAjPb0+4SHJI3mLI+QciauDTsD8QDCBsxfY2UYgZtqq8YyxZm1 dzQQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Io4BV64I; 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-4604289bd3asi23269401cf.488.2024.10.10.14.51.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Oct 2024 14:51:13 -0700 (PDT) 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=Io4BV64I; 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 1sz13L-0007HU-8M; Thu, 10 Oct 2024 17:50:35 -0400 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 1sz13C-0007Fk-0G for qemu-devel@nongnu.org; Thu, 10 Oct 2024 17:50:27 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sz139-0004cr-MP for qemu-devel@nongnu.org; Thu, 10 Oct 2024 17:50:25 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-20b7eb9e81eso14387205ad.2 for ; Thu, 10 Oct 2024 14:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728597019; x=1729201819; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y6VDUacv/t+N2b53bBz4BEo9jleuzzWeufmM8SdWIsc=; b=Io4BV64IFiS8+AafVqwrCs6Tu0UW1+bWfKIRM+/CSHscTba6q6zlnQfH/I7GcYpss8 wjuGvLNFUs6BviGMq5jSIBzzC45mAOzbhrEIQTFIZFsfOcslVbJkLVmdvWIMJDvKwajG rXMRSe9lYLDR/yv1GacZ+9RGg3VZEgVzj6PFByUYCQ86u/35MW4CgKmJk21ByWcIclOP ecgcN18oRdZ3xnpxV8eN6rNq77M40N2qaLCI8R4tynx9A692HBgXQ6cmkl32GdD6d9Fx iFcVEhOahXvtk2qm2nPI+rcuii/srWichWAV7Wr4av8anmONrtVvH5XwzSAbbGs1kUNs zlBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728597019; x=1729201819; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y6VDUacv/t+N2b53bBz4BEo9jleuzzWeufmM8SdWIsc=; b=JT2LeX3rCqLkTIzZTNY6MKT2Q7qEqy9H6RbwSy9khEA27GfEE4OjSElJy73mw8TLlb WFR261yJzYmqGeWUHyIdbCKv5MDYRsopvhPe6LYPkGkcx3E5bEOIvai6Xgt/aQcvWdn/ TQXelfIH3XatHjxovKFWlLxjenqQhNuQQ4moxBUsOmij42nGAs8TAACu42RCXl/4GYvX 9MdRYZEgjyR9QZ5qbcK9sZFCn2AdSwDm9YBQ0agBLGpOD23CVJQDTMtQ0w7nOmFUPrwb jW/Zae7Gjbl0Xm1X5Gg7k7Wc1fMbQgFr7RZexOmWigpnPUGitayvImhXFGMJHmEr2aMR ED7A== X-Gm-Message-State: AOJu0YzimRz96g225yFITmdhuZQ6iga4hS66yAm/WDwuyAzFXxuc2Iu3 Lqqna3oVFqW2tnO5XMIZxOlOhM3ZCEqGfdi520Gb+EX2O00z05OqLguHqIx9O0mdJjhTey9OVJI j X-Received: by 2002:a17:903:2b0c:b0:20b:9379:f1f7 with SMTP id d9443c01a7336-20ca169e6b5mr4236645ad.40.1728597019591; Thu, 10 Oct 2024 14:50:19 -0700 (PDT) Received: from localhost.localdomain ([45.176.89.169]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8bad344asm13777225ad.19.2024.10.10.14.50.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 10 Oct 2024 14:50:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Jiaxun Yang , =?utf-8?q?Herv=C3=A9_Poussineau?= , Aleksandar Rikalo , Aurelien Jarno Subject: [PATCH v2 00/16] target/mips: Remove target-specific endianness knowledge Date: Thu, 10 Oct 2024 18:49:58 -0300 Message-ID: <20241010215015.44326-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-pl1-x633.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Since v1: - Addressed rth review comment (adding new patches) Get vCPU endianness from CP0::BE bit. Propagate endianness at the board level, using QOM property. Remove target-specific endianness knowledge from target/. Philippe Mathieu-Daudé (16): target/mips: Declare mips_env_is_bigendian() in 'internal.h' target/mips: Rename cpu_is_bigendian() -> disas_is_bigendian() target/mips: Introduce mo_endian_env() helper target/mips: Replace MO_TE by mo_endian_env() in get_pte() target/mips: Convert mips16e decr_and_load/store() macros to functions target/mips: Factor mo_endian_rev() out of MXU code target/mips: Explode MO_TExx -> MO_TE | MO_xx target/mips: Rename unused sysemu argument of OP_LD_ATOMIC() target/mips: Introduce mo_endian() helper target/mips: Replace MO_TE by mo_endian() target/mips: Have gen_addiupc() expand $pc during translation target/mips: Use gen_op_addr_addi() when possible target/mips: Use tcg_constant_tl() instead of tcg_gen_movi_tl() target/mips: Expose MIPSCPU::is_big_endian property hw/mips/cps: Set the vCPU 'cpu-big-endian' property hw/mips: Have mips_cpu_create_with_clock() take an endianness argument include/hw/mips/cps.h | 1 + target/mips/cpu.h | 7 +- target/mips/internal.h | 10 ++ target/mips/tcg/translate.h | 13 +- hw/mips/cps.c | 4 + hw/mips/fuloong2e.c | 2 +- hw/mips/jazz.c | 2 +- hw/mips/loongson3_virt.c | 2 +- hw/mips/malta.c | 5 +- hw/mips/mipssim.c | 2 +- target/mips/cpu.c | 17 +- target/mips/tcg/ldst_helper.c | 15 +- target/mips/tcg/msa_helper.c | 2 +- target/mips/tcg/mxu_translate.c | 18 +- target/mips/tcg/sysemu/tlb_helper.c | 2 +- target/mips/tcg/translate.c | 193 ++++++++++------------ target/mips/tcg/tx79_translate.c | 8 +- target/mips/tcg/micromips_translate.c.inc | 34 ++-- target/mips/tcg/mips16e_translate.c.inc | 118 +++++++------ target/mips/tcg/nanomips_translate.c.inc | 150 +++++++---------- 20 files changed, 293 insertions(+), 312 deletions(-)