summaryrefslogtreecommitdiffstats
path: root/drivers/xen/swiotlb-xen.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-09-17 12:45:49 +0200
committerJuergen Gross <jgross@suse.com>2021-09-20 17:01:07 +0200
commit9074c79b62b6e0d91d7f716c6e4e9968eaf9e043 (patch)
tree931808fa66b39770c46f8facdb9e0195c0a682cf /drivers/xen/swiotlb-xen.c
parentf28347cc66395e96712f5c2db0a302ee75bafce6 (diff)
downloadlinux-9074c79b62b6e0d91d7f716c6e4e9968eaf9e043.tar.gz
linux-9074c79b62b6e0d91d7f716c6e4e9968eaf9e043.tar.bz2
linux-9074c79b62b6e0d91d7f716c6e4e9968eaf9e043.zip
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 <jbeulich@suse.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Link: https://lore.kernel.org/r/7b3998e3-1233-4e5a-89ec-d740e77eb166@suse.com Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen/swiotlb-xen.c')
-rw-r--r--drivers/xen/swiotlb-xen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 9c9ba500ef23..c0c38672fee3 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -230,10 +230,11 @@ retry:
/*
* Get IO TLB memory from any location.
*/
- start = memblock_alloc(PAGE_ALIGN(bytes), PAGE_SIZE);
+ start = memblock_alloc(PAGE_ALIGN(bytes),
+ IO_TLB_SEGSIZE << IO_TLB_SHIFT);
if (!start)
- panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
- __func__, PAGE_ALIGN(bytes), PAGE_SIZE);
+ panic("%s: Failed to allocate %lu bytes\n",
+ __func__, PAGE_ALIGN(bytes));
/*
* And replace that memory with pages under 4GB.