Commit 4c092c59 authored by Jan Beulich's avatar Jan Beulich Committed by Juergen Gross

swiotlb-xen: fix late init retry

The commit referenced below removed the assignment of "bytes" from
xen_swiotlb_init() without - like done for xen_swiotlb_init_early() -
adding an assignment on the retry path, thus leading to excessively
sized allocations upon retries.

Fixes: 2d29960a ("swiotlb: dynamically allocate io_tlb_default_mem")
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>

Link: https://lore.kernel.org/r/778299d6-9cfd-1c13-026e-25ee5d14ecb3@suse.comSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
parent ce6a80d1
......@@ -211,8 +211,8 @@ int __ref xen_swiotlb_init(void)
if (repeat--) {
/* Min is 2MB */
nslabs = max(1024UL, (nslabs >> 1));
pr_info("Lowering to %luMB\n",
(nslabs << IO_TLB_SHIFT) >> 20);
bytes = nslabs << IO_TLB_SHIFT;
pr_info("Lowering to %luMB\n", bytes >> 20);
goto retry;
}
pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment