Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp87335rdb; Mon, 18 Dec 2023 09:35:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiP7RJwtbHk8fzxU0fiSP9DkNHGuH3E5rSJcgoTGrsydVu5Tz/qK4Hptf6r+JITB3wFnJJ X-Received: by 2002:a05:6a00:1896:b0:6ce:e5e:91b4 with SMTP id x22-20020a056a00189600b006ce0e5e91b4mr10486266pfh.29.1702920936965; Mon, 18 Dec 2023 09:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702920936; cv=none; d=google.com; s=arc-20160816; b=nNJdqybavPz0AKyng+CdIAN6TNMx1d9BtWhYprkH80laWC7Hb+guZoM7CSwJbEyUrY SIhGnO1m5W+Kgvn569OtfzVS13yvXwzbnYVryWKySeYJ2jPTDrImi3oH20rhb9gZUpqt TebLc/w2qwELQnyOVhMh5WskAS7j/ruunCZkScUw2ORGhDgO5XIDk/dU+grL/gqd3v9M Yv0X54diAHeTLi5cA7QZ4x9YCmql7UQi0mQS3SRZonO6SjyPxpOTKPUvYkgWZEDgk8ia YgSlSZRi+p2EJQBVG2Cn31gADcl1buyz19gTlwS55mJGptlbQoeNb2aXS7g646KOI1Nd WU2Q== 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=bEVkf321jDmtGm0NurOfm6mh878b4uuSIKAe2dHZN2A=; fh=U5NoW9J4ndek829pi3YwaIYffSVRe1fDzepDKnbmVSk=; b=vJytJa7I4DbCxSlvf5rKYx7Lx2RRy6/ODjclnR4eNytqwkwgXBd9/iQqwCwIPRuoZ8 odNsy+sqLEOX4iPFZ3uOtNboPw79q9GeBV0LRQPaXAPo3ay+7JpAsFl9zciMdn/76kTl 2OZywCeDgA5sDllolnuGxFszoqiiohhUMcWGVMD8lpZzh1BSo7JmHja/Vi5lfK9woKZZ 6Jaa/DAIElrmxHIQIr3i4+sxw1MPU0/iPgN5hzKGXubsQPeNapj2g4a5mWZhahp8CEga YDnuWQ/bsfqCvVZC/knx5QTEm9+1QqPSFwnpHDa81NpCfw/QBIj/XWE15tBNadvFM6m0 mbQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g5n4paOl; spf=pass (google.com: domain of linux-kernel+bounces-4171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b13-20020a630c0d000000b005c1e716256asi17877358pgl.218.2023.12.18.09.35.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:35:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g5n4paOl; spf=pass (google.com: domain of linux-kernel+bounces-4171-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4171-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A090BB244C9 for ; Mon, 18 Dec 2023 17:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E10A45D724; Mon, 18 Dec 2023 17:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g5n4paOl" 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 188C85BFAE; Mon, 18 Dec 2023 17:29:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1A76C433C8; Mon, 18 Dec 2023 17:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702920590; bh=C5WyAAOndAR8UwN5Lk4RjxcNZZKDcXr2Gv0zWrp9jvE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g5n4paOl/XTn4kF5V1GTVnAgJTrvITqdFgotD68Fm4l6anGCltOd0lBnx+XhjjYKa ITbM+JjZK5/lnZQCvImsmVekn+Y/qCWgMWMHRDDktmlPdsceqpz5xK7dE94BzkkDOI 0jSYwhj0oddXFyuYiA5nCYBh3XfDvJCmq1Br9WKnAOiqIfFQ/AZNDPUrnXak8j+LZ9 q/I1+I8PdsJQbDRuKVMyN4hktLLJd51eYsNEhBdHxPw/yDOR2lsrXX5qlro/bdO8cB wsEb1bypi83T/GFgocb5LF6KPRzNId11e5F0EU9A6RrI48cexAmFRsOUv6hipusqbz Lg9NqeFuLSIOQ== 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.95) (envelope-from ) id 1rFHR6-0058CE-LU; Mon, 18 Dec 2023 17:29:48 +0000 Date: Mon, 18 Dec 2023 17:29:48 +0000 Message-ID: <86r0jja06r.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> <878r5s8xvc.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/29.1 (aarch64-unknown-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 Mon, 18 Dec 2023 17:20:04 +0000, Oliver Upton wrote: > > On Sun, Dec 17, 2023 at 06:52:55PM +0000, Marc Zyngier wrote: > > 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? > > Isn't that the case where we have a physical IRQ mapped and wind up > forwarding state to the physical GIC? Indeed. But that's not specific to the timer. That's a general infrastructure that NV also uses it for the GIC maintenance interrupt. > > > 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. > > Fine by me. I had felt like a common helper w/ the user v. guest > exclusions is a bit easier to understand than diffing two very similar > functions, but it isn't a big deal. To be clear, I'm not objecting to that rework. It's just that we should carefully review these patches on the list, as they would have a wider ranging impact than a pure GICv4.1 change. > Anyway, I'm happy with your fix. I'd like Kunkun to give it a go but > either way I can pick it up for 6.7. Yup, same here. But we also shouldn't hold the 6.7 fixes for too long. If we don't get feedback from Kunkun shortly, I'd suggest to move this patch to 6.8, and at this point your approach makes complete sense. Thanks, M. -- Without deviation from the norm, progress is not possible.