Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp268087rdb; Sun, 17 Dec 2023 10:53:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUergRFbrfpg8JE3STKkx412MlJEaznkzJ76AQgz1l4F1ba6LtJQ/25N+xKGuLUSSPOolq X-Received: by 2002:a05:6a20:7fa0:b0:187:d4e3:c13a with SMTP id d32-20020a056a207fa000b00187d4e3c13amr19672482pzj.22.1702839186440; Sun, 17 Dec 2023 10:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702839186; cv=none; d=google.com; s=arc-20160816; b=rhvKe2Xm6gKuEqp99pBe59yHZm/o2KBntSf314RPGIEAQkF3GSRglziBZaJTjKNpu3 JjNf/ArVW2VZwHywbCwhz8dX4xLLiKSLGshFVCsQ+dT0QRiIhZCvyH8PLHy7tt88KmP0 osSV75f54XxKw7sxkaIeZuYpQef8TUc/0zDfl+Lr4CBoz5Q77U1coZJKeHQI4DyFvMhk lMzW2U2z7BJqNKN5RUNRSdo9KuRPuXOgZ0mXxRy1Kx/lRYQu6N9kqhmhwEcXjr/YYQPD qGqZ7pxbnoCK1s2Yklv31ybH3qG/VShyId0VJRc9IZxr48Hn3UdWGdqvdkcv4QMXJjo3 5S7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=MKgY385nW8tQylmclgFSNM8IfudCUEM6AJluRkhd+MM=; fh=U5NoW9J4ndek829pi3YwaIYffSVRe1fDzepDKnbmVSk=; b=HJYKHKRWYy7YtkPKNiyZB0EUl+Zy6CV3s04lpkdmqAXm2k/gG32sFuo+RyiyvSbogd Ola5GALYkDqdvheyyPfbTjmylWCuMIo0llg9WXc5JUKqrBLQ0oQNoDQkjOjhTjc2cFKJ 7HcVbtxMv2/ANliySXEj+IRMGmFLOkec5sue+zP/5C4DLzRzUR9ASL42pjN6jHqPdCTM LeTyDXmcxrG26e8W+iP6IvFpnsxPOwmZimi48FYufL8yET8FC5qTW6jJ3ZddMLhObtLR bH+cdLAbFa1eNjMVKKd4GlSXbPdo4ABviHqfPqyIuGLImFPceeexBeDBnKzXf4usU8uZ UrQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zkwv67ry; spf=pass (google.com: domain of linux-kernel+bounces-2777-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h15-20020a17090aa88f00b0028a2fd5ba9csi16306512pjq.107.2023.12.17.10.53.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 10:53:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2777-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zkwv67ry; spf=pass (google.com: domain of linux-kernel+bounces-2777-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E9B1B2830BE for ; Sun, 17 Dec 2023 18:53:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F189947F77; Sun, 17 Dec 2023 18:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zkwv67ry" X-Original-To: linux-kernel@vger.kernel.org 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) 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.