From patchwork Fri Oct 4 16:21:10 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: 832732 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp863858wra; Fri, 4 Oct 2024 09:22:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV6ovHgywnWxz2tnrN8NH1fLNF0ug8OioLRHZEqTBYsIngolSNAG1z0/7qoe24vM2IoDPeSiQ==@linaro.org X-Google-Smtp-Source: AGHT+IGIyVVV5A8PWH6dhTo+QerQSmKJHextm0fI7WWytZnDSe3bUW374nd/ixngHcSOjQvFvbNC X-Received: by 2002:a05:620a:4627:b0:7ac:a077:6a3e with SMTP id af79cd13be357-7ae6f45443cmr550859785a.39.1728058948459; Fri, 04 Oct 2024 09:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728058948; cv=none; d=google.com; s=arc-20240605; b=UrWvSwAS4Cvrm0mv9rArjVWDwttPxYJVKaCdHODyHsX4oFLPrfHJR5wiuCCzls0Ymc pmoH1bcIT+qHGdf9Q+JhX+tApMisxd9P+nUawLK/ocaNigcVI2Yvlz5hljkVHGXt4ZPn usP6hAnfsigjyXgj7TbLdvTgloQYiEFC9HXREnvuVTGX8w5e4a8zCrSbC71mNZPoKvQw 7bVzG3SNt2HSfGM52rJNcO0fDlxW32lZmJJ3rHmaqIFOFcjqLNKOR2dYsbFy539rZdbH t3mrshLyWOQJn1msx8TFEh1iLRRTTE79tdDiCMVz+XhSV/QxmeLWZ01fR02UrTTOj2JA tXag== 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=gAASx7TY8bTkB3/GQlruQrs3zPDMiizNhLdumqS8Pfo=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=eSKdFjBymh31i2AcZmgmBzPiQl0aQzBG59a7Z463y1FEwsUJzXOxQXIUsRVgax7bCe 050RAInr25Q2aAolUDSbz8SCfYwyG20Y0995rFh1CkFfZOIzPytdhSj0ig5vLnZnm4Ws J9rx44wPG+ySCfg7z8ZePAqG7VYVsJe3oaQA0xNEjD3yNjAGsK6vo7v9LbvZqpOhqJHh 73jhhVVXPb+t6FYe20hq28wUWoeFHOOtZ+SjngNjS+8YB+kMc0uDzUCVvsaIFdMv+YCc xGU9ugbWTZP1Tb0hhaqAdQGcdy89nwDStP701m8dlWNDbf5C16HBlGnJLZMGj+31jRIl jyOw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YYWsfRmr; 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-7ae6b763b24si352364885a.220.2024.10.04.09.22.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:22:28 -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=YYWsfRmr; 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 1swl3n-0003HJ-NT; Fri, 04 Oct 2024 12:21:43 -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 1swl3l-0003GQ-EE for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:21:41 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl3j-0004GY-9b for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:21:41 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2fac787f39fso25978581fa.2 for ; Fri, 04 Oct 2024 09:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058897; x=1728663697; 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=gAASx7TY8bTkB3/GQlruQrs3zPDMiizNhLdumqS8Pfo=; b=YYWsfRmrAUdvBE2fjC8u/A1UhNObiJZSO3DMLM5RKuqrC9CoeCK5fgG3CrBAaseTTj IW9/eS0h874Kf9J9ru64x9NV8AerkHYLKjndhd2mAvAMooTmStKYLnarDr6vIUzzakr9 sq1NINsqNOeZxg0uBV3FMgnnIrneKhiBVHqvmwD8MdvWoave2PtDmprnDn3qWgYB7qxK GTsNB6FOq4oyAjM1bIHVwNxgeWdyPJfInlALA+o3Wfpzj4fYMs9bfunpm/e/9CRG3y3z OFoKPOzw/oWehykOQ9galj82qwf3Me242ztxg81b/nEjB90TzRYDNxvTwkzaHbEWq2jP sEUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058897; x=1728663697; 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=gAASx7TY8bTkB3/GQlruQrs3zPDMiizNhLdumqS8Pfo=; b=wJrgMyzsWIRiTXsEhotUqXlkZK570doqoBsPGXDQQIPXgTSuKwoftsyx5DSm9HpfSm 6/9zY3EvyIiFsfiTMARDCNPwz/rirlAxbYdFNMTpJyvCJDvjjau7IexlqurMjghnGZRG LrtlNT6R9RkqB8Dr2l2VmMVkGfYWFC3oL27i2NxwZnmdvTEWUoh+840mZj1oqFSjcglU 1bcjd5K7Pwbi5O4ZXKP9oWKxIgo9k+fIYVwIoPEm+8jLmeO8bc1rcu2/lRyVp4rU5om5 onTeJpb5DzGovp1cPiYFImIMdoIEjAbyHwIY+dqmEdutWJ0oqnXcDECV1WA/AA5s5dKi xjCA== X-Gm-Message-State: AOJu0YxMqo9z2BH8igUN3ZRkuVEUTCeox9LRJxmeb//EI16yuwpPKgqt AAkhv82eSD4nCLfZXhdcDFFfuWWQls0a06OM2cWbwJ3vyNYvdo+RzJiRstKc4mSK/TmB6NuCkfu bZBBQOp6Z X-Received: by 2002:a2e:be9d:0:b0:2f7:ad6b:a31e with SMTP id 38308e7fff4ca-2faf3d75b0dmr16935471fa.31.1728058896925; Fri, 04 Oct 2024 09:21:36 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faf9ab1564sm160281fa.7.2024.10.04.09.21.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:21:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aurelien Jarno , Eduardo Habkost , Yanan Wang , "Edgar E. Iglesias" , qemu-ppc@nongnu.org, Marcel Apfelbaum , Aleksandar Rikalo , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Nicholas Piggin , qemu-arm@nongnu.org, Zhao Liu , Peter Maydell , Jiaxun Yang Subject: [PATCH 0/8] hw/core/cpu: Expose cpu_is_big_endian() method Date: Fri, 4 Oct 2024 13:21:10 -0300 Message-ID: <20241004162118.84570-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=philmd@linaro.org; helo=mail-lj1-x233.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 Introduce CPUClass::is_big_endian() handler and expose the cpu_is_big_endian() method. This will be useful later when endianness will be propagated in the slow paths, allowing removal of various TARGET_BIG_ENDIAN uses. Philippe Mathieu-Daudé (8): exec/tswap: Massage target_needs_bswap() definition hw/core/cpu: Introduce CPUClass::is_big_endian() handler target/arm: Implement CPUClass::is_big_endian target/microblaze: Implement CPUClass::is_big_endian target/mips: Declare mips_env_is_bigendian() in 'internal.h' target/mips: Implement CPUClass::is_big_endian target/ppc: Register CPUClass::is_big_endian hw/core/cpu: Expose cpu_is_big_endian() method include/exec/tswap.h | 2 +- include/hw/core/cpu.h | 11 ++++++++++- target/mips/internal.h | 5 +++++ hw/core/cpu-common.c | 14 ++++++++++++++ target/arm/cpu.c | 6 ++++++ target/microblaze/cpu.c | 8 ++++++++ target/mips/cpu.c | 6 ++++++ target/mips/tcg/ldst_helper.c | 15 +++++---------- target/ppc/cpu_init.c | 5 +++-- 9 files changed, 58 insertions(+), 14 deletions(-)