On Mon, Nov 16, 2026 at 11:51:04AM +0530, Aneesh Kumar K.V wrote:
> Marc Zyngier <[email protected]> writes:
> 
> > On Fri, 06 Nov 2026 15:45:29 +0000,
> > Aneesh Kumar K.V <[email protected]> wrote:
> >> 
> >> Marc Zyngier <[email protected]> writes:
> >> 
> >> > On Wed, 04 Nov 2026 16:45:55 +0000,
> >> > "Aneesh Kumar K.V (Arm)" <[email protected]> wrote:
> >> >> 
> >> >> VPE L1 tables are allocated from the CPU-starting callback, where 
> >> >> sleeping is
> >> >> not allowed.  Remove the page allocation from this atomic path.
> >> >> 
> >> >> Use a blocking allocation for the boot CPU and record the resulting 
> >> >> table
> >> >> order.  Allocate a page of that order from the sleepable CPU hotplug 
> >> >> prepare
> >> >> stage for each secondary CPU.  Consume the preallocated page only when 
> >> >> the CPU
> >> >> cannot inherit an existing redistributor or ITS table.
> >> >> 
> >> >> Reclaim unused preallocations after the CPU reaches the online state, 
> >> >> and from
> >> >> the prepare-state teardown when CPU bring-up aborts.
> >> >
> >> > No. The way to do it is to move the ITS probing out of the
> >> > non-sleepable CPU hotplug path.
> >> >
> >> > I proposed a potential hack at [1] (which I find far more palatable
> >> > than this proposal), but the real fix is to probe the ITSs as
> >> > devices.
> >> >
> >> 
> >> Could you share a bit more detail on what you have in mind?
> >> 
> >> Are you suggesting that we create a platform device for each ITS and
> >> initialize it through the driver's probe callback, while the rest of the
> >> GIC initialization stays in the existing early boot path?
> >> 
> >> Would that mean the main GIC is operational during early boot, while
> >> ITS-dependent features, such as MSI delivery and direct injection, become
> >> available after the ITS devices probe?
> >> 
> >> Is that the split you have in mind?
> >
> > Yes. Then once this is done, all the tables become normal DMA
> > allocations, for which there should already be adequate support.
> >
> 
> Thanks for confirming. Can we handle the ITS platform-device conversion
> and the switch to DMA allocations in a separate series?
> 
> The existing VPE L1 allocation path calls set_memory_decrypted() from
> the non-sleepable CPU-starting callback, even though
> set_memory_decrypted() can sleep. This issue predates the shared-granule
> allocator changes.

If I may ask, why does the existing code ends up calling set_memory_decrypt(),
or reworded, why does the VPE L1 allocation path goes through the ITS specific
allocation function rather than using alloc_pages() (as it was before
b08e2f42e86b5) ?

Why did b08e2f42e86b5 patched allocate_vpe_l1_table() allocation and moved
it to using its_alloc_pages() ?

Thanks,
Lorenzo

> 
> Since fixing this properly needs a broader ITS rework, can we handle
> that separately and drop the preallocation patch from this series?
> 
> -aneesh

Reply via email to