On Mon, Nov 16, 2026 at 03:32:25PM +0000, Steven Price wrote:

[...]

> >> 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) ?
> 
> Because it needs to be accessible to the GIC "hardware". In this case
> the GIC is emulated by the hypervisor and the hypervisor for a realm can
> only see the unprotected memory.
> 
> Now I agree this is a little academic in practise because Linux (as a
> hypervisor) will not expose RVPEID - so allocate_vpe_l1_table() will
> early out. IIUC this would only actually be relevant in the case of
> nested virtualisation within a realm guest - which is a long way off if
> it ever happens.

That's what I was actually getting at.

> > Why did b08e2f42e86b5 patched allocate_vpe_l1_table() allocation and moved
> > it to using its_alloc_pages() ?
> 
> In that commit I simply changed all the allocation paths which were
> allocating memory to be visible to the GIC to use the new allocator. As
> we "know" that the GIC can only access "decrypted" memory. Admittedly
> that could easily change in the future - but my expectation is that it
> will only change with the switch to GICv5.

Yes. I just wanted to understand whether, for VPE tables, this is,
currently, a requirement.

> Of course what I missed was that this specific allocation uses
> GFP_ATOMIC and that set_memory_decrypted() can sleep. This wouldn't have
> shown up on any testing because of the early exit:
> 
>         if (!gic_rdists->has_rvpeid)
>                 return 0;

Understood, see above.

Thanks,
Lorenzo

Reply via email to