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 A74F5135405 for ; Wed, 3 Apr 2024 10:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138999; cv=none; b=AjQ9ny5Xyv+DxDHLGgA7aNOw/LQB2lrhdJRLqffKXMCbjBvMGuuDwcR1EEu2Pu4GODKitTOY0LOIPiLlyeKcGdLCQuDxAgMVUsotIWeiJVSW8jXgLFvIsBC3HnybRqbaSaPnrpdS9TXoT3ku3tSd05wIijgKNdxsb7hQHOENR50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138999; c=relaxed/simple; bh=hxisYTtqHS0PgSLllLBFMBX8OHBg9yUGMbWMb7P2n4Q=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Le3dY5n0dDyVl+k4y2FJ68lD4O1nmlfMnMg8fbEneslXBI/CvBGA/m4ln5eTx2QAJ/fK1sOpEBlpzxw+jx/u94+o2PbL/hwLnOr5dbNwNd+P/HtxP8uGdUvmgtlGT0uTUdzb8NdVAaW/NJoqilv7GqAneUmqPAianGK1hlxRXRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=avnjnlHH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="avnjnlHH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A70FC433F1; Wed, 3 Apr 2024 10:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712138999; bh=hxisYTtqHS0PgSLllLBFMBX8OHBg9yUGMbWMb7P2n4Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=avnjnlHHCpktGusaWZ+BxlVSqNE4lgl1pOwyrB5ahxSzLBgF7EfbY/sZFXjRdZWAx mvy3FVtCcVie+vKHkQ+zx3bddWhICRdSJc+MiTEVu3wa05/pbaMcE0+4kWk8CN0t9z c9a5SRlNEgEsyrNn22q53BGfqAKN0ohKjxyVyanU1O5+auca1Jjn1/g+u1mKKW7Cpw QTTAgtKI407kDOi1Y6+hd06oYnNRwBOkta3viy6DobXsBvcnKcCjC6e6JVycSMjMwg 7hU5WQPijaobrcDEBjxLVpdB2+q7e7m4jd4uMBOZYPmDCTLZXI3C4Tja371id/oeAH 2R+tB9CMpJzcg== 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 1rrxZ7-0012Sl-96; Wed, 03 Apr 2024 11:09:57 +0100 Date: Wed, 03 Apr 2024 11:09:56 +0100 Message-ID: <86cyr6u58r.wl-maz@kernel.org> From: Marc Zyngier To: t00849498 Cc: , , , , Subject: Re: [RESPIN PATCH] irqchip/gic-v3-its:Fix GICv4.1 needless VSYNC after unmap VPE In-Reply-To: <20240403083556.3862236-1-tangnianyao@huawei.com> References: <20240403083556.3862236-1-tangnianyao@huawei.com> 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.2 (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: tangnianyao@huawei.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, guoyang2@huawei.com, wangwudi@hisilicon.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Thanks for respinning this. A few remarks: The subject line could be improved. Something like: "irqchip/gic-v4: Don't issue a VSYNC after VMAPP with V=0" On Wed, 03 Apr 2024 09:35:56 +0100, t00849498 wrote: > > From: Nianyao Tang > > Quote from GIC spec 5.3.19, a VMAPP with {V, Alloc}=={0, x} > is self-synchronizing, This means the ITS command queue does not > show the command as consumed until all of its effects are completed. Since this is a direct quote, make it clear that it is so. > > We don't need VSYNC to guarantee unmap finish. And VSYNC after unmap VPE > will reach an invalid vpe table entry, which may trigger exception > like SError or RAS. Let's fix it. This should be much stronger. It's not that we don't need VSYNC. It is that VSYNC is actively wrong. I suggest that you rewrite the commit message along these lines: As per the GICv4.1 spec (Arm IHI 0069H, 5.3.19): "A VMAPP with {V, Alloc}=={0, x} is self-synchronizing. This means the ITS command queue does not show the command as consumed until all of its effects are completed." Furthermore, VSYNC is allowed to deliver an SError when referencing a non existent VPE. By these definitions, a VMAPP followed by a VSYNC is a bug, as the later references a VPE that has been unmapped by the former. Fix it by eliding the VSYNC in this scenario. > > Signed-off-by: Nianyao Tang Please also add: Fixes: 64edfaa9a234 ("irqchip/gic-v4.1: Implement the v4.1 flavour of VMAPP") With the above fixed: Reviewed-by: Marc Zyngier Thanks, M. -- Without deviation from the norm, progress is not possible.