linux/drivers
Alex Williamson f9e54c3a2f vfio/pci: implement huge_fault support
With the addition of pfnmap support in vmf_insert_pfn_{pmd,pud}() we can
take advantage of PMD and PUD faults to PCI BAR mmaps and create more
efficient mappings.  PCI BARs are always a power of two and will typically
get at least PMD alignment without userspace even trying.  Userspace
alignment for PUD mappings is also not too difficult.

Consolidate faults through a single handler with a new wrapper for
standard single page faults.  The pre-faulting behavior of commit
d71a989cf5 ("vfio/pci: Insert full vma on mmap'd MMIO fault") is removed
in this refactoring since huge_fault will cover the bulk of the faults and
results in more efficient page table usage.  We also want to avoid that
pre-faulted single page mappings preempt huge page mappings.

Link: https://lkml.kernel.org/r/20240826204353.2228736-20-peterx@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Gavin Shan <gshan@redhat.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-09-17 01:07:00 -07:00
..
accel
accessibility
acpi mm: introduce numa_memblks 2024-09-03 21:15:30 -07:00
amba
android
ata
atm
auxdisplay
base arch_numa: switch over to numa_memblks 2024-09-03 21:15:32 -07:00
bcma
block zram: support priority parameter in recompression 2024-09-09 16:39:12 -07:00
bluetooth
bus
cache
cdrom
cdx
char tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support 2024-08-27 21:11:44 +03:00
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl mm: make range-to-target_node lookup facility a part of numa_memblks 2024-09-03 21:15:32 -07:00
dax mm: make range-to-target_node lookup facility a part of numa_memblks 2024-09-03 21:15:32 -07:00
dca
devfreq
dio
dma dmaengine: dw-edma: Do not enable watermark interrupts for HDMA 2024-08-28 18:40:17 +05:30
dma-buf
dpll
edac
eisa
extcon
firewire
firmware mm: rework accept memory helpers 2024-09-01 20:26:07 -07:00
fpga
fsi
gnss
gpio
gpu mm: kvmalloc: align kvrealloc() with krealloc() 2024-09-01 20:25:44 -07:00
greybus
hid
hsi
hte
hv
hwmon hwmon: (pt5161l) Fix invalid temperature reading 2024-08-26 20:58:05 -07:00
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input Input updates for v6.11-rc5 2024-08-31 15:32:38 +12:00
interconnect
iommu IOMMU Fixes for Linux v6.11-rc5 2024-08-31 06:11:34 +12:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net Regressions: 2024-08-28 16:54:45 -07:00
nfc nfc: pn533: Add poll mod list filling check 2024-08-29 12:08:44 +02:00
ntb
nubus
nvdimm
nvme
nvmem
of of, numa: return -EINVAL when no numa-node-id is found 2024-09-03 21:15:32 -07:00
opp
parisc
parport
pci pci-v6.11-fixes-2 2024-08-31 14:54:11 +12:00
pcmcia
peci
perf
phy
pinctrl
platform platform-drivers-x86 for v6.11-5 2024-08-29 07:12:02 +12:00
pmdomain
pnp
power power sequencing fixes for v6.11-rc6 2024-09-01 09:07:44 +12:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi SCSI fixes on 20240831 2024-09-01 07:00:38 +12:00
sh
siox
slimbus
soc Qualcomm driver fixes for v6.11 2024-08-28 20:27:39 +00:00
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb USB fixes for 6.11-rc6 2024-09-01 07:06:28 +12:00
vdpa vduse: avoid using __GFP_NOFAIL 2024-09-09 16:39:02 -07:00
vfio vfio/pci: implement huge_fault support 2024-09-17 01:07:00 -07:00
vhost
video video/aperture: optionally match the device in sysfb_disable() 2024-08-26 19:14:48 -04:00
virt acrn: use the new follow_pfnmap API 2024-09-17 01:06:59 -07:00
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile