Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp79750rdb; Mon, 18 Dec 2023 09:22:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYlmoPUu3LojDGm4d6+Wq9Us7cU3ehphn/dat5P2nzgP7GMZ4ek6mlP6BxQgYbMT504YCP X-Received: by 2002:a50:c308:0:b0:553:3e64:c5fc with SMTP id a8-20020a50c308000000b005533e64c5fcmr1277963edb.7.1702920158339; Mon, 18 Dec 2023 09:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702920158; cv=none; d=google.com; s=arc-20160816; b=xLxIzS4qfvpB970PfkXw/6HqA9i8nk2VCsY3WtUsfMr+Ym/DEFOwPKpl4IUTL1zd3b y0zXAR5njLnVIlFc7/L9M5msoUglifK+J+JJT08yHwAbG+7moijKWlfD7tC9rFzD4/eL +IvbsaYlD/yiLjT8hbVtsG1TkDLGoaQ3VobESUwfLBUEL1QtbtBNuY4Jb++zDjGgq5L2 jfMu7rBC/t1qDUYGd8dXk5K2q0Em5zh6QsNdQj+JNzx7byao8ugMzkK47owbmL4e6Xb8 R4B+qIjY8nLcI7bEcPC1m1jeXZGMRK+3R+cvkgxYTFj2WhfQbQjWHUMvnuQ4jHGamgfU 4s1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=gZ5piTv0+pYp16eP2qMvs+lTjxUIdakKgcBRhgaO2U4=; fh=PPS7r75Er+86of0ZGKnin0zZdsUZtJPCOT+z8FcvOo4=; b=WRnpf8A0VUqTYJS5v4qxBylJs/kJADoNDnT5u5E2I9qCeWsyuYEY8nUmwJuk2TlIcI 48sZcc/gvGAlbhtx4kXsijsQnbH3uo0WTiemZo0wfOp884fMeio0OD1FRGW9jGwFT89c k3X3vPf9VBsqKMwO9PzbL2fZ3YFpbpSiNDwhLmd6/RS/QQmTnjf8oMzHteeDQTqpCxVg zkSRdjj540+Bg/BTrhUKIfDAWT2bFRi3JSUN0fiIV1sWrAyWCJMwF6UAPsEE2JHQft4I Eg1qmLxbFzlUV3H9Rt+mGW6UdAKkUz2WI+LpvkYfjyY4vxwoNa+1ou3Gf9EoBNie4JPX 6bkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=sacaxvEL; spf=pass (google.com: domain of linux-kernel+bounces-4151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g31-20020a056402321f00b00552fd4f41b3si2434004eda.44.2023.12.18.09.22.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:22:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=sacaxvEL; spf=pass (google.com: domain of linux-kernel+bounces-4151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D60751F231E2 for ; Mon, 18 Dec 2023 17:21:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFB977205E; Mon, 18 Dec 2023 17:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="sacaxvEL" X-Original-To: linux-kernel@vger.kernel.org Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 30D625A860 for ; Mon, 18 Dec 2023 17:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 18 Dec 2023 17:20:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702920009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gZ5piTv0+pYp16eP2qMvs+lTjxUIdakKgcBRhgaO2U4=; b=sacaxvELU65hlgNAtaUo0nZziNlrsTWqPWJQ6Nwc19vywZeLqjxoHYCmwWoYR3SHYtb+SG y6I3nMK/Q3uTtMEWthVNMVFbcb8xrTNjA9C3js0S5fzyxahj2GD6o7T7dJ4JFRD0xr0I3H q8CsUIXdXuxr9BdAM8LifTywD3fyK94= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier 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 Message-ID: References: <7e7f2c0c-448b-10a9-8929-4b8f4f6e2a32@huawei.com> <87a5q983zc.wl-maz@kernel.org> <878r5s8xvc.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878r5s8xvc.wl-maz@kernel.org> X-Migadu-Flow: FLOW_OUT 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? > 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. 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. -- Thanks, Oliver