From nobody Tue Feb 10 10:55:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1608287260; cv=none; d=zohomail.com; s=zohoarc; b=BrRULoqDYbRpXNdEjytKPmoSBJKAVc1veA/NqTtj6GcAuJ4HA1WPeDnOIHdYNN3XCc0MHl1T2EC4v6Jz8ZpUBVFcs8lCBH2KFiVoj16gSVo3krqe1Cc+FewFzChIyCCg7XIKXa3PQUFD+9TfAX6jezCvlmTKDISNUAp33PssfMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608287260; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YbjuEhdxK5YICkARuxB+KNMQo5bJ9YjwvjUIolw9+vk=; b=Xi6VtCjWM1PuM9PTIEWe+/JyFN5pClv60QnJRhVou/Parvo0HXGwzbW4KudTy3MMOJvkiaJQAP77qTCBuEyV/jYqx9TQSFf9Yr3ZQLLXB223Rma7DAn4SRUs1tJk1WDGUgU2wYDcCl/K03Y5sTKV3u1SOUECoNDoOZyPOyvzzI4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608287260931588.395443269082; Fri, 18 Dec 2020 02:27:40 -0800 (PST) Received: from localhost ([::1]:54844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqCz5-0007ma-AC for importer@patchew.org; Fri, 18 Dec 2020 05:27:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqCvq-0002rc-Ew for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:24:18 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:33605) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqCvo-00073d-GY for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:24:18 -0500 Received: from localhost.localdomain ([82.252.144.198]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MCsLu-1kz2dQ0xPc-008oSK; Fri, 18 Dec 2020 11:24:12 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 04/14] linux-user/elfload: Introduce MIPS GET_FEATURE_REG_SET() macro Date: Fri, 18 Dec 2020 11:23:57 +0100 Message-Id: <20201218102407.597566-5-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201218102407.597566-1-laurent@vivier.eu> References: <20201218102407.597566-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:wuqXcLWJwT22rsqHIlWK2F1sTo7/1zk1RaJYfjjLYqGYhHVG29G KAs5Z/ITuLXsPVTBeG96/4DbefAKJBVSZnTL0xeJ3E3wX5z4wpK0joYWLslg35d4jbECwmM cL2liQSctXwRG3b+R6Ih+ISiJXVqe10VRI+8YTVEhHMYLU1OimI1gWn9pkTK/g1lTJSE0v6 lMl49y0KcqW9tVYF6Gs6A== X-UI-Out-Filterresults: notjunk:1;V03:K0:f+doaN3aWXY=:orMGH1C7mjD+XeXIwvhtkP XfjMzpwRltIprXRm10MX5QfRWVj+yNMlCdpoxP4hLjYly9vWqnlpgNiCG63qSf0TupO5GCmxP keRNvl9qE3QyXE5FFFP36VokzD1jy/imjOg0/8YUjFw4W4iyKReSVc2VC6xYOQZQnXWAbSeKj I6cCSZj221Hor4u8/txRUPlAEbe6lYkUrfjqdauPRVk5fGykDDUV/+O83p0f1i9wRSvdiEkqm fLivZm3GZk/quCmqmFX5kCZn90Ghq/OYPyVpVhX/xdLtfjvr+96LzdkUQuWccMDcp83K+c+MN Wju4xg9kIpPRey/oVKn9gUrM6abCQzdDJYoOQU7Q8R73KhUIwGBCDDR+jcYHnRLLVR5Gxvq6E H8csrXCycftV+m1QLKZWs71jfan2E6uSKPiyijr7wcwkBRZ4nl12laOd3AlljecFOY90xuMR5 0E7Ue8Zk0Q== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 ISA features are usually denoted in read-only bits from CPU registers. Add the GET_FEATURE_REG_SET() macro which checks if a CPU register has bits set. Use the macro to check for MSA (which sets the MSAP bit of the Config3 register when the ASE implementation is present). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201214003215.344522-4-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0e1d7e7677c8..b7c6d30723a3 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -992,17 +992,21 @@ enum { #define GET_FEATURE_INSN(_flag, _hwcap) \ do { if (cpu->env.insn_flags & (_flag)) { hwcaps |=3D _hwcap; } } whil= e (0) =20 +#define GET_FEATURE_REG_SET(_reg, _mask, _hwcap) \ + do { if (cpu->env._reg & (_mask)) { hwcaps |=3D _hwcap; } } while (0) + static uint32_t get_elf_hwcap(void) { MIPSCPU *cpu =3D MIPS_CPU(thread_cpu); uint32_t hwcaps =3D 0; =20 GET_FEATURE_INSN(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6); - GET_FEATURE_INSN(ASE_MSA, HWCAP_MIPS_MSA); + GET_FEATURE_REG_SET(CP0_Config3, 1 << CP0C3_MSAP, HWCAP_MIPS_MSA); =20 return hwcaps; } =20 +#undef GET_FEATURE_REG_SET #undef GET_FEATURE_INSN =20 #endif /* TARGET_MIPS */ --=20 2.29.2