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 F0911D44C70 for ; Thu, 15 Jan 2026 16:05:56 +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=0z6eOkq1/Q8eYhvkB8qig7EgvntIuaPDQlVJlaR2xnw=; b=C49qfFsG8CqzmqrQaQp2p5mDuI J0oL2dL8v05/RvdmJ6OZTeDeMvj+sz8VvYW+aMc289EXBhrKeyefsHV8a8lViMhHTLhyJKmy6gYoP i53GhqkD74urCa+tvr5HhRs5VU3cnpMOjI3kg+BT/r+fRZ6KAIi6xtQqdtqi6Ansii47Lr0hD/UKe SCYOveCnX0hM9zQFCpIKfjn2GU1Kxzu2LU1+PGTMtulFjSFjqR2wN8e7hL0GrAg0Y0zJjyiE1HPsK 2xrSQRag7YnVbH1LSEiwc8VBEEtY9ZrdYgUMmFZbF/OJXdAzaUAu0WxP2bs7XYcT2HjmfKijU/fWH 9FrlF2jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vgPr1-0000000Cdkt-0QIE; Thu, 15 Jan 2026 16:05:47 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vgPr0-0000000Cdkl-0ewc for linux-arm-kernel@lists.infradead.org; Thu, 15 Jan 2026 16:05:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 9766C6001A; Thu, 15 Jan 2026 16:05:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47752C116D0; Thu, 15 Jan 2026 16:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768493145; bh=IqXfpQMSe5Bc42TV9K9KEsrFbbGkWI5+nq8h1vmGF1s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mhP6JI5QPxOrcz4QO2QLcThZgZjpJ/rUNw5WkRCZ+HfaSeHtoJkpqAvh0zwD2jgz5 g0MOT1YF0p2DN+KjPJkbLcvTTQAo4IHStPau1lkBsY2V+2lXUi/u/dq4l/JzCktzap b9SkgOYh6S1lNpuqcSndgM1BsrLlqZkg2/MfcFLEX00lnp1tPxsh3XLz6hr8dk050P CNHXv24wK7ylkQLUMMSlAXKYJ61SoLnjelLB2RsSiLkRl6gYpxkQLEfYjnh0EWQrCb 3x+E2giWiBEj3ie5ANb2A4bIV+M0uwOQIkWyNoN97ROGWPdj94yP7T/CXFcBuZiZUg BvCLK8SivC1MA== 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 1vgPqw-00000002aLK-3tBN; Thu, 15 Jan 2026 16:05:43 +0000 Date: Thu, 15 Jan 2026 16:05:42 +0000 Message-ID: <86fr86lv3d.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev, will@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, vladimir.murzin@arm.com Subject: Re: [PATCH v6 8/9] KVM: arm64: Check whether a VM IOCTL is allowed in pKVM In-Reply-To: References: <20251211104710.151771-1-tabba@google.com> <20251211104710.151771-9-tabba@google.com> <86h5smlxyo.wl-maz@kernel.org> 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: tabba@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev, will@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, vladimir.murzin@arm.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 Thu, 15 Jan 2026 15:19:48 +0000, Fuad Tabba wrote: > > Hi Marc, > > On Thu, 15 Jan 2026 at 15:03, Marc Zyngier wrote: > > > > On Thu, 11 Dec 2025 10:47:08 +0000, > > Fuad Tabba wrote: > > > > > > Certain VM IOCTLs are tied to specific VM features. Since pKVM does not > > > support all features, restrict which IOCTLs are allowed depending on > > > whether the associated feature is supported. > > > > > > Use the existing VM capability check as the source of truth to whether > > > an IOCTL is allowed for a particular VM by mapping the IOCTLs with their > > > associated capabilities. > > > > > > Suggested-by: Oliver Upton > > > Signed-off-by: Fuad Tabba > > > --- > > > arch/arm64/include/asm/kvm_pkvm.h | 21 +++++++++++++++++++++ > > > arch/arm64/kvm/arm.c | 3 +++ > > > 2 files changed, 24 insertions(+) > > > > > > diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h > > > index 5b564576160d..0fa8c84816fd 100644 > > > --- a/arch/arm64/include/asm/kvm_pkvm.h > > > +++ b/arch/arm64/include/asm/kvm_pkvm.h > > > @@ -9,6 +9,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > > > > /* Maximum number of VMs that can co-exist under pKVM. */ > > > @@ -43,6 +44,7 @@ static inline bool kvm_pkvm_ext_allowed(struct kvm *kvm, long ext) > > > case KVM_CAP_ARM_SVE: > > > case KVM_CAP_ARM_PTRAUTH_ADDRESS: > > > case KVM_CAP_ARM_PTRAUTH_GENERIC: > > > + case KVM_CAP_ARM_BASIC: > > > > Can we instead rely on an existing VM capability? I'm not overly keen > > exposing something new to userspace (KVM_CAP_ARM_BASIC) for something > > that really is KVM's own internal problems. > > > > Looking at the history, a bunch of things have always been present: > > KVM_CAP_NR_VCPUS, for example. You could even #define > > KVM_CAP_ARM_BASIC to that if you want. > > I wasn't too crazy about that either. I like the idea of defining it > as an alias of KVM_CAP_NR_VCPUS. I'll do that when I respin. I've done something [1]. If that works for you, let me know and I'll just merge that. Thanks, M. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=kvm-arm64/pkvm-features-6.20&id=8823485a697de5c280a7a2632620338722f16663 -- Without deviation from the norm, progress is not possible.