Skip to content
Permalink
Browse files
swiotlb: Remove external access to io_tlb_start
Add a new function, get_swiotlb_start(), and remove external access to
io_tlb_start, so we can entirely hide struct swiotlb inside of swiotlb.c
in the following patches.

Signed-off-by: Claire Chang <tientzu@chromium.org>
  • Loading branch information
Claire Chang authored and intel-lab-lkp committed Feb 9, 2021
1 parent 6155670 commit 6efc25e988b76cfd9934a78fbd2f096b89182fac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
@@ -55,8 +55,8 @@ void __init svm_swiotlb_init(void)
if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, false))
return;

if (io_tlb_start)
memblock_free_early(io_tlb_start,
if (vstart)
memblock_free_early(vstart,
PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
panic("SVM: Cannot allocate SWIOTLB buffer");
}
@@ -192,8 +192,8 @@ int __ref xen_swiotlb_init(int verbose, bool early)
/*
* IO TLB memory already allocated. Just use it.
*/
if (io_tlb_start != 0) {
xen_io_tlb_start = phys_to_virt(io_tlb_start);
if (is_swiotlb_active()) {
xen_io_tlb_start = phys_to_virt(get_swiotlb_start());
goto end;
}

@@ -81,6 +81,7 @@ void __init swiotlb_exit(void);
unsigned int swiotlb_max_segment(void);
size_t swiotlb_max_mapping_size(struct device *dev);
bool is_swiotlb_active(void);
phys_addr_t get_swiotlb_start(void);
void __init swiotlb_adjust_size(unsigned long new_size);
#else
#define swiotlb_force SWIOTLB_NO_FORCE
@@ -719,6 +719,11 @@ bool is_swiotlb_active(void)
return io_tlb_end != 0;
}

phys_addr_t get_swiotlb_start(void)
{
return io_tlb_start;
}

#ifdef CONFIG_DEBUG_FS

static int __init swiotlb_create_debugfs(void)

0 comments on commit 6efc25e

Please sign in to comment.