From patchwork Mon Jun 22 08:06:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11619453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE88413A0 for ; Tue, 23 Jun 2020 00:27:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 983E620706 for ; Tue, 23 Jun 2020 00:27:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i+PywVa4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="tofBpQcy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 983E620706 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=9ClKw0dpwUoPCXVDjrMrkAjZrSc5XVTUBsgsO0lWCQ0=; b=i+PywVa4egE2lSIdhLXSe+25ZL HdLeHJODTm00CxdAjpkk3fzqGd2s9ATrTkfM+snc7C4alA/CXyiKIugitLOd1DRUXsPYFdfXMjjOF AijR/8T8Ts0HFAXQwvi5t3+6WNL75IHxH0EJ0OEdfMbXkDuv8bN8154CQSrr9uLuuINAg1Y2pqSdH uRANNGwv7eAKQlnKsRyrY+I65s9P3xjPkwfpxnK8T5yjEO1r6eqiyqVSN2fExKQrQqQQz1XIOMR/J SQU5JAgKY3n5UrG8aAHiMcAgpe293sJ5vIA3hxihXg1kChfvvoPPyzY91XyX9bR1OjyHbqNMUVZnv fnWiovow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnWkI-0007bC-U5; Tue, 23 Jun 2020 00:25:03 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHTi-0002lR-8H for linux-arm-kernel@lists.infradead.org; Mon, 22 Jun 2020 08:06:56 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D60E207C3; Mon, 22 Jun 2020 08:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592813213; bh=Ii14i7vMt5G0blEY8jOOtv2hk5ArajPnLztxOTdDv4o=; h=From:To:Cc:Subject:Date:From; b=tofBpQcybBeOKxwi8eoUa+ScRMUGCbQlt4sgu/nO4mJqbCzrEuGE1DgnIgIYns6VG Y+7ifpP6U5+arBiWpI32ti/Y2LlZa6Ve+oiwtHz2lO/zCvssW41I0leGdPqyVobmom 2SP3RE7P4Ucv/BmtBeQRSRMIN7daLpqlPS2cOpGQ= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnHTf-005FG8-Br; Mon, 22 Jun 2020 09:06:51 +0100 From: Marc Zyngier To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 0/5] KVM/arm64: Enable PtrAuth on non-VHE KVM Date: Mon, 22 Jun 2020 09:06:38 +0100 Message-Id: <20200622080643.171651-1-maz@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, mark.rutland@arm.com, ascull@google.com, Dave.Martin@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Note: CRM114 invocation failed X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Suzuki K Poulose , James Morse , Andrew Scull , kernel-team@android.com, Dave Martin , Julien Thierry Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Not having PtrAuth on non-VHE KVM (for whatever reason VHE is not enabled on a v8.3 system) has always looked like an oddity. This trivial series remedies it, and allows a non-VHE KVM to offer PtrAuth to its guests. In the tradition of not having separate security between host-EL1 and EL2, EL2 reuses the keys set up by host-EL1. It is likely that, should we switch to a mode where EL2 is more distrusting of EL1, we'd have private keys there. The last two patches are respectively an optimization when save/restoring the PtrAuth context, and a cleanup of the alternatives used by that same save/restore code. * From v1 [1]: - Move the hand-crafted literal load to using a mov_q macro (Andrew, Mark) - Added a cleanup of the alternatives on the save/restore path (Mark) [1] https://lore.kernel.org/kvm/20200615081954.6233-1-maz@kernel.org/ Marc Zyngier (5): KVM: arm64: Enable Address Authentication at EL2 if available KVM: arm64: Allow ARM64_PTR_AUTH when ARM64_VHE=n KVM: arm64: Allow PtrAuth to be enabled from userspace on non-VHE systems KVM: arm64: Check HCR_EL2 instead of shadow copy to swap PtrAuth registers KVM: arm64: Simplify PtrAuth alternative patching arch/arm64/Kconfig | 4 +--- arch/arm64/include/asm/kvm_ptrauth.h | 30 ++++++++++------------------ arch/arm64/kvm/hyp-init.S | 5 +++++ arch/arm64/kvm/reset.c | 21 ++++++++++--------- 4 files changed, 27 insertions(+), 33 deletions(-)