From: sashiko-bot@kernel.org
To: "Steven Price" <steven.price@arm.com>
Cc: media-ci@linuxtv.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] irqchip/gic-v3-its: Zero shared pages after conversion
Date: Thu, 20 Aug 2026 11:08:41 +0000 [thread overview]
Message-ID: <20260820110842.2724D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260820105026.53208-2-steven.price@arm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] its_alloc_pages_node() can sleep while allocating memory in an atomic context when running on Arm64 Realm systems, causing a "scheduling while atomic" BUG.
--
--- Patch [1]: [PATCH 1/2] irqchip/gic-v3-its: Zero shared pages after conversion ---
commit 36d3014f90a1ff0fea959d794f1e5680dcbc80f5
Author: Steven Price <steven.price@arm.com>
irqchip/gic-v3-its: Zero shared pages after conversion
its_alloc_pages_node() passes __GFP_ZERO to the page allocator before
calling set_memory_decrypted(), but for Arm CCA with MEC the key used to
access the page will change. This masks out __GFP_ZERO from the allocation
request and zeros the page after decryption instead.
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index b57d81ad33a0a..1a69eef9209e7 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -213,10 +213,12 @@ static gfp_t gfp_flags_quirk;
> static struct page *its_alloc_pages_node(int node, gfp_t gfp,
> unsigned int order)
> {
> + bool want_zero = gfp & __GFP_ZERO;
> struct page *page;
> int ret = 0;
>
> - page = alloc_pages_node(node, gfp | gfp_flags_quirk, order);
> + page = alloc_pages_node(node, (gfp & ~__GFP_ZERO) | gfp_flags_quirk,
> + order);
>
> if (!page)
> return NULL;
[Severity: High]
This is a pre-existing issue, but does the set_memory_decrypted() call that
follows this allocation sleep in an atomic context?
During CPU hotplug, gic_starting_cpu() executes with interrupts disabled
and calls its_cpu_init_lpis() -> allocate_vpe_l1_table(). This function
requests an atomic memory allocation:
drivers/irqchip/irq-gic-v3-its.c:allocate_vpe_l1_table() {
...
page = its_alloc_pages(GFP_ATOMIC | __GFP_ZERO, get_order(np * PAGE_SIZE));
...
}
This wraps its_alloc_pages_node(), which then calls set_memory_decrypted()
unconditionally.
On Arm64 Realm guests supporting BBML2, set_memory_decrypted() eventually
calls split_kernel_leaf_mapping(), which takes a mutex:
arch/arm64/mm/mmu.c:split_kernel_leaf_mapping() {
...
mutex_lock(&pgtable_split_lock);
...
}
Could this acquire a mutex from an atomic context and trigger a kernel panic?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260820105026.53208-1-steven.price@arm.com?part=1
next prev parent reply other threads:[~2026-08-20 11:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 10:50 [PATCH 0/2] Clear shared pages after private-to-shared conversion Steven Price
2026-08-20 10:50 ` [PATCH 1/2] irqchip/gic-v3-its: Zero shared pages after conversion Steven Price
2026-08-20 11:08 ` sashiko-bot [this message]
2026-08-20 12:32 ` Marc Zyngier
2026-08-20 12:55 ` Steven Price
2026-08-20 13:27 ` Jason Gunthorpe
2026-08-20 10:50 ` [PATCH 2/2] dma-buf: heaps: Zero system shared heap " Steven Price
2026-08-20 11:02 ` sashiko-bot
2026-08-20 12:20 ` [PATCH 0/2] Clear shared pages after private-to-shared conversion Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260820110842.2724D1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=steven.price@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.