From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796026146; b=TUfctv5y0CqR71lNkEnmGCYYTbl419yrNG7Wt1DU6cNf9avWR8yVrMunFcG8oZuL8F3L +UUF233RvyUmw7kWyHxaaLVsxTGBgaYqfs0g15brNFG1RkuCbA1U5nVyANI8VwsTQJL41 T7EDbnqiGhE/tgYvZQc6KsZdlqqcW6gMWoHPdpCAc05/X2++Tgn4c69lzxwLXHpO5/Ao8 BVJhFi4ZTgFyow1NsjZA05V+JwluO8g9w/fY2SpuNWWaMQkfkR3mt1qDn6N7FhxYNrHxp 1p+gHAyNE3/s+zdsG1Oct/ScfBOikgfRA0yMN8CRfaA3CNMHU5thvYKerN1OpcH58ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796026146; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=ziu69vOMrOewBtd1iJ9qvFAqitU7yxV6TX3fRw4IMs4=; b=ICpEQ8N/VEXBxP4IOROCjssL1o2w2hOfXG1IUNd8aVn4O69O3L90BxTQe9Jz2dAB5dST mLi/6OXil0oQfRxd5kK1IO0p/RLsM40Ffv/W98XcqAvG0Kyc47B0iuBJ6dLeuiht7T+ed /IW3hdFR9VyvOTEd+jPNgjjjwvWaZz0S5rz/w7ZwNlhMra6ELKDDbDicAbh3khDqx/umL S6739zBz9cZrNreacjCG4/t0L7hLmqNJwWR8V7bNFCNa/rqpM0KDzZAuOAc1hGy1FtaXS A3MP2lf5rwLSEfdWFabNT9ZVCvlErNRHm1t8qm4EWkcmDmN4W0Hdd1dihxBW8p4iU9Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=H1P5NrI2; arc=none smtp.remote-ip=91.218.175.174 Received: from mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94066606A32A for ; Mon, 30 Nov 2026 08:09:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 94066606A32A 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=H1P5NrI2 X-Envelope-To: linux-kernel@vger.kernel.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-kernel@vger.kernel.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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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