diff options
| author | Jan Beulich <jbeulich@suse.com> | 2026-11-10 10:56:05 +0100 |
|---|---|---|
| committer | Juergen Gross <jgross@suse.com> | 2026-11-13 12:10:17 +0100 |
| commit | 2b66f2cc753243a6adb3e9a5c038b0fc59ba7ec9 (patch) | |
| tree | 5b60a39e0438804096028554c5cc975eb0e37889 /scripts/Makefile.thinlto | |
| parent | 4ebb3b8d129cbb419a55924f6a75f8f58435e37b (diff) | |
| download | lwn-2b66f2cc753243a6adb3e9a5c038b0fc59ba7ec9.tar.gz lwn-2b66f2cc753243a6adb3e9a5c038b0fc59ba7ec9.zip | |
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: 9bdc7304f536 ("xen/grant-table: Allow allocating buffers suitable for DMA")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110095605.369848-3-jgross@suse.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
