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 8C9D3C433EF for ; Wed, 16 Mar 2022 15:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=hnuHlMmNuHIrMYaUtKzXJky5YEP82+geqraDWcsxYAE=; b=fUAo3bVdycuDkc LAX3gcABif5NAAhu9DZsdgbR90NoyRc4YKA5Jsgwi0h24c0z5y2B74g50bsUTo/r7FI65jc2BKWvU lC7ksRls2yDBl6s34AqMycltaMbgDbepS/p1vA5vg1BHNpoINNAL6pl5NYaUYUDeHPzATqqrSccwF TABwaG0CuqUnRKBQhGKhr70evEbCmfMbXKozrDIHQtlsXHUWBXX05ipXJZepwi53ALOfOO8Xj4L9b rXdtzIfoRzAvw62K8fN2HMWgTIhddQ2KYRgSr90ujoh2XxA9igf2h0YSQaZYUq5q17D9fu835N5Jk VWY8mayLipqv+MKALpaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUV9A-00DONG-WE; Wed, 16 Mar 2022 15:01:09 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUV97-00DOMo-QU for linux-arm-kernel@lists.infradead.org; Wed, 16 Mar 2022 15:01:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 69A6FB81BF9; Wed, 16 Mar 2022 15:01:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31308C340E9; Wed, 16 Mar 2022 15:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647442863; bh=Dy0POSLfJZum5AoWzG4sgm9ElC3fanRy+FgV015B1YA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nU2bjpfIzatogL6tjUB9CATcwxHgDBPE+S2SVfJwirxSIG+U0zRzfnFs/ox9yGkl6 KZ/LkUfgaHcOxmk6W77+qEk0Na+Ln0zpxL9aC6F8P7eGtqrcRuEatZY3FDAa7QGGvt cHC1ALT/QJcCz9CGjKmyBUItLHKC0mS4TEvypk9UO+xFcy4U/hGWVu2UIKb9OoxUsm DJc+0g7Ptv7PZ4aXsr+k9wROafXCuAxOHmGyXJyYEuxRfgCsLtBmzLKyAVgRO/zUqI GlCS/Q87zb8CpZtLyHEdctzBpQ3USo/68d51eBziszvmup/62pzfeE+DMpin4MvyNO IT8yEFZCky4wQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nUV92-00Ewsa-L4; Wed, 16 Mar 2022 15:01:00 +0000 Date: Wed, 16 Mar 2022 15:01:00 +0000 Message-ID: <875yoeymab.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kernel-team@android.com, Andre Przywara Subject: Re: [PATCH 4/4] KVM: arm64: vgic-v3: Advertise GICR_CTLR.{IR, CES} as a new GICD_IIDR revision In-Reply-To: References: <20220314164044.772709-1-maz@kernel.org> <20220314164044.772709-5-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/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kernel-team@android.com, andre.przywara@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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220316_080106_052058_BFDCB2FC X-CRM114-Status: GOOD ( 19.97 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Oliver, On Tue, 15 Mar 2022 23:13:09 +0000, Oliver Upton wrote: > > Hi Marc, > > On Mon, Mar 14, 2022 at 04:40:44PM +0000, Marc Zyngier wrote: > > @@ -87,8 +91,16 @@ static int vgic_mmio_uaccess_write_v2_misc(struct kvm_vcpu *vcpu, > > * migration from old kernels to new kernels with legacy > > * userspace. > > */ > > - vcpu->kvm->arch.vgic.v2_groups_user_writable = true; > > - return 0; > > + reg = FIELD_GET(GICD_IIDR_REVISION_MASK, reg); > > + switch (reg) { > > + case KVM_VGIC_IMP_REV_2: > > + case KVM_VGIC_IMP_REV_3: > > + dist->v2_groups_user_writable = true; > > Could you eliminate this bool and just pivot off of the implementation > version? [coming back to this] Now I remember why this doesn't work. The established behaviour is that it takes a write to IIDR to switch to the 'writable groups' mode. If we base the switch on the implementation version, we don't need a write anymore (we always allow groups to be writable), and old guests cannot be reliably restored. 32f8777ed92d has the gory details, and that's really not old enough that we can turn a blind eye to it, unfortunately. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel