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 57E9DEA3C59 for ; Thu, 9 Apr 2026 13:45:31 +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=vCXEjEzw6Nc0u2HRk3Ki8Amy/rBfim8G6PYAFVir7Ak=; b=mvGjdhvNIAUDyY57ShG1Y69WQp vtVfxLm2x2ZAeHz74Kxk/lneG2GwaP9fMPNhpbWA1KLgE1b75JispWhFkMSa8e2jpHJsHno+l7GBv +3CRjDq4NvuWt+umItWV92xdIqzkVsllo3qTOArkaLnCiddjSoURBR4mHVkTAhc0AWUSQaIXid3hA okB547ZH+3CbJU1l9gBqoNHua4kKgDrqYu2UTqmGZcP3AWfgiDNUGhkRYX6rM3HAa5FuR9goNYHnM FyxWzyyyHyqC1Ei6DRoOgA9b+KKHH6LSlzKCxaSSu0TVBLMhw3rN4Fm04QnI9VTmn9Z3Mapgg7gA9 p28XTwrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wAphA-0000000AYhR-2E4i; Thu, 09 Apr 2026 13:45:20 +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 1wAph3-0000000AYgB-48f4 for linux-arm-kernel@lists.infradead.org; Thu, 09 Apr 2026 13:45:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id DCF1D60125; Thu, 9 Apr 2026 13:45:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C6EFC4CEF7; Thu, 9 Apr 2026 13:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775742312; bh=eq8if797wFl6ufcGFq/diuqKdbrPEilao+Lf3/c2Jaw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EbJEneOG7FTCc3lWUwOtZr9eysP74IJKxUgTvtOM0rsjRRUbCBE1ARNjGHIQ9/40h M4Y8T03KS8vyz2tlMsE1BrfuD3TN3/wPU1YQGOzOQPKvkIzpHre84BerUHsFDsYRUy PiDoiyBfflr2JF5f+Q1GEEKjJ4VZM6MNYJ3HxQOXf9ojT8vKXeXWWPjxJdDwZ2BIHI HN9ls3H14GV/0ricbKGpXcFkbB7LxS6IFuygZYuSUvABSw1wCYz6Y/VzJq/CERGn41 pj1u+gmXGlaS+xqzcIoumcZ4p+1fR+iv1x+AKJtY8GmAl0vXK4nNUgXoe1yFrRrL4r JYAsgy3RZgCyQ== 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 1wAph0-0000000AGYy-1SET; Thu, 09 Apr 2026 13:45:10 +0000 Date: Thu, 09 Apr 2026 14:45:09 +0100 Message-ID: <86v7e02qoq.wl-maz@kernel.org> From: Marc Zyngier To: "Woodhouse, David" Cc: "kvm@vger.kernel.org" , "shuah@kernel.org" , "yuzenghui@huawei.com" , "joey.gouly@arm.com" , "linux-kernel@vger.kernel.org" , "catalin.marinas@arm.com" , "nathan@kernel.org" , "pbonzini@redhat.com" , "kvmarm@lists.linux.dev" , "arnd@arndb.de" , "kees@kernel.org" , "will@kernel.org" , "suzuki.poulose@arm.com" , "oupton@kernel.org" , "rananta@google.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kselftest@vger.kernel.org" , "eric.auger@redhat.com" Subject: Re: [PATCH 2/3] KVM: arm64: vgic: Allow userspace to set IIDR revision 1 In-Reply-To: References: <20260407210949.2076251-1-dwmw2@infradead.org> <20260407210949.2076251-3-dwmw2@infradead.org> <87wlyhc2g4.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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dwmw@amazon.co.uk, kvm@vger.kernel.org, shuah@kernel.org, yuzenghui@huawei.com, joey.gouly@arm.com, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, nathan@kernel.org, pbonzini@redhat.com, kvmarm@lists.linux.dev, arnd@arndb.de, kees@kernel.org, will@kernel.org, suzuki.poulose@arm.com, oupton@kernel.org, rananta@google.com, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, eric.auger@redhat.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 Wed, 08 Apr 2026 09:39:15 +0100, "Woodhouse, David" wrote: >=20 > [1 ] > [1.1 ] > On Wed, 2026-04-08 at 08:54 +0100, Marc Zyngier wrote: > > On Tue, 07 Apr 2026 21:27:03 +0100, > > David Woodhouse wrote: > > >=20 > > > From: David Woodhouse > > >=20 > > > Allow userspace to select GICD_IIDR revision 1, which restores the > > > original pre-d53c2c29ae0d ("KVM: arm/arm64: vgic: Allow configuration > > > of interrupt groups") behaviour where interrupt groups are not > > > guest-configurable. > >=20 > > I'm a bit surprised by this. > >=20 > > Either your guest knows that the group registers are not writable and > > already deals with the buggy behaviour by not configuring the groups > > (or configuring them in a way that matches what the implementation > > does). Or it configures them differently and totally fails to handle > > the interrupts as they are delivered using the wrong exception type, > > if at all. > >=20 > > I'd expect that your guests fall in the former category and not the > > latter, as we'd be discussing a very different problem. And my vague > > recollection of this issue is that we had established that as long as > > the reset values were unchanged, there was no harm in letting things > > rip. >=20 > What if the guest boots under a new host kernel and finds the group > registers are writable, and then is live migrated to an old host kernel > on which they are not? That's your problem. KVM/arm64 never supported downgrading. Not to mention that there is no valid GIC implementation that has RO group registers. All you are doing is to inflict a hypervisor bug on unsuspecting guests, for no good reason. > What about hibernation, if the *boot* kernel in the guest configures > the groups, but then transfers control back to the resumed guest kernel > which had not? A guest that doesn't configures the groups cannot expect anything to work. You'd have the exact same problem on bare-metal. >=20 > > So what is this *really* fixing? >=20 > I look at that question the other way round. >=20 > KVM has an established procedure for allowing userspace to control > guest-visible changes, using the IIDR. First the host kernel which > *supports* the change is rolled out, and only then does the VMM start > to enable it for new launches. >=20 > Even if we can address the questions above, and even if we can convince > ourselves that those are the *only* questions to ask... why not follow > the normal, safe, procedure?=C2=A0Especially given that there is already = an > IIDR value which corresponds to it. >=20 > We don't *have* to YOLO it... and I don't want to :) That's hardly an argument, is it? M. --=20 Without deviation from the norm, progress is not possible.