From patchwork Thu Feb 24 12:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 12758501 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 5FDFEC433EF for ; Thu, 24 Feb 2022 12:51:22 +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=axoxsV+rdWGBfaHUY5MIeXjm180P4zMQMcrBM1qdxTw=; b=kRaOCxBGEW8uG2 9Q12i2wT4dEVHYC+bKBDFUHz6dEOVDPVLUfGFHP0BjHIL5Vlec0+cd9/sp7KQjMazgjri9NNEyPrT HUN48qoOu3QeTXX8YaWDto45Gv57CitjeT3knLLskXKUbSsfVgWSSEjxWRzgHY2m3s7N4q82o5CqK hiPQrX6wNVAA9j4Vghzh/bfrg20gG13OjhPigSajNOG85tkLFIHh1nAa2NZK/QP60cSMKPff/4Mld lJ56AVtgnLs4CvmYWWnF4JTAsCylg8m+86cou9VXhFqtD5DUFG7c2aqbW5ibyIAyaFFr7+jWeTQoe mcVK2ubHQosFydoVjC9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNDZR-000kOz-Fv; Thu, 24 Feb 2022 12:50:09 +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 1nNDZN-000kNK-Su for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 12:50:07 +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 1A04B106F; Thu, 24 Feb 2022 04:50:02 -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 4D8EA3F66F; Thu, 24 Feb 2022 04:50:01 -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 v3 0/3] arm64: Support of PAuth QARMA3 architected algorithm Date: Thu, 24 Feb 2022 12:49:49 +0000 Message-Id: <20220224124952.119612-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-20220224_045006_004221_8F9AD90F X-CRM114-Status: UNSURE ( 7.27 ) 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 v2 -> v3 - Removed WARN_ON(s) (per Will) - Rebased on 5.17-rc5 Thanks! Vladimir Murzin (3): arm64: cpufeature: Account min_field_value when cheking secondaries for PAuth 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 | 59 ++++++++++++++++++++++---- 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, 110 insertions(+), 13 deletions(-) Acked-by: Marc Zyngier