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 BC2A0CCF2C1 for ; Sat, 17 Oct 2026 16:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Sn6oltEz1l2gbSTEtMRaMGw2g3dSBbPeiQre/ajrvSI=; b=W9skK02g+8UANV7Pqoxv9wwdJQ 028hHxQD7qx6mO0t4RW7TgNvgInin4at3sgTCIfJPOQVpHm7aQ4IfXamkeuOhszHqviUzvlqbL7u1 4sx3XZlhTzetL+YZn1o25aQJ40W/kaE/joQgYn3RUy0BPj8rgWKcE0vKDEqfq2KugN3B2m6WUckft MZSUEJwVhKwnYmlErLlvOj6/1QDwP5vMJbCafpnME1lKadWVnqKDpTr0uc/2SVl2d1jH5bcK66Zn+ 8cTtjjGRRX5naSG3O0xbFrPUbW4GzMXucaYM67obCGI8dyku9/jo82tWOgQm7DUgQcfl18BW0wDLO SmqAPLdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xI7Cj-00000004v7z-0yCB; Sat, 17 Oct 2026 16:24:17 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xI7Ch-00000004v7s-3UT6 for linux-arm-kernel@lists.infradead.org; Sat, 17 Oct 2026 16:24:15 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 37E4A60A9D; Sat, 17 Oct 2026 16:24:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0A011F000C4; Sat, 17 Oct 2026 16:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792254254; bh=Sn6oltEz1l2gbSTEtMRaMGw2g3dSBbPeiQre/ajrvSI=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=jJUye3F71L6g7gXBMb4EwJv4URAOh3FVM+EV/DoYqFRNTmSIzHAmrX2JvlEtbC/AL b6OxHpY2Jl+E1DJ2WHt+UlRnG5FbiY9wqOyLfndPwyUSKgmGctEEn97wtmfsbnxs2c iLEUjbrOBbr2m8ydOX9WoGmSG1/5PACeLRGORO7OFdsuPi+H3oTRgecNjjV0F33tW1 Bbn+qlfJipAP0sw3igJyGh585gBx1ej6PG9ojGvGN2NKQ9B75MeEaaNQDjW4yd2T8j wJ3S6WU0//4Q8jesK1KWtD8i1mRcbBqAGmkc8W805ONV0knOEazkamnVevvuIi6tZS BuSg5FTjWvSTw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xI7Ce-0000000487K-0c5q; Sat, 17 Oct 2026 16:24:12 +0000 Date: Sat, 17 Oct 2026 17:24:11 +0100 Message-ID: <865wz01ej8.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, mark.rutland@arm.com, vdonnefort@google.com, qperret@google.com, Sascha.Bischoff@arm.com, steven.price@arm.com, tabba@google.com Subject: Re: [PATCH v3 1/5] KVM: arm64: Reject the GICv5 CPU interface hypercalls under pKVM In-Reply-To: <20261012161524.4016464-2-fuad.tabba@linux.dev> References: <20261012161524.4016464-1-fuad.tabba@linux.dev> <20261012161524.4016464-2-fuad.tabba@linux.dev> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: fuad.tabba@linux.dev, oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, mark.rutland@arm.com, vdonnefort@google.com, qperret@google.com, Sascha.Bischoff@arm.com, steven.price@arm.com, tabba@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 On Mon, 12 Oct 2026 17:15:20 +0100, Fuad Tabba wrote: > > __vgic_v5_save_apr() and __vgic_v5_restore_vmcr_apr() remain callable > once pKVM has finalised. pKVM never registers a GICv5 vgic, so neither > has a valid caller in protected mode, and on a GICv3 machine both reach > a register that is UNDEFINED at EL2 and panic the hypervisor. > > Move both into the band the dispatcher rejects once pKVM has finalised. > > Fixes: af325e87af5da ("KVM: arm64: gic-v5: Add vgic-v5 save/restore hyp interface") > Reviewed-by: Suzuki K Poulose > Signed-off-by: Fuad Tabba > --- > arch/arm64/include/asm/kvm_asm.h | 4 ++-- > arch/arm64/kvm/hyp/nvhe/hyp-main.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h > index e5b92ac09e69e..ea319c496bb26 100644 > --- a/arch/arm64/include/asm/kvm_asm.h > +++ b/arch/arm64/include/asm/kvm_asm.h > @@ -62,6 +62,8 @@ enum __kvm_host_smccc_func { > __KVM_HOST_SMCCC_FUNC___kvm_enable_ssbs, > __KVM_HOST_SMCCC_FUNC___vgic_v3_init_lrs, > __KVM_HOST_SMCCC_FUNC___vgic_v3_get_gic_config, > + __KVM_HOST_SMCCC_FUNC___vgic_v5_save_apr, > + __KVM_HOST_SMCCC_FUNC___vgic_v5_restore_vmcr_apr, > > MARKER(__KVM_HOST_SMCCC_FUNC_MIN_PKVM), > > @@ -87,8 +89,6 @@ enum __kvm_host_smccc_func { > __KVM_HOST_SMCCC_FUNC___tracing_write_event, > __KVM_HOST_SMCCC_FUNC___vgic_v3_save_aprs, > __KVM_HOST_SMCCC_FUNC___vgic_v3_restore_vmcr_aprs, > - __KVM_HOST_SMCCC_FUNC___vgic_v5_save_apr, > - __KVM_HOST_SMCCC_FUNC___vgic_v5_restore_vmcr_apr, > > MARKER(__KVM_HOST_SMCCC_FUNC_PKVM_ONLY), > > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c > index 9a3b92e626adb..7c939baf9c1ba 100644 > --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c > +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c > @@ -911,6 +911,8 @@ static const hcall_t host_hcall[] = { > HANDLE_FUNC(__kvm_enable_ssbs), > HANDLE_FUNC(__vgic_v3_init_lrs), > HANDLE_FUNC(__vgic_v3_get_gic_config), > + HANDLE_FUNC(__vgic_v5_save_apr), > + HANDLE_FUNC(__vgic_v5_restore_vmcr_apr), > HANDLE_FUNC(__pkvm_prot_finalize), > > HANDLE_FUNC(__kvm_adjust_pc), > @@ -932,8 +934,6 @@ static const hcall_t host_hcall[] = { > HANDLE_FUNC(__tracing_write_event), > HANDLE_FUNC(__vgic_v3_save_aprs), > HANDLE_FUNC(__vgic_v3_restore_vmcr_aprs), > - HANDLE_FUNC(__vgic_v5_save_apr), > - HANDLE_FUNC(__vgic_v5_restore_vmcr_apr), > > HANDLE_FUNC(__pkvm_host_share_hyp), > HANDLE_FUNC(__pkvm_host_unshare_hyp), In order to minimise the number of conflicts while merging this, I've dropped the last two hunks that only serve a cosmetic purpose. Same thing for the following patch. Thanks, M. -- Without deviation from the norm, progress is not possible.