Skip to content

Commit 9074c79

Browse files
jbeulichjgross1
authored andcommitted
swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests
While the hypervisor hasn't been enforcing this, we would still better avoid issuing requests with GFNs not aligned to the requested order. Instead of altering the value also in the call to panic(), drop it there for being static and hence easy to determine without being part of the panic message. Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Stefano Stabellini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent f28347c commit 9074c79

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/xen/swiotlb-xen.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,11 @@ void __init xen_swiotlb_init_early(void)
230230
/*
231231
* Get IO TLB memory from any location.
232232
*/
233-
start = memblock_alloc(PAGE_ALIGN(bytes), PAGE_SIZE);
233+
start = memblock_alloc(PAGE_ALIGN(bytes),
234+
IO_TLB_SEGSIZE << IO_TLB_SHIFT);
234235
if (!start)
235-
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
236-
__func__, PAGE_ALIGN(bytes), PAGE_SIZE);
236+
panic("%s: Failed to allocate %lu bytes\n",
237+
__func__, PAGE_ALIGN(bytes));
237238

238239
/*
239240
* And replace that memory with pages under 4GB.

0 commit comments

Comments
 (0)