From patchwork Mon Jan 31 17:06:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 12730944 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 57269C433F5 for ; Mon, 31 Jan 2022 17:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jXwmnc005vpIzRFzPntskP5g1/wfGNujp4N26fqZuvk=; b=PplKRmP0vnaiEx vhakxfbJusfoeGaKqOEijMaJwh1lSn2kjSz+WBEYIFY4UyDaNA16edF1DUEs6k9jobmY8wEefI6cu yhyYZX29tqF/2B7g2MVHJY6gSgvSBmYbmhRgqqQ5rkPZI/axmXrvMPbdgleYN0MhHY3MftSeDH+lf YriEoSs9kUlx3a2mBiuaBjfFicgZ6AteI3mHZSX18bdLOg6aGim9jDsmo7GcnGWnicjClnWx1T728 6MQWO4ltDGizuTYMInVae/IHG9SMGsIQmwlHvjTKuvYOTcOHTGcNgsG9kkIvaRAj39wEFpDi2DrdA UV9tPmXflnBjn4tczq2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEaRf-00A6XP-7k; Mon, 31 Jan 2022 17:26:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEa92-00A04c-7u for linux-arm-kernel@lists.infradead.org; Mon, 31 Jan 2022 17:07:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D946BED1; Mon, 31 Jan 2022 09:07:08 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1951E3F73B; Mon, 31 Jan 2022 09:07:07 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Cc: maz@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, will@kernel.org Subject: [PATCH v2 0/4] arm64: Support of PAuth QARMA3 architected algorithm Date: Mon, 31 Jan 2022 17:06:50 +0000 Message-Id: <20220131170654.62381-1-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220131_090712_380842_6B5174EB X-CRM114-Status: UNSURE ( 7.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org QARMA3 is relaxed version of the QARMA5 algorithm which expected to reduce the latency of calculation while still delivering a suitable level of security. Feature advertised via a new ID fields in ID_AA64ISAR2_EL1 [1], so we need to teach the kernel to identify this. [1] https://developer.arm.com/documentation/ddi0601/2021-12/AArch64-Registers/ID-AA64ISAR2-EL1--AArch64-Instruction-Set-Attribute-Register-2?lang=en Changelog: v1 -> v2 - Removed unintended whitespace change in sysreg.h - FTR_ALIAS_OPTION_LEN now accounts null terminator - Extract only APA3 bits from ID_AA64ISAR2_APA3_SHIFT (in contrast to id_aa64isar1_el1 where both APA and API bits are extracted) in asm_pointer_auth.h Thanks! Vladimir Murzin (4): arm64: cpufeature: Account min_field_value when cheking secondaries for PAuth arm64: cpufeature: Warn if mutually exclusive PAuth algorithms detected arm64: cpufeature: Mark existing PAuth architected algorithm as QARMA5 arm64: Add support of PAuth QARMA3 architected algorithm arch/arm64/include/asm/asm_pointer_auth.h | 3 ++ arch/arm64/include/asm/cpufeature.h | 1 + arch/arm64/include/asm/kvm_hyp.h | 1 + arch/arm64/include/asm/sysreg.h | 12 +++++ arch/arm64/kernel/cpufeature.c | 63 ++++++++++++++++++++++---- arch/arm64/kernel/idreg-override.c | 16 ++++++- arch/arm64/kvm/arm.c | 1 + arch/arm64/kvm/hyp/include/nvhe/fixed_config.h | 5 ++ arch/arm64/kvm/hyp/nvhe/sys_regs.c | 14 ++++++ arch/arm64/kvm/sys_regs.c | 5 ++ arch/arm64/tools/cpucaps | 6 ++- 11 files changed, 114 insertions(+), 13 deletions(-) Reviewed-by: Marc Zyngier