From mboxrd@z Thu Jan 1 00:00:00 1970 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 BBBDBC433F5 for ; Wed, 8 Dec 2021 17:50:35 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t6YvP8JwrnNSDYSELqYWFsUi0AodVcLF9dpQ9G06owg=; b=13HvISIJdcWR0v 4BC7yiaT2aSJGrSr9TL+auGcdJIxZZVUpuaogcsPFrDoeNOn44IRH7tCd8Vo851SSCAnJjz9tnLoT HUdpMAnMZC+Nz30zR0uNaZEZi7TOZxSxYGXCLoJccO6Q/Ch4KJG1Lxtro2B0uFe0vL1jfceKJyNUs OxbsrC8TOcTWaGUtzPNrLTtvY68HEmKb0yhIIJaJTxQnaxOvB4oCBm+DcXxMQHL7lHBuxvP8OdvKQ Z545PK67fquvEUxcNgABtz1+5jr8H8+xuBvmLsaSCKCAj1i5MvYkjI9cM/4rv242tXWRbpV6/6ZYx 3RcW7YlVzSVU2DNRl8Jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mv14C-00Dn7Q-0a; Wed, 08 Dec 2021 17:49:20 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mv147-00Dn62-Vy for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 17:49:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 47D8FCE2291; Wed, 8 Dec 2021 17:49:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DF2EC00446; Wed, 8 Dec 2021 17:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638985752; bh=eSGWmUYDabFMwKqG3Chvgj52S+6K8S0+wchgsln66Fs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FVmbuBVeHGA+t64aKKCQOwctestVgv+cfhL7/r35fiX8zZB3uJURgeSJ7dHVxN2Gk aDzKJ/pmK12DTEPigcRtOzASHbVbl/6ENj+4/EPq+4KZ0oz4DgNiEYHAxAxUpsJhD7 o51f+yGvq8oPCbCgtfwoS0tMm2EFXSOT59VWXNT/Egzvtor5jg89SNSgMNezUUWxKg H6Dgf/MNSrEXbo7szXz7gyIW8OkSLT7P2NXyMCOwc0gypZDsAdkRrheMVScy3G/nGO 2O9YmzKL+wHhQSTU3Whi2kgOlzMR3hiawKJbt+Tn6VZHy3X43CIsmlT+xICA2uU0WS nohonXYIn9Pjw== Date: Wed, 8 Dec 2021 17:49:07 +0000 From: Will Deacon To: Quentin Perret Cc: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 5/6] KVM: arm64: pkvm: Stub io map functions Message-ID: <20211208174906.GE820@willie-the-truck> References: <20211208152300.2478542-1-qperret@google.com> <20211208152300.2478542-6-qperret@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211208152300.2478542-6-qperret@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_094916_275508_BF64D621 X-CRM114-Status: GOOD ( 17.60 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 08, 2021 at 03:22:58PM +0000, Quentin Perret wrote: > Now that GICv2 is disabled in nVHE protected mode there should be no > other reason for the host to use create_hyp_io_mappings() or > kvm_phys_addr_ioremap(). Add sanity checks to make sure that assumption > remains true looking forward. > > Signed-off-by: Quentin Perret > --- > arch/arm64/kvm/mmu.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index 326cdfec74a1..605c104eb030 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -407,6 +407,9 @@ int create_hyp_io_mappings(phys_addr_t phys_addr, size_t size, > unsigned long addr; > int ret; > > + if (is_protected_kvm_enabled()) > + return -EPERM; Looks like the vGIC is the only caller, so no need to worry about anybody relying on *kaddr being zeroed on failure. Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel