|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] xen/swiotlb: don't initialize swiotlb twice on arm64
From: Stefano Stabellini <stefanos@xxxxxxxxxx>
On arm64 swiotlb is already initialized by mem_init. We don't want to
initialize it twice, the memory is already allocated. Detect this
condition in swiotlb-xen and skip the second initialization.
Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>
---
There are other issues which I found recently affecting the swiotlb on
arm64 -- I'll send the other patches separately.
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 877baf2..8fcda2bf4 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -206,6 +206,7 @@ int __ref xen_swiotlb_init(int verbose, bool early)
int rc = -ENOMEM;
enum xen_swiotlb_err m_ret = XEN_SWIOTLB_UNKNOWN;
unsigned int repeat = 3;
+ bool pre_initialized = false;
xen_io_tlb_nslabs = swiotlb_nr_tbl();
retry:
@@ -214,7 +215,10 @@ int __ref xen_swiotlb_init(int verbose, bool early)
/*
* Get IO TLB memory from any location.
*/
- if (early) {
+ if (io_tlb_start != 0) {
+ xen_io_tlb_start = phys_to_virt(io_tlb_start);
+ pre_initialized = true;
+ } else if (early) {
xen_io_tlb_start = memblock_alloc(PAGE_ALIGN(bytes),
PAGE_SIZE);
if (!xen_io_tlb_start)
@@ -264,7 +268,7 @@ int __ref xen_swiotlb_init(int verbose, bool early)
verbose))
panic("Cannot allocate SWIOTLB buffer");
rc = 0;
- } else
+ } else if (!pre_initialized)
rc = swiotlb_late_init_with_tbl(xen_io_tlb_start,
xen_io_tlb_nslabs);
if (!rc)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |