From patchwork Tue Dec 7 12:42:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12695139 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 9F4EDC433EF for ; Tue, 7 Dec 2021 12:45:55 +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=foGeBGY92Le8zh zF4BXyhVfx6im3aa3OQofpd0tywUx01GiMf0IoCoqer99iQT/BsdzPBDVeCuiHHExdbQIpmJzhXd/ oNu5Y1iAvfQJzjvY7v5QRCdkzOQOmNSMm0ZnXjt3YhRik/S5wFsN1kopqOTeefJrGtnoEXJUhifr8 haWZteEpfKKUCaf2ZjbLroE1uXVoD5dzSUqLwEbClilV0BQ1DjjGrOHMl2MUv85mGlSo0w8xARCNP 8lMohcm+hhwMgf5cI0sM5SKNAUj5NqGGMD+PMb0T9M+zV4CWZSFZ6G1kuVhqq4RQk7hQMZBkXHHCU gQAVDlegWC+4e2KHqgyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muZoe-008Uc2-Pw; Tue, 07 Dec 2021 12:43:29 +0000 Received: from mail-am6eur05on2085.outbound.protection.outlook.com ([40.107.22.85] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muZoN-008UXI-7Q for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 12:43:13 +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=KwaUrlUowKcGpnnMyJsT6CJRJ9NwAN+38WIZ8C8hzUxivn7FD+DG8Jfgr6FFFYwQM+7JQc71a5g9VjtxhONaZg1mtyvKlHw0dQMxAlf+3phNLYiiFqBtD8JFlgmH0JU3OQe93uxphYFagYKPVfWKAG4zZwWRxJ0RRlXOfKfuRzI= Received: from AM5PR0202CA0009.eurprd02.prod.outlook.com (2603:10a6:203:69::19) by AS8PR08MB7026.eurprd08.prod.outlook.com (2603:10a6:20b:34d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16; Tue, 7 Dec 2021 12:43:04 +0000 Received: from VE1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:69:cafe::f4) by AM5PR0202CA0009.outlook.office365.com (2603:10a6:203:69::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.11 via Frontend Transport; Tue, 7 Dec 2021 12:43:04 +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 VE1EUR03FT023.mail.protection.outlook.com (10.152.18.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.13 via Frontend Transport; Tue, 7 Dec 2021 12:43:04 +0000 Received: ("Tessian outbound de6049708a0a:v110"); Tue, 07 Dec 2021 12:43:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ce9b00823f8779e4 X-CR-MTA-TID: 64aa7808 Received: from 629cfa6c54f4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A36E5385-AC48-4157-9706-CAB9A4E44585.1; Tue, 07 Dec 2021 12:42:57 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 629cfa6c54f4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Dec 2021 12:42:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kiYG8SB8gD8O3Q1/hJoEEdTz475mHtNzKVvCcPyIx15e+pZs9QTcBBWNzC1Sl7AwoVHspE+zFIGT0v3QR/GoL4ADd/fAwgH+qT3pP7VPHuc8bWYeYBMMhKfqpGfRHZSgzOQQ13pEd+Ww2ieFxtaYGJN1o05iOgd4yM9oixBUhASmudKKYp3NOq2V3J0guVFy/nOEDoP2a4jquE/QUyQN6O8dFbNS1DPSgLVmSwDZy+yFmWpT4/x5L80R8fDiXXANlqQX38tJ+a+mrTuxxLrP0x4Xv+/12WoqA0uZQrmXsVZ5v0XPPzcSl0Ufm88mttHT7Ker8ZjMgPnE2Le90KWqqw== 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=IiJjIdStUUlzIHG54l16F9tg2s1i4QshY0qIjdMjbsFhfRzLFuOwoCAYElX70K4uxHhQ8FQj+cYiBbRblr2aui6ifdFLixfbAYqDSvEAGXqPO4xMaAReGR922KgxFJEKj0QwzwfKhoc2Tob0Qrlz54cy2XOsDDqz3o9X9T3EonQNAreR1FDON+TpUZ+v5Jacjyz4blVDtlGdezDHH6kKr8EQTeTB9IiPv5FDH78LlYjskRb5JLmVIsam79lmOlTfphRzo9g7DcmiqQROzGnik22cZ06VlQVEXOA1qnrzK2VLpH11gmj3vr5JXlZG1v5we+ovJlmRXotNFdvmJkFKfA== 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=KwaUrlUowKcGpnnMyJsT6CJRJ9NwAN+38WIZ8C8hzUxivn7FD+DG8Jfgr6FFFYwQM+7JQc71a5g9VjtxhONaZg1mtyvKlHw0dQMxAlf+3phNLYiiFqBtD8JFlgmH0JU3OQe93uxphYFagYKPVfWKAG4zZwWRxJ0RRlXOfKfuRzI= Received: from DB6PR1001CA0045.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::31) by VE1PR08MB4957.eurprd08.prod.outlook.com (2603:10a6:803:109::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20; Tue, 7 Dec 2021 12:42:54 +0000 Received: from DB5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::f9) by DB6PR1001CA0045.outlook.office365.com (2603:10a6:4:55::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Tue, 7 Dec 2021 12:42:54 +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 DB5EUR03FT019.mail.protection.outlook.com (10.152.20.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4755.13 via Frontend Transport; Tue, 7 Dec 2021 12:42:54 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Tue, 7 Dec 2021 12:42:45 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.20; Tue, 7 Dec 2021 12:42: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; Tue, 7 Dec 2021 12:42:44 +0000 From: Joey Gouly To: CC: , , , , , , , , , Subject: [PATCH v2 1/3] arm64: cpufeature: add HWCAP for FEAT_AFP Date: Tue, 7 Dec 2021 12:42:24 +0000 Message-ID: <20211207124226.50095-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211207124226.50095-1-joey.gouly@arm.com> References: <20211207124226.50095-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: b5b587ff-cac3-497b-514a-08d9b97f1cd2 X-MS-TrafficTypeDiagnostic: VE1PR08MB4957:EE_|VE1EUR03FT023:EE_|AS8PR08MB7026: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: IEjRogi3/2UDU0xyRnhxRPEhXneeQAk04wu7053zSnz/3JZUfBC4aABcTpn69lDSh51Ajm7QbA9bgiuPiDlkGZQWbcSbGEa7mN7OnOZCJkzoUwhRM1Q+MW+MvNbFk8q8mGMDZSM5cS4w87y1SnX6gvbDnl8/BnaYC7IIqjrfuUAs4uz9VUZXvo2xDEIiKN/N3J7hFuyS9eGKrdx7CyewPjznvphG4AwzMN6XjyOncnPrfh0CQ42H21Fh2BCNngYMCnJ8REY/hDad8c5mwt+FIKSHhHqn3HcMnEm2oE7WXNzhDlwfFaC7BHWJnPesGUQF1+auVhoqxTi62EOcIpjv7Xe9tznzZjQ4Dw+C+hq6BP1835+B3YdO49ZgS5CsVtsASI5dGiL3u763/vcoFa2pXLO8euZ3PnE7QB6GsJHXb1uxqr3Yx68i78snPsCISNIDbQJsHIkyrmkS1Mvw1ch7xmA+LvRiO31CwAkY/oOhX2/EZjCJjpjE8NMhVrcH8y5gu0EHvnyL00DAoueQOW9c+rK5rFRQHPuuYQpAIOwI8N4J1HnEWZKJUplpffCI9MYmFBhMBOGZjjWrUDj+uUp/GAlFBiWUJZKCH+RW/mf67e6RHrcdt9c493f2g8ZnnWUouaIo8Hj15SoxrQD9jDxuPCHmm/ipQeTdh2a3VcM9Nwzq1FFNH6Zjcc9ysaBpuABfP4i1kylNgvk3hGjn8tT228OA0r3TfsAgNndxtBzzDD2nDuZ2TMN/xW7fkbZTExO+RXyy+FPfkSUhnNJpw4HlCIrkIUyBp6CECHuD/UBl2QU= 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)(336012)(5660300002)(426003)(6916009)(82310400004)(8676002)(7696005)(40460700001)(70586007)(1076003)(70206006)(26005)(44832011)(8936002)(2616005)(4326008)(508600001)(36860700001)(316002)(6666004)(36756003)(186003)(81166007)(47076005)(2906002)(83380400001)(54906003)(356005)(86362001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4957 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 36f5e38d-dd8b-4173-283e-08d9b97f170b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T1RWCXbB077lk+Hgvqo18Kp2J6vin3dzRcngEasKdeXDw0xjOTrjrLp5CuQpgifCMP/qDaq10zRnxKqSlk9ORPL84uVoE6SFtsuqNd4pXpczvJ8z0vNOy/5QltWmPROmoMubTEONGtIx2TWvXZA0hG7oGmU+mkfkqTNMfEPt+/bngF+sWbSMtEhUKRaDpFzpNKNxe7u4lkBw3Ki6xrD2w5b4VekXf+HiF+kHoMFcF6Xm8cLrL+a71ad5ujG7c23mVMCNTrJBP0KbB+qIllksbx9KXFmGYPms/1tpaK1I3GV7NeTg9RT79B43cvm7gJuK2j5Op1rvqBSKMS7KWYAzMRGjmRTTyows/Mb+n8sCYX1C8obCXdf9+AdZelXPzBviw76CJpAeL+Df4m/2eCgyUyd4F0V3rk5cC+wMMO/viN4ZgfJSsJjcGzFn4ANAOCGN1WcPK2m3Si4IbojSOhlpCqN6zEgRmNEJsPnJA+5WJSpmdxufWgpvmlZBl5Ybnc/PVxYxP79QxsnzF5vhhfHGVWeTTzxOTGM02bumLui9RI+Py/9BWCf63tRyG0wEe8zK2k3VhV8gLBQKj34M8tsNXgYPq2SGQTaww2aE65EKg4Sl7SsCFrJKxkiyEPxCGPt3+ZEnMEXeq3jZVeywg+JOzGFSxwElHHl697p5SJO9fNUSLBW4oEa6Rwsua0W0FQOlmoB4m02/ZnJ5QyOKL91VvA== 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)(46966006)(36840700001)(8936002)(81166007)(336012)(36860700001)(316002)(8676002)(47076005)(426003)(508600001)(82310400004)(6916009)(54906003)(26005)(6666004)(44832011)(2906002)(5660300002)(2616005)(4326008)(107886003)(1076003)(70206006)(7696005)(83380400001)(86362001)(186003)(36756003)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 12:43:04.4072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5b587ff-cac3-497b-514a-08d9b97f1cd2 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: VE1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7026 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_044311_468633_FF39867C X-CRM114-Status: GOOD ( 13.49 ) 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 Tue Dec 7 12:42:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12695141 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 EDE9AC433EF for ; Tue, 7 Dec 2021 12:46: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=YxSOT3hfAqe4j1PNleSNDCuok73a6HUTKlNRiJkYi0g=; b=cxYKR42mtwgh+T jzjLUAaZGqrHFYbIHnbIWazY7Q3I1NMLUbx2musT0LO4sneALHl99UPqqXypqnabo38gUnRTfoQIL t8LF/DQ+++fs2ODjM4b8YXSlO0bC5vcbJwlr0aD21RgcdT6df5Yb5O9PwkDO20p6Hwgb9ByqPuav0 D06cGyxH8DBLXgmviBeMtBbtO4MJYwegb608Ffi/avDi6bdUEC25NLSmr2TPv0mjQc2x2nm3c0Btw FUwvpPjSMBQ0FMd9NSPnvMFLl4zYduU0HuuyWvocEvytLVtOkQyKcsOCCY/I0DW+7dnwodYQ7h4bi igpV5SCtsi/rg1vtzgbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muZp9-008Uit-5v; Tue, 07 Dec 2021 12:43:59 +0000 Received: from mail-vi1eur05on2049.outbound.protection.outlook.com ([40.107.21.49] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muZoS-008UYz-Ck for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 12:43:18 +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=1j8lNY5C7cMtKmHM2jGENL8Jr8VEs1Fg/Ln9DH/25WI=; b=0NAOUcLyEOilpOCwssAefImzRS5fQfODpSLzExlXZcYXwM07ORJ863aXUOjJjMwv+IAwGvNyb60LYO4qDUWvlQABCXAQigQFuc5a3mmke2/CRi7xN+PiRNMT8HBo++Ok2bDM1Xs6iBfMw+s+mh34aPmJ9y2jyrsOlu354qfaPwY= Received: from DU2PR04CA0315.eurprd04.prod.outlook.com (2603:10a6:10:2b5::20) by DB7PR08MB3164.eurprd08.prod.outlook.com (2603:10a6:5:24::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Tue, 7 Dec 2021 12:43:03 +0000 Received: from DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::eb) by DU2PR04CA0315.outlook.office365.com (2603:10a6:10:2b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16 via Frontend Transport; Tue, 7 Dec 2021 12:43:03 +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 DB5EUR03FT055.mail.protection.outlook.com (10.152.21.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.13 via Frontend Transport; Tue, 7 Dec 2021 12:43:03 +0000 Received: ("Tessian outbound 1cd1a01725a6:v110"); Tue, 07 Dec 2021 12:43:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ae76239a85065afe X-CR-MTA-TID: 64aa7808 Received: from b645fe3e1cb7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CD1976ED-0B66-4C9C-9A2E-72184AC66C70.1; Tue, 07 Dec 2021 12:42:56 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b645fe3e1cb7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Dec 2021 12:42:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oQrOSaXmLGg9+LDqUttXPgy6/XaoU8+sCbrJm3H8pmCU4v+Cpo3TBMiOwvjvlLhZIjAxeAgRnNe+5ymaIE6qmnWuqzMKLZTABsgXCxPpVXDpXqkgZOFOZ7uDiAyKJdImYi6IgNUk7eiWF5eNZhPVnpWd1CNnfaILm6fhJa+Q397TC47s/FoW1KbzEZwueMw3YgrCQriP0xFFkMxXk2msKesvvJsjX7tHHC8jrpYIVy8/TIieIeBZ6Y5hMaowko9iD02JMOqlU+fzmCHVFa0gjc8asM/rFau1rZOppnQZNS1XHng0Ids08hCXwA8alJ42FWSU+iq8eel2LxWjkN4aNw== 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=1j8lNY5C7cMtKmHM2jGENL8Jr8VEs1Fg/Ln9DH/25WI=; b=YbQeO32MPPMz5VRwY/OzYLp6oiA6hfPPETtxc/A/ntRMbNCF0NNprzBi1shn2/GSDlov6YZRvhC6Rx1Kc6VAOA/CBoPrvBgepANuIluPaScCv6nsHRW9nGk/hM6K5zem8M6a78yyK77y3ChfuUmFucTrdY7tiH4RNyB/fQRsmeHekKROP2qpII0KOVYjCQd1RnJI8DOTI5p6CIbQXoh712cOfDtfoRKLhC0+Apzmr6UeXjH0SgjiR49PedDdMjCbrHX0y39a4NDtlC8hBg6vM8jIcthC13UkfuGPtqNrfolA0NUQkSqVddClgbjXCb2YfVWEK+0/z/oOwJranMsc5w== 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=1j8lNY5C7cMtKmHM2jGENL8Jr8VEs1Fg/Ln9DH/25WI=; b=0NAOUcLyEOilpOCwssAefImzRS5fQfODpSLzExlXZcYXwM07ORJ863aXUOjJjMwv+IAwGvNyb60LYO4qDUWvlQABCXAQigQFuc5a3mmke2/CRi7xN+PiRNMT8HBo++Ok2bDM1Xs6iBfMw+s+mh34aPmJ9y2jyrsOlu354qfaPwY= Received: from DB6PR1001CA0029.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::15) by HE1PR0801MB2060.eurprd08.prod.outlook.com (2603:10a6:3:51::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20; Tue, 7 Dec 2021 12:42:54 +0000 Received: from DB5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::15) by DB6PR1001CA0029.outlook.office365.com (2603:10a6:4:55::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Tue, 7 Dec 2021 12:42:54 +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 DB5EUR03FT019.mail.protection.outlook.com (10.152.20.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4755.13 via Frontend Transport; Tue, 7 Dec 2021 12:42:53 +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; Tue, 7 Dec 2021 12:42:45 +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; Tue, 7 Dec 2021 12:42:45 +0000 From: Joey Gouly To: CC: , , , , , , , , , Subject: [PATCH v2 2/3] arm64: add ID_AA64ISAR2_EL1 sys register Date: Tue, 7 Dec 2021 12:42:25 +0000 Message-ID: <20211207124226.50095-3-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211207124226.50095-1-joey.gouly@arm.com> References: <20211207124226.50095-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 04680903-975a-4737-5e2b-08d9b97f1c18 X-MS-TrafficTypeDiagnostic: HE1PR0801MB2060:EE_|DB5EUR03FT055:EE_|DB7PR08MB3164:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1051;OLM:1051; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: seNYyAd1dsmF/YrUqnQf4j+RfaMTwdVdcKOmnx11PBAKeKNdJBCIIpVHLVL4/QxkHLatRWSaeJBb03vLL2XUJKLLO919/JJlXDC3gGIkx4PnGVA+IWHmVzdj7CTwwxjgB7iHkZlY2nfzkJNqj/dP1St/pjkTCsSdI0tva1UXc2puZn5DXKbFKdb/naHfevPKFBFuHoPAP9QmL3NU95bvDF9fn5BG1zPLkdkZ8uc8AYYq1zoRdnVQFYT1PFIOc7cIjlTyBodu0EhEqSIU3x5d5alDTWXbrP5hJtaIysar1EyADYojquF7ssHOiegPgdpmbHF8liFbWC5kH3HsJ0/iA226DT42pZps0QvY60zn6lVIV8TBIKmGttglvoqNqYaf9upDRbw3p8gm7QOTMZktQZlw/gS5T04rruUKWfsRvFiOYDe8p4nSvSVwLr6oFDwFjYTVpHIbgWTsq2lylhR0U3p4SaaSQfgIaUj8kRHUA2fv4U/LoMTM6DZcfaVpQ/ipzIKHoiWzKXnK+iqrv2RcrvH36oSJh8jKdaL6ymAgQH7QkF6HaQpxgh/Yj2chzHnvK5429FYxaBj4J+4BE4odma9eN0OmpA5VR54jyvfKvGlpClQofx9FeEWz8rP8YT1G/pV44yDAwQoPsD4h7cLVDyRtsIPwVxyJSkaKQrly0M9gcKD4b4CRaSvMHzElVHfydHv77RLaS4lo9LjnWzzh/KzSept4f+iMihx3I4qr10EvhF7e6l5uWfrGngqfujTSFm0SDoML3gg2/Sp6tpnAHApW/qYAptlkCPLD3ryFFwg= 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)(36860700001)(6916009)(54906003)(1076003)(70206006)(70586007)(47076005)(36756003)(508600001)(6666004)(426003)(86362001)(336012)(44832011)(8676002)(40460700001)(356005)(186003)(4326008)(5660300002)(8936002)(2906002)(316002)(82310400004)(26005)(81166007)(2616005)(7696005)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2060 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 95cf92c2-f19d-4a86-8502-08d9b97f1691 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N03FUKHydZWj+nYSzwnGSSndgujS5tNwRgARyb5bcwNrMcSLBzwHunUx9HwOQWjJB5zs2dKRNB+A8qeXR47wdCGnfjkBo9VaxR2CsiBBKmEsOH6GEZD691lrdTx/qdbK3V3H8v8K99FpAoO4FGIf4jbeNybeutSggTR6VNEtoAucF7Uo3hWFbU2zsyJiuQNT2PCEGsxDwPdFkcYto789RUb4dOHg0qkWpT2PvbRDFLGpum34H3rKl5KJ3YuvJgM6p9SZbPSAP3AA05Ei+6KlHq2xS3SiWhuCkTzQDYC2u0lDQp2uOm7ed5PP1KceoCF1iaeDcsWBf/F45bn7mWiZ4DHqXEn/x7CjB1IaGPox0ryLbl2vgvnuopXoP0f5VriVBvYpj4hzIO1dabZHvjO0sVzoq/84sGhv80nQb94OTrbc1tKSyxSS49iKNMvC0e6C2xyDSPcw6PxkkgoyvBIU4aBRWgirAHL801LPEuAYuTamtZwaAOf23ItNAXlqEVyy85IXxz/9RRv64Ssnd8ok5KbfjNdk8by/aTEzmWFflsmjypBIoBA5Cz1dUTHvjiZOERIksKPCPgP1bG5WFNF5EKsc4i5Bc6JK4IMcKUHgl/5Iut2GukhP4OfiMIDVeyEBcn9oPiUfsAMNUEJbPO+R/kiBN99mK3DRzDu/fL0RGYY9BC95ojNdawC/bv6dxKwzQb232ZFB1T7ok6FDKCw0vg== 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)(83380400001)(6666004)(2616005)(426003)(8676002)(82310400004)(44832011)(8936002)(47076005)(70206006)(316002)(70586007)(6916009)(36756003)(36860700001)(54906003)(7696005)(86362001)(4326008)(26005)(2906002)(186003)(81166007)(336012)(107886003)(508600001)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 12:43:03.2823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04680903-975a-4737-5e2b-08d9b97f1c18 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: DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3164 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_044316_634211_B692AD21 X-CRM114-Status: GOOD ( 13.26 ) 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 | 10 ++++++++++ arch/arm64/kernel/cpufeature.c | 9 +++++++++ arch/arm64/kernel/cpuinfo.c | 1 + arch/arm64/kvm/sys_regs.c | 2 +- 5 files changed, 22 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..5393a00340f5 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,15 @@ #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 +#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 Tue Dec 7 12:42:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 12695140 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 8035FC433EF for ; Tue, 7 Dec 2021 12:46:08 +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=vtXCsIZevkEvLb YSPPIAzN21qWXcF+yA1uGvxgfnsYTW+hBtjY8u3hyxy14+r3monuPpCdX90J4sQVttEoF7f3Md2um FXDNGXsV1i77XZtDnA92CwzkuBSYv7p4wFkdQgvACKTN04+v1L/TNECdIvbBGTlbSwKDpK2qKqyOa HA83M3GKBQLwPoOF6Cl90HlzuNkeGBfr2TZoXGLIL/eB4rO832kNx31VmJZI2p7D58sweKi0ppAZC K4WiB1hiMJfMgmRhXnlCUbYu2gTR2ahr5FJrmYx+iKDsDxLoS1FYmmMK1otbGsvj0uQx3t6QfhpMv PUwPPlwxqpRv9K36RTaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muZot-008UeL-G4; Tue, 07 Dec 2021 12:43:43 +0000 Received: from mail-eopbgr140049.outbound.protection.outlook.com ([40.107.14.49] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muZoO-008UXQ-JJ for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 12:43:14 +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=UA85KOESTSii6odrzhpE2i2A0Kpa+3IR7yIFSr81yb8WI8lYX1PYp0ftNk/8V0K/E8evruAmFJfCW95NeBPjaZWMx1chWn/dp+/ZGIxwjiDGMag4gAAsVkuMRG0x4U2z8UPJKKpGlRpVz9kwEAc5sPF7Ge6pQLZr1DSygOcX7Xc= Received: from AM6PR10CA0014.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::27) by AM6PR08MB3702.eurprd08.prod.outlook.com (2603:10a6:20b:8e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.11; Tue, 7 Dec 2021 12:43:06 +0000 Received: from AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:89:cafe::30) by AM6PR10CA0014.outlook.office365.com (2603:10a6:209:89::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Tue, 7 Dec 2021 12:43:06 +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 AM5EUR03FT005.mail.protection.outlook.com (10.152.16.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.13 via Frontend Transport; Tue, 7 Dec 2021 12:43:06 +0000 Received: ("Tessian outbound dbb52aec1fa6:v110"); Tue, 07 Dec 2021 12:43:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fe84ed471874df6c X-CR-MTA-TID: 64aa7808 Received: from f078e22935c9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F9B3835D-58AD-43EB-855A-9710EA2B75AD.1; Tue, 07 Dec 2021 12:42:59 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f078e22935c9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Dec 2021 12:42:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UIFSwauOexcbAUDy1/YFx7Be1l+D5V1rWn9lRKB7KUYBhV4NN2XV4klWiOsms36ZLLV8uwhYh2jlf7EXHuyNBnsoGNIU4hXCVcCxuNwOnKZ7/BGgPhVjc0w71fm25HKfiduWwiwzJdFZ1YA+o8Gz+vI7jGyDfSABu2KLmYoow7Wl0huuFSEH3s8i2n8hzy32ZuDhx675lEQHkWYKQOQ06FqC1z2xvc9q0E8q3ZI1ZfBV5ApYeXOr3W5GntHl2B7a0voyT0X9HF4NCOEP+91IKOQOM8trsFyGH5/tKa7GDqJ0Pr33e57IJJ70pAonN/aIC7Uem6BwgIpoSjSmV1YYQQ== 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=aULAvtkblLU6LPN0kVmgHNFDtUeYtDp0hdB7/stNbDZ9R+JUR+pkLCRM8lURLq3y5NianMQnCPOqZhAtqsETVZ+NoMVMHsc1pn3urrUAnUjCyAtQo1n+df27TLDmRUidBl3DYeW8xxs93G2/lof3Gn66uJMRv35CuS8As8AVa7ZjZ0SyWLGl4XwtXmmdpr7l7SDnxIRCa2q7Qybsw+HbDmo8jXH4BP8iwRAeLJGBteiD3XcWHORJqTRsZ/XXOxiUfRyyGa3gZZaazWJjN6NPeL8VOWZEAUCKAVcxiMpb2PtQGsaEosU85ukDpR1gyD5iKshAjHdAGL24Pf1wcQOg3A== 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=UA85KOESTSii6odrzhpE2i2A0Kpa+3IR7yIFSr81yb8WI8lYX1PYp0ftNk/8V0K/E8evruAmFJfCW95NeBPjaZWMx1chWn/dp+/ZGIxwjiDGMag4gAAsVkuMRG0x4U2z8UPJKKpGlRpVz9kwEAc5sPF7Ge6pQLZr1DSygOcX7Xc= Received: from DB6PR1001CA0036.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::22) by AS4PR08MB7480.eurprd08.prod.outlook.com (2603:10a6:20b:4e7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Tue, 7 Dec 2021 12:42:55 +0000 Received: from DB5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::69) by DB6PR1001CA0036.outlook.office365.com (2603:10a6:4:55::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Tue, 7 Dec 2021 12:42:55 +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 DB5EUR03FT019.mail.protection.outlook.com (10.152.20.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4755.13 via Frontend Transport; Tue, 7 Dec 2021 12:42:55 +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; Tue, 7 Dec 2021 12:42:46 +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; Tue, 7 Dec 2021 12:42:45 +0000 From: Joey Gouly To: CC: , , , , , , , , , Subject: [PATCH v2 3/3] arm64: cpufeature: add HWCAP for FEAT_RPRES Date: Tue, 7 Dec 2021 12:42:26 +0000 Message-ID: <20211207124226.50095-4-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211207124226.50095-1-joey.gouly@arm.com> References: <20211207124226.50095-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 5d40873e-24e2-456d-bbd0-08d9b97f1e1a X-MS-TrafficTypeDiagnostic: AS4PR08MB7480:|AM5EUR03FT005:EE_|AM6PR08MB3702: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: nLteVL3Br6dZs/qWZP+nZGKuMV8cpdNl2kbddMgwkuyUyGeB/7xSctk63Sdd2yb1gVhIhDAoDBlxBDaEgkUtuAS5xlXE28Sr+noss61s7iteUpymZ+oB/b9e4701tmuQa99VJfvI8WJjacrIJGgIxdtvw5vpxkznYfG9xX2L2zDQbC0dA6RAl9cgpPW5InBO+3nvExHIArA+EwsYUAULoKsG73O83bLpdEBacVb3eTHn4I91T7z/YdGUM4HAfES4PRHhi78/uY9sM33CEdWuXojnhG+I9wJecqABgYQfJ9Ywm6KPxnJ32f7Fj9M9/4gbskicmLxjIoT/Dv7/uOEQy2eXIBngYfn5VnzxqTOwOXCfqgQdv7I8tBmNg0ed81+EAiPB12tlpPxxz2G1Nz043eSgal3Wgn4XU2yjCmaTY2o9CjkIn7UvTCNyca/F2n4XBHUzEYSIBcyUi/pn+8Jold1fRqDkKztzSD71ErOVO05oWTNZxe5erCBLRRDmiXFBiRF/w9b3NznlQQ6eAToBazpGdWq3ukMAb+x4rXsYrcXMjKIKGn4oAavfxcPycOk5Depwml1ICBc0Cw5rxCagnTZ9YV0P6EJEe/QCnUjcZCXheQ+LcZla8W5TX7yaY/j89EIMNo4+kKa59YMN/tNwyUstZb/7qHMAhod0IjpnVTIi68X7VC4jm5fiPYMAlkzqUGd0BJ3TbqL5pVYYzZxCZWkFVLyincBeLIahfAm7QspJZZtFgsaS7tLLulWg30Bohg7/Z4baIydeAXWuP6+fWKXxqf0OapIZlX5f3okTHfs= 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)(83380400001)(82310400004)(356005)(5660300002)(2906002)(6916009)(316002)(36756003)(44832011)(2616005)(36860700001)(1076003)(70586007)(47076005)(81166007)(54906003)(426003)(40460700001)(8936002)(4326008)(186003)(508600001)(8676002)(70206006)(26005)(336012)(6666004)(86362001)(7696005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7480 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c9ba4243-92e3-4706-f3d1-08d9b97f1755 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N6YobrRZ9XsRZPY53XffCcbysr7rSqedHpAs3JVvjDrzoEn5OeSWihlCHKEUmKUmmRuO7jP6gIv1vxXP/ns59daMfTHW7vz1Bxtw3uHXnEXF0cBuZXK014k7LutRosp8ZCLPU1hSrz5rNokyidyBiqieNdtw67MK4u8nd0mfSqgshIQUp5ZOPg7L0P2q+4L0YR5z6stnVdfZxrw7nrHXFhShFFTeYPrgijrgRVUoXlYXqYvA+d0nvo5gKe8gcg9HxBSfVMXJKx81IdiHVRr6WFN/y3yft+56THmnqZVroNCnt8YRS+FHtRKj0qxe97l3wY4fd5E4gjhCyLN6wlhDZI1Ci/1vEOLzRLaqK5OH75r905J+4iZ1R+W+LC5UgpIi10YiJcbMjZ/ApMWk4N1YNgj9En5dMw7FCcX4Ifc8r/chFsW6T7AbHhdpgppcJqJGs5uPcOYIVxI4QB95oOs0IiPyMK3KNh9MuTNkroNCvPw27s+sgm3SlUozkRXgzZ4MFPlGHRR3ypbiixymmO7ZfQtG1k4VhRKIuPirPP3F6wjYJ6wjW5rpTRePduv7NC49JqbF1wluhF69xKR4t5F2nqUfKChR1bDkvz7Oczr7cTaFqEGALgVOQiniHUCrS9l1JSfVremgVRGhD2k9uVJRLnntj7cbL/F30nMubxKUSNOVxn8sMlXO2oxRdZ1/V6y6sodaByhAsmxADM9xA8Q4+A== 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)(46966006)(36840700001)(70586007)(86362001)(81166007)(316002)(2616005)(4326008)(36860700001)(83380400001)(47076005)(2906002)(70206006)(36756003)(508600001)(54906003)(107886003)(8676002)(8936002)(82310400004)(1076003)(26005)(6916009)(44832011)(6666004)(426003)(7696005)(336012)(186003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 12:43:06.6064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d40873e-24e2-456d-bbd0-08d9b97f1e1a 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: AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3702 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_044312_688587_F2F5FD15 X-CRM114-Status: GOOD ( 13.55 ) 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