Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

- two patches for error path fixes

- a small series for fixing a regression with swiotlb with Xen on Arm

* tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/swiotlb: check if the swiotlb has already been initialized
arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h
xen/unpopulated-alloc: fix error return code in fill_list()
xen/gntdev: fix gntdev_mmap() error exit path

+34 -17
+7 -13
arch/arm/xen/mm.c
··· 135 135 return; 136 136 } 137 137 138 - int xen_swiotlb_detect(void) 139 - { 140 - if (!xen_domain()) 141 - return 0; 142 - if (xen_feature(XENFEAT_direct_mapped)) 143 - return 1; 144 - /* legacy case */ 145 - if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain()) 146 - return 1; 147 - return 0; 148 - } 149 - 150 138 static int __init xen_mm_init(void) 151 139 { 152 140 struct gnttab_cache_flush cflush; 141 + int rc; 142 + 153 143 if (!xen_swiotlb_detect()) 154 144 return 0; 155 - xen_swiotlb_init(); 145 + 146 + rc = xen_swiotlb_init(); 147 + /* we can work with the default swiotlb */ 148 + if (rc < 0 && rc != -EEXIST) 149 + return rc; 156 150 157 151 cflush.op = 0; 158 152 cflush.a.dev_bus_addr = 0;
+2 -1
arch/arm64/mm/init.c
··· 43 43 #include <linux/sizes.h> 44 44 #include <asm/tlb.h> 45 45 #include <asm/alternative.h> 46 + #include <asm/xen/swiotlb-xen.h> 46 47 47 48 /* 48 49 * We need to be able to catch inadvertent references to memstart_addr ··· 483 482 if (swiotlb_force == SWIOTLB_FORCE || 484 483 max_pfn > PFN_DOWN(arm64_dma_phys_limit)) 485 484 swiotlb_init(1); 486 - else 485 + else if (!xen_swiotlb_detect()) 487 486 swiotlb_force = SWIOTLB_NO_FORCE; 488 487 489 488 set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);
+3 -1
drivers/xen/gntdev.c
··· 1017 1017 err = mmu_interval_notifier_insert_locked( 1018 1018 &map->notifier, vma->vm_mm, vma->vm_start, 1019 1019 vma->vm_end - vma->vm_start, &gntdev_mmu_ops); 1020 - if (err) 1020 + if (err) { 1021 + map->vma = NULL; 1021 1022 goto out_unlock_put; 1023 + } 1022 1024 } 1023 1025 mutex_unlock(&priv->lock); 1024 1026
+5
drivers/xen/swiotlb-xen.c
··· 164 164 int rc = -ENOMEM; 165 165 char *start; 166 166 167 + if (io_tlb_default_mem != NULL) { 168 + pr_warn("swiotlb buffer already initialized\n"); 169 + return -EEXIST; 170 + } 171 + 167 172 retry: 168 173 m_ret = XEN_SWIOTLB_ENOMEM; 169 174 order = get_order(bytes);
+3 -1
drivers/xen/unpopulated-alloc.c
··· 39 39 } 40 40 41 41 pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL); 42 - if (!pgmap) 42 + if (!pgmap) { 43 + ret = -ENOMEM; 43 44 goto err_pgmap; 45 + } 44 46 45 47 pgmap->type = MEMORY_DEVICE_GENERIC; 46 48 pgmap->range = (struct range) {
+14 -1
include/xen/arm/swiotlb-xen.h
··· 2 2 #ifndef _ASM_ARM_SWIOTLB_XEN_H 3 3 #define _ASM_ARM_SWIOTLB_XEN_H 4 4 5 - extern int xen_swiotlb_detect(void); 5 + #include <xen/features.h> 6 + #include <xen/xen.h> 7 + 8 + static inline int xen_swiotlb_detect(void) 9 + { 10 + if (!xen_domain()) 11 + return 0; 12 + if (xen_feature(XENFEAT_direct_mapped)) 13 + return 1; 14 + /* legacy case */ 15 + if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain()) 16 + return 1; 17 + return 0; 18 + } 6 19 7 20 #endif /* _ASM_ARM_SWIOTLB_XEN_H */