From patchwork Fri Dec 10 16:54:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12695616 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 DB158C433FE for ; Fri, 10 Dec 2021 16:57:30 +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=5UjX0HXwVk3ihMMTJquAkahFtKITN1+PI5FvU4iIiR8=; b=R+gotet0AFnBxc TVFtqvTQBjCmkBQRNz7YCEdJrTRWmQjYHG89MrrnbXWEqHlXOSfSBMVdBKAOxw+lEWrtLHkTddzLp KauFOoXbIMhI63/o7z/p0RvacbJCLnMUzCTSpOXC1bBI9c+SX0YQATZqy7UKXyPsO9H65jUf4/dNP Ol098/oXiL2luaEFRu+Fk43j+RYodPa8M5Q+Uf+pELVvhUPUYC1IpR0v0Zs67vVIEaQjImS1McrNy 4fY+itexlG0oUBTDhyI/Ks2oFxEhTS86j4skYz0EYeZ9GoX9tLjYydi4MUvU+H2OZZpUIKs54khwf vz0eatkRMf2qxEU59yrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvjAv-002etr-0g; Fri, 10 Dec 2021 16:55:13 +0000 Received: from mail-eopbgr30056.outbound.protection.outlook.com ([40.107.3.56] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvjAc-002eob-F6 for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 16:54:56 +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=9lDkNEFk8RQdcEB82yprqZKvXxhkFrSDtH499VMxWy4=; b=BgPU2s+sJEPm0EdP+KXFySHuFoVCrsf0S72NgIQvCTuQZuQuSDYDZRRquBsF9cZ+VSwJmmAYCCEj7ZtJFBSUE+vjfTTsCdpb1Vd841a0Y0/V84FxpFPOhMCxYAgVnReEMsZuqFn+q5dyYJp8WxqdAAEvKBedVL7Qo2KZOlEUgHE= Received: from AS8P189CA0013.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::22) by DU2PR08MB7376.eurprd08.prod.outlook.com (2603:10a6:10:2f4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Fri, 10 Dec 2021 16:54:49 +0000 Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31f:cafe::a5) by AS8P189CA0013.outlook.office365.com (2603:10a6:20b:31f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.14 via Frontend Transport; Fri, 10 Dec 2021 16:54:49 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:48 +0000 Received: ("Tessian outbound f493ab4f1fb8:v110"); Fri, 10 Dec 2021 16:54:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 21248d9cc4fa16ec X-CR-MTA-TID: 64aa7808 Received: from 900cefba5978.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E75E0A84-DCF8-4F3B-A5C8-DD1D7B355D68.1; Fri, 10 Dec 2021 16:54:42 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 900cefba5978.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Dec 2021 16:54:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wan0sL3JXcwGkrAvn9QXGjNOInIapX1eIJ1xgRnxtlKga7VKZ/fuYwRow4qQ/ZKzq2a0Jq45yDUFM9zaODs1xWV1DSIQyXCodpxtv8v7mOvkwqfdb7VGi67eCl41/x8ocbXebGgwM3mQXK4u9Y9K29s8Sl8HS1DVyiSxi6v63JQ3hRSq9GJiGKSwq0aNjWC1ga2GyWzaICUBAUcb53vL0WvYRAT6YYIa/zlVMzWVnwmuuPdMCFElAv2YmQhJYmLI51bHoLO4wahOQH8tNlMOirfiw7NxQr0ZFdBHvd8WllgyIOlemMVDLAtl3bzazCcMcUg7Db2UZevgcMyGSAacUQ== 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=9lDkNEFk8RQdcEB82yprqZKvXxhkFrSDtH499VMxWy4=; b=L26yZhfhyNawPDX0AM3gaR6xt6+z8zY364UkmyxwBwu1h9JHnPjlIxlQ1hb4bb/QZNYw4hmSdC+3tcbQdmb/90TZaMxvhuaEsuH7E5Xaqm+UoTb6H1EXLJN+IPSOrF0xabacAgsBBzdCnPauFXwH1YTxTMEp+14HIc24NYEcdrztg2ADfkbhqWYVv3xkgwk3/P11aCvUA8CrtW42cQZeijzbgfWkez6br0A/tvrbnYIpxz4k852Y8ne0+ZH3AMtVR4MmQjAFJTjC25nAyYFXhNL4DWAOYjkyI5/2mqttknnbE6GNRfgVZux9SsRnDxcJnCS9a3dXJTa4OltpXUNecQ== 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=9lDkNEFk8RQdcEB82yprqZKvXxhkFrSDtH499VMxWy4=; b=BgPU2s+sJEPm0EdP+KXFySHuFoVCrsf0S72NgIQvCTuQZuQuSDYDZRRquBsF9cZ+VSwJmmAYCCEj7ZtJFBSUE+vjfTTsCdpb1Vd841a0Y0/V84FxpFPOhMCxYAgVnReEMsZuqFn+q5dyYJp8WxqdAAEvKBedVL7Qo2KZOlEUgHE= Received: from AM7PR03CA0029.eurprd03.prod.outlook.com (2603:10a6:20b:130::39) by PAXPR08MB6464.eurprd08.prod.outlook.com (2603:10a6:102:df::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.13; Fri, 10 Dec 2021 16:54:40 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::4b) by AM7PR03CA0029.outlook.office365.com (2603:10a6:20b:130::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:40 +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; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:40 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.20; Fri, 10 Dec 2021 16:54:38 +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.2308.20 via Frontend Transport; Fri, 10 Dec 2021 16:54:37 +0000 From: Joey Gouly To: CC: , , , , , , , , , Subject: [PATCH v3 1/3] arm64: cpufeature: add HWCAP for FEAT_AFP Date: Fri, 10 Dec 2021 16:54:30 +0000 Message-ID: <20211210165432.8106-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211210165432.8106-1-joey.gouly@arm.com> References: <20211210165432.8106-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 9dd41f85-8385-4cbc-3452-08d9bbfdc6e4 X-MS-TrafficTypeDiagnostic: PAXPR08MB6464:EE_|VE1EUR03FT058:EE_|DU2PR08MB7376:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: MfQQ+TEmhube+EeOfGBQ1g8PSPPqrxuM6fDdsm60n6NTXuxmcIWmpVVvPzkXWQRPn99To622MF0uJ0lygYw+TwaU0pK38+Jr82S3rVnca/mQxm/hpONVPSmOMOvgnNQVjABRdpuC8VeG1LEoZpY3I8LoTFgB7VoI4OUTJ6xZOQTI5Itjf0vLJCJ42XJte2nTqmQfunXRQ+WXsD5F2L2qXZPuCLEY1+1WPVwQb35aszPVE/6KSQ+K3sQuNgaoDk41kZX/1mb29yoQOEiBkBMJGr8+oA9x3qqPAII1SvOIybEKIdESv29i+Cxsh1b1L/vd/YKK9wXTn5sOUYFvhyP8Gb0t459tOBqVBX1qRc09S7El2J0Tb293PaIVMxx/pgUm8YYTcIDulrUwgXdrxRT/YUtT1H42Bn1UPpgUkQUiSFAfUNt5W4Y2dk5cNW9PO2pMMePZIPS3pcnETF6dTkg/BvyaoSM+0WKY7cxWX3pd3KSJSjbli0lcoXAz+Uqd91Tf/+JaqjfbtLWnZvbZrGSbYC8dvQaOPUKv+mYEwaozS2dIqlKvGaJtcmYxOGl8Ej5dSZFto9slG/nosxCGEKa3KcnWU72WPZ2Y1Ih3zTYfixJ0KPS1RYUqz90HAguPDHD8wQEv3/XBRqKuHqRL1kE4dX7qYPoAKnm+Set0aaaO3WmZU0jpNtEkUI6ULXk3xFGotZ0/wnj8n7GFWIWF2zV3nmKjgQk0602hKmb3JtZEcSMa0Fw7xC3SzDM4Pi2tCdGP/u9KuEllashcogQBG8x1JNkYuEDk0vFfHzImt1rcBxE= 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:(4636009)(46966006)(36840700001)(40470700001)(1076003)(54906003)(4326008)(186003)(83380400001)(36860700001)(8936002)(316002)(26005)(6916009)(81166007)(86362001)(47076005)(70586007)(70206006)(44832011)(508600001)(2906002)(5660300002)(356005)(7696005)(336012)(36756003)(2616005)(8676002)(82310400004)(426003)(6666004)(40460700001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6464 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d357f2d5-ec90-4f14-f61f-08d9bbfdc1d8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6vWPCGSNrYSu8eRiPoTVOnVw02tYq3M3+IaC5ilvqxxh/CiAREjtvkjSrP4zsSYb5gRV1mSniORHgSLaALIKBgKl8F0KFdWnJeN8IiqUuw02VSzRq3VHU8wFvLPFYrt/qeua6k2mQktX4yUPdtP2r3+qTcllDCeD4L4gbke/FMV1X5bSYhbpXQ4Zkm7VT5s+202vsD7D4pxylf6RhXGyF+zZdXpZ5VptbdHInyLjUn7TB/zHUjJTrxXClPXWQvlkFv0smkvfCVTmcHuNvAOHy5rWzmzE+Pz8zuq1biEhw7fWhVRu8iKTZAiGNjA8qJ1DWN6XUf8ZNfQqUdYoPdgS/x0NZFmNDyB4DBQrLuqWFTwzveeGE6sj7YaRd4ZeBnjJ+vmqf/O0sYCkfCsBSEe4bHqHc2Vcn+zRhzZjFgsSacEdtY/T4Tj9+3oydKVfsoxLnvE95SB2Iethij/NzqSGnjzKJ0OmVBzLNHo1m/RXtkWJLQGyNQdSaYD78EWG3qPofQPYjMuVw9WPWhcImn/jglRLDxGYxCsht8ziiR2VoyCfltBCGXYk1RzbEipQrDJIyEkU6kEsBHbGrWxdiEZqn8lFn+/8/J0kClgcA0gcnIPa0IPOsRwYqQmu2qpwIhFqOUiF8duWSGnWSx5MJtcFuF8nL+Jmo2t+0eeGWDmsBvv0rVRgGPGX+hq7pR8ZN7Z/l/Fmp1OT/3cDeqt3ZMi79IGyMef3zaFzqYLcVmpw7KkbDJzX529thsIDWItcUFc5a1bJAxb/VC5wbwoIdD13zw== 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:(4636009)(36840700001)(46966006)(40470700001)(47076005)(81166007)(86362001)(70586007)(44832011)(36860700001)(186003)(54906003)(336012)(70206006)(508600001)(4326008)(5660300002)(40460700001)(6916009)(26005)(2906002)(8936002)(8676002)(7696005)(426003)(2616005)(1076003)(107886003)(6666004)(82310400004)(83380400001)(316002)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2021 16:54:48.6506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9dd41f85-8385-4cbc-3452-08d9bbfdc6e4 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: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB7376 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_085454_710024_ECF562D1 X-CRM114-Status: GOOD ( 13.18 ) 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 new HWCAP to detect the Alternate Floating-point Behaviour feature (FEAT_AFP), introduced in Armv8.7. Also expose this to userspace in the ID_AA64MMFR1_EL1 feature register. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- Documentation/arm64/cpu-feature-registers.rst | 9 +++++++++ Documentation/arm64/elf_hwcaps.rst | 4 ++++ arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/include/asm/sysreg.h | 1 + arch/arm64/include/uapi/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 2 ++ arch/arm64/kernel/cpuinfo.c | 1 + 7 files changed, 19 insertions(+) diff --git a/Documentation/arm64/cpu-feature-registers.rst b/Documentation/arm64/cpu-feature-registers.rst index 9f9b8fd06089..1b19d20c2dbd 100644 --- a/Documentation/arm64/cpu-feature-registers.rst +++ b/Documentation/arm64/cpu-feature-registers.rst @@ -275,6 +275,15 @@ infrastructure: | SVEVer | [3-0] | y | +------------------------------+---------+---------+ + 8) ID_AA64MMFR1_EL1 - Memory model feature register 1 + + +------------------------------+---------+---------+ + | Name | bits | visible | + +------------------------------+---------+---------+ + | AFP | [47-44] | y | + +------------------------------+---------+---------+ + + Appendix I: Example ------------------- diff --git a/Documentation/arm64/elf_hwcaps.rst b/Documentation/arm64/elf_hwcaps.rst index af106af8e1c0..247728d37911 100644 --- a/Documentation/arm64/elf_hwcaps.rst +++ b/Documentation/arm64/elf_hwcaps.rst @@ -251,6 +251,10 @@ HWCAP2_ECV Functionality implied by ID_AA64MMFR0_EL1.ECV == 0b0001. +HWCAP2_AFP + + Functionality implied by ID_AA64MFR1_EL1.AFP == 0b0001. + 4. Unused AT_HWCAP bits ----------------------- diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index b100e0055eab..2809df2fdd63 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -106,6 +106,7 @@ #define KERNEL_HWCAP_BTI __khwcap2_feature(BTI) #define KERNEL_HWCAP_MTE __khwcap2_feature(MTE) #define KERNEL_HWCAP_ECV __khwcap2_feature(ECV) +#define KERNEL_HWCAP_AFP __khwcap2_feature(AFP) /* * This yields a mask that user programs can use to figure out what diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 16b3f1a1d468..adcab9009f9d 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -889,6 +889,7 @@ #endif /* id_aa64mmfr1 */ +#define ID_AA64MMFR1_AFP_SHIFT 44 #define ID_AA64MMFR1_ETS_SHIFT 36 #define ID_AA64MMFR1_TWED_SHIFT 32 #define ID_AA64MMFR1_XNX_SHIFT 28 diff --git a/arch/arm64/include/uapi/asm/hwcap.h b/arch/arm64/include/uapi/asm/hwcap.h index 7b23b16f21ce..180da7396549 100644 --- a/arch/arm64/include/uapi/asm/hwcap.h +++ b/arch/arm64/include/uapi/asm/hwcap.h @@ -76,5 +76,6 @@ #define HWCAP2_BTI (1 << 17) #define HWCAP2_MTE (1 << 18) #define HWCAP2_ECV (1 << 19) +#define HWCAP2_AFP (1 << 20) #endif /* _UAPI__ASM_HWCAP_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 6f3e677d88f1..71ff5a4afb0f 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -325,6 +325,7 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr0[] = { }; static const struct arm64_ftr_bits ftr_id_aa64mmfr1[] = { + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_AFP_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_ETS_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_TWED_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_XNX_SHIFT, 4, 0), @@ -2476,6 +2477,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_MTE_SHIFT, FTR_UNSIGNED, ID_AA64PFR1_MTE, CAP_HWCAP, KERNEL_HWCAP_MTE), #endif /* CONFIG_ARM64_MTE */ HWCAP_CAP(SYS_ID_AA64MMFR0_EL1, ID_AA64MMFR0_ECV_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ECV), + HWCAP_CAP(SYS_ID_AA64MMFR1_EL1, ID_AA64MMFR1_AFP_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_AFP), {}, }; diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 6e27b759056a..0e52014019f6 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -95,6 +95,7 @@ static const char *const hwcap_str[] = { [KERNEL_HWCAP_BTI] = "bti", [KERNEL_HWCAP_MTE] = "mte", [KERNEL_HWCAP_ECV] = "ecv", + [KERNEL_HWCAP_AFP] = "afp", }; #ifdef CONFIG_COMPAT From patchwork Fri Dec 10 16:54:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12695617 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 DE56EC433EF for ; Fri, 10 Dec 2021 16:57:37 +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=e3YdJyIER4F2SF/NFRfEsiq13ExJobLcvGZIH3AWdn0=; b=0jKf0NluFB95My UxSnGSnNygMueuF3knHY/XCc7v+pbTyfSV+5HzH+lXXarPthqGuqqXxZZLFwHdQT3spj1AEG39KGJ BSxkUPOoJxtspmhwWFYyj6o8rK5utWWD2rOPjOJXN/vUP5n+J3w5SdGvHaM7fWGDPnH6BzuX7qrWh RCfEo0RUehQJKPE5f90tI1KZlaRnBixz4cDZeM6qqJePQJR5DnA808qsAoegw/1D81GfT1Gn1ewRe xYGZDZTKgf1M0fuo6vgasB0LZR6BarGVgcVQvyVqVrnaCZs2MRgcH0YeZiYTmWmX3KfDDf6zfhk7Q IOn2q2IDDYbr6PUDSoxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvjB6-002ew0-Pf; Fri, 10 Dec 2021 16:55:25 +0000 Received: from mail-db8eur05on2058.outbound.protection.outlook.com ([40.107.20.58] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvjAd-002ep9-RQ for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 16:54:58 +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=DS9lQpzQ7G2RmpEUXjkbhad06QUbPky/X1eYpTGxy2o=; b=vRWgHjEsKerh8PBUWIKH9eynnrln2xo1dTFDSGyVIRvWjqq0xmmdIL5Xo8SVW1U8ZfnNihFgQuh/JsafcHy7bMMJKgzkEbJ8VNrKpK2je8g8r542JAVUALRHrSkb5OQEstJ2OqCWWWCQy83DqrVq0LYbnZvgPJCoeHaICfviWAk= Received: from DU2PR04CA0284.eurprd04.prod.outlook.com (2603:10a6:10:28c::19) by AM8PR08MB6513.eurprd08.prod.outlook.com (2603:10a6:20b:366::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Fri, 10 Dec 2021 16:54:53 +0000 Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28c:cafe::ef) by DU2PR04CA0284.outlook.office365.com (2603:10a6:10:28c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Fri, 10 Dec 2021 16:54:53 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:53 +0000 Received: ("Tessian outbound a33f292be81b:v110"); Fri, 10 Dec 2021 16:54:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ffcd13d52515d581 X-CR-MTA-TID: 64aa7808 Received: from 747c70be337e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BE4C81E1-330C-4DB7-A25C-D5559A45FFD2.1; Fri, 10 Dec 2021 16:54:46 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 747c70be337e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Dec 2021 16:54:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HsSjAYN61mtGItllMisjo7U4dFhS+xJKZbLfTjvTmh4p5TfHAfJoevKvIo3+H0evIBrYG7szJpPwBO7rJKccjfLK6mF9ES1NHQG1wM8Z4G+W6wZcBonBjG8LJJw6fP/uEiXR+A726vf2yPP/MkWCk8Qpg10iPSWMvEBzKerQ9qltsR0Hr5TjF4ptaGS21i36OYvTeGQg80F2F7dC5JzagfVDWjksFTzEUllwFms/vx1XbP/zpHRrnYN2i203hShcmQbhNgpgFSyGOiCIVFgeXL515xxI951ULcYt6w+w+dbbLO2uWoFwzIiVo2bvyG9bzA7uRwvRvXs/c6rrAadf5w== 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=DS9lQpzQ7G2RmpEUXjkbhad06QUbPky/X1eYpTGxy2o=; b=H8AJs6D8tfGENxZ1xkPbWsHraLeU5ibpiXICGC6kwvO7FvZhLFXAaPLSa1XIHUD+AqNDj71HC9TvAgs0lhncAdhQ9Kq2k9J1POabCOOKzymzem3Tkxm4WjJY2P2mzWiS6cfMqnj1suIHW6YIQJHJdymTAw7NLq5vwKOIC/f94q55pCBxWkhaimO3FtjIm4KLyBp/f4yAaYbsESnnPwMIzPpLf/vAtHotcC96CvCnHJDQcDapVkZQCqAKVUX24eVbdBXQ3afLLN0UTOj7GNvLpkwP1Io07ta19GOsPLK1GgMpEhaOkTjKk5C5NknochIpT8DhcX8ZRExezkFldkI5bg== 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=DS9lQpzQ7G2RmpEUXjkbhad06QUbPky/X1eYpTGxy2o=; b=vRWgHjEsKerh8PBUWIKH9eynnrln2xo1dTFDSGyVIRvWjqq0xmmdIL5Xo8SVW1U8ZfnNihFgQuh/JsafcHy7bMMJKgzkEbJ8VNrKpK2je8g8r542JAVUALRHrSkb5OQEstJ2OqCWWWCQy83DqrVq0LYbnZvgPJCoeHaICfviWAk= Received: from AM7PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:20b:130::13) by VE1PR08MB5774.eurprd08.prod.outlook.com (2603:10a6:800:1a1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20; Fri, 10 Dec 2021 16:54:44 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::1e) by AM7PR03CA0003.outlook.office365.com (2603:10a6:20b:130::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.15 via Frontend Transport; Fri, 10 Dec 2021 16:54:44 +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; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:43 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.20; Fri, 10 Dec 2021 16:54:38 +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.2308.20 via Frontend Transport; Fri, 10 Dec 2021 16:54:38 +0000 From: Joey Gouly To: CC: , , , , , , , , , Subject: [PATCH v3 2/3] arm64: add ID_AA64ISAR2_EL1 sys register Date: Fri, 10 Dec 2021 16:54:31 +0000 Message-ID: <20211210165432.8106-3-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211210165432.8106-1-joey.gouly@arm.com> References: <20211210165432.8106-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 10269d66-446a-49b8-8227-08d9bbfdc977 X-MS-TrafficTypeDiagnostic: VE1PR08MB5774:EE_|DB5EUR03FT060:EE_|AM8PR08MB6513:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: r/zf4AJxppjjiKPobCa+ufiHLqSsnLu85qQHTWXPRgxNWYLUz/OEpsr1AcAhS22hgoKYf0GPYq6wJPDKmQzClAS0iv3rkzSVCP4OUlnjalsjH8V3EDk8jRn1jnGkQtqMcyJRGX+GCEwfRpjRByi0/W4+V24E/iU/LOWw8ZzTs3dK/seBZs7sQ1iNsI2qOeTciYDfvxp7spPwyKIp/pP5g+KB4C9A2iEqLfLlg+c734PM6MqOUj6mia49tR9aiGolXGydd4xs8MhDq7bPqyg/GWo6SNb1eSQi7yDZ/XoM6gQXPgrSOkDmohXAvzaX0FS3GeCELspspqABakz2xUf7rIlExB8kJObsC5xQuHIcXZo+Zhey3dDnpY7ZZeJLDJfRCyUii8zzIn2cgyIgOJEnahptEkQg9fiavZCv0pyQDqhNOzBS7DFwdNUzUafNbgPUEz5HdQHZFGdSS2mmYsqA//S9TZNtKYOFFgV3CJKkyM+uFxFNStoEQtvlQGhYz/WmAgeOTHbvov/0L1xEh+6OHybKCLci5oaAEnin7AETTAGGBc2YLXd2SwO5mw2h+RW5p76SxwqmezyDa/DtK1AELRBcwGoRBpuYv5KrrxWrr0I/4yd7lFQWV9f9oZOOHHmTaL3ZvRAU7Zrmnq4TiBzM2X24Ha9QO4cOs+lnLgqkt29U5Y0uXqsO0ql0HNbR/TxcAO0iBJsCS1/yEowBDmLl8XVhfpZ2JpgMmiKSQLAs1Jw1bzfeL0rWBwjolb2dn1V1806U6z6x/qR7tkWDQ6oIqZZC/q0JIsO+4TeVaP7Grv4= 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:(4636009)(36840700001)(46966006)(40470700001)(316002)(336012)(6666004)(26005)(508600001)(36756003)(2616005)(7696005)(83380400001)(81166007)(356005)(47076005)(8936002)(8676002)(6916009)(36860700001)(186003)(82310400004)(40460700001)(44832011)(70206006)(70586007)(5660300002)(426003)(86362001)(1076003)(54906003)(4326008)(2906002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5774 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: fed530df-0c5e-4c45-acba-08d9bbfdc3ff X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: va7RUOvzwaWj0To+bPjnCVHV/5sL+hiVdWFn9H19ihsymBQJv0KT8mmLS8sq/fxkc4qkaFgbuhlYUIIS5wtwrBG6teCOpfBEa595LU1nWgAReRABdTTCp3Eb9VCU5hQrrEQFCwt3kO07sncoL581iXKc+1qlve5i4wLVizqvJjPaRVfmP1wBTpUx+DAe3hXY2RqsSrspM5xLPeIpHK7m2SJeV8JmdrLzhq92IHBPgGm56OcT5PE9To/XxlSiJp6+Ctl99GF4EIvpJhoK5bsEk5So7BhYmZYVYuWGuheaJgIi/S0oaeO0YIjIoDpLX7cBdHi+O58aR2f/5GjgICeIIaNuV28uPf4rbJMrBc6afkgs61f4rlDSYzJT45E5WZ9YMV8emRQ3lRj48sZrbl3h2ef4am4GlzkXHQvGc4/TVYovk1CsDPO5W5JF7S4RUSFs5vMT3dIUMOOPCbvreEmyhi/VhS01MgGZ8kYkfBgEfO8Mm66qXolXkH+I9hHvEtJH2WT2CTMQvOEBBT1mGM0spWGc9a/aOK02tvd7OgjSV87eL1UTYdzWvUSzcCu10h7spopUypFCYL3zi7bJuTyC5xSHJIoJPRdjbLi2lJ+oduZe1l1nmZLoWec68sOYICwaSfNF5ZFhQiMJx+xqi1ksNl/kXooAtQepCjcZZd83oS86YDsTF88txvBQTet0PKXv8gDMoxuxTa7ezZeEZs1Okw== 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:(4636009)(36840700001)(46966006)(1076003)(2616005)(8936002)(86362001)(70586007)(26005)(47076005)(426003)(44832011)(8676002)(81166007)(316002)(7696005)(36756003)(107886003)(54906003)(186003)(70206006)(83380400001)(82310400004)(5660300002)(36860700001)(4326008)(2906002)(6916009)(6666004)(508600001)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2021 16:54:53.0723 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10269d66-446a-49b8-8227-08d9bbfdc977 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: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6513 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_085456_051195_54C3FA4E X-CRM114-Status: GOOD ( 15.42 ) 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 This is a new ID register, introduced in 8.7. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Reiji Watanabe --- arch/arm64/include/asm/cpu.h | 1 + arch/arm64/include/asm/sysreg.h | 15 +++++++++++++++ arch/arm64/kernel/cpufeature.c | 9 +++++++++ arch/arm64/kernel/cpuinfo.c | 1 + arch/arm64/kvm/sys_regs.c | 2 +- 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cpu.h b/arch/arm64/include/asm/cpu.h index 0f6d16faa540..a58e366f0b07 100644 --- a/arch/arm64/include/asm/cpu.h +++ b/arch/arm64/include/asm/cpu.h @@ -51,6 +51,7 @@ struct cpuinfo_arm64 { u64 reg_id_aa64dfr1; u64 reg_id_aa64isar0; u64 reg_id_aa64isar1; + u64 reg_id_aa64isar2; u64 reg_id_aa64mmfr0; u64 reg_id_aa64mmfr1; u64 reg_id_aa64mmfr2; diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index adcab9009f9d..4704f5893458 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -182,6 +182,7 @@ #define SYS_ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0) #define SYS_ID_AA64ISAR1_EL1 sys_reg(3, 0, 0, 6, 1) +#define SYS_ID_AA64ISAR2_EL1 sys_reg(3, 0, 0, 6, 2) #define SYS_ID_AA64MMFR0_EL1 sys_reg(3, 0, 0, 7, 0) #define SYS_ID_AA64MMFR1_EL1 sys_reg(3, 0, 0, 7, 1) @@ -771,6 +772,20 @@ #define ID_AA64ISAR1_GPI_NI 0x0 #define ID_AA64ISAR1_GPI_IMP_DEF 0x1 +/* id_aa64isar2 */ +#define ID_AA64ISAR2_RPRES_SHIFT 4 +#define ID_AA64ISAR2_WFXT_SHIFT 0 + +#define ID_AA64ISAR2_RPRES_8BIT 0x0 +#define ID_AA64ISAR2_RPRES_12BIT 0x1 +/* + * Value 0x1 has been removed from the architecture, and is + * reserved, but has not yet been removed from the ARM ARM + * as of ARM DDI 0487G.b. + */ +#define ID_AA64ISAR2_WFXT_NI 0x0 +#define ID_AA64ISAR2_WFXT_SUPPORTED 0x2 + /* id_aa64pfr0 */ #define ID_AA64PFR0_CSV3_SHIFT 60 #define ID_AA64PFR0_CSV2_SHIFT 56 diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 71ff5a4afb0f..c36018310da5 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -225,6 +225,10 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = { ARM64_FTR_END, }; +static const struct arm64_ftr_bits ftr_id_aa64isar2[] = { + ARM64_FTR_END, +}; + static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = { ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_CSV3_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_CSV2_SHIFT, 4, 0), @@ -638,6 +642,7 @@ static const struct __ftr_reg_entry { ARM64_FTR_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0), ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1, &id_aa64isar1_override), + ARM64_FTR_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2), /* Op1 = 0, CRn = 0, CRm = 7 */ ARM64_FTR_REG(SYS_ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0), @@ -934,6 +939,7 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info) init_cpu_ftr_reg(SYS_ID_AA64DFR1_EL1, info->reg_id_aa64dfr1); init_cpu_ftr_reg(SYS_ID_AA64ISAR0_EL1, info->reg_id_aa64isar0); init_cpu_ftr_reg(SYS_ID_AA64ISAR1_EL1, info->reg_id_aa64isar1); + init_cpu_ftr_reg(SYS_ID_AA64ISAR2_EL1, info->reg_id_aa64isar2); init_cpu_ftr_reg(SYS_ID_AA64MMFR0_EL1, info->reg_id_aa64mmfr0); init_cpu_ftr_reg(SYS_ID_AA64MMFR1_EL1, info->reg_id_aa64mmfr1); init_cpu_ftr_reg(SYS_ID_AA64MMFR2_EL1, info->reg_id_aa64mmfr2); @@ -1152,6 +1158,8 @@ void update_cpu_features(int cpu, info->reg_id_aa64isar0, boot->reg_id_aa64isar0); taint |= check_update_ftr_reg(SYS_ID_AA64ISAR1_EL1, cpu, info->reg_id_aa64isar1, boot->reg_id_aa64isar1); + taint |= check_update_ftr_reg(SYS_ID_AA64ISAR2_EL1, cpu, + info->reg_id_aa64isar2, boot->reg_id_aa64isar2); /* * Differing PARange support is fine as long as all peripherals and @@ -1273,6 +1281,7 @@ u64 __read_sysreg_by_encoding(u32 sys_id) read_sysreg_case(SYS_ID_AA64MMFR2_EL1); read_sysreg_case(SYS_ID_AA64ISAR0_EL1); read_sysreg_case(SYS_ID_AA64ISAR1_EL1); + read_sysreg_case(SYS_ID_AA64ISAR2_EL1); read_sysreg_case(SYS_CNTFRQ_EL0); read_sysreg_case(SYS_CTR_EL0); diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 0e52014019f6..f2f8fe02f39c 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -392,6 +392,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info) info->reg_id_aa64dfr1 = read_cpuid(ID_AA64DFR1_EL1); info->reg_id_aa64isar0 = read_cpuid(ID_AA64ISAR0_EL1); info->reg_id_aa64isar1 = read_cpuid(ID_AA64ISAR1_EL1); + info->reg_id_aa64isar2 = read_cpuid(ID_AA64ISAR2_EL1); info->reg_id_aa64mmfr0 = read_cpuid(ID_AA64MMFR0_EL1); info->reg_id_aa64mmfr1 = read_cpuid(ID_AA64MMFR1_EL1); info->reg_id_aa64mmfr2 = read_cpuid(ID_AA64MMFR2_EL1); diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index e3ec1a44f94d..4dc2fba316ff 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1525,7 +1525,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { /* CRm=6 */ ID_SANITISED(ID_AA64ISAR0_EL1), ID_SANITISED(ID_AA64ISAR1_EL1), - ID_UNALLOCATED(6,2), + ID_SANITISED(ID_AA64ISAR2_EL1), ID_UNALLOCATED(6,3), ID_UNALLOCATED(6,4), ID_UNALLOCATED(6,5), From patchwork Fri Dec 10 16:54:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12695618 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 7F6E9C433F5 for ; Fri, 10 Dec 2021 16:57:50 +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=KQjHSVNJk+5UTbn9IBATz/XaOfOz85NtQ7+ScuD4zM4=; b=NKjt6NQNkALRST ASEe/qp8I4RK0Cn3aR50akgwNPX1l8JQJfBTB8iMERDzbzo/7DFLNiPgWgWPT3vnFWoU3/4RpGyRx 8ZP76OuCyJ1OtSe+3/AchljQCf05fZdJCyEdYZRamV7qNymlxjIOCdldXYNzfs0/KsOXd9jlxWpKy lGWmflLXhs3b2Ul1X46sycRzevX6nf5ISIaZKESy8Nl7Fim1hl2UPud88vD03nUJjMJA7haC5pKAq uUCB8yunGaRvnNYOwwQhoa8ddG14RdI2sTrDyTdDG62Tz5J6loPXcPR5dOBdgNvcsOzi3ffK4Va37 /7WyvAw4AyvlGwiFA9MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvjBO-002f1N-D4; Fri, 10 Dec 2021 16:55:43 +0000 Received: from mail-vi1eur05on2059.outbound.protection.outlook.com ([40.107.21.59] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvjAg-002epz-Nl for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 16:55:00 +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=pfcz/wRaHn2k8tM0/H778pNFOIC5Wa6nOLQ3VFYVg3Y=; b=3hbmT7LMJVmZD2YeMAg5nd/m4G2U8rxBZhPbu/DKjgf11gQZmvgXDVMWqeKY7674t1YsIGezkWTBa6NTXHjPb+4F4odBIs3negZoGFLzhMum07+XyHSKgsF4jRRmBDBCTQwAhRmA3nFC9GzQ3RMdkPDWgIUZ3nAfBzA8CGCn48E= Received: from DB6PR0301CA0027.eurprd03.prod.outlook.com (2603:10a6:4:3e::37) by VI1PR0802MB2511.eurprd08.prod.outlook.com (2603:10a6:800:b1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Fri, 10 Dec 2021 16:54:54 +0000 Received: from DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3e:cafe::6) by DB6PR0301CA0027.outlook.office365.com (2603:10a6:4:3e::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.22 via Frontend Transport; Fri, 10 Dec 2021 16:54:54 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT056.mail.protection.outlook.com (10.152.21.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:54 +0000 Received: ("Tessian outbound de6049708a0a:v110"); Fri, 10 Dec 2021 16:54:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f4a0a2056158d7e1 X-CR-MTA-TID: 64aa7808 Received: from 912efa2c9e15.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 334CDB5B-C516-4937-AD58-271701E8DD80.1; Fri, 10 Dec 2021 16:54:47 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 912efa2c9e15.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Dec 2021 16:54:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bij3IT9dIpA5po9aTM5cyD/NjacMzWN5zU7dAIpYyBFulvCzLwLeut8sz5mYhEIjtFEDY6hNe1nT6r4UA7o4HBMTYtiCCdiaonXtXdN0aSHtUJvNcCeapjGHieFZQAC+PPQaj/Zqq8mQ3EpgN1x/aDc1taKlFV8Uvyw8fvz24wMpjvYkFAYNrxYT6EgrzDi1fWDQUKutDYH+PIwD+CNjvsvTD+o8SU4PEcPXkBrcmODSSNlug9sJNkgB24rY9XOluQ20LdjhBxLfrmPpONuNAiMNy/OVDUjkcWwDdCu4Tnvqz8eumTDN/+wGfx2zVRItySWV3UvTAehRdTishFjo8Q== 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=pfcz/wRaHn2k8tM0/H778pNFOIC5Wa6nOLQ3VFYVg3Y=; b=QMn6aW8cfT7YlQf/xNIyLHpVssBQ9WdMyVzJH1dgKAryl8hUNSsAauy6Y3ppaxGgYLfvNdTbt/Gjb9tuLS18gZGlxbp2Q2nrtEIuzcjTBpKljV9hX/iFODPJEsExC5yp0OCbvxM04UsoALyUT19Fb1ItziOnf6S7/hpflGk5nfgcUSqV+PjwRhYR18J2VkRsgg+Nj9z+mcBSxFKhBEcCPK+kho3mXtf29suXLNSpur3OSa0iwQB22smLRkgBCO4S6kBdoPHw2wA+Kk6UfCGo49GBuWoi05a4sfnbcAhaHAgT/SbXnOh9IhVzkQTKjYqjpkGQsYlm6YODL65y2wRW2A== 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=pfcz/wRaHn2k8tM0/H778pNFOIC5Wa6nOLQ3VFYVg3Y=; b=3hbmT7LMJVmZD2YeMAg5nd/m4G2U8rxBZhPbu/DKjgf11gQZmvgXDVMWqeKY7674t1YsIGezkWTBa6NTXHjPb+4F4odBIs3negZoGFLzhMum07+XyHSKgsF4jRRmBDBCTQwAhRmA3nFC9GzQ3RMdkPDWgIUZ3nAfBzA8CGCn48E= Received: from AM7PR03CA0014.eurprd03.prod.outlook.com (2603:10a6:20b:130::24) by DB7PR08MB3628.eurprd08.prod.outlook.com (2603:10a6:10:44::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Fri, 10 Dec 2021 16:54:45 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::97) by AM7PR03CA0014.outlook.office365.com (2603:10a6:20b:130::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:45 +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; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4778.12 via Frontend Transport; Fri, 10 Dec 2021 16:54:45 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.20; Fri, 10 Dec 2021 16:54:39 +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.2308.20 via Frontend Transport; Fri, 10 Dec 2021 16:54:39 +0000 From: Joey Gouly To: CC: , , , , , , , , , Subject: [PATCH v3 3/3] arm64: cpufeature: add HWCAP for FEAT_RPRES Date: Fri, 10 Dec 2021 16:54:32 +0000 Message-ID: <20211210165432.8106-4-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211210165432.8106-1-joey.gouly@arm.com> References: <20211210165432.8106-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 9c4a9304-6565-4c74-f199-08d9bbfdca18 X-MS-TrafficTypeDiagnostic: DB7PR08MB3628:EE_|DB5EUR03FT056:EE_|VI1PR0802MB2511:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: bpe70+SfdE3ALR8M+qSIJoq+wugaFenCzlsrfnYvDIBca2jvkAKl7DJiKdjgL4KO8Dd/X0Jow1gWG3+UWpiPWFs3Dks61MliVRT/MUEz7RuKcoaA+wrh5yESO6w987altdK4DYC5TS8eAzXAiK2S0Blewkv4wxkx6N7gzas4SJ/Kc5ARJjO7zADqw8BWh8tJuU/ekS5zM83CDsLBwjJi8LhgubBHXtOLRMN2rOxB8+oyutqdnW8lJq6Dret88A7n2yW7JZJvflvQHYRWKhmB9B9DWnQIVjJ1JuY1/b5BW5ci+Jm8JKBTODamvMQg1gVWd8+MqRoX6pP++9EB5gMHlhteQNF/QmKrp0xH73t+s2yfDVcTwq2kyEWGxufXh3S3FBI+a8VRyCjFGZaVrC/xDdtduyk9kVHkFASIJOmXhy93jvPnGLQ6aHfHF+lRvuq9C/DFATn3pAQPG3juRhOGGrUjjknjlME8gxyVZU7w/5a+n+OTsI0HOn7UjrMAp8bOxFj0Rf7irMZXvWI7lPpweTwi8L1XbN5E9ha5l2j1ODpoccw7uhiSLeHSwEXeDWsiRMjrjP2HA9uurxFT1WQKNrTlhlo6PeJys7MHL1LTwVpcc0iVcGIhX30IGW8atvLGjNGdNIU7hGPIPS8AjhNNRyfTSR4FeID9ZLodfO0tAyDbUc40JPQzwXa2xp0+QLwmT1QcG2JiGx8JFD9nT7A0/olUD0NmWE+smjFiCLa4z1RLGL5gERv2vnpWSxmy2cyr3byXs5WDVE9YnKpoG8gsYYiaQXqjosPCr3RU/NE3PUA= 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:(4636009)(46966006)(36840700001)(40470700001)(6666004)(36756003)(36860700001)(26005)(186003)(508600001)(336012)(8676002)(426003)(70586007)(70206006)(83380400001)(4326008)(47076005)(40460700001)(54906003)(8936002)(2616005)(6916009)(316002)(7696005)(81166007)(5660300002)(1076003)(356005)(2906002)(82310400004)(86362001)(44832011)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3628 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a3673b3a-9313-49b0-c271-08d9bbfdc51d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vHDS4TItrW2zmEOwm52yTyg2+XMWCkr+SsahIQFppQCTih/Alk/RN5FzCWc8ztQMzN1DiiTCgXB1BnU9nYkw5qcXlnuLk5uSW4gNQw+BRODZ2QIyXeh41suU3xKMBW1bm5unDj6OED1GU1sRDSchJQcEoChmifwsR1faS2IHo/dUohAlkyIvC6CW8a2AN+/uh/PVhntvrRjFhwWamHkSY92ChsfVsHf9WN6tNfNyVYxgY84lzBO5lswhSBJKQHRHOi+v4ygIPRXiGpzcsxV6BwrHLcHi8SSJHy+gPS121UwZ6y0FhfB8K/mD1Xi4KPayQX0i4xLTB9khBMpRR6cfVo0wOm0BU2dJVa0vY42uCDKsFwVCgeehT2XRq4IsyQmlzHQvUCin1H0VE80gDyg1FhPYtpVqOO6oBuq0fX17vjIve6q6zv3LGUdr38mpRSvx139eaY7eVrK0r/qMagcjIfMH2k97wrDbktlouGvquutrTaol2cvrViGMS4tv8EMMNi9mclKOkdcD+6CRVrvvLOewd6BIBF/+w2n95l/UcYgR/frrgMjrlWBmq+dkG9i/U3Kqnuawt2Q7VXJ9dNsLF3QmRbqF1xQbcp2gU10CnGB8nBpexYhoraLQPXKiSR/uYo0/LKhUphTHGph3qIzxOz/2v0fG0yfTO4RO+TCCQ2MuLqmzMemdHrRwIVVjzH+oHx2dp466FHSDQgsUFS6JkA== 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:(4636009)(36840700001)(46966006)(7696005)(508600001)(26005)(336012)(186003)(2616005)(44832011)(5660300002)(426003)(6916009)(54906003)(86362001)(36756003)(82310400004)(316002)(4326008)(1076003)(8936002)(8676002)(83380400001)(81166007)(70206006)(70586007)(36860700001)(47076005)(2906002)(107886003)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2021 16:54:54.1075 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c4a9304-6565-4c74-f199-08d9bbfdca18 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: DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_085458_814193_21E511F3 X-CRM114-Status: GOOD ( 13.22 ) 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 new HWCAP to detect the Increased precision of Reciprocal Estimate and Reciprocal Square Root Estimate feature (FEAT_RPRES), introduced in Armv8.7. Also expose this to userspace in the ID_AA64ISAR2_EL1 feature register. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Jonathan Corbet --- Documentation/arm64/cpu-feature-registers.rst | 8 ++++++++ Documentation/arm64/elf_hwcaps.rst | 4 ++++ arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/include/uapi/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 2 ++ arch/arm64/kernel/cpuinfo.c | 1 + 6 files changed, 17 insertions(+) diff --git a/Documentation/arm64/cpu-feature-registers.rst b/Documentation/arm64/cpu-feature-registers.rst index 1b19d20c2dbd..749ae970c319 100644 --- a/Documentation/arm64/cpu-feature-registers.rst +++ b/Documentation/arm64/cpu-feature-registers.rst @@ -283,6 +283,14 @@ infrastructure: | AFP | [47-44] | y | +------------------------------+---------+---------+ + 9) ID_AA64ISAR2_EL1 - Instruction set attribute register 2 + + +------------------------------+---------+---------+ + | Name | bits | visible | + +------------------------------+---------+---------+ + | RPRES | [7-4] | y | + +------------------------------+---------+---------+ + Appendix I: Example ------------------- diff --git a/Documentation/arm64/elf_hwcaps.rst b/Documentation/arm64/elf_hwcaps.rst index 247728d37911..b72ff17d600a 100644 --- a/Documentation/arm64/elf_hwcaps.rst +++ b/Documentation/arm64/elf_hwcaps.rst @@ -255,6 +255,10 @@ HWCAP2_AFP Functionality implied by ID_AA64MFR1_EL1.AFP == 0b0001. +HWCAP2_RPRES + + Functionality implied by ID_AA64ISAR2_EL1.RPRES == 0b0001. + 4. Unused AT_HWCAP bits ----------------------- diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 2809df2fdd63..f68fbb207473 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -107,6 +107,7 @@ #define KERNEL_HWCAP_MTE __khwcap2_feature(MTE) #define KERNEL_HWCAP_ECV __khwcap2_feature(ECV) #define KERNEL_HWCAP_AFP __khwcap2_feature(AFP) +#define KERNEL_HWCAP_RPRES __khwcap2_feature(RPRES) /* * 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 180da7396549..f03731847d9d 100644 --- a/arch/arm64/include/uapi/asm/hwcap.h +++ b/arch/arm64/include/uapi/asm/hwcap.h @@ -77,5 +77,6 @@ #define HWCAP2_MTE (1 << 18) #define HWCAP2_ECV (1 << 19) #define HWCAP2_AFP (1 << 20) +#define HWCAP2_RPRES (1 << 21) #endif /* _UAPI__ASM_HWCAP_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c36018310da5..a46ab3b1c4d5 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -226,6 +226,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_RPRES_SHIFT, 4, 0), ARM64_FTR_END, }; @@ -2487,6 +2488,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { #endif /* CONFIG_ARM64_MTE */ HWCAP_CAP(SYS_ID_AA64MMFR0_EL1, ID_AA64MMFR0_ECV_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ECV), HWCAP_CAP(SYS_ID_AA64MMFR1_EL1, ID_AA64MMFR1_AFP_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_AFP), + HWCAP_CAP(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_RPRES_SHIFT, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_RPRES), {}, }; diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index f2f8fe02f39c..591c18a889a5 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -96,6 +96,7 @@ static const char *const hwcap_str[] = { [KERNEL_HWCAP_MTE] = "mte", [KERNEL_HWCAP_ECV] = "ecv", [KERNEL_HWCAP_AFP] = "afp", + [KERNEL_HWCAP_RPRES] = "rpres", }; #ifdef CONFIG_COMPAT