Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292967; b=1piPDmMdu/8Bs4HmFQopEqedK9O6nbWV1clcvwi2j4ZEFm80ujC3JYOYd/OczJ2+yUrA pjTWJZpu3i63h6iGxcEXVnE4GN06U9QMKnJFlQQU5PA3u6yYSefEbelagEP0HMjG8Idm3 8YIAPJ4+GPYwIVDlhOgHONpTCX2KjpVCEtIwveO2oaNivBlvzwk/hAoc33adwEyA6+OCb R3pNs2C36Z+ee8YsXBqVPxF/UBWw4hQ+n7XSKf6i/ddteavvIMAwXFXvhJCQ0faTgzTvs 3fNTZiWxR8ouqYj2WUQVhHCj4qqsXf84j2Zbmh2PqQ2LYV1pDfDUMvUKHOIfgXgPP4g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292967; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=jv6czP0Aj1q3f968acMSQG2oya7xCN/Zgu4f4CgkDHo=; b=PvxYioF+i0jyThNXn+OpAuX5dbMwMiImyRqG+b9pF+35QJRD3jO3vm4rxY/Z5GKSYJOo Q4PLIwOODByk7zDc8EJOgJeWs/lAXuNxolot04Z8OVdZtY+4kF0MPUYXxex6lLnzmNgtR 1rSGnsICdK4QDB1y8FZP0G3vT2BeLlAGsGW1QVcrHedJISByI/nQi1Jc2Ch8ZhSWBJcJM ytfrY2TXv0cyYnOombNDRscF0uZw8rxCgVpqx7jzzf896jfdk+n52bcOvUTlYhPaCiPK1 xb2bkVsKZB3wrGU/WR1ItrmxWPrcxc145epU6mfyG9n5hjxMjdwqnN6pzEHDEAiahSw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cmDTQzNR; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F371606A33D for ; Thu, 3 Dec 2026 10:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cmDTQzNR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66BCA1F00899; Thu, 3 Dec 2026 10:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796292966; bh=jv6czP0Aj1q3f968acMSQG2oya7xCN/Zgu4f4CgkDHo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cmDTQzNROjReoxYWuuK8WCMlS93QvTkKksJaiexlDr7IHnLft8fiwroPMFcV+32R5 jexUbGWk3apUi6mAlQ4OwSZJLvHmji4n3OpaeSIaKY72VIiY0jZRahfRw884hyZc0x rKaEB6cd01T4PkbvCfvEz2oiiHM/2Ci1hXWhVExNcwECUvBi5hAbOQjsKOn4r99N0N +87ThCjFFOwYHik1+1k+TgFlIpSuYkZ1GmdqVHQDbbxzjkhh+G8CC5bCqPNNm68Rnc 3xIqoyx9V8NgJCpDDvXKZMFo51Vl1tXV6+ZWFiyAI3R9QlP82j1276eUKLT6yyLkN8 3JVpjD2z2C2tg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 14/23] irqchip/gic-v3-its: Allocate shared tables using CoCo shared memory allocator Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?QW5lZXNoIEt1bWFyIEsuViAoQXJtKQ==?= Cc: "Andrew Morton" , "Catalin Marinas" , =?utf-8?b?Q2hyaXN0aWFuIEvDtm5pZw==?= , "Jason Gunthorpe" , "Joerg Roedel" , "Marc Zyngier" , "Marek Szyprowski" , "Robin Murphy" , "Steven Price" , "Sumit Semwal" , "Suzuki K Poulose" , "Will Deacon" , "T.J. Mercier" , "Madhavan Srinivasan" , "Heiko Carstens" , "Christian Borntraeger" , "Sven Schnelle" , "Dave Hansen" , "Kiryl Shutsemau" , "Rick Edgecombe" , "Paolo Bonzini" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Haiyang Zhang" , "Wei Liu" , "Dexuan Cui" , "Andy Lutomirski" , "Peter Zijlstra" , "Alexander Gordeev" , "Gerald Schaefer" , "Vasily Gorbik" , x86@kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, kvmarm@lists.linux.dev, "Oliver Upton" , media-ci@linuxtv.org In-Reply-To: <20261202095446.2029567-15-aneesh.kumar@kernel.org> References: <20261202095446.2029567-1-aneesh.kumar@kernel.org> <20261202095446.2029567-15-aneesh.kumar@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 10:16:05 +0000 X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] irqchip/gic-v3-its: sleepable alloc_cc_shared_node() called in atomic context -- commit 7bc078950f204b97107cefaed10cb60658f98e21 Author: Aneesh Kumar K.V (Arm) irqchip/gic-v3-its: Allocate shared tables using CoCo shared memory allocat= or This commit converts GICv3 ITS table and command queue allocations from alloc_pages_node() and set_memory_decrypted() to alloc_cc_shared_node() and free_cc_shared(). > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v= 3-its.c > index ada5c30af41ea..cc64384109def 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c [ ... ] > @@ -213,47 +212,18 @@ static DEFINE_IDA(its_vpeid_ida); > =20 > static gfp_t gfp_flags_quirk; > =20 > -static struct page *its_alloc_pages_node(int node, gfp_t gfp, > - unsigned int order) > +static void *its_alloc_node(int node, gfp_t gfp, unsigned int order) > { > - struct page *page; > - int ret =3D 0; > - > if (node =3D=3D NUMA_NO_NODE) > node =3D numa_mem_id(); > =20 > - page =3D alloc_pages_node(node, gfp | gfp_flags_quirk, order); > - > - if (!page) > - return NULL; > - > - ret =3D set_memory_decrypted((unsigned long)page_address(page), > - 1 << order); > - /* > - * If set_memory_decrypted() fails then we don't know what state the > - * page is in, so we can't free it. Instead we leak it. > - * set_memory_decrypted() will already have WARNed. > - */ > - if (ret) > - return NULL; > - > - return page; > -} > - > -static struct page *its_alloc_pages(gfp_t gfp, unsigned int order) > -{ > - return its_alloc_pages_node(NUMA_NO_NODE, gfp, order); > + return alloc_cc_shared_node(node, gfp | gfp_flags_quirk, > + PAGE_SIZE << order); > } > =20 > -static void its_free_pages(void *addr, unsigned int order) > +static void *its_alloc(gfp_t gfp, unsigned int order) > { > - /* > - * If the memory cannot be encrypted again then we must leak the pages. > - * set_memory_encrypted() will already have WARNed. > - */ > - if (set_memory_encrypted((unsigned long)addr, 1 << order)) > - return; > - free_pages((unsigned long)addr, order); > + return its_alloc_node(NUMA_NO_NODE, gfp, order); > } [ ... ] > @@ -3000,12 +2970,12 @@ static int allocate_vpe_l1_table(void) > =20 > pr_debug("np =3D %d, npg =3D %lld, psz =3D %d, epp =3D %d, esz =3D %d\n= ", > np, npg, psz, epp, esz); > - page =3D its_alloc_pages(GFP_ATOMIC | __GFP_ZERO, get_order(np * PAGE_S= IZE)); > - if (!page) > + table_base =3D its_alloc(GFP_ATOMIC | __GFP_ZERO, get_order(np * PAGE_S= IZE)); > + if (!table_base) > return -ENOMEM; [Severity: High] Does routing its_alloc(GFP_ATOMIC | __GFP_ZERO, ...) through alloc_cc_shared_node() call might_sleep() in atomic context? allocate_vpe_l1_table() is called from the CPUHP_AP_IRQ_GIC_STARTING hotplug callback (gic_starting_cpu() -> its_cpu_init() -> its_cpu_init_lpis()) with interrupts and preemption disabled, as noted in d1bd7e0ba533 ("irqchip/gic-v4.1: Use GFP_ATOMIC flag in allocate_vpe_l1_table()"). Unlike set_memory_decrypted(), which returned early without calling might_sleep() when memory encryption was inactive, alloc_cc_shared_node() unconditionally calls might_sleep() at entry before checking gfp flags or CC_ATTR_MEM_ENCRYPT. On GICv4.1 systems with multiple CommonLPIAff groups where a secondary CPU allocates a new VPE L1 table, this triggers a sleep-in-atomic-context splat even on non-CoCo systems (and sleeps in atomic context if CC_ATTR_MEM_ENCRYPT is active). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202095446.2029= 567-1-aneesh.kumar@kernel.org?part=3D14