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

Merge tag 'for-linus-5.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen update from Juergen Gross:
"Only two small patches this time:

- a small cleanup for swiotlb-xen

- a fix for PCI initialization for some platforms"

* tag 'for-linus-5.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/pci: reserve MCFG areas earlier
swiotlb-xen: Convert to use macro

+17 -9
+15 -6
drivers/xen/pci.c
··· 17 17 #include "../pci/pci.h" 18 18 #ifdef CONFIG_PCI_MMCONFIG 19 19 #include <asm/pci_x86.h> 20 + 21 + static int xen_mcfg_late(void); 20 22 #endif 21 23 22 24 static bool __read_mostly pci_seg_supported = true; ··· 30 28 #ifdef CONFIG_PCI_IOV 31 29 struct pci_dev *physfn = pci_dev->physfn; 32 30 #endif 33 - 31 + #ifdef CONFIG_PCI_MMCONFIG 32 + static bool pci_mcfg_reserved = false; 33 + /* 34 + * Reserve MCFG areas in Xen on first invocation due to this being 35 + * potentially called from inside of acpi_init immediately after 36 + * MCFG table has been finally parsed. 37 + */ 38 + if (!pci_mcfg_reserved) { 39 + xen_mcfg_late(); 40 + pci_mcfg_reserved = true; 41 + } 42 + #endif 34 43 if (pci_seg_supported) { 35 44 struct { 36 45 struct physdev_pci_device_add add; ··· 214 201 arch_initcall(register_xen_pci_notifier); 215 202 216 203 #ifdef CONFIG_PCI_MMCONFIG 217 - static int __init xen_mcfg_late(void) 204 + static int xen_mcfg_late(void) 218 205 { 219 206 struct pci_mmcfg_region *cfg; 220 207 int rc; ··· 253 240 } 254 241 return 0; 255 242 } 256 - /* 257 - * Needs to be done after acpi_init which are subsys_initcall. 258 - */ 259 - subsys_initcall_sync(xen_mcfg_late); 260 243 #endif
+2 -3
drivers/xen/swiotlb-xen.c
··· 39 39 #include <asm/xen/page-coherent.h> 40 40 41 41 #include <trace/events/swiotlb.h> 42 + #define MAX_DMA_BITS 32 42 43 /* 43 44 * Used to do a quick range check in swiotlb_tbl_unmap_single and 44 45 * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this ··· 116 115 return 0; 117 116 } 118 117 119 - static int max_dma_bits = 32; 120 - 121 118 static int 122 119 xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs) 123 120 { ··· 135 136 p + (i << IO_TLB_SHIFT), 136 137 get_order(slabs << IO_TLB_SHIFT), 137 138 dma_bits, &dma_handle); 138 - } while (rc && dma_bits++ < max_dma_bits); 139 + } while (rc && dma_bits++ < MAX_DMA_BITS); 139 140 if (rc) 140 141 return rc; 141 142