From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A618606A31C for ; Mon, 30 Nov 2026 08:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=oJgysGLC; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=H1P5NrI2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=ziu69vOMrOewBtd1iJ9qvFAqitU7yxV6TX3fRw4IMs4=; b=oJgysGLCI8T3qJ Gx0zCn+GjORpQw9AKaUR2bL7yrdDvj37b7m4W1paqcFFCeqZ2EkwJnUP5ca96QzV7VHPQ0OvG1R/a dwChNCkAkeqClXM5v8Ehge925DENpp45znjooh3Foo2egh34rxBkvmn4+66vFP444lMZGiPUX3OVE ca0nejuzm/rht5X5HxHWFyQEMBcecblxrJo9OlZZdqjBqKjwBUISSR42Te/pWfbcAEpTuUektg1Ke U0foqTCzlaZXq6ju9QRcKXlEbdqOw75vJln3FjsDv1xW0gMfJurSMMbwHlaOmXXfMW10ouePWrytM O0YoA+CNsWCGkkBTzCyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwRn-00000003hMW-0ddU; Mon, 30 Nov 2026 08:09:15 +0000 Received: from out-238.mta0.migadu.com ([2001:41d0:1004:224b::ee] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXwRd-00000003hIU-26hV for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 08:09:06 +0000 X-Envelope-To: linux-arm-kernel@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=SvvTpaYgs1e5snrFL7BXQtj6PicwTAKhHSrG26Jn5SY=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796026143; v=1; x=1796630943; b=H1P5NrI2EyP24xcb83xGcO+f9xQ//GyTJaPIJo1GygMY1Uq/b94mk4xBh206IRCgbQFhS68U zZLhtXwwUUljrJUQACyuXFgSw1UumHrtk/cBCJF+qFctnFJt+69AjWAA2WAaj2/4EhUxbl8VaMM 5bGQcNbgBS0Ktm4PPAlyye+o= X-Envelope-To: linux-arm-kernel@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id 089072a5fa7ee700; Mon, 30 Nov 2026 08:09:03 +0000 X-Mizu-Trace-ID: 089072a5fa7ee700 X-Migadu-Flow: FLOW_OUT From: Fuad Tabba To: Marc Zyngier , Thomas Gleixner Cc: Radu Rendec , Zenghui Yu , Lorenzo Pieralisi , Steven Price , Suzuki K Poulose , "Aneesh Kumar K . V" , Will Deacon , Fuad Tabba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/5] irqchip/gic-v3-its: Order table zeroing before the GIC can see it Date: Mon, 30 Nov 2026 08:08:52 +0000 Message-ID: <20261130080856.636755-2-fuad.tabba@linux.dev> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130080856.636755-1-fuad.tabba@linux.dev> References: <20261130080856.636755-1-fuad.tabba@linux.dev> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_000905_680522_16A8EEA6 X-CRM114-Status: GOOD ( 12.05 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The ITS driver allocates the ITS tables and the vPE tables as zeroed pages. It exposes each table with a single store: a relaxed GICR_VPROPBASER write with Valid set, the relaxed GITS_CTLR write that enables the ITS, or a valid level-1 entry for a level-2 page. However, on a shareable table the zeroing isn't ordered before that store, so the GIC can read the page's previous contents as table entries, which the spec makes UNPREDICTABLE (IHI 0069H.b 5.2.1, and GICR_VPROPBASER.Z in 12.11.39). A level-2 page is exposed at runtime, when the GIC may already be walking the level-1 table for other IDs. Add a dsb(ishst) at the end of its_alloc_pages_node(), as its_flush_cmd() does for a command. The allocator doesn't take a shareability argument, so the barrier is unconditional. On a non-shareable table it doesn't hurt. Reviewed-by: Zenghui Yu Reviewed-by: Marc Zyngier Signed-off-by: Fuad Tabba --- drivers/irqchip/irq-gic-v3-its.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index c952c069f9373..9900c6a53526e 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -233,6 +233,9 @@ static struct page *its_alloc_pages_node(int node, gfp_t gfp, if (ret) return NULL; + /* Order the zeroing before any store that exposes the page to the GIC */ + dsb(ishst); + return page; } -- 2.47.3