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 27CD6CA5FDD for ; Sat, 3 Oct 2026 08:46:02 +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-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Subject:Cc:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zxZleFQUEISD064kSfjMjMxf0Adv0+eg+SUInoyeOkM=; b=rZauLAupvFfzyKuTaYuN+AjDH7 M0r3diIpjT03ZF0Ac+Bdh1ggGKORCfPg0rtd45wKqk4Z0dgRNWn6UbOGFbKsXcHQHgLkzLX+XCib5 vlf1JFYYuzTbfgTQhjv3rYYhXtAqW2AoKPife5mv5m751Gem/whG8gD7gg+zRd4KUtQgaxUTo6hHC 824+/BSIgD2DlLq9M2ZwDY4rNQhZjdYiR3rMfUO1y9jzv6Jx1pz5pgKIOYfhdkML1wlv9qw736vzo fk3wyn7crcKVVKiNatTMmuswDzWPNyfwS83cVh3dKpL4Z5cGN7BKElCZ5hno49Szg895e2ECqe0kY S/HEGPOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xCvNT-0000000DCz9-1KCX; Sat, 03 Oct 2026 08:45:55 +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 1xCvNQ-0000000DCyt-1nU7 for linux-arm-kernel@lists.infradead.org; Sat, 03 Oct 2026 08:45:53 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 8807E60AAF; Sat, 3 Oct 2026 08:45:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37BA01F0089B; Sat, 3 Oct 2026 08:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791017151; bh=zxZleFQUEISD064kSfjMjMxf0Adv0+eg+SUInoyeOkM=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=CdvyVKHZynq+wKXiwTb2wUbImBUsPXNZ9b5G58qvJbwUraRUEMQLg1XT9zBpaQtHz O/sZaA5oyo2yoo8B9GvO+5BtRoTLEMHSJ04cG3FJzBxIui+zMCpHs5wSxYRvUwFBPg mvJVCepy0Nk8CjWXTZZULFrfKzGqsoAQXWQoYLGx7OgBxI09TfXciGLJabnWopj8Kx Ir6c7ZIBqhhxqfiASq5aVX/zimjZTCZklH/GhBmcHMq1l088jV2lnTsWgytwLGwJ1r FRfWOPfhhHOs3Awk9IHTDr6kVRfPhWKAq5xq3PbUbmyg53/ZEKZqNh9cv78oWKlkHo oaPfn7JY5t+4w== 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 1xCvNM-0000000GUTq-3GbA; Sat, 03 Oct 2026 08:45:48 +0000 Date: Sat, 03 Oct 2026 09:45:48 +0100 Message-ID: <86jynz2mv7.wl-maz@kernel.org> From: Marc Zyngier To: Suzuki K Poulose Cc: Fuad Tabba , kvm@vger.kernel.org, kvmarm@lists.linux.dev, will@kernel.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, steven.price@arm.com, aneesh.kumar@kernel.org, oupton@kernel.org, gshan@redhat.com, joey.gouly@arm.com, yuzenghui@huawei.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, sdonthineni@nvidia.com, alpergun@google.com, fj0570is@fujitsu.com, WeiLin.Chang@arm.com, lpieralisi@kernel.org, enju.kohei@fujitsu.com, sudeep.holla@arm.com, jonathan.cameron@oss.qualcomm.com Subject: Re: [PATCH v21 05/23] KVM: arm64: Track the type of VM in kvm_arch In-Reply-To: References: <20261001210703.1597150-1-suzuki.poulose@arm.com> <20261001210703.1597150-6-suzuki.poulose@arm.com> <86se2o2rbs.wl-maz@kernel.org> <86pkxs2npx.wl-maz@kernel.org> <86o6dc2ka1.wl-maz@kernel.org> <83e79119-b331-4640-b2c7-cc8135d71c77@arm.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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: suzuki.poulose@arm.com, tabba@google.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, will@kernel.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, steven.price@arm.com, aneesh.kumar@kernel.org, oupton@kernel.org, gshan@redhat.com, joey.gouly@arm.com, yuzenghui@huawei.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, sdonthineni@nvidia.com, alpergun@google.com, fj0570is@fujitsu.com, WeiLin.Chang@arm.com, lpieralisi@kernel.org, enju.kohei@fujitsu.com, sudeep.holla@arm.com, jonathan.cameron@oss.qualcomm.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 Sat, 03 Oct 2026 08:07:39 +0100, Suzuki K Poulose wrote: >=20 > On 03/10/2026 06:53, Suzuki K Poulose wrote: > > On 02/10/2026 16:29, Marc Zyngier wrote: > >> On Fri, 02 Oct 2026 15:37:00 +0100, > >> Fuad Tabba wrote: > >>>=20 > >>> Hi Marc, > >>>=20 > >>> On Fri, 02 Oct 2026 15:15:06 +0100, Marc Zyngier wro= te: > >>> [...] > >>>> Honestly, we introduce the flavor stuff to make it easy to match > >>>> things on a particular VM type in a readable way. So why isn't this > >>>> reading: > >>>>=20 > >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (vcpu->kvm->arch= .vm_flavor !=3D VM_PROTECTED_PKVM) > >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return; > >>>=20 > >>> I know this is a sketch, but just in case: that's inverted. The sync > >>> only applies to non-protected pKVM VMs (EL2 ignores it for protected > >>> ones), so it would be !=3D VM_PKVM. > >>=20 > >> See what I meant about this stuff being completely intractable? I > >> still have no idea what it means! ;-) > >>=20 > >=20 > > Just to be clear: unprotected_pkvm() !=3D (vm_flavor !=3D VM_PROTECED_P= KVM). > > Rather, unprotected_pkvm =3D> (vm_flavor =3D=3D VM_PKVM). > >=20 > > And the code wanted to bail out early for !unprotected_pkvm(). We can > > stick in "is_protected_kvm_enabled()" for unprotected_pkvm predicate > >=20 > > But, I can drop the helper and use the vm_flavor check. >=20 > FWIW: Here is the diff for the above change. If you are happy > with the following, I could fold this in. Yes please. This is far more readable. Once we have the full picture, we can maybe look at more synthetic helpers, but let's start without any premature abstraction. Thanks, M. --=20 Without deviation from the norm, progress is not possible.