From patchwork Fri Oct 8 13:58:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 12545471 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE735C433F5 for ; Fri, 8 Oct 2021 14:00:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7540A60FD8 for ; Fri, 8 Oct 2021 14:00:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7540A60FD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=gtnYoE/pFpktPUn7QEhSJPsbzQmP2HovVMPLUPy6dpE=; b=IkzUPCiEicbe41 cVoOrcSGTBSErH42lb8167dRhFG+d73jt2jHsnS0sB6tz8h3ZwWRDLdhffulXKPJOe1yrhbriDZOB K5NgssMUyO7lTWWMGsQAN1GgiBTemgzNfM7C8/uEkc5YEgebmVNTESFrn9VxSkN3c3EkuIaLQ+vIv z6fPNC1jMSi3EMzHXeXmeMh94h4YlG6Vu8Qqo2+PlSVPM7Kk1MegKLAcUNRhSh+gpHC8s1FnA+B/M O2u4IibxoohKlhLQKqV9HPyp5TOvN5JKeoMmOjTd2uvaFptaJTrIQuffiaZa7oOqNACHoceXiCON9 Zmd2pUsV5ZC2aolrMWPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYqOj-002ygY-81; Fri, 08 Oct 2021 13:58:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYqOg-002yfi-2U for linux-arm-kernel@lists.infradead.org; Fri, 08 Oct 2021 13:58:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D01560FD8; Fri, 8 Oct 2021 13:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633701529; bh=qt4qPRpZDqP972BpcROFKMWTXqqtdlBS+kVAYhW5nnY=; h=From:To:Cc:Subject:Date:From; b=EkDiypqvcaB7DkOBZOcY+S4dX2SGaQSl6JIsiPx3b+pNCHmM+nQTKasmFVczJWcm1 S0blUSmZ8teMSON1g0eluYDf1eEY7d2DWd48JCJd3HOahk6sGvx6bAuUBdP82leL2E T8hYr+z6765nE69dixOa+1ns41Pr0EbzjqLXayo4JhjfYikVUdQ/FVaPGCjueCliMn tjMJPmvXGhr/1Yn+naxdECb/bHP0wg8fXyM5mVwXg1ESdIOL4NFWBRlgvntHrRewUC Y9jCao85pLV6UisBtYWfZf9A4Gyggy3M+GQDGGSFh8vc0q0SQsotQiiRg5oXOD9hMW vQzDVpQfFuzPQ== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , Marc Zyngier , Quentin Perret , Catalin Marinas , Alexandru Elisei , Suzuki K Poulose , Mark Rutland , kvmarm@lists.cs.columbia.edu Subject: [PATCH v3 0/6] KVM: arm64: Restrict host hypercalls when pKVM is enabled Date: Fri, 8 Oct 2021 14:58:33 +0100 Message-Id: <20211008135839.1193-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_065850_153110_3B9CF8DC X-CRM114-Status: UNSURE ( 7.17 ) 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 Hi again folks, This is version three of the patches I previously posted here: v1: https://lore.kernel.org/r/20210923112256.15767-1-will@kernel.org v2: https://lore.kernel.org/r/20211005113721.29441-1-will@kernel.org Changes since v3 are: - Included proposed cleanup (using an enum) from Marc - Rebased onto -rc4 Cheers, Will Cc: Marc Zyngier Cc: Quentin Perret Cc: Catalin Marinas Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Mark Rutland Cc: kvmarm@lists.cs.columbia.edu --->8 Marc Zyngier (1): KVM: arm64: Turn __KVM_HOST_SMCCC_FUNC_* into an enum (mostly) Will Deacon (5): arm64: Prevent kexec and hibernation if is_protected_kvm_enabled() KVM: arm64: Reject stub hypercalls after pKVM has been initialised KVM: arm64: Propagate errors from __pkvm_prot_finalize hypercall KVM: arm64: Prevent re-finalisation of pKVM for a given CPU KVM: arm64: Disable privileged hypercalls after pKVM finalisation arch/arm64/include/asm/kvm_asm.h | 47 ++++++++++++--------- arch/arm64/kernel/smp.c | 3 +- arch/arm64/kvm/arm.c | 61 ++++++++++++++++++--------- arch/arm64/kvm/hyp/nvhe/host.S | 26 ++++++++---- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 37 +++++++++++----- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 3 ++ 6 files changed, 117 insertions(+), 60 deletions(-)