By default the io_tlb_nslabs is set to zero, and gets set towhatever value is passed in via swiotlb_init_with_tbl function.The default value passed in is 64MB. However, if the user providesthe 'swiotlb=<nslabs>' the default value is ignored andthe value provided by the user is used... Except when the SWIOTLBis used under Xen - there the default value of 64MB is used andthe Xen-SWIOTLB has no mechanism to get the 'io_tlb_nslabs' filledout by setup_io_tlb_npages functions. This patch exports thevalue that is potentially set by setup_io_tlb_npages and renamesit to swiotlb_nslabs.

/*+ * The amount of slabs set by swiotlb=<pages> argument.+ * It is multiple of 128Kb chunks.+ */+extern unsigned long swiotlb_nslabs;+/* * Maximum allowable number of contiguous slabs to map, * must be a power of 2. What is the appropriate value ? * The complexity of {map,unmap}_single is linearly dependent on this value.diff --git a/lib/swiotlb.c b/lib/swiotlb.cindex 93ca08b..0822fec 100644--- a/lib/swiotlb.c+++ b/lib/swiotlb.c@@ -63,7 +63,7 @@ static char *io_tlb_start, *io_tlb_end; * The number of IO TLB blocks (in groups of 64) between io_tlb_start and * io_tlb_end. This is command line adjustable via setup_io_tlb_npages. */-static unsigned long io_tlb_nslabs;+unsigned long swiotlb_nslabs;