Files
Jan Beulich 2b66f2cc75 Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()
Both decrease-reservation and populate-physmap can succeed partially. For
the former this may be pretty unlikely, but clearly the latter can hit
both out-of-memory conditions in the hypervisor or denial because of the
allocation exceeding the domain's allowance (there's no interaction with
the balloon driver here either).

In gnttab_dma_free_pages() we simply can't give back to the system what
hasn't been re-filled with backing memory. For gnttab_dma_alloc_pages()
both parts of the overall region need dealing with differently.

While no present caller of gnttab_dma_free_pages() checks its return
value, also don't use -EFAULT there: It really is an out-of-memory
condition. (In gnttab_dma_alloc_pages() -EFAULT doesn't look quite right
either, but I couldn't think of a clearly better error code there.)

Fixes: 9bdc7304f5 ("xen/grant-table: Allow allocating buffers suitable for DMA")
Signed-off-by: Jan Beulich <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Message-ID: <[email protected]>
2026-11-13 12:10:17 +01:00
..
2026-08-06 13:18:31 +02:00
2025-11-16 01:35:02 -05:00
…
…
2026-08-06 13:18:32 +02:00
2026-08-06 13:18:32 +02:00
2026-10-09 09:58:46 +02:00
…