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 'vfio-v5.5-rc1' of git://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson:

- Remove hugepage checks for reserved pfns (Ben Luo)

- Fix irq-bypass unregister ordering (Jiang Yi)

* tag 'vfio-v5.5-rc1' of git://github.com/awilliam/linux-vfio:
vfio/pci: call irq_bypass_unregister_producer() before freeing irq
vfio/type1: remove hugepage checks in is_invalid_reserved_pfn()

+5 -23
+1 -1
drivers/vfio/pci/vfio_pci_intrs.c
··· 294 294 irq = pci_irq_vector(pdev, vector); 295 295 296 296 if (vdev->ctx[vector].trigger) { 297 - free_irq(irq, vdev->ctx[vector].trigger); 298 297 irq_bypass_unregister_producer(&vdev->ctx[vector].producer); 298 + free_irq(irq, vdev->ctx[vector].trigger); 299 299 kfree(vdev->ctx[vector].name); 300 300 eventfd_ctx_put(vdev->ctx[vector].trigger); 301 301 vdev->ctx[vector].trigger = NULL;
+4 -22
drivers/vfio/vfio_iommu_type1.c
··· 294 294 * Some mappings aren't backed by a struct page, for example an mmap'd 295 295 * MMIO range for our own or another device. These use a different 296 296 * pfn conversion and shouldn't be tracked as locked pages. 297 + * For compound pages, any driver that sets the reserved bit in head 298 + * page needs to set the reserved bit in all subpages to be safe. 297 299 */ 298 300 static bool is_invalid_reserved_pfn(unsigned long pfn) 299 301 { 300 - if (pfn_valid(pfn)) { 301 - bool reserved; 302 - struct page *tail = pfn_to_page(pfn); 303 - struct page *head = compound_head(tail); 304 - reserved = !!(PageReserved(head)); 305 - if (head != tail) { 306 - /* 307 - * "head" is not a dangling pointer 308 - * (compound_head takes care of that) 309 - * but the hugepage may have been split 310 - * from under us (and we may not hold a 311 - * reference count on the head page so it can 312 - * be reused before we run PageReferenced), so 313 - * we've to check PageTail before returning 314 - * what we just read. 315 - */ 316 - smp_rmb(); 317 - if (PageTail(tail)) 318 - return reserved; 319 - } 320 - return PageReserved(tail); 321 - } 302 + if (pfn_valid(pfn)) 303 + return PageReserved(pfn_to_page(pfn)); 322 304 323 305 return true; 324 306 }