From nobody Sat Jul 25 01:37:30 2026 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) (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 3FED8418A28 for ; Tue, 21 Jul 2026 06:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784615571; cv=none; b=R94XL8UrgsOU3WzZRf7gZnQ9WE0KJOgVRtY72PI7FrGKKyB2vg5Pl7L7Kon5VzHfXFU1xnarCH4aXPQkreWIB5uk8HPsMJejW0P5kBt3/cfEgBpxEyQosHQeCwLB3f7QKsQ0Kdv5us3oq/D8G1MXzcSwbPq4KVPrfvg9zJwMyx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784615571; c=relaxed/simple; bh=gzz/eSll9kuZpSpUk0kZzcjbC3x19vEPLkJ04I2yCCI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m2cQKHoRL+3mgiOa70WzjNWuPjoAmLwgnPrWBmnx+vmvaBG2u7IDXUG0GSTyncz1oIjebVhFFw5l1Y8uYav3LgfCvgTCIPUPrmhHMDd6AwHDTjjTUz0aZKnmEu7oSG239s7k5QoN6TSSx+zwCoPs2Up8n8a94JZTcJe7lu/1kdo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.198]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4h46xH1jKjzKHMRw for ; Tue, 21 Jul 2026 14:32:03 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id D95CD40561 for ; Tue, 21 Jul 2026 14:32:44 +0800 (CST) Received: from huaweicloud.com (unknown [10.166.163.161]) by APP1 (Coremail) with UTF8SMTPA id cCh0CgBXsm6KEl9qRSYCCA--.34790S3; Tue, 21 Jul 2026 14:32:44 +0800 (CST) From: Kemeng Shi To: maz@kernel.org, tglx@kernel.org, radu@rendec.net Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kemeng Shi Subject: [PATCH v6 1/2] irqchip/gic-v3-its: Fix leak in its_vpe_irq_domain_alloc() Date: Tue, 21 Jul 2026 14:32:40 +0800 Message-Id: <20260721063241.52549-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20260721063241.52549-1-shikemeng@huaweicloud.com> References: <20260721063241.52549-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: cCh0CgBXsm6KEl9qRSYCCA--.34790S3 X-Coremail-Antispam: 1UD129KBjvJXoW7uw48Gw1kAFWrWw1xCryrXrb_yoW8Gw17pF WrXr9Fkr4xAFy7Wrs8uw18ua43t397t3yj9ayxC3ZIvr1DAF9FkF1Iya4avrySyrW7J3Zx ZF1FgFWruF4UCa7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBG14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2 x26xkF7I0E14v26r1I6r4UM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1l84 ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY1x0262kKe7AKxVWUAVWUtw CF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j 6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64 vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0x vEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUhvttUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ Content-Type: text/plain; charset="utf-8" When its_irq_gic_domain_alloc() fails, the following its_vpe_irq_domain_free() skips calling its_vep_teardown() for the corresponding irq. Try its_vpe_teardown() in error handling to avoid the leak issue. Fixes: 7d75bbb4bc1ad ("irqchip/gic-v3-its: Add VPE irq domain allocation/te= ardown") Signed-off-by: Kemeng Shi Acked-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index 291d7668cc8d..28899792afd3 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4594,6 +4594,13 @@ static int its_vpe_init(struct its_vpe *vpe) =20 static void its_vpe_teardown(struct its_vpe *vpe) { + /* + * If vpt_page is NULL, then its_vpe_init() has failed, and + * there is nothing to do as no resource has been allocated. + */ + if (vpe->vpt_page =3D=3D NULL) + return; + its_vpe_db_proxy_unmap(vpe); its_vpe_id_free(vpe->vpe_id); its_free_pending_table(vpe->vpt_page); @@ -4674,8 +4681,10 @@ static int its_vpe_irq_domain_alloc(struct irq_domai= n *domain, unsigned int virq irqd_set_resend_when_in_progress(irq_get_irq_data(virq + i)); } =20 - if (err) + if (err) { + its_vpe_teardown(vm->vpes[i]); its_vpe_irq_domain_free(domain, virq, i); + } =20 return err; } --=20 2.36.1 From nobody Sat Jul 25 01:37:30 2026 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) (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 40034419FDA for ; Tue, 21 Jul 2026 06:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784615572; cv=none; b=oxeD1G00HXZJHu7X7aAPEs2MgMhVGyswVv7xXn6VlH+mK2bsSapE83zLPSIcBaBFrTrKiIoU5h73Dy8mcONcVck5lefWKARHTPUISFxmFKCtQQp6u7a6En0oJhoctTkdiY3BN7ZZbQrjYp9JiGvQii/WJaAtPUrWQzAKyi6wHR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784615572; c=relaxed/simple; bh=naH1SjkQdk4GGwmy7F+HV5fB7V/GsMGkGwPmq13hxXs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gQwEUshM+N+PXxlT6soiRMsEIoM9dkwgGwtM25JbtJmrryXwgyVA55op00M/HP/riZFrh3LHV2PDA0By7I/EFVPt53+/2NUug34jEnoAHAjENuKQcVl3QYvHofB/R0FGbnlXTG7ATA93AbG3QyJcmjxz/zEnW8T8glrO9+aZyn0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.170]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4h46xH4Bc8zKHMSl for ; Tue, 21 Jul 2026 14:32:03 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 3CB084056B for ; Tue, 21 Jul 2026 14:32:45 +0800 (CST) Received: from huaweicloud.com (unknown [10.166.163.161]) by APP1 (Coremail) with UTF8SMTPA id cCh0CgBXsm6KEl9qRSYCCA--.34790S4; Tue, 21 Jul 2026 14:32:45 +0800 (CST) From: Kemeng Shi To: maz@kernel.org, tglx@kernel.org, radu@rendec.net Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kemeng Shi Subject: [PATCH v6 2/2] irqchip/gic-v3-its: Fix grammar and replace a bit number with its symbol Date: Tue, 21 Jul 2026 14:32:41 +0800 Message-Id: <20260721063241.52549-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20260721063241.52549-1-shikemeng@huaweicloud.com> References: <20260721063241.52549-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding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6r4UMIIF0x vEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUolk3UUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ Content-Type: text/plain; charset="utf-8" Fix grammatical errors in comments and simplify the comment about reading GITS_BASER_INDIRECT to check two-level support. Signed-off-by: Kemeng Shi Reviewed-by: Radu Rendec Acked-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index 28899792afd3..1c6a5213e779 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -163,7 +163,7 @@ struct event_lpi_map { =20 /* * The ITS view of a device - belongs to an ITS, owns an interrupt - * translation table, and a list of interrupts. If it some of its + * translation table, and a list of interrupts. If some of its * LPIs are injected into a guest (GICv4), the event_map.vm field * indicates which one. */ @@ -2501,10 +2501,7 @@ static bool its_parse_indirect_baser(struct its_node= *its, =20 /* No need to enable Indirection if memory requirement < (psz*2)bytes */ if ((esz << ids) > (psz * 2)) { - /* - * Find out whether hw supports a single or two-level table by - * table by reading bit at offset '62' after writing '1' to it. - */ + /* Find out whether hw supports a single or two-level table */ its_write_baser(its, baser, val | GITS_BASER_INDIRECT); indirect =3D !!(baser->val & GITS_BASER_INDIRECT); =20 --=20 2.36.1