Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3250064pxb; Tue, 12 Jan 2021 09:51:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFvyPQL4K6rjUKj6FKX5Gff1r24sc90HfbeJV+rfwwmylWHjiJh5NGK9SRBalps5QRkoOe X-Received: by 2002:a17:906:dd3:: with SMTP id p19mr3913305eji.221.1610473893136; Tue, 12 Jan 2021 09:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610473893; cv=none; d=google.com; s=arc-20160816; b=AbWJjxZSBefml96a0st5TXEqStFZNVHV5sBYlTHrlFuMHE14Yr2SJuo2vZwfeGilQy 4VrNXkNU+FydQdKzVTJH87yUHxY3CFZgiBgL4+KcOhIV0aALLuRufPPHzJpkfBPzHxtG KInMD8dBdQsrBQFcisuswyu6/Nd6fzpdqb1+o6LCkED5eA22HIEUf43A2LhPQ/Y3Tn3+ OtqFsK4PTsGSCMnvSZdxuLFxWxrcOuckL9rpDLEzX7zHRCKERuND/lA4H8zA59Z8Oyza Cuj0IdyTPW2p8k0hSj+8WCOsXNwd0axp5m+lTZe6atikJ5F0bpR9eC46h/3CiKLv10Oq btvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=QchLDRbppCmb3WoLHyVNz6RXjLE5EwajpyPLiWUEtnw=; b=hozPx5gYY5b/eumdtezyylNvfPzZMfJTb1NG/Do8R+pVj9F23bdF8nGL6LvnhBTqK/ GVZPRSdk3skigSRwc5wh3F4+DTBLaXZC2L/kQTD/x69epMDWgJrXf5c7v5RtaeslLivh 76BawLYOwXzq5i5gqZHnKVsjJowB9qqLVnW7WkB7WJNvEe4BUMkVBhNXf+QAuujCG9Af S2WEN5zvhkrQTAzwiVbHdWzecMq7cxxrlR7bYaskrupvtYn7m3SrWJfYwTnSrRkCNpp3 Qee+TP2szPvJLSYxpIaBlicUNb7AkoDXgrW36ngyyfatzh5X7YVW5h8/JcsQgYM98dz3 iN2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si1345720ejf.416.2021.01.12.09.51.09; Tue, 12 Jan 2021 09:51:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404882AbhALRtU (ORCPT + 99 others); Tue, 12 Jan 2021 12:49:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:50310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731303AbhALRtR (ORCPT ); Tue, 12 Jan 2021 12:49:17 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93C2D23107; Tue, 12 Jan 2021 17:48:36 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kzNmU-0072aN-89; Tue, 12 Jan 2021 17:48:34 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 12 Jan 2021 17:48:34 +0000 From: Marc Zyngier To: Alexandru Elisei Cc: Eric Auger , eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, drjones@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, shuah@kernel.org, pbonzini@redhat.com Subject: Re: [PATCH 8/9] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace In-Reply-To: References: <20201212185010.26579-1-eric.auger@redhat.com> <20201212185010.26579-9-eric.auger@redhat.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <1a06be3153927f1051fcbc87f0e52e98@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: alexandru.elisei@arm.com, eric.auger@redhat.com, eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, drjones@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, shuah@kernel.org, pbonzini@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-12 17:28, Alexandru Elisei wrote: > Hi Eric, > > On 12/12/20 6:50 PM, Eric Auger wrote: >> Commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the >> reporting of GICR_TYPER.Last for userspace") temporarily fixed >> a bug identified when attempting to access the GICR_TYPER >> register before the redistributor region setting but dropped >> the support of the LAST bit. This patch restores its >> support (if the redistributor region was set) while keeping the >> code safe. > > If I understand your patch correctly, it is possible for the > GICR_TYPER.Last bit > to be transiently 1 if the register is accessed before all the > redistributors > regions have been configured. > > Arm IHI 0069F states that accesses to the GICR_TYPER register are RO. I > haven't > found exactly what RO means (please point me to the definition if you > find it in > the architecture!), but I assume it means read-only and I'm not sure > how correct > (from an architectural point of view) it is for two subsequent reads of > this > register to return different values. Maybe Marc can shed some light on > this. RO = Read-Only indeed. Not sure that's documented anywhere in the architecture, but this is enough of a well known acronym that even the ARM ARM doesn't feel the need to invent a new definition for it. As for your concern, I don't think it is a problem to return different values if the HW has changed in between. This may need to be documented though. Thanks, M. -- Jazz is not dead. It just smells funny...