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 583B72E11A6 for ; Thu, 15 Jan 2026 15:03:48 +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=1768489428; cv=none; b=tNPKhqx1IT8RfsMZIXS5y/UQuOrFbOYi1ps7l8L2kKt9GrKsuSzSFZx38ueta+vIwT2KvHofSd53Cij57wIoj7rRFiIqJyPb4zhsRIewBoN0wWa4cdaHtH4rSgaNstXK2T3jxNg20RSwh63AemL0+RWkZX5A5DV0Vi7xiodTM0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768489428; c=relaxed/simple; bh=IomSoaKDjFHmV/r1mkpq9gL3BQYgXNcAVFd336zBXbw=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=JlupI/75BAdKsp0J3ehq7QLh5udc3LC9qrYFLjgkjR4KjHwAnctf7xeJAosCk+UBvAA1AT7ET0bNALH7j3Tx5heOB2bAciqclbRxy0StaWDE1C4oc2eWRTqQJSPntd9bTsxwDReW8N1WfsLFRIRBzlnYGte2/FTlCK75Kao5q6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AEDrr9fO; 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="AEDrr9fO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEA0CC116D0; Thu, 15 Jan 2026 15:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768489426; bh=IomSoaKDjFHmV/r1mkpq9gL3BQYgXNcAVFd336zBXbw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AEDrr9fOTUYSFiLkg4xrDl6EGCM9/VrDLjsWW0HX9Q92yoffZlX8KcmD6uy+P8yq6 72z+YY8qTffeS0x09GrMySTQrz2uNPLo85vsZQVXAYXdZzvQSIlAWb+uqUZjO75lcO oizY/+s8h8kiMaoDv2NxVVd7rMOPGlQTOgFOHfJbZBy1NZtmmv656qXfFO3S7GcdSd Rgl3CApzlCZrx1YK3931JXigstScPBCKHn7VEEp/r4WHSfbeTJQcgg11QjQyhrKvNQ IC1hVkjD23colBxmMNB6CFtnL/qkdO75rLPF6AwdEUPYygE8LDqEqEHxLV+P4HSxSR utDrL6R+JV8Dg== 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 1vgOsy-00000002ZBB-2pIB; Thu, 15 Jan 2026 15:03:44 +0000 Date: Thu, 15 Jan 2026 15:03:43 +0000 Message-ID: <86h5smlxyo.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: <20251211104710.151771-9-tabba@google.com> References: <20251211104710.151771-1-tabba@google.com> <20251211104710.151771-9-tabba@google.com> 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, 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. Thanks, M. -- Without deviation from the norm, progress is not possible.