From patchwork Fri Oct 4 16:21:11 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: 832733 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp863901wra; Fri, 4 Oct 2024 09:22:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXHlbjAGk32qAUF8jqSJ4DKwimmbd4HaW3GiYyZ97nNWkBDieaL9BmgSKEzgD3GpFXFionisA==@linaro.org X-Google-Smtp-Source: AGHT+IF2HC5lca5GpW+IfFf/RvvNbntVmLDLpUzJXO1psAEBS9ZMF9p+KQHDDiDJiQKy0MCRwbeq X-Received: by 2002:ac8:5a8b:0:b0:458:5fd0:964c with SMTP id d75a77b69052e-45d9bb0c0a8mr35892621cf.50.1728058952624; Fri, 04 Oct 2024 09:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728058952; cv=none; d=google.com; s=arc-20240605; b=FMKcWykcIwUnIM7Je3V+nV3UoK0af9D4+eUBwN16zAJbK2ZGi0SDmuZCn42S99H4vP IHNbIsT13iqcD/NVO98ky6CLtxU6u0VFd6vNZFaR/Om2Zo6QPZGBBXg8ruru7fw+CRgX vjRURenN+3uA50kKtWsjtr/9daSuqH2B9vVovh32NJCMzvRmeQrboeHjI/PZ5TovK9/4 NbKAmd2vyFJ9GG8ezhXOIBY7GCL7tL6GhnGEkiXWOSkNB9ckeYojThzCL1PGZEqAxTBN dVtZP2DLQla8ArIp6mjaHxt9uvjtFvoCUioSho1oT2IZq//fj4YNbABA31QSyp0nno+S cPOw== 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=4OOxOqFJJ2HqgakCTfYbfryttytdC4aA+0dIobma124=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=HMcyDK/lT4A2CUsxC20PlQeOe1CL19llwWm0IhfAMScY8VpyELXR9D1adTJINLw4p3 kOCo+eVp8QTY5YSnDNpN76waqXJHzYrTmZz7cepQbWTx7+wPTBRSNYnVOPtSXHRhQ8mt TfsJoe+E4zNetTBm4RtS76M5GUdBNiCJOnhIWPq4L76pBmXgDseE008ftWyLJ87qi7vG rp6lBNrl4LFFDALQ77v2YlTmJlGp8+Rbxkw8anbEM5T4V+1JbyVmx7ZomRglVPXFaj5Y 3S5WM61VxVHCepQf/knhnPWbpHOz1yjjFtRgRy6dWl/Y2DfagLSN5lkCGyqo/DJc3d77 /kqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlIFSrh0; 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-45da76f5dcfsi946981cf.760.2024.10.04.09.22.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:22:32 -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=PlIFSrh0; 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 1swl41-0003pB-90; Fri, 04 Oct 2024 12:21:57 -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 1swl40-0003kD-0f for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:21:56 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl3x-0004IH-T7 for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:21:55 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2fabe5c8c26so22485441fa.2 for ; Fri, 04 Oct 2024 09:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058912; x=1728663712; 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=4OOxOqFJJ2HqgakCTfYbfryttytdC4aA+0dIobma124=; b=PlIFSrh0yxcgXCr7mZVxqYAKhAT3qUeLGN30iQtSfFphmadQFpOWytjUbPxsrRQWbM 82pDAMitaOC/fCLMxP7XD9JMwdQL3pBx6hYJzrNtVNxFViaEunDr7W3ZmcziMuhmWrqd w1JWpmHJnYSFziEGsXvYQl+sonDZWdQg5G8gyj1sjwL0QrBlKKUqxn3AG7Heb+MNTTPy fB6Oxwv8+Jvw7ONBGukuxMj1HkT5e0KEBcEIDUAwj81WDRucOUbL/xFoNR071DEt+jGh fGX6tn39k7ts4UBS3XUydKRpAcGuTp7jvNp3ux+cgcIITpYQetcj3VVkbIHSwtqsiYRH xGrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058912; x=1728663712; 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=4OOxOqFJJ2HqgakCTfYbfryttytdC4aA+0dIobma124=; b=CdZPwYZGP/HnxXW79BzO+AEzEcU3iZsb9hvnyrSFFmVC+bG9kYk0CIGbLJCq60L7gg pcuP312gh9DjsRt7s4iggD3FDRnTMT9oHW7PTkEnDGrapy/oHmiCQvgUns+A6yQc3DSg reW10WGqj3Lh+oZnXqXBLLY8WTND1bq/1PnBwgsQ0Ym9oV9nXrh/HUUnzAuSnfuOEbyO AD3i1dv1eiKF8mRFnLAnRJ0ZR+bJEBbQlxXOuksxIHdxhgVg5w1yT/bFgIbElEygD4Ka vLbgP4We76BTlre+g0JRopg0H9dYohBnx7Mnb48k48i9GPI0oRd87w0W1Q/++qy/DI+J M0zQ== X-Gm-Message-State: AOJu0YzKlr8GGVnygPi0b8ki359uWrFPVjUwBl6kLp9IpthE1Fo81KiJ 2br2GRDym14kNnUpH6Akr0D8v4c/cxpSCG7g8M5sGH8WB1Vz+WKGQZyZARM7t/MPn8pP7rmSVqZ AosAq451l X-Received: by 2002:a05:651c:1994:b0:2fa:d296:6fbf with SMTP id 38308e7fff4ca-2faf3c1419fmr17307381fa.1.1728058911540; Fri, 04 Oct 2024 09:21:51 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faf9b329a7sm146481fa.104.2024.10.04.09.21.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:21:51 -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 1/8] exec/tswap: Massage target_needs_bswap() definition Date: Fri, 4 Oct 2024 13:21:11 -0300 Message-ID: <20241004162118.84570-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.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 Invert target_needs_bswap() comparison to match the COMPILING_PER_TARGET definition (2 lines upper). Signed-off-by: Philippe Mathieu-Daudé --- include/exec/tswap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index b7a41913475..ecd4faef015 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -28,7 +28,7 @@ bool target_words_bigendian(void); #ifdef COMPILING_PER_TARGET #define target_needs_bswap() (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN) #else -#define target_needs_bswap() (target_words_bigendian() != HOST_BIG_ENDIAN) +#define target_needs_bswap() (HOST_BIG_ENDIAN != target_words_bigendian()) #endif /* COMPILING_PER_TARGET */ static inline uint16_t tswap16(uint16_t s) From patchwork Fri Oct 4 16:21:12 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: 832735 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp864042wra; Fri, 4 Oct 2024 09:22:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQKzgw5T1M9GYjA5P2LshzxuK/+2o7pOUyYhHARnf25erXISmK3xDzO/cu/qSSvPKfmUJr+Q==@linaro.org X-Google-Smtp-Source: AGHT+IFVAPVtBtbO52j/4cJrmbEdx8EaCkBJTAE1Z4BNnxlYJ2/hWzjmAZDYUoWsZ/WICByxqY1K X-Received: by 2002:ad4:5d4f:0:b0:6cb:2e49:a743 with SMTP id 6a1803df08f44-6cb902f2191mr132675996d6.24.1728058972144; Fri, 04 Oct 2024 09:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728058972; cv=none; d=google.com; s=arc-20240605; b=ipXJJn36O2wuxUFIs5Z2PV+oQUHNaVwjA5RqnxElHIiJlVPaxialUdwpcHIhLByW3s xKx1ei0hIvQ6/dp2BT41/yVGLGBmOplVT5YJHHN1UAPddhvymytuOi/qTivm/UwbSF5C +nB3OU8vf61dCWQJdJFiEA5u0eEctdTY5OP35ilPq3AjNMQhBo847Y9adwZgAtkVLxNm G6zmWkCxfa/FdIe3vEJ+/iOkCvf/xrzd8Sx06gI5FmlYu1UpOYnTN+xbmj7MVNEOEJba LIdmePGZToCl2Ij8iHVx6EuA9GlYK27T3jFpZ1LonDznxrUSD7kPl0MNyeBp8pwojpfb 493g== 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=ar5l4AIEpN89iIriQ1A0Rg6FdJgoGAMAWx9ArtF1/do=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=AtxHiNNKi3Kj85cj/gR0L6UEZJezimfLybeYDTGwmx0hdjca4neNNFvaLguLWNQZqv jCsv/eAKEvR0/98o6NJb7pADAsuvyA3sSYQE/oswz7Z/Mk0/+8xCwyVZFkeTnNCEoj2v n7N13z5Hygm1ucB5UOMqT76STGtFtQdDW5D77Dup5kSsvZpyNfo7VXmgBScGW2NIGs2D lP4RIBocH+AbjIv7pnzcwXc9MswSg5W+fj12T/3MtlngAUAo4FHeEjASs++3OGPoGeqm DRPEXWtRE5YxwRbuMDAQrPfcQmRibUFWOShs9Eyf0caeFOQlABMxyHFOoauUlKgnimPk BIbg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ytp0wzKT; 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 6a1803df08f44-6cba4772eabsi1230686d6.419.2024.10.04.09.22.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:22:52 -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=Ytp0wzKT; 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 1swl4K-0004Ek-S4; Fri, 04 Oct 2024 12:22:17 -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 1swl4G-00049L-0Q for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:22:13 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl4D-0004Jv-Im for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:22:11 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2facf00b0c7so30379521fa.1 for ; Fri, 04 Oct 2024 09:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058927; x=1728663727; 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=ar5l4AIEpN89iIriQ1A0Rg6FdJgoGAMAWx9ArtF1/do=; b=Ytp0wzKTkW8NIPEum3ch5BKTIUseSEEti4EBj3Va0PjPyzOXXJoBPmz/aCffQCD0kA 9AUmpDDjj30sz3pDRGZWur0HZtaSt5J4HRvZZOvR+oog+v/tgvFbvdXKhi7N6/fA3W5B B32ke9DsYjLwb1GtCMDtnM08oo1cpf8xGqMRmgGicKna3Y6nWbzEpBGfePAT2wsECryq VsEmgIngAoDDO+dbUYA2WWBzT3GrLK8OnlZpctUYcZWmnkNq+eeUSNqUqWvt3J/g98I+ mXgHCcPOHMPgy114mnh6X/Wy1wBB10iKff14hQEw/46i2FQJZZUkyGeh81kMfIFjrwCb CYVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058927; x=1728663727; 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=ar5l4AIEpN89iIriQ1A0Rg6FdJgoGAMAWx9ArtF1/do=; b=ZxGYrk2bQrMr8ZD7nJ4CgKZNxeTvTJ6j58FixD/HH92/evIBRBsTx7S6UHc15CLDbO +TSPHMYZa7khAYaYk25g3ynW1LxEYcjA5X9Up6TwaqHgpPBuX9bz7VjMSORFx/mF05XL hnS/Mz/SbKiO1stnrXt6gnJdlHFq0GC8z4axKNyN7hTbpGtTWgmudmAL+gCWboTV0B1O po0LEB85lVTs4z/FExY8uTJbNTWspvN8Lt6USvObqUtjHsAxgrF5wZ0DdFeofS07w5Vb zXZJ/HYDk85Txjvpk9S523Xj3vFM9vREJsvUh6w7Q1vXd8Wl9qpNqCi9WveraFcUyGHv JUrA== X-Gm-Message-State: AOJu0YywSJUg5sxywsJ/JjthjhGf/MrBr2zZOGcRtL3rRbzL+TFzrCWG SguuPsPA2a4N3lO9CCZK0IzzIrMoogJdChIKaftKblOSubMy0DN4e+3cO5+hcO0/31A4dRQ8DPY R4SlkvOBv X-Received: by 2002:a2e:b8c9:0:b0:2fa:cf2c:479a with SMTP id 38308e7fff4ca-2faf39f9266mr9732401fa.24.1728058927479; Fri, 04 Oct 2024 09:22:07 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faf9b33027sm161171fa.115.2024.10.04.09.21.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:22:06 -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 2/8] hw/core/cpu: Introduce CPUClass::is_big_endian() handler Date: Fri, 4 Oct 2024 13:21:12 -0300 Message-ID: <20241004162118.84570-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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 the CPUClass::is_big_endian() handler and its common default. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 3 ++- hw/core/cpu-common.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 04e9ad49968..22ef7a44e86 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -150,6 +150,7 @@ struct CPUClass { ObjectClass *(*class_by_name)(const char *cpu_model); void (*parse_features)(const char *typename, char *str, Error **errp); + bool (*is_big_endian)(CPUState *cpu); bool (*has_work)(CPUState *cpu); int (*mmu_index)(CPUState *cpu, bool ifetch); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, @@ -749,7 +750,7 @@ int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs); */ bool cpu_virtio_is_big_endian(CPUState *cpu); -#endif /* CONFIG_USER_ONLY */ +#endif /* !CONFIG_USER_ONLY */ /** * cpu_list_add: diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 7982ecd39a5..aa5ea9761e4 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -26,6 +26,7 @@ #include "qemu/main-loop.h" #include "exec/log.h" #include "exec/gdbstub.h" +#include "exec/tswap.h" #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" @@ -138,6 +139,11 @@ static void cpu_common_reset_hold(Object *obj, ResetType type) cpu_exec_reset_hold(cpu); } +static bool cpu_common_is_big_endian(CPUState *cs) +{ + return target_words_bigendian(); +} + static bool cpu_common_has_work(CPUState *cs) { return false; @@ -306,6 +312,7 @@ static void cpu_common_class_init(ObjectClass *klass, void *data) k->parse_features = cpu_common_parse_features; k->get_arch_id = cpu_common_get_arch_id; + k->is_big_endian = cpu_common_is_big_endian; k->has_work = cpu_common_has_work; k->gdb_read_register = cpu_common_gdb_read_register; k->gdb_write_register = cpu_common_gdb_write_register; From patchwork Fri Oct 4 16:21:13 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: 832734 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp863972wra; Fri, 4 Oct 2024 09:22:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVigL5jg4yEAhLPZFwVMYR1Nn+oJrZ1c+iU4t+/k+r+m4rmlZIKxGS7A7SHk9/NULau8n99yg==@linaro.org X-Google-Smtp-Source: AGHT+IFoiL3Hw5IgtbIXzuhrZGU/uKzbVvb6YeCx7Z4lAxA1VocMtUPcIUjZso65/zSZ1ptMp9Nl X-Received: by 2002:a05:622a:8c:b0:458:53b3:7a01 with SMTP id d75a77b69052e-45d9ba9eaf7mr53801451cf.18.1728058962834; Fri, 04 Oct 2024 09:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728058962; cv=none; d=google.com; s=arc-20240605; b=iUuwfo6kaOjyy8fGCw53VtAp7wSrJICSgdJ2kDQbklxjQXGUDG+/FDyvVHgJuFJ1Z/ viJt3MFxcgWCO4WCT4vQq3sJ5AvxjYM+DiIM69FuaPwE2+GLmVSe/wQMTIDusSRP9yjb XBlaQV/XGIsnC07Xt7RRZ8gJ89voc/npSEJCd0IZ3+MRiMukCuBHWxoBI4XqwRMARc+b b3iaplpMePtj9Gc7yDi6i0D8KAItxFdio+YP2IKnm8ilo4fG3iLeELVVwTZ3JT36iOE0 E9shkJ4Z6UrguuMXzNk287BIv0g1+yKURXVFJXxpd/8ajva2xH/NB4tudzGcS5wf8BEe rFHw== 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=ebEqKdyGGyobi2PRRQ6OMJlevfLMnU19pPI1rOWFDYg=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=CADj9VQGd4OpFoMotnD8E2bBhmK6qBIfV2HLj/ttz8mFRvIY9ik83Nnf8Cm21Kyabr C19+uXPGd1DOUfO/jwEsDGo48kXBuTEvpLXhz0MesHmFhXiX5C+5ijIdDf3WPd8pnzKC arohbU0m6CwDcUgBf4kRdUCOBMmDz5S1As6qfLJxwUQpO+cvTr+f8iSxlSdT6lUZ1dX0 dS7CgLG2ipZdpQ4YvOTyUigLLbRZpg16/PP2FfAsdheLTeHtF4SkWOO4IJSz8MFD2Tw6 S6gg23lSb/nTbLfVbwca2mPR8/Qgc93P/hTUVXqQUOJDcOX5Kw+2r814hBFErHqad34I P12Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QeOk1ome; 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-45da769918csi981651cf.577.2024.10.04.09.22.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:22:42 -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=QeOk1ome; 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 1swl4Z-0004vF-1a; Fri, 04 Oct 2024 12:22:31 -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 1swl4W-0004r7-LV for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:22:28 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl4U-0004LK-9E for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:22:28 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2faccccbca7so21896121fa.2 for ; Fri, 04 Oct 2024 09:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058944; x=1728663744; 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=ebEqKdyGGyobi2PRRQ6OMJlevfLMnU19pPI1rOWFDYg=; b=QeOk1omeyi60bBcIQ8fFXbIOsEtajeYXVHvNf/ZvXGDEQVqiA9e3eOVhtCuoieRgfW pXfR5ojRGVXq30WFIY+n9uUf6Q+CKPMRXd45/crn/BYmZvy2SDrgnitmImYGXGhxFuWK PQNaLNqkCyynv4VW8hyF4dIFufKKrG9qm6byjyxUD4vycaOk5KVf6B+pD+YYf46VyMkh b+K0fTw7SJqTwaWk2BU3ZgecbQ4jAiCqkybYpglqakkb9YE9VngeDzdhwuvLahHQt+4O Wrjb3jkEeUscCm12ThSFXXaI9tZ7zDHfIyQmaAI6CeVri2PkPY+2ANKEHC0mV7P0S5IG 7Wqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058944; x=1728663744; 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=ebEqKdyGGyobi2PRRQ6OMJlevfLMnU19pPI1rOWFDYg=; b=ER0bccNMsrgkhD31HNbbX7UZQaLdPd2CKwnf4T2Pg82tC35lnGLZgEyXJTQFmUOBDB D3FyAykrFCxyZDMl7M2Q/yPAQOV5bfH3e9gkNi7/jRs8/Ljjf8WpO7sxF4y0Efiq+H/1 0j093gv59m586ymVecBfi1I8AbdZOnHVT5+OTmR7eUhcfKy1d1JmjnZThFp5bUIxB604 +EVtFh2jA/FXFVQLffV3lRCdOovWCMIcjtvNqUk9Ow3qevrTUwcadNDQLiCYiB2YJbVv R2l3kpR6LEMFVe4xOcECsz2Wsk0RnN61zJaL8WLi5a9uCNZA00EriRfw9Hg2fVqkBSmf I2Tw== X-Gm-Message-State: AOJu0Yy+TNBYA29B+EjV+iRToDMiQTGRGpeZiTsD/PdAK0i6yaVjr6qT uAezXeVzHb+aDSJMr6NsqThijJNdBgrzFRiy9LgHHUo2JULbN3IsLQAI8NPR3px7xQBVLhVHFgj mgCdJ+A== X-Received: by 2002:a05:651c:a0b:b0:2f7:4ccd:8918 with SMTP id 38308e7fff4ca-2faf3dac918mr20555041fa.43.1728058944270; Fri, 04 Oct 2024 09:22:24 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2faf9ac4415sm164741fa.34.2024.10.04.09.22.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:22:22 -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 3/8] target/arm: Implement CPUClass::is_big_endian Date: Fri, 4 Oct 2024 13:21:13 -0300 Message-ID: <20241004162118.84570-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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 Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 19191c23918..2bb87a9299f 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -122,6 +122,11 @@ void arm_restore_state_to_opc(CPUState *cs, } #endif /* CONFIG_TCG */ +static bool arm_cpu_is_big_endian(CPUState *cs) +{ + return arm_cpu_data_is_big_endian(cpu_env(cs)); +} + /* * With SCTLR_ELx.NMI == 0, IRQ with Superpriority is masked identically with * IRQ without Superpriority. Moreover, if the GIC is configured so that @@ -2692,6 +2697,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_phases); cc->class_by_name = arm_cpu_class_by_name; + cc->is_big_endian = arm_cpu_is_big_endian; cc->has_work = arm_cpu_has_work; cc->mmu_index = arm_cpu_mmu_index; cc->dump_state = arm_cpu_dump_state; From patchwork Fri Oct 4 16:21:14 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: 832737 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp864368wra; Fri, 4 Oct 2024 09:23:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCMKzgtiDfsZdOwAYb8iu35NcQs6zZHUUrgH1kQNHm363apDKihaTjopHdlNkYfMjfQEJZjA==@linaro.org X-Google-Smtp-Source: AGHT+IGDyWP764w74wi6vaWJrOmXgtMWwtonRrKblqwER9poGiKOxn4/lbYgxtX3UmE9j5lrQyco X-Received: by 2002:ac8:57d6:0:b0:458:256c:fb1d with SMTP id d75a77b69052e-45d9bb25a6cmr48045111cf.49.1728059012580; Fri, 04 Oct 2024 09:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728059012; cv=none; d=google.com; s=arc-20240605; b=KyBEqG8jDRVVX9k9A7kt1kKDOEdPY79bIbYqSkaUvh25JkwJENl2h5nPpDmYNMGNTr 99Zad+CgBLq+hQSNG8+OSYWeB4ebK9EFIlCCiTD5/BsCjwcdNoX8DQmLVF1G6Bbh2mzk Fu4yYLchvzPJ2vuLQTHRbQEKKrtRdSGdnXCvq0sIcr+tRJvnx3PBWooAjtkMitzM8D5i 86+Zhlu4SZVxLqa5RUxBsI4TnZTOSamMzN1vguMxq05PGiLBfmWMs8r+oHqA0f0ppuO1 JoDuq4QKM1mAml6ITdY4RoF+K0aRQK+ocsaouFYNU4ZjKxqf+eb6q4nbs9ylFMXHUKBB geYg== 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=mLznYmz+P7vBJ8H0SWJD6m73dHSWXSUG/rbFskhTHcE=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=RH39GOFLKKkQIMKEzP7fYOOMegV+T6/Zsb5vAsh+19AACmTWgXmGdspR9SID1M4TkE QkNuhtOqOncUJMoPTe9qtyigqcRiFzum2bn4k7GoinFIklqCnvNJMHIZBjiKygQEJllf u6/OEFzX3wRdd+Kdxf0kR/5z/59N7r/Rl0Pu+TTIojIGnZDGynjm8WONSHDKZjBCpQD7 9BdS8U0hH7gtpYKBpEGxMXlaa+vetGxqllm1m9lYeJl2/iwFjvygNVm8zuAs/dU0s2LM l5SeqiH/H5ghnSWpCCTnBxoofZ/64jqtHauTRcEYhSBzGpqRNGD37mLC9vOZbEqKKVf/ uLXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aioN/uev"; 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-45da74ac816si1247111cf.32.2024.10.04.09.23.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:23:32 -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="aioN/uev"; 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 1swl4x-0005vL-Je; Fri, 04 Oct 2024 12:22:55 -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 1swl4p-0005hR-8k for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:22:49 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl4m-0004OA-4B for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:22:46 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-53993564cb1so2705909e87.2 for ; Fri, 04 Oct 2024 09:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058961; x=1728663761; 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=mLznYmz+P7vBJ8H0SWJD6m73dHSWXSUG/rbFskhTHcE=; b=aioN/uevlUgE3ioqzYydQ7BAzxp5k+EVy504y2/wi6XeF7jxiAIs1nImK/gD0g/GL0 MV3ZxhK/V+P+91NcWyphMW3u/G4zlBAZn1R/6/JmkWdW6A+wtv06tus0vNSL6pZrjPOE WCuVMJ5htETLtfziJ7/m21quSjpJOXsSPjb732v0bkYth2HOUfDuQD0Jw5UDWjW+vKqT 4bhtdDIUaBZmMS/LRksHJUqY+txsscTeGoUk5cEhb+TwOd7z4cbv3y2hoiEjcrO+TLii fiwDGKINSaHKDc5ua7ttqaT+6Mc29uvf4iX7qx6ITsYXZuBo3CaKK/jXnCAdlsba3x3p Xk+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058961; x=1728663761; 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=mLznYmz+P7vBJ8H0SWJD6m73dHSWXSUG/rbFskhTHcE=; b=phC+rJVSaxItPDdz+gyKO0xoHBla2dOKSYoBLqMyzoPl+xrDfvkozvtmn5Igjp2brQ 8fJ1H1axXa7DB3c1AxeYOxSgkOirLM9+zZH4v1QmED4tVAIO+BF8mEcvvX24CtvX6JKv fzrSouDczXydPYwKkPPqyGud2EwkU46Gr674kthR9bu39RysTas5X08+MU7rQZWyKeHZ PPVn4rtS04gEaxbxZ8+pgqEgW9PJPzD52a/KVlnS01Sw0/8mLxcqkB86veAMTyJJJGV0 khxij0PscUTWKEzEzL/nFWHUYhq4JI2QalEXZymkQKctd7/3B6ORBZjeOJHLvqTmnFEI +ShA== X-Gm-Message-State: AOJu0Ywm+J3ICdnmMYTP4+W2goiOHpTBpD9kDxn7JEJiHVeOw/6CGyLn jVrk3HBVXdRIkUwfL2Pye31PAM52LhbM5JCZhkr8GY5vDICuEbW/BYHjj05ifXK9VK9ZBE7+KLy I9i9sYg== X-Received: by 2002:a05:6512:3d10:b0:533:4522:7409 with SMTP id 2adb3069b0e04-539ab8c2165mr2174945e87.53.1728058961531; Fri, 04 Oct 2024 09:22:41 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a82973f7sm464073e87.120.2024.10.04.09.22.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:22:40 -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 4/8] target/microblaze: Implement CPUClass::is_big_endian Date: Fri, 4 Oct 2024 13:21:14 -0300 Message-ID: <20241004162118.84570-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=philmd@linaro.org; helo=mail-lf1-x12e.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 Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 135947ee800..93c0c6d36c8 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -119,6 +119,13 @@ static bool mb_cpu_has_work(CPUState *cs) return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +static bool mb_cpu_is_big_endian(CPUState *cs) +{ + MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); + + return !cpu->cfg.endi; +} + static int mb_cpu_mmu_index(CPUState *cs, bool ifetch) { CPUMBState *env = cpu_env(cs); @@ -433,6 +440,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) &mcc->parent_phases); cc->class_by_name = mb_cpu_class_by_name; + cc->is_big_endian = mb_cpu_is_big_endian; cc->has_work = mb_cpu_has_work; cc->mmu_index = mb_cpu_mmu_index; cc->dump_state = mb_cpu_dump_state; From patchwork Fri Oct 4 16:21:15 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: 832738 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp864369wra; Fri, 4 Oct 2024 09:23:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWBLiMn3E4CEV4hS6O4zIr2Dj53Trzq5o1ibZvaBoWEPafpxEWStJYqoOLUnozkUtapmQ64mg==@linaro.org X-Google-Smtp-Source: AGHT+IEmtrSCidDCJa0+eFJuVQIMDMdWvvYOKTqw4AYQ7CNQIMa9wAQzqTZ7qIZJGoo6kubH4DEz X-Received: by 2002:a0c:e5ce:0:b0:6cb:73f6:7fba with SMTP id 6a1803df08f44-6cb9a4ea99emr35557026d6.41.1728059012581; Fri, 04 Oct 2024 09:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728059012; cv=none; d=google.com; s=arc-20240605; b=Q6wamWnm/w/MShENUn6u6Epv6l6G+PYuiAqcWrVeqW+20OBa4mSPfy19CEKBu14MLI I8rOeikaX34oRQGjG0fXG3FTj0YvWp/pJJWGBvqsnFCHwpnHXg+NhT5eyXKRunoh1oOO nZ739DPfZj9vSpqhc9uaThchMxrhPGXN1Wkse6a2/MvdZYpnrK8E0dfV/vngBce3TKKD eONOGkgqLJoanLt1ZNj3gO96aum9y4k39gibPdOD0/drLtNl5PsyAnBjmKUntd6zhySq Tw7LHsIzB6OxJTDHMXAGN/g0CNumeF6UxGnWmB8Azz+FE/SLl8RssLYaP0WgJB6XTyiX twpw== 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=Xgf9BvICxNs8M4a+Ynl2kNbkAd0IyBvDVaoxDWmJxpI=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=KJI1cpFHAZ1qEaooyaWF8MhmNUzuXac9rvipwenQAFyz66M9uPknrxTaBaJrpPt4qc DvCRil7u/93Lc54PIcW/pkT6jLCUZyVfsBI9EaFhRVZ0O6sDeaJkLrAHFaDQb/WGTg3N wvDjjKXW8X3ht/yGSOAr6zx+e/RxqA4+ksSSZ2vLoAIijHJfH/bKawudZX/tVYzKEj61 xzGggk697Kluq7VgVrgp+U4Zd8oB0uSL+EXjR0iTUQILyKFeiTqKGQ4UNKKb30jywZFu XT6DOcGfqBZAdznXYJ9xyjUxzLbngW8rdBRIba7IMbQyJHcoiCqMX9rCVnDdTeHQ+MZ5 zpMg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JqwwkUTC; 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 6a1803df08f44-6cba47729a7si1337126d6.340.2024.10.04.09.23.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:23:32 -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=JqwwkUTC; 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 1swl5M-0006dV-CP; Fri, 04 Oct 2024 12:23:20 -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 1swl57-0006MX-Ty for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:05 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl55-0004Ql-Qj for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:05 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5398ec2f3c3so3055273e87.1 for ; Fri, 04 Oct 2024 09:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058982; x=1728663782; 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=Xgf9BvICxNs8M4a+Ynl2kNbkAd0IyBvDVaoxDWmJxpI=; b=JqwwkUTCGAS7MP+bCiTPAeoQsbHN5rRlGRKnOFwamWc0YD3U1gMoWnkDYluQ631gL/ Nn0ovlnL3rNv8k7S50/a3wsgNgtHUKLgKXb5VcX1yUP7IY/elTZhBsKl/1d07OzH9LH6 57V+NrP7bt2HRbzC5va3L4I0gvbb7gU6fc2ohPXMGx639iPiRRPzLbAcAY73c69V0bD4 EGJMoyYwCRH6oWfVuwZJHg6gJFkvV3PSgCuw0g3Hr8INVT97aygSevm9OaR2pRNHEsf0 OMzwIcDdKlF05gqPO5Zj0Vl7Q2bT2lzF9EHjpviFBAiLQfrDE3/T50P0CTsw8s7PF+9B GH6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058982; x=1728663782; 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=Xgf9BvICxNs8M4a+Ynl2kNbkAd0IyBvDVaoxDWmJxpI=; b=gyz9Eoi4wKN27IgNlh4fO52S+aAq5qoOoW6OWSoeo+esBHerz0lKyHOwYXDXemA1xJ vfYzfyFP6q4hc55Ja5ce+LO9pQzP6j7NYHGcJLYoF86Fo8QpCP3/HBEeP1UhzjN0QY0L HV81EMCKFdNMlrLs3NE8JdRA4foY7Taay5KnO7pxYHe9ulh3O78CWX173iHrBEerqjmb jZSVWs7zQdZ5PQMsisqOteFjQDJoNO6UMGbiOIG4DoA/7MI9Obawcqv1xYukjicbztdE BsDg+1k2lHgWUA80e9PtaEdc8kFAWKefGharqQ+PkE2nGZeQGs1etJUk15h3TIH2RpeO zFdg== X-Gm-Message-State: AOJu0YzwhlmZdKOQvqsSYjwgKHEiYOd2IzqdDkMmUR+udcw88L1G1LnF hq5g8RVVwAQ6fd/o9zFQtO4nm3/w9UqyhNq2h1j/3ODbj1jSPQEC0yz8oY1RRpna1srQA+rzcoP cAbRjkQ== X-Received: by 2002:a05:6512:1250:b0:536:a4e1:5fa2 with SMTP id 2adb3069b0e04-539ab88cec1mr2019399e87.26.1728058981712; Fri, 04 Oct 2024 09:23:01 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539afec8093sm483e87.80.2024.10.04.09.22.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:23:00 -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 5/8] target/mips: Declare mips_env_is_bigendian() in 'internal.h' Date: Fri, 4 Oct 2024 13:21:15 -0300 Message-ID: <20241004162118.84570-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=philmd@linaro.org; helo=mail-lf1-x12e.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 In order to re-use cpu_is_bigendian(), declare it on "internal.h" after renaming it as mips_env_is_bigendian(). Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 5 +++++ target/mips/tcg/ldst_helper.c | 15 +++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index a9a22ea00ec..84c8e5e1ae7 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -225,6 +225,11 @@ static inline void mips_env_set_pc(CPUMIPSState *env, target_ulong value) } } +static inline bool mips_env_is_bigendian(CPUMIPSState *env) +{ + return extract32(env->CP0_Config0, CP0C0_BE, 1); +} + static inline void restore_pamask(CPUMIPSState *env) { if (env->hflags & MIPS_HFLAG_ELPA) { diff --git a/target/mips/tcg/ldst_helper.c b/target/mips/tcg/ldst_helper.c index 97056d00a27..f92a923d7ad 100644 --- a/target/mips/tcg/ldst_helper.c +++ b/target/mips/tcg/ldst_helper.c @@ -53,11 +53,6 @@ HELPER_LD_ATOMIC(lld, ldq, 0x7, (target_ulong)) #endif /* !CONFIG_USER_ONLY */ -static inline bool cpu_is_bigendian(CPUMIPSState *env) -{ - return extract32(env->CP0_Config0, CP0C0_BE, 1); -} - static inline target_ulong get_lmask(CPUMIPSState *env, target_ulong value, unsigned bits) { @@ -65,7 +60,7 @@ static inline target_ulong get_lmask(CPUMIPSState *env, value &= mask; - if (!cpu_is_bigendian(env)) { + if (!mips_env_is_bigendian(env)) { value ^= mask; } @@ -76,7 +71,7 @@ void helper_swl(CPUMIPSState *env, target_ulong arg1, target_ulong arg2, int mem_idx) { target_ulong lmask = get_lmask(env, arg2, 32); - int dir = cpu_is_bigendian(env) ? 1 : -1; + int dir = mips_env_is_bigendian(env) ? 1 : -1; cpu_stb_mmuidx_ra(env, arg2, (uint8_t)(arg1 >> 24), mem_idx, GETPC()); @@ -100,7 +95,7 @@ void helper_swr(CPUMIPSState *env, target_ulong arg1, target_ulong arg2, int mem_idx) { target_ulong lmask = get_lmask(env, arg2, 32); - int dir = cpu_is_bigendian(env) ? 1 : -1; + int dir = mips_env_is_bigendian(env) ? 1 : -1; cpu_stb_mmuidx_ra(env, arg2, (uint8_t)arg1, mem_idx, GETPC()); @@ -130,7 +125,7 @@ void helper_sdl(CPUMIPSState *env, target_ulong arg1, target_ulong arg2, int mem_idx) { target_ulong lmask = get_lmask(env, arg2, 64); - int dir = cpu_is_bigendian(env) ? 1 : -1; + int dir = mips_env_is_bigendian(env) ? 1 : -1; cpu_stb_mmuidx_ra(env, arg2, (uint8_t)(arg1 >> 56), mem_idx, GETPC()); @@ -174,7 +169,7 @@ void helper_sdr(CPUMIPSState *env, target_ulong arg1, target_ulong arg2, int mem_idx) { target_ulong lmask = get_lmask(env, arg2, 64); - int dir = cpu_is_bigendian(env) ? 1 : -1; + int dir = mips_env_is_bigendian(env) ? 1 : -1; cpu_stb_mmuidx_ra(env, arg2, (uint8_t)arg1, mem_idx, GETPC()); From patchwork Fri Oct 4 16:21:16 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: 832736 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp864364wra; Fri, 4 Oct 2024 09:23:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXZIaNkzDuzlaof+2c5cqWuSi94kMfxTPKJ7KYd8/dFLUkoum4HnCrSxWi6drryAGxTx+aj/A==@linaro.org X-Google-Smtp-Source: AGHT+IHo+wkQAnxBQtjPm/UMdNxfUxujglBdPWKsKxhASceLLOzOef2vtI1iTusvd5iGu0eo7dhm X-Received: by 2002:a05:6214:2f06:b0:6c3:6e6f:794a with SMTP id 6a1803df08f44-6cb9a330b76mr42414096d6.20.1728059012288; Fri, 04 Oct 2024 09:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728059012; cv=none; d=google.com; s=arc-20240605; b=MG6l3D1lRxvDBkSIZqRJsaMWycwzXqGFE7eg4Ug/D6sQgGmcRQ9JDXK4YUdMfLrYcq Oox7llEsHasZuxNdSfqHIr9T2pmqgSrVa7SD8MKGwtecMSVjG/9jyr716Em/BkdLOcXe 0ydH7nCqGc4Bjs+oDbMdFUcD5FQ+/Y9PKN+GDy/oFB+kGmVTWJ/3qec6y3Bw7H7N4okO 2reShXS7OoplGA3jASRDyMhzmZh9lBUrB8rTzELn0oaNycEJTPwXKbkjMG+vz0fUj11H uT3khOffyC4xaEDJP4HwVCI7cerqUYtw4Q49UGN4YIlN7O0tdFSejdpOOppwB3dnU2bD 3fEg== 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=8EXxbN9xNIe/fch86Xk2ysVTGoSQLunGFBZDl5pFX4s=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=P9i+so/dRox+Q9HUEt0e4djT7tM9xJ6XIjRFKUZpAhNYycPZa02k6F6YqJl7JKWyOv E2Qa4nGgPqvK+dqXvD9jNbChUJGztJySCQdDqB0RyNNf3Rv7T8qW+iMeoJvG2HEhX1/v xtFaah0Q6d6BTwUtZ5PgxyKbaR1LLQ+m2a9zjCHevJEl8FhqX1PWoJ+Q1zU9MLmyA2+J pYrhRKaqhsctSO6GIRq4dj0eF5DFnYdMyoME9xZds2F7F9/aOLnL1e7slBs//uqHT4Bv IZmjKoXhTWTlmheGZNYq3DMcWo/5rMLog0KMWoqTAP6NLxrRxn07WQQlgl4xBlFZLRJZ RtHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zABwxirR; 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 6a1803df08f44-6cba478744esi1246136d6.436.2024.10.04.09.23.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:23:32 -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=zABwxirR; 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 1swl5R-00070C-Vv; Fri, 04 Oct 2024 12:23:26 -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 1swl5O-0006sr-JB for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:22 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl5M-0004TR-0V for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:22 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-537a399e06dso2649118e87.1 for ; Fri, 04 Oct 2024 09:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728058998; x=1728663798; 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=8EXxbN9xNIe/fch86Xk2ysVTGoSQLunGFBZDl5pFX4s=; b=zABwxirR9zGdwUzNB/qmkeoWOcE3czRgqCE2MIUHprD3ravoGKBCjx5giPQ7RvDxH/ +7IKAzXLZi9pJ16MT3lXH0KcsqZmApWb6U/CdnCiZ9Den5F9HK+MwtGAY1YQxAlUK4H1 yt4UTmbdT4JNXlIZHHaIJquoiwaSg+yiHTDEh9Gy+P3ypCnYKA5aR7s98HvmNrz94UIw PUiz8xkyDZoFnnbBUpR4aq2/15PQOLmo5Ufhcr2zT5OMg4GYln1FPf2VDlpWYYwgsGl/ aMTwBLPaexHCXtwpDRakeYteYFjU1oqV8G4H/2A+MuFOM9oJIxnHclxJ/L02DL1pZYKA Ul8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728058998; x=1728663798; 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=8EXxbN9xNIe/fch86Xk2ysVTGoSQLunGFBZDl5pFX4s=; b=sYIwpqWIoQEawMjzgEDeDllyua54rDas9BVHIqv9QTheDcXXdHbMrpdMLQ3U4oj2eh ocAM6fnYf+OE027NzKmnn8kXcdJUTy7fKEnQ7Yyg74vgzgGmAFgTpmP9YjVaFoVSJKFl hAARZdMFbv8yDMoaBYIMT/EVL6APoj64uPSH6WtqNgxisJlCVYTwtdq+P5DAZwhoeouj RNE1hcJkW9pVlGGuD5mAhTeCPq2XN4L0ETKtIL/1/zSCv+zyH6eK3MZh+iZ8cKDt0wOz i31jKAeHxa68xmVbvDw2Jg4PrPzsjSy0mAgU8VyKOWGO+GeOEkU8Ohqp6cQz4XUysezb k4mQ== X-Gm-Message-State: AOJu0Yw/rftqwp6jJP48vcEptZYB+AMqPiDf3m1/A701aKg1Or7gJLau MJJS+UYLCszzJjJ7LBfYOQzjGCr6f9lChp6PPMgvvnbaQFScWwEep5nbQRo1mRzsTxAEVXwM+aX CGo/M6g== X-Received: by 2002:a05:6512:33d0:b0:533:cf5a:eb32 with SMTP id 2adb3069b0e04-539ab8741c0mr2171775e87.19.1728058997637; Fri, 04 Oct 2024 09:23:17 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a82a4f83sm458713e87.236.2024.10.04.09.23.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:23:17 -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 6/8] target/mips: Implement CPUClass::is_big_endian Date: Fri, 4 Oct 2024 13:21:16 -0300 Message-ID: <20241004162118.84570-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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 Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 89655b1900f..ad70ad802a7 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -132,6 +132,11 @@ static vaddr mips_cpu_get_pc(CPUState *cs) return cpu->env.active_tc.PC; } +static bool mips_cpu_is_big_endian(CPUState *cs) +{ + return mips_env_is_bigendian(cpu_env(cs)); +} + static bool mips_cpu_has_work(CPUState *cs) { CPUMIPSState *env = cpu_env(cs); @@ -577,6 +582,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) &mcc->parent_phases); cc->class_by_name = mips_cpu_class_by_name; + cc->is_big_endian = mips_cpu_is_big_endian; cc->has_work = mips_cpu_has_work; cc->mmu_index = mips_cpu_mmu_index; cc->dump_state = mips_cpu_dump_state; From patchwork Fri Oct 4 16:21:17 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: 832739 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp864490wra; Fri, 4 Oct 2024 09:23:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVVhowv2fvwz8yOvkX3cztHFU8pEdhEcljWz5Yiplu1K2lKhlC9870ARsP8nN3RNNMXSdREVQ==@linaro.org X-Google-Smtp-Source: AGHT+IH6Rr6hjO7oTtTs9YuT3BiUjWz7EtIgnBA9TnV6jAHuEgsb/tP+R/tOxWATmfqOM76Sy9SN X-Received: by 2002:a05:620a:19a4:b0:79f:932:86e3 with SMTP id af79cd13be357-7ae6f437217mr484321585a.19.1728059026711; Fri, 04 Oct 2024 09:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728059026; cv=none; d=google.com; s=arc-20240605; b=Us+3xWABfxZQgGwduTW6NqKIH8+sQ9IlpkGriuQ8EwlFdXZ4aJ0OB+dP1cStIdrat1 sWquBdfmCdiVZ9n/eQOD9hPEUSDhlEu+cMppkCa9pZU+D8IbPsRoq8q0RojjFOw/b/53 8M9vA5HMN250GwPs2m5sr2BV0IyV9Cb3abe7/pB8TiUISNiPJOsZ/cJZecosbg1+vBfC vyRq+ZKj7kzRpwJu1W3/ynJZmB3fIsnssCB+y/wKkuQb6IPrmIVTciGMa9wNwYWbihbu FCurKqFOewxxDIQ4ZRkGn5q5kvmnx5XX745VWdaYNu4WlYFJJ4mxT7URlMplZMR+AkA6 jscg== 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=VYw3qJQ7kjnbHLJqdL2EvLbi+7yWM9GeS/O5plTTIVE=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=kG8UdIW4O4mYWA2aJnw2HovKIFjsk0RqTh/P0dcLbZYSFrjfO6Y6yfCCJk7aAew+iU PUWgdngmDw5g2/8tqcFIxtVp3EYhZeUCCEz39TKSavUYDLLYAPiFiOPwXLY+rMJUXiTr KgJrcpDi5nb/cMt95D7YfPZb0Rv2BMJu64YEU58S+gLkEEI6oHWD1JWV8g0ONhzSxvjw Tnx/my8njQ7X9nbHAn44P2LNTY8QRd7pc5YzHRTRsgb/YzkEttFbRqQXa/PdrSZJTZkl xiBvMnmh33A+PHQOl5k32nBblVjF3ILmqE7umVPNoazSxkpJbkgJ0+S/Za6+75vSL+au JK/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pqBa/cjC"; 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-7ae6bb65d82si364433285a.691.2024.10.04.09.23.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:23:46 -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="pqBa/cjC"; 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 1swl5i-0000TT-Sf; Fri, 04 Oct 2024 12:23:42 -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 1swl5g-0000Og-W6 for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:41 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl5e-0004WQ-Km for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:40 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5398b2f43b9so3174816e87.1 for ; Fri, 04 Oct 2024 09:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728059017; x=1728663817; 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=VYw3qJQ7kjnbHLJqdL2EvLbi+7yWM9GeS/O5plTTIVE=; b=pqBa/cjCptOFwkDGGZQzF4gpmYN7wFC8jnomAVv2DL4oLcriIcfy7G+HAXf52yxtXm lw3K/iWBrjGYGHO3tKXNr/vZVBVAzueIJnzW8gEx/Dn8O3Z9oHA7X/4ly3Urdq4n8wza 8qje07EuTqqsN4hzM8R2oZ3Chqb+HgP8mSx26kv6dyZfnX48Puv4UwxU+vpKfuz0J1uR TIyJCCmfkINaN3Tn2XIBvxqIkIT4YKqCSsTKbNNbwmt9mx5/8eKRfMmvM7wunDHosaxD ItiJtmyWREecYNKPNaM4LUzS4Dl1iK5/OoEtkYa41mbhwrxEpXOCrumZikohWKXEwjBb B95w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059017; x=1728663817; 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=VYw3qJQ7kjnbHLJqdL2EvLbi+7yWM9GeS/O5plTTIVE=; b=JnWgz13CxxuA/f9MbT7bMd3aKGO3KpWnCUe7KRYuEjVlEAX3vjfQty4QPDk/jaG84g lsnwQlN75nKdCCvjmJO/iLDoLQg70JSuCAOf1+Ffd9guyVZS1NRg6lweFpgg4fx8eG2a mX3gXZawDc/ipcB435uUSvxWaGUT/w4faHMMFz2C519si5V+/NGSbUAmO6Jp9Na6fK3H BDK1hBwpRzeWlmNZ99N8SRjDOhZE3Pd7LV02cAiJUq8UFtjMT3sUlBMGkIvwlwCo99K9 ReuT3USkfbXcIK3H/0juDjs67nJ2S1uOVD88csOa/K12HDA2iF/+Uw7vYsWgEqk55yGh T8uA== X-Gm-Message-State: AOJu0YznormquyWWPz3HDn0hZtUJGX7bv87+TPTcs37nIgedoGFMfrgj WTS7sGJ9pjhy2SuCIpBXg8bHl04/zyYY0zs/NrNTdQ2FAugJtrvDCpatyEEQ0WCD2ZhxljW+XtQ E2g0oug== X-Received: by 2002:a05:6512:6c6:b0:539:9155:e8cb with SMTP id 2adb3069b0e04-539ac0a9e01mr1184983e87.0.1728059016567; Fri, 04 Oct 2024 09:23:36 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539a82a4f83sm458760e87.236.2024.10.04.09.23.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:23: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 7/8] target/ppc: Register CPUClass::is_big_endian Date: Fri, 4 Oct 2024 13:21:17 -0300 Message-ID: <20241004162118.84570-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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 Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 23881d09e9f..39ec290cdc0 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7341,8 +7341,6 @@ static void ppc_cpu_reset_hold(Object *obj, ResetType type) #endif } -#ifndef CONFIG_USER_ONLY - static bool ppc_cpu_is_big_endian(CPUState *cs) { cpu_synchronize_state(cs); @@ -7350,6 +7348,8 @@ static bool ppc_cpu_is_big_endian(CPUState *cs) return !FIELD_EX64(cpu_env(cs)->msr, MSR, LE); } +#ifndef CONFIG_USER_ONLY + static bool ppc_get_irq_stats(InterruptStatsProvider *obj, uint64_t **irq_counts, unsigned int *nb_irqs) { @@ -7515,6 +7515,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) &pcc->parent_phases); cc->class_by_name = ppc_cpu_class_by_name; + cc->is_big_endian = ppc_cpu_is_big_endian; cc->has_work = ppc_cpu_has_work; cc->mmu_index = ppc_cpu_mmu_index; cc->dump_state = ppc_cpu_dump_state; From patchwork Fri Oct 4 16:21:18 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: 832740 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp864847wra; Fri, 4 Oct 2024 09:24:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEUbp1BdZxqTHXcF79iOJfteVfF3BMTyN7xWggMP+zs2Q176BjH0cilYuQmOv83qHEpmTStA==@linaro.org X-Google-Smtp-Source: AGHT+IFDWo7UudiBN08+xkSkilNF7/TB4b2k52vVFkso7vHttPsnzQmuog/NYaamVEo8azBlnGdB X-Received: by 2002:a05:6102:dd2:b0:4a3:d215:4261 with SMTP id ada2fe7eead31-4a40591877dmr3052572137.25.1728059070278; Fri, 04 Oct 2024 09:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728059070; cv=none; d=google.com; s=arc-20240605; b=EXErkB58yduG0hfuZq2DIe6nTFsfhgHRtoYbSo3ytl9ilVtIdX4oHzjVMDWfdWBXY0 G+O3QmTuUZr5zUyu/3NeXFIRRxIpznTWynwMvLpb8QCLbtcZfDw02BPWH3DbXCoiibfB hX4PFSrQVrOkPGCfpjg1Bxe4xSVekjtr3LdN40jC5KsjXW99MnrmbLXbND/w3hYOdON5 gN5APUgz/PYbthQ3kl4t2Gd3Y38vWmHkmJ45umwdm+F6wayRUCKHnoipnpUX3S9BHWKE wOpPbylZ6vAKvHBIHbj554yxrpnlBR1rmMN6H/HW5KzFDuFEXkXWmtqSxYKSWftvOfA7 P1BQ== 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=Nhw11vsNB7sU+tP522HMuXKhN8uIssw/t+jNogdyCDQ=; fh=IxtCl+9ZHUzZoUVl4S7ob8DSiOMwUZ6EKD3En8tt6Ik=; b=heqtSLTxRGO7c+BvQSOm3X327lXNetcvOkwaL6y+gNXR+vxVpWdpxf1IXkTzOIlVY1 na1DLykzXWoGsEi10HnT9atZcN5A4pnqkC96hsE4V79eNUVu31Lyn8GtcllB9Yr6PQBy n2UPC+lTit2UsaGcedicek9TT1AFs7cfNo+ndO8iG7BLEE4ZJ+QjLaxlY5qzBdht/ui8 ptXSOm8MEM5AFqwAtas2Y9YB88f8GJ0JxUOYmvv4oZiXiLsR0n2XwmFE5LjtAMqNYMIz o1UXTf1qOAhBov+TVpWlrfmZRuTvuqWp7d/Yrgd+/9OzheZL4LzRamqpOmLnpIpifp1a HPWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JSCsNJ4/"; 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 ada2fe7eead31-4a412ebe793si37457137.553.2024.10.04.09.24.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 09:24:30 -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="JSCsNJ4/"; 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 1swl6B-00012W-CP; Fri, 04 Oct 2024 12:24:11 -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 1swl60-0000vM-LG for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:24:02 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swl5w-0004Xv-Cu for qemu-devel@nongnu.org; Fri, 04 Oct 2024 12:23:58 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5366fd6fdf1so3343835e87.0 for ; Fri, 04 Oct 2024 09:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728059033; x=1728663833; 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=Nhw11vsNB7sU+tP522HMuXKhN8uIssw/t+jNogdyCDQ=; b=JSCsNJ4/h4mDFcEIhn6sh/a5cHlTQB0CClsvKocKhtPvyhyblvIgqCujFye5hkL9lC P4HGffO9jgJf/A3qRR+AUliJMiJ1vvDTpBAEEpO4bJy8DgfTUAMMi3M3aiOkwy8wkNlJ T6XDK2shCOscBdQjIaeBIzFTLvig6SBCHKtqdTEmn3q3cmjpDN/LqrPoJp9VCf1nsE0r JmbEM1eq6FynZsw93quaNYNC1jDTPNfIPHSunCwGpbTFZB5bKjHZnehhxtLWk6Wp5145 F66b2OaScIJ3gzd4NvFlEBWVMPF5jENLCZZaE7oYbi0tM1lm79ULgYTDppaJWmWhBs5K S1FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059033; x=1728663833; 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=Nhw11vsNB7sU+tP522HMuXKhN8uIssw/t+jNogdyCDQ=; b=ZM2bfjzkD46huaIEwicHi+Wk2+PpuGQisohq9bwM1ZMAMj5+8Czia5VKPi8ZzEVej5 3Z416jimIIS/AAi5A6lprCUH++uBtPJsLgW6PFiqEA1tRuA0a8rf/YjMo0WZvbm+uRw6 mpFOcIM2/OcIwuV0dZb+ZANEF+9K2xVEjBp30OJY5CoWey6ZK6nBN5jS/ye3UKAd99um Wz9E5yq4xyjzGBlCD2K/PWknfr1Xif6eFvk7uoY+g3KRU30CXgC00i+z6ExyicDaAm57 aN8EcS4fd8FFwWhpcBmQG3WTcflogdmT1LdnBXomloj/W0c8WW1iwQltVGgmXWnJ/pgx YZmA== X-Gm-Message-State: AOJu0YxxYpNtOnUo+l9PSamYjp4CUAJO4N1jtS4F3URGmiv9sQpzu0RR x+EeSk9wQik6UnJfscsL5+G98VB522BgCsEzgH8jBjuhKg2UF6LrKSH7DdJA8AKX7LdrxuGpnE8 9urJKmQ== X-Received: by 2002:a05:6512:a96:b0:52c:8979:9627 with SMTP id 2adb3069b0e04-539ab84a43cmr2465175e87.3.1728059033509; Fri, 04 Oct 2024 09:23:53 -0700 (PDT) Received: from localhost.localdomain ([91.223.100.208]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539afec83efsm684e87.75.2024.10.04.09.23.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Oct 2024 09:23:53 -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 8/8] hw/core/cpu: Expose cpu_is_big_endian() method Date: Fri, 4 Oct 2024 13:21:18 -0300 Message-ID: <20241004162118.84570-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162118.84570-1-philmd@linaro.org> References: <20241004162118.84570-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=philmd@linaro.org; helo=mail-lf1-x12b.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 Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 ++++++++ hw/core/cpu-common.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 22ef7a44e86..2550bc98dee 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -608,6 +608,14 @@ extern __thread CPUState *current_cpu; extern bool mttcg_enabled; #define qemu_tcg_mttcg_enabled() (mttcg_enabled) +/** + * cpu_is_big_endian: + * @cpu: The CPU whose state is to be inspected. + * + * Returns: %true if the CPU runs in big endianness, %false otherwise. + */ +bool cpu_is_big_endian(CPUState *cpu); + /** * cpu_paging_enabled: * @cpu: The CPU whose state is to be inspected. diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index aa5ea9761e4..277c4ee6720 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -66,6 +66,13 @@ CPUState *cpu_create(const char *typename) return cpu; } +bool cpu_is_big_endian(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + return cc->is_big_endian(cpu); +} + /* Resetting the IRQ comes from across the code base so we take the * BQL here if we need to. cpu_interrupt assumes it is held.*/ void cpu_reset_interrupt(CPUState *cpu, int mask)