From patchwork Thu Aug 3 07:02:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Heng X-Patchwork-Id: 13339326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5BBAC001DF for ; Thu, 3 Aug 2023 07:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EyZXKeuucZjN1my0eFlScm9uXgrpeyJMTkTXARycRkk=; b=NE0r3sHWzTPyQF VC4q/16Tg0efrMFfT5lDIm1Rv3W5y8JH6QPO0xmJ8NB9tK5Q2u0AwCnMKdMwJEP6SF54qmSTkh4IN b1jsKHZc165Bf4lrcxMVifmAoqMsccVBGg0gcdcxkVO4IvFz1iBbhsqmngud0GOr3SXkmQgSbewdc d+uLEZzg5a3lxmelI0hwELV8PIKCWHr8VnlbrW+IezOJ+Rg5+oYXt+U12D2l1vcyhuhZ8kDeEM+mj CyGyckC6hjKWzTECkrGeRCxP3nEqjrT0nxOjjcyfVnevcEhSAfbhAbznIxspeo5uhn9NfLPlYKtwl xPAZ8TOPibsCn6xcGu7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRSOs-006pNe-2G; Thu, 03 Aug 2023 07:05:34 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRSOp-006pMc-0q for linux-arm-kernel@lists.infradead.org; Thu, 03 Aug 2023 07:05:33 +0000 Received: from kwepemi500024.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RGfsX1RcZzNmQq; Thu, 3 Aug 2023 15:01:52 +0800 (CST) Received: from huawei.com (10.175.103.91) by kwepemi500024.china.huawei.com (7.221.188.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 15:05:17 +0800 From: Zeng Heng To: , , , CC: , , Subject: [PATCH] kselftest/arm64: add RCpc load-acquire to the tested hwcaps Date: Thu, 3 Aug 2023 15:02:31 +0800 Message-ID: <20230803070231.3962475-1-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500024.china.huawei.com (7.221.188.100) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_000531_497902_A78D9BFF X-CRM114-Status: UNSURE ( 9.19 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add RCpc load-acquire and various features check in the set of hwcaps. Test log as shown below: ~~~ # RCpc load-acquire present ok 47 cpuinfo_match_RCpc load-acquire ok 48 sigill_RCpc load-acquire # RCpc load-acquire2 present ok 49 cpuinfo_match_RCpc load-acquire2 ok 50 sigill_RCpc load-acquire2 ~~~ Signed-off-by: Zeng Heng --- tools/testing/selftests/arm64/abi/hwcap.c | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c index 93333a90bf3a..ccb3f6adb68f 100644 --- a/tools/testing/selftests/arm64/abi/hwcap.c +++ b/tools/testing/selftests/arm64/abi/hwcap.c @@ -194,6 +194,18 @@ static void svebf16_sigill(void) asm volatile(".inst 0x658aa000" : : : "z0"); } +static void lrcpc_sigill(void) +{ + /* LDAPR W0, [SP, #0] */ + asm volatile(".inst 0xb8bfc3e0" : : : ); +} + +static void ilrcpc_sigill(void) +{ + /* LDAPUR W0, [SP, #8] */ + asm volatile(".inst 0x994083e0" : : : ); +} + static const struct hwcap_data { const char *name; unsigned long at_hwcap; @@ -364,6 +376,20 @@ static const struct hwcap_data { .hwcap_bit = HWCAP2_SVE_EBF16, .cpuinfo = "sveebf16", }, + { + .name = "RCpc load-acquire", + .at_hwcap = AT_HWCAP, + .hwcap_bit = HWCAP_LRCPC, + .cpuinfo = "lrcpc", + .sigill_fn = lrcpc_sigill, + }, + { + .name = "RCpc load-acquire2", + .at_hwcap = AT_HWCAP, + .hwcap_bit = HWCAP_ILRCPC, + .cpuinfo = "ilrcpc", + .sigill_fn = ilrcpc_sigill, + }, }; static bool seen_sigill;