From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD047C9830E for ; Fri, 25 Sep 2026 08:50:32 +0000 (UTC) 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-Owner; bh=Waf0cqzYN/DoA4E1QtAC1/YJCneTE+7ad71bBdcmkQY=; b=Vub55deu5/N2qkCcZRrFYcrXSu LT/NZv1McSSrDXcyC1e/R3z31LCood/e3rdWJitWAuedN9e40L0nZ1aE7gr0WsD1S/h6jKQetoFqg FzbeynU9F2TxE4HA149ichk1lNqNT3ua57WjWzo2kWLjQOHGNMMX3kob+G7RBhkMOYdDxFvo6OLLD sX+mrx1cViecpYWMA/ZpnJm/U7+/ukY22lgoOpAK8Z1XT4iv2Rec4BAgVfUHXQRmPmplIx3Wg58lk v9c6+R8RgpBxBvXPQSvXVtgJkB73ZZUQuhMDTnZXixbRx15q9vA4cWfGrWjPJUxLdgfJrHQWk1VpO ki1K0qzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xA1dS-0000000CvpN-3bCv; Fri, 25 Sep 2026 08:50:26 +0000 Received: from out-230.mta1.migadu.com ([95.215.58.230] helo=mta1.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xA1dH-0000000Cvls-31dR for linux-arm-kernel@lists.infradead.org; Fri, 25 Sep 2026 08:50:17 +0000 X-Envelope-To: linux-arm-kernel@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=bbqKbCVQWUtgUYZiQExxW9IUx9sKykumuGPzmEQ+fcs=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790326213; v=1; x=1790931013; b=d5Ture6LeAhVfoA8mrzFeiZQK8Ft2qnKFbomgM7rbKM3ajLJsYu69kGmrhW8G/qyhwZ2lnnj PdigIzM7CLX99PAhqR5800dosaDOeF/fJvQZ4gBVCTNtuR8GG2ILc0HigOfNYSDOCRHvFAxWf8s sdCq3fvAwpUDnHoK1hxmUbZ8= X-Envelope-To: linux-arm-kernel@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id 2fbfd764a3836168; Fri, 25 Sep 2026 08:50:11 +0000 X-Mizu-Trace-ID: 2fbfd764a3836168 X-Migadu-Flow: FLOW_OUT From: Fuad Tabba To: Marc Zyngier , Thomas Gleixner Cc: Radu Rendec , James Morse , Will Deacon , Fuad Tabba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] irqchip/gic-v3-its: Don't free a vPE table shared with another ITS Date: Fri, 25 Sep 2026 09:49:58 +0100 Message-Id: <20260925085000.753400-2-fuad.tabba@linux.dev> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260925085000.753400-1-fuad.tabba@linux.dev> References: <20260925085000.753400-1-fuad.tabba@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260925_015015_902066_F6AA5C67 X-CRM114-Status: GOOD ( 14.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On GICv4.1, its_alloc_tables() copies a sibling's vPE table baser rather than allocating one, but its_free_tables() frees it like the rest. A probe failure on the copying ITS then frees pages the enabled sibling still points GITS_BASER2 at, and the kernel comes up running on that sibling. Mark a shared table so its_free_tables() skips it. Fixes: 5e5168461c22c ("irqchip/gic-v4.1: VPE table (aka GICR_VPROPBASER) allocation") Signed-off-by: Fuad Tabba --- drivers/irqchip/irq-gic-v3-its.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index e9807af235373..58e52095e6ea8 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -87,6 +87,8 @@ struct its_baser { u64 val; u32 order; u32 psz; + /* Inherited from a sibling ITS, not freed here */ + bool shared; }; struct its_device; @@ -2604,7 +2606,8 @@ static void its_free_tables(struct its_node *its) for (i = 0; i < GITS_BASER_NR_REGS; i++) { if (its->tables[i].base) { - its_free_pages(its->tables[i].base, its->tables[i].order); + if (!its->tables[i].shared) + its_free_pages(its->tables[i].base, its->tables[i].order); its->tables[i].base = NULL; } } @@ -2703,6 +2706,7 @@ static int its_alloc_tables(struct its_node *its) WARN_ON(i != 2); if ((sibling = find_sibling_its(its))) { *baser = sibling->tables[2]; + baser->shared = true; its_write_baser(its, baser, baser->val); continue; } -- 2.39.5