From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CB1F47F43; Sun, 17 Dec 2023 18:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zkwv67ry" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5B7CC433C8; Sun, 17 Dec 2023 18:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702839178; bh=h3U7iqYMSSXE3PLLsIKv7FMGZUFaSTPMFTW4G0Ip/kA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Zkwv67ry4jM9CrEDBCo8NgGmOjYoDUnAqgtuY0r9ceizWfkrO2uDiCA5ZoGQ2es2k JaZA5uIBcV3EI1gWgo/hI4iWAvVXO2ILW49yDGTmDjOLP6EG0e3G6gj6jSNMT0fHoS 1c0ZM6LQ5oFNpLeVzIOB+S/SeHeqUU7UntUOKl+/qBFq+85Nx07N0cH2ZsE5fMw4TT IZB1OPvjHXrHlDilVw/XOIdfmWEqlUZBwMrF+AZcBQADBhMfEroMybeZ0bW2senamY GMA8gq/WZusrHSgFECPH/nOqBqHV/90HIhvoasUg76Lxqqs+lSEngDNGZRfLt/o56e nSdgTHUz5GCFg== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rEwFz-004rnx-TY; Sun, 17 Dec 2023 18:52:56 +0000 Date: Sun, 17 Dec 2023 18:52:55 +0000 Message-ID: <878r5s8xvc.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: Kunkun Jiang , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Jean-Philippe Brucker , "moderated list:ARM SMMU DRIVERS" , kvmarm@lists.linux.dev, open list , "wanghaibin.wang@huawei.com" Subject: Re: [bug report] GICv4.1: vSGI remains pending across the guest reset In-Reply-To: References: <7e7f2c0c-448b-10a9-8929-4b8f4f6e2a32@huawei.com> <87a5q983zc.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/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: oliver.upton@linux.dev, jiangkunkun@huawei.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, jean-philippe@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, wanghaibin.wang@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Sun, 17 Dec 2023 17:34:38 +0000, Oliver Upton wrote: > > On Sun, Dec 17, 2023 at 05:33:16PM +0000, Oliver Upton wrote: > > On Sun, Dec 17, 2023 at 11:26:15AM +0000, Marc Zyngier wrote: > > > > [...] > > > > > But this has *nothing* to do with the guest. This is the *host* > > > userspace performing a write to the redistributor view, which has > > > different semantics. Which is why your earlier description made no > > > sense to me. > > > > > > I think the problem is slightly larger than what you describe. A write > > > to ISPENDR0 should be propagated to the ITS for any values of the > > > latch, just like this happens on enabling HW-backed SGIs. > > > > > > Can you please give this a go? > > > > What do you think about using this as an opportunity for a bit of > > cleanup? It'd be nice unify the various MMIO and uaccess handlers for > > SPENDING + CPENDING while being careful about the arch_timer interrupt. What is special about the timer interrupt? > Cut myself off... Meant to say that user writes to SPENDING for GICv3 > can then be treated as: > > > clear = ~val; > > vgic_uaccess_write_spending(val); > > vgic_uaccess_write_cpending(clear); Could be. But I'd rather have separate fixes from more invasive reworks. Specially given that we have had multiple ugly bugs around this code in the past, which is why we ended up splitting userspace from guest accessors. M. -- Without deviation from the norm, progress is not possible.