From patchwork Fri Aug 4 14:37:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13341989 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 DA9B9C001DF for ; Fri, 4 Aug 2023 14:53:38 +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:References:In-Reply-To: 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: List-Owner; bh=6djcoVV4X1F+2g+fU0Y4PWTrKPP2/xJuQ7zHlI5agBA=; b=Jbf34Gl0VkWu2s aykbReRqq6hFdfUBlhKF7dhrt8Tt+mMnPTioBmv4pFndqJ1mmP+4BgqUw+6EVSBjZTXA0yc7Ucrzg XMdJFPFNIWX5hqI3+q81pHy+G/yJsjUBdxFtS+Yb/Sy4JZFb33XSnErFtV3u5Mc/ZgKwzq8IaGDHJ Qd8kC3haDdyW20rdNzrFAcaWKsvMu19Xu2/AlvyaKbxG3EQ/Iwu3IRfI/mbNB9xYMrLH0RsktB8aG u/X3JCxy08g11QfqSBmh/Q5cVV2TbbesHxXipN7ZJXMRJFaFnfnncUawj8tjw0gOwqyZ+ocZeJwfo vAqo4hVjZc5CzgMccdsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRwB2-00CdNs-2H; Fri, 04 Aug 2023 14:53:16 +0000 Received: from mail-db5eur01on0610.outbound.protection.outlook.com ([2a01:111:f400:fe02::610] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRwB0-00CdNP-1A for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2023 14:53:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HSsGCrGGEY638pEukkzID6LWXOs9zCekGMfmV9KI2bI=; b=A4LMbx4GWhaOzA5Q3HKYK3X2LHfGWT0r+P08CZGaN9hsRvnx+38CKOaOqLvJSpQNfeHO8euHgwwRRA3mFd7CUPWQS1IjJBfwd+xva42CfvzFBPAcW0xOTWSgvqR/Ibrx2uAQqwIAfW18MLa6gPVTvCgp5434m7zxKw0U8jUO5Pg= Received: from DB3PR08CA0027.eurprd08.prod.outlook.com (2603:10a6:8::40) by DB9PR08MB8737.eurprd08.prod.outlook.com (2603:10a6:10:3d3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 14:38:23 +0000 Received: from DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::75) by DB3PR08CA0027.outlook.office365.com (2603:10a6:8::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21 via Frontend Transport; Fri, 4 Aug 2023 14:38:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT046.mail.protection.outlook.com (100.127.142.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.48 via Frontend Transport; Fri, 4 Aug 2023 14:38:23 +0000 Received: ("Tessian outbound d7adc65d10b4:v145"); Fri, 04 Aug 2023 14:38:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9743fd2c2ee2cebf X-CR-MTA-TID: 64aa7808 Received: from 14b6bbc8bf9b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1EFEA095-6300-4273-9625-7A1BC0606DF0.1; Fri, 04 Aug 2023 14:37:51 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 14b6bbc8bf9b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 04 Aug 2023 14:37:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K4t3DO4nA+bOHN9+aUwa8mDN1oaudNZAWjEGVmPVU8QtAgeXyvsV5C4xqVpcLMW0PG9BAIFQD4Xng9PJHhyVU+qaiYjlYakq5j5SNEVOjumLHUdHqjBF+qNJPwCAvAIPgIJnhJMARq3R9L9K83ys834m288yCijJup+rp9CFpTCZ/jflfQFzDWnC0K4anyO+fb6uPR/ZOaLFORH69l08hS40J9Su6oVaqsM9T82ghovQQGwsDEBNG1x9M3rxynWSrVr3VV+zRMwQadZwwsoM5qlTuVo7nwSyP4l+hO4xEGq4Wqwx4E+GTKw6lcTwVNX+hMEvt52f3KcRM9tHmIdVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HSsGCrGGEY638pEukkzID6LWXOs9zCekGMfmV9KI2bI=; b=EdLKHfYkG2PNqBZZKrNom+v6Y0kTQXyD6U0XTXTUT6XjpQXn6hH2Wl41HB7Q+EE1Yk/ui7C97fnSkOYd4r1Rt6C1Ck/evlKxHBRzdYeA9Eb15HPJJgAK8WsUBQm1b/UAMUPRq+MQVGZlVts3ZlkXWio1/Usiy68tvdKe3Z7LfUyUlqGCOA7XFgLlHeRP01aPvRdErhyPrfJEQrMlOX3q4I+NCv+Q9ruvsF38LXEG4ydOvV22lDEg6GnF2c4XwZyD8gfELGYuuA3mutKuVkpmnZ3c760or/dRggW84LTJ3bCgQCLtw1R89g7xxhachMtNJbYhcCh58PsPofQ2XnWp6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HSsGCrGGEY638pEukkzID6LWXOs9zCekGMfmV9KI2bI=; b=A4LMbx4GWhaOzA5Q3HKYK3X2LHfGWT0r+P08CZGaN9hsRvnx+38CKOaOqLvJSpQNfeHO8euHgwwRRA3mFd7CUPWQS1IjJBfwd+xva42CfvzFBPAcW0xOTWSgvqR/Ibrx2uAQqwIAfW18MLa6gPVTvCgp5434m7zxKw0U8jUO5Pg= Received: from AS9PR06CA0573.eurprd06.prod.outlook.com (2603:10a6:20b:486::8) by AS8PR08MB10098.eurprd08.prod.outlook.com (2603:10a6:20b:62a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 14:37:49 +0000 Received: from AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:486:cafe::52) by AS9PR06CA0573.outlook.office365.com (2603:10a6:20b:486::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.20 via Frontend Transport; Fri, 4 Aug 2023 14:37:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT041.mail.protection.outlook.com (100.127.140.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.48 via Frontend Transport; Fri, 4 Aug 2023 14:37:49 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 14:37:49 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 14:37:48 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Fri, 4 Aug 2023 14:37:48 +0000 From: Joey Gouly To: CC: , , , Subject: [PATCH v2 1/2] arm64: add HWCAP for FEAT_HBC (hinted conditional branches) Date: Fri, 4 Aug 2023 15:37:45 +0100 Message-ID: <20230804143746.3900803-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230804143746.3900803-1-joey.gouly@arm.com> References: <20230804143746.3900803-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT041:EE_|AS8PR08MB10098:EE_|DBAEUR03FT046:EE_|DB9PR08MB8737:EE_ X-MS-Office365-Filtering-Correlation-Id: b06f6a30-236e-41a1-a277-08db94f87503 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: kLavNuN9z9Y0hyeYRphejTTHOPUgtZB+lf1wXSwJBv93bygO0zjwBG11VEzVgan3gpewlyUpdFQv4BmyMkliI6tAOGTBXJFrML7LGgAWLXXAknnmSxEnxGWAMTbWg+mxrHpnHPiudAKo8jXc6J4OwBNop9pJuonc4KX4iLtNd9TlVhfauUtlvJyyCakg2t9hzfbEeGF0s/Qr3dwkdJXmq8adF5HX2GKY4TvWXmC5CNVgU3GL12jySn9QLLnRrMJtUo6aS8auSgK/ihAyjpT1Lq7hsxuI5ooIu8YdtyYrWS8FJvSc3gxThp4S1sqlk19R8QqJGjchYLXnRbM51jtPbMAbaMIhXZo7QT6cXDWtSb+hbZi4ThamaYDG8YxkowuLAvReGOry/onqijT/ClANgEHdY9BrpocmqHUrsbMCrAnh2a0Zn1mzzTDbxU+kZKp1khJ8DY15ufdTlUVWZGmSmxWs4vmq8QOIIrj9EF+Qxggz+e8c+VA5BW1urw+hUKzEhotlwfyb456/tfBOUF8eoCEjv5nWAt4PM11ikx1gNzwcEf9jK4hmtOxaqcN+onwtW1RvJCdj0JOoBgJzA2sqMBQvSwFg1Lv4G5Q7wKL1HTEP+01kr/Rm22PLt7MHM55wWmkLuee9dGFd3NFc6yUq5Oi0Ln/CRwuq88FEBf2siDZfHfIajHWapu1WW0+O7rEpFzkCvIGshMmBkZCvWdDKnRrwBIiwrrXD8AB0zv134+AVB7MNC6QgF4VkmQFe+rWY X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(186006)(82310400008)(451199021)(1800799003)(46966006)(36840700001)(44832011)(4326008)(6916009)(70586007)(2906002)(70206006)(356005)(426003)(81166007)(2616005)(1076003)(336012)(82740400003)(47076005)(83380400001)(36860700001)(54906003)(40480700001)(86362001)(26005)(478600001)(36756003)(7696005)(6666004)(8936002)(8676002)(5660300002)(41300700001)(316002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10098 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4cce7319-90d8-4152-3cc9-08db94f86077 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d2DZDwQYYv4G8SBguG/UKAGgWqctoKbx32q+BF9Yn0Dg0CDrBkdr2XXgSqd7jXXBTfcF/2wL9mCypiuLZBSv1t7rcCLEpdsDiiKSnc8earpvZYoYf0atUEkVvblsngZW43kYq++jI6gv6F/v7hqLdhADVybewsoZifmVOi8GS1mRNCKBf8HuUaFzx4CMYaTsJgcEQTeMuafU00DmhfSrfRRN27n9lWpiDYHAfI4TZOti3n/XGNqDIv1W5aA1NyS7prw2Subt2YuLdxqIw78AisjfYrUhUYbN3ODcqZlnRl0DWdkMyb587KjmG6smTA4+Q8xRX7e0+A3fQeDIBoNUkWamgTncvxPJQEKYLMCik5uvcgawaYIN1m4zxr+1WB1ZsD5a+/H2fLoaVqjpc6HuIky/4f2gZldo/GMqXe54XD2oTid5MTmOb0bzs2lxknOarxG2wi9TqhkQl0Izeb0c0aLZqeoObW2r7hTbv++u+bGnavWR2Aq9a2tN0guOIj/J/9CgRPCQnPlK6Ol1xGBAra8E35vwQ3aKBwyCwl9QGCS92OC5q7r4P9sT5mBlmiuoO1asuMj0i03s5xSUQoJzupD5ShJ3+T7bKzkJvU2LeBwCQjmkVG/vBUAFNPstLfMzb37dEiDXB0SNtWRMzmI4KkHihfu7KtRYSY5OBYk3HWyOiHkrQ5zakXgVFLQ9mdx31RYA1w+K0na1QMF5/CP8jxtfHNBltU6CQeCpVN0vElmquYLm8jOlsUQuuDXdE5iK X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(39850400004)(376002)(346002)(396003)(451199021)(186006)(82310400008)(1800799003)(40470700004)(36840700001)(46966006)(7696005)(6666004)(40460700003)(86362001)(40480700001)(1076003)(36860700001)(26005)(107886003)(426003)(336012)(36756003)(2616005)(83380400001)(47076005)(81166007)(82740400003)(5660300002)(41300700001)(8936002)(8676002)(4326008)(6916009)(2906002)(70586007)(70206006)(316002)(478600001)(44832011)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 14:38:23.9029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b06f6a30-236e-41a1-a277-08db94f87503 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8737 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230804_075314_411874_30C5293C X-CRM114-Status: GOOD ( 13.60 ) 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 a HWCAP for FEAT_HBC, so that userspace can make a decision on using this feature. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/include/uapi/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 3 ++- arch/arm64/kernel/cpuinfo.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 692b1ec663b2..521267478d18 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -138,6 +138,7 @@ #define KERNEL_HWCAP_SME_B16B16 __khwcap2_feature(SME_B16B16) #define KERNEL_HWCAP_SME_F16F16 __khwcap2_feature(SME_F16F16) #define KERNEL_HWCAP_MOPS __khwcap2_feature(MOPS) +#define KERNEL_HWCAP_HBC __khwcap2_feature(HBC) /* * This yields a mask that user programs can use to figure out what diff --git a/arch/arm64/include/uapi/asm/hwcap.h b/arch/arm64/include/uapi/asm/hwcap.h index a2cac4305b1e..53026f45a509 100644 --- a/arch/arm64/include/uapi/asm/hwcap.h +++ b/arch/arm64/include/uapi/asm/hwcap.h @@ -103,5 +103,6 @@ #define HWCAP2_SME_B16B16 (1UL << 41) #define HWCAP2_SME_F16F16 (1UL << 42) #define HWCAP2_MOPS (1UL << 43) +#define HWCAP2_HBC (1UL << 44) #endif /* _UAPI__ASM_HWCAP_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index f9d456fe132d..ac764c1dac36 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -222,7 +222,7 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = { static const struct arm64_ftr_bits ftr_id_aa64isar2[] = { ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_EL1_CSSC_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_EL1_RPRFM_SHIFT, 4, 0), - ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_HIGHER_SAFE, ID_AA64ISAR2_EL1_BC_SHIFT, 4, 0), + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, ID_AA64ISAR2_EL1_BC_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_EL1_MOPS_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH), FTR_STRICT, FTR_EXACT, ID_AA64ISAR2_EL1_APA3_SHIFT, 4, 0), @@ -2844,6 +2844,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { HWCAP_CAP(ID_AA64ISAR2_EL1, RPRES, IMP, CAP_HWCAP, KERNEL_HWCAP_RPRES), HWCAP_CAP(ID_AA64ISAR2_EL1, WFxT, IMP, CAP_HWCAP, KERNEL_HWCAP_WFXT), HWCAP_CAP(ID_AA64ISAR2_EL1, MOPS, IMP, CAP_HWCAP, KERNEL_HWCAP_MOPS), + HWCAP_CAP(ID_AA64ISAR2_EL1, BC, IMP, CAP_HWCAP, KERNEL_HWCAP_HBC), #ifdef CONFIG_ARM64_SME HWCAP_CAP(ID_AA64PFR1_EL1, SME, IMP, CAP_HWCAP, KERNEL_HWCAP_SME), HWCAP_CAP(ID_AA64SMFR0_EL1, FA64, IMP, CAP_HWCAP, KERNEL_HWCAP_SME_FA64), diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 58622dc85917..98fda8500535 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -126,6 +126,7 @@ static const char *const hwcap_str[] = { [KERNEL_HWCAP_SME_B16B16] = "smeb16b16", [KERNEL_HWCAP_SME_F16F16] = "smef16f16", [KERNEL_HWCAP_MOPS] = "mops", + [KERNEL_HWCAP_HBC] = "hbc", }; #ifdef CONFIG_COMPAT From patchwork Fri Aug 4 14:37:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13341961 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 D36EEC001DF for ; Fri, 4 Aug 2023 14:39:07 +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:References:In-Reply-To: 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: List-Owner; bh=xJabXpdLMcNAeOqzvcRWuHNQk77uAF8Bn7V3wDNRDBE=; b=RirZw58JBRbz/A ssj1SgvC7RUh6CTvSfeKiKrMwQi2sjYP7oo8VOr4xmM1TXXLp9YtgfN2ev5DzY/XrsCkPATcUudBP j+ZAZ9NI+i7ThvKI0saOugrff67eV6yJOHXLcejkiE4ADjG78U72paDAwOOrwRp7sG9N9ziqpJpEB zvZNW6q6XzVvo9vO0EklNg14tZM34co2rCuSXEx3ZhSmtZY0Cm1fRu3lQrLjqhckTifs0BojJhesl tQ9rBxwvudtcVWqNy5IlUrv0Fkmw/2W2xkRd9wOYjkqdlskvMz6FnE7N/stL1glpeJ5Vkd6IJ8mWL dIv/PE3Qrht3I22iSLvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRvwr-00Cc2M-2A; Fri, 04 Aug 2023 14:38:37 +0000 Received: from mail-db8eur05on2062d.outbound.protection.outlook.com ([2a01:111:f400:7e1a::62d] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRvwp-00Cc0b-1e for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2023 14:38:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GSUb1XCKi8fuhSd1bBTZnWEZ3qW6vygikUhYZKi5vgo=; b=V23hz1YNwToEElaNK+kOkHd1aK69xkgujriy/AmN3Bb1OrK8EFlIxEpmOcc5ZL2jjjR0GorX3UZDRMxAtJdpoo8zcYCYP8iK9UE5ZVAQZ9r98Q5ieCgCjnwuYVGMJxyDadgmU+hDUNDTW2Uo53hgE3AROYq8vuSFrqU2/GohHVA= Received: from DB9PR06CA0007.eurprd06.prod.outlook.com (2603:10a6:10:1db::12) by DB9PR08MB8267.eurprd08.prod.outlook.com (2603:10a6:10:3c5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 14:38:26 +0000 Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::af) by DB9PR06CA0007.outlook.office365.com (2603:10a6:10:1db::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21 via Frontend Transport; Fri, 4 Aug 2023 14:38:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.48 via Frontend Transport; Fri, 4 Aug 2023 14:38:26 +0000 Received: ("Tessian outbound f9124736ff4f:v145"); Fri, 04 Aug 2023 14:38:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3843b96e6a282dc1 X-CR-MTA-TID: 64aa7808 Received: from a64207de25d4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 37B54E0F-57FB-4165-849A-6CAA75D5A576.1; Fri, 04 Aug 2023 14:37:57 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a64207de25d4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 04 Aug 2023 14:37:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eBCCyygKkddPyeFiL9sPw2R3aLT2nxUJbhtRKWQTvxVbrEAjDd6ZAxcrBlcgBlI2oJErgijgvH5FWUofTKFG2OAyFNzhDWg4/xLolcSp28cY7w34HflAl4Ak+at89NO2SuTfE1NTplJZhjWhsCvX0d0ivqsUYaE3D1nLPbi9qc72P1eLvdXPs8IAFWLlWcnd6/2KkT7sutcFaT5R7Hj6d5BpjkxFl1bhFqMJfcZx5xwXzIRUR2Gm0HGsP05pgBQmz+5VH1oDnS4l4stj2njYdckXxiy7/Gwio7Pc6U+TW79zDc/QQI5QKncpwvSowEZlKxQr4H0q+BZqOawSiGWzcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GSUb1XCKi8fuhSd1bBTZnWEZ3qW6vygikUhYZKi5vgo=; b=hXe0py/1e3T6WftLUi3Vnot2H7P232AZ8PDSrUeXb7YtxV1+bXauxLv5xpGDi8j9ORyNu0Tr/h7SMs+mrJAZjilgOwfkJ2QcNXCKgeoCRpOtVP7T+l0+4x/wzzNMhqhluzOhjwsxp0/p4wDtKo/bOIJDEly3lkBOm99wqg3DoiD1Hl1SI2vVO/d1Aa8dtiBS5FmBQuPTy8UHk7CulT3c8ype6qCcHO4NMc4X6RlEY8Q5NgyOwIsLcSWTD1Oe3duxjgcNOdn8wMb+Stlplc6tQHaTFog8UuuA+zY6lls5qvl05++7iFjgeCww+p64dC2Q9i6fcsGZZFVOcuNdmHiyOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GSUb1XCKi8fuhSd1bBTZnWEZ3qW6vygikUhYZKi5vgo=; b=V23hz1YNwToEElaNK+kOkHd1aK69xkgujriy/AmN3Bb1OrK8EFlIxEpmOcc5ZL2jjjR0GorX3UZDRMxAtJdpoo8zcYCYP8iK9UE5ZVAQZ9r98Q5ieCgCjnwuYVGMJxyDadgmU+hDUNDTW2Uo53hgE3AROYq8vuSFrqU2/GohHVA= Received: from AS9PR06CA0584.eurprd06.prod.outlook.com (2603:10a6:20b:486::9) by DU0PR08MB9396.eurprd08.prod.outlook.com (2603:10a6:10:423::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Fri, 4 Aug 2023 14:37:51 +0000 Received: from AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:486:cafe::49) by AS9PR06CA0584.outlook.office365.com (2603:10a6:20b:486::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21 via Frontend Transport; Fri, 4 Aug 2023 14:37:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT041.mail.protection.outlook.com (100.127.140.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.48 via Frontend Transport; Fri, 4 Aug 2023 14:37:50 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 14:37:48 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Fri, 4 Aug 2023 14:37:48 +0000 From: Joey Gouly To: CC: , , , Subject: [PATCH v2 2/2] selftests/arm64: add HWCAP2_HBC test Date: Fri, 4 Aug 2023 15:37:46 +0100 Message-ID: <20230804143746.3900803-3-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230804143746.3900803-1-joey.gouly@arm.com> References: <20230804143746.3900803-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT041:EE_|DU0PR08MB9396:EE_|DBAEUR03FT010:EE_|DB9PR08MB8267:EE_ X-MS-Office365-Filtering-Correlation-Id: 71c0af80-3b1a-4890-82be-08db94f87690 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SOt7VokCe9Xq0Y3+hcJXd9mLbdnVEWwBEKRU5gkyM7J52H4UQJJOh6jOFP3vpAC/akOjn6KQi+1JLV+EnXyJeU4z0+7gIrP/E9VJXgqP3PQH/cqhaHemFGF2gOvRHNs/ii8IsKN5ANyoWITwHZ/lXPXlx9fbzPTEcPFcJKhMu0EnwguQSGhHv3KiaG0o9cMvlz0RKyhsDSOLA8h8kDmO2jQM1me7ensqMIVhbLbu5Ak+7HuLyyAhAqdfjBWhG5BiGJ6MO6J3N6EVIBHJhwwk+jVNL3ag1IyVEaHiJLR99jS8o02Ngtm8k3ceSw02TTeJMF4442K5BC7+/VgpQRB+x2QuBYKeK+Q3HzaNTF08feShNzxT3ny7opELPW/gPMtX9srcPYla/yyLU5ugnKXd/dBf3oKFv3TdsDJ1nLRnNPiCRGV4s8gjujwjy4+qegAmyQZnBYxubvF0MzwhHC7tWZJo8dW6AyJ4fXolHS5Y8B8RSTZkWpZGVQJaAIGKLdKE1II8POZfh3pLm0nhFPiMV5Fg6TCtxRg2weShSGCcq1iH9G+ohZn4H/hdFwFWS8LbaF9oGoIoIsvlI5nmtkeC+hlR+DSPsNoAs8AwNnPexmeSd9pVb7inkl7FD0w46G60khsR1yS1v81FcGA0KL4JpFMA9yVyPlLBP0eaE2ndGZlBcEl4qSWVcgNBf8xcmQCUDXv5/R1v7uPdHYYV6lGhbbWY4uNmkKrW2Ll+Hhi034eNIFa+EFrNnUPnbPF/CxMa33Gg4bn9PsnpmIRdZbKopg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(39860400002)(346002)(82310400008)(1800799003)(186006)(451199021)(46966006)(36840700001)(40470700004)(82740400003)(40460700003)(2616005)(1076003)(8676002)(26005)(336012)(47076005)(4326008)(2906002)(36860700001)(316002)(70586007)(5660300002)(6916009)(426003)(70206006)(44832011)(8936002)(41300700001)(7696005)(478600001)(40480700001)(54906003)(356005)(81166007)(36756003)(86362001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9396 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3b6bb211-90d9-4df9-6805-08db94f8616a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HGsYUJxSa0j2sNWzW35EizKtLM5PoLXlVI3df4OGnM22unequtWttwz9u8mgpytpLU/UDmtbQ8CobZgdQxsvk5Oscw4o8l7ZuQEdNBxVDThr5ZZ6uQ8YQ7brKoa94/K6QCWgGauzpnHP0oMdTw35KHtIcOtkxsN7+hp1wI5W8bUgXontq4ZIJGPvJ7cH5Wzk62IJiGB5+MOovKB1MF18QI5zJ7aV3qREHxFshh+IjVX0zk0dnPbc4wZ6DTyvizaF5wNITIBVsu8JVyjNib/Y8YZZjeeWBg6t8f+lvPKuEyOGTB21FwY7/15A8n1hAOgxopo2y+DeK+oiZ7irqaf7DN0gH9G4ZzinXNx47Y/pHdY7BTJ/3PYIqtIcQK7tpRdnKW3MS/RUpLEgroHcMH1hFE8YklLIT0zht0poU9Qepl1eBV9h7YSSweBtswqI49QKKu+tJVEBveJYzKvkceq4ERcd5s1FGtPD3BqfPl+XsP+0IE66XoI0Q/2SOx1xZrRdIWcH6zBKoTEPgRiqEpEMZiQI1unGMEbGmlOdqkkMDOkLI5cHMjfoO1NDvxipWjNuLU67TGTBM284udTW4zawyMO0DNC5Xj2XEnsKdc4BL7QixqARwJGbKnF8QgXhZ+lH88G1DX70ITg0aLLQPLr4ZSHXdXg3oAX13rNRt57fdxYIQqSvneWLeXGM9cCWwItsrqOH55A5zLZG/7sLtm8+c2+kYNNIKYvtmQMLBBXb3Da9C9T7RxgHg86F8KAsjEQs X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(39850400004)(346002)(1800799003)(82310400008)(186006)(451199021)(46966006)(36840700001)(40470700004)(2906002)(40460700003)(44832011)(107886003)(426003)(36756003)(2616005)(47076005)(40480700001)(26005)(1076003)(86362001)(336012)(6916009)(70586007)(70206006)(4326008)(41300700001)(316002)(7696005)(82740400003)(81166007)(54906003)(478600001)(8676002)(8936002)(5660300002)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 14:38:26.4883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71c0af80-3b1a-4890-82be-08db94f87690 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8267 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230804_073835_586002_7EAFD89B X-CRM114-Status: GOOD ( 11.41 ) 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 a test for the newly added HWCAP2_HBC. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- tools/testing/selftests/arm64/abi/hwcap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c index d4ad813fed10..fabeac9a1b5e 100644 --- a/tools/testing/selftests/arm64/abi/hwcap.c +++ b/tools/testing/selftests/arm64/abi/hwcap.c @@ -208,6 +208,13 @@ static void svebf16_sigill(void) asm volatile(".inst 0x658aa000" : : : "z0"); } +static void hbc_sigill(void) +{ + /* BC.EQ +4 */ + asm volatile("cmp xzr, xzr\n" + ".inst 0x54000030" : : : "cc"); +} + static const struct hwcap_data { const char *name; unsigned long at_hwcap; @@ -386,6 +393,14 @@ static const struct hwcap_data { .hwcap_bit = HWCAP2_SVE_EBF16, .cpuinfo = "sveebf16", }, + { + .name = "HBC", + .at_hwcap = AT_HWCAP2, + .hwcap_bit = HWCAP2_HBC, + .cpuinfo = "hbc", + .sigill_fn = hbc_sigill, + .sigill_reliable = true, + }, }; static bool seen_sigill;