From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A26102BFC70 for ; Thu, 15 Jan 2026 16:05:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768493145; cv=none; b=GdDxb3IUUTaYaKpPXoJL9N/qIroX+5DNSKrsNvSM3CWH6ZSfLcTiNAuzbdp+sI+hMg92N8nkMpTMsiTSfn//te5tzJZqOJZxy4iaXf/x1gpOAYDI5dudX1QROHiQkoxubggtfkodgUSky/EYvO0jwvxn0n3VumM6Hz4k4BNEIcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768493145; c=relaxed/simple; bh=IqXfpQMSe5Bc42TV9K9KEsrFbbGkWI5+nq8h1vmGF1s=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=dEM8AM3ioLRUj2dEYhEJ2trqi1HEFMBUkQjV8VwFzmbMZTgFAgrspjL/K6nQKG3sjzMkU9zM4N5qNvoERnGoOWMFXeWtfbf2tQpiQKuvytORgX5Rb1vFkocBx5xHGiHLL19bFIoZ9ujEmN4XqMWhS+vWjI8wlOd48Bti8cnd9EM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mhP6JI5Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mhP6JI5Q" 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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.