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 487E0D44C5E for ; Thu, 15 Jan 2026 15:04:05 +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=FfV0WOMn4XBiSXMAHGBPR0wJK8BwddTGTPcaWxCVZSE=; b=sG7XDllf0QVNBc5lBzni7jPj9i x0i5ZsWi7XCIeXWhfnZfioNweCKiVO52oHe/ZAD3x4LWXIPlTtwKIfS2vGFknw/Yw/wo/gwLYOmPy 6EcZju/wYII/VvtVS5hZ8p9dTXt3GHR6MtxyhQL3SzjHbu8wSnlxzmyAsf7dDcLRyWiqOv1yDeEnx cYbcsgfrZUJBve46o41USmunRrXgXnatOMMG9ySRcUaC1uHpSDk9Mm6kpuzDsLsLbqrRBF3DXeqWF xpGTTo1omJ7DcyuilKrbjqlPP6WtrKWt5bf0p/L0jmY1XlQFeZfXjT5aJxcMWELZMJBSDboafdjgN S7qXjO+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vgOt6-0000000CYjH-3vQF; Thu, 15 Jan 2026 15:03:52 +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 1vgOt2-0000000CYj5-0VpS for linux-arm-kernel@lists.infradead.org; Thu, 15 Jan 2026 15:03:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 1CA806001A; Thu, 15 Jan 2026 15:03:47 +0000 (UTC) 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) 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, 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.