linux/drivers
David Hildenbrand 94c8945376 virtio-mem: check against mhp_get_pluggable_range() which memory we can hotplug
Right now, we only check against MAX_PHYSMEM_BITS - but turns out there
are more restrictions of which memory we can actually hotplug, especially
om arm64 or s390x once we support them: we might receive something like
-E2BIG or -ERANGE from add_memory_driver_managed(), stopping device
operation.

So, check right when initializing the device which memory we can add,
warning the user.  Try only adding actually pluggable ranges: in the worst
case, no memory provided by our device is pluggable.

In the usual case, we expect all device memory to be pluggable, and in
corner cases only some memory at the end of the device-managed memory
region to not be pluggable.

Link: https://lkml.kernel.org/r/1612149902-7867-5-git-send-email-anshuman.khandual@arm.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
Cc: teawater <teawaterz@linux.alibaba.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-02-26 09:41:01 -08:00
..
accessibility Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
acpi pci-v5.12-changes 2021-02-25 09:56:08 -08:00
amba
android
ata
atm atm: idt77252: fix build broken on amd64 2021-02-15 12:36:27 -08:00
auxdisplay
base drivers/base/memory: don't store phys_device in memory blocks 2021-02-26 09:41:00 -08:00
bcma
block xen: branch for v5.12-rc1 2021-02-21 13:06:08 -08:00
bluetooth TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
bus Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
cdrom
char Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
clk Driver core / debugfs update for 5.12-rc1 2021-02-24 10:13:55 -08:00
clocksource A small set of clockevent fixes which fell through the cracks 2021-02-22 14:11:36 -08:00
connector
counter
cpufreq Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-02-21 17:23:56 -08:00
cxl cxl/mem: Fix potential memory leak 2021-02-22 14:44:39 -08:00
dax Merge branch 'for-5.12/dax' into for-5.12/libnvdimm 2021-02-23 18:13:45 -08:00
dca
devfreq Merge branches 'pm-devfreq' and 'pm-tools' 2021-02-15 17:02:04 +01:00
dio
dma dmaengine updates for v5.12-rc1 2021-02-23 15:05:10 -08:00
dma-buf dma-buf: Avoid comma separated statements 2021-02-09 17:14:11 +01:00
edac Merge branch 'edac-misc' into edac-updates-for-v5.12 2021-02-15 10:06:58 +01:00
eisa
extcon
firewire firewire: replace tricky statement by two simple ones 2021-02-09 12:16:20 +01:00
firmware Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
fpga
fsi
gnss
gpio Driver core / debugfs update for 5.12-rc1 2021-02-24 10:13:55 -08:00
gpu Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2021-02-23 14:52:22 -08:00
hsi
hv mm/memory_hotplug: MEMHP_MERGE_RESOURCE -> MHP_MERGE_RESOURCE 2021-02-26 09:41:00 -08:00
hwmon Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
hwspinlock hwspinlock: omap: Add support for K3 AM64x SoCs 2021-02-09 11:36:50 -06:00
hwtracing ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
i2c ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
i3c I3C for 5.12 2021-02-22 09:52:55 -08:00
ide
idle
iio - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
infiniband Linux 5.11 2021-02-18 11:19:29 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-02-23 14:56:23 -08:00
interconnect
iommu dma-mapping updates for 5.12: 2021-02-24 09:54:24 -08:00
ipack ipack: Handle a driver without remove callback 2021-02-09 09:48:23 +01:00
irqchip irqchip updates for Linux 5.12: 2021-02-15 15:41:56 +01:00
isdn
leds TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
lightnvm lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() 2021-02-14 21:27:24 -07:00
macintosh
mailbox mailbox: arm_mhuv2: Skip calling kfree() with invalid pointer 2021-02-22 13:34:27 -06:00
mcb
md - Fix DM integrity's HMAC support to provide enhanced security of 2021-02-22 10:22:54 -08:00
media Fixes around VM_FPNMAP and follow_pfn 2021-02-22 17:45:02 -08:00
memory Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
memstick
message
mfd Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00
misc pci-v5.12-changes 2021-02-25 09:56:08 -08:00
mmc ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
most
mtd This pull request contains changes (actually just fixes) for UBIFS 2021-02-21 13:57:08 -08:00
mux
net Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
nfc Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
ntb NTB: Add support for EPF PCI Non-Transparent Bridge 2021-02-23 14:12:53 -06:00
nubus
nvdimm libnvdimm + device-dax for 5.12 2021-02-24 09:35:54 -08:00
nvme for-5.12/drivers-2021-02-17 2021-02-21 11:06:54 -08:00
nvmem
of Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
opp opp: Don't skip freq update for different frequency 2021-02-18 12:31:08 +05:30
parisc
parport
pci pci-v5.12-changes 2021-02-25 09:56:08 -08:00
pcmcia
perf IOMMU Updates for Linux v5.12 2021-02-22 10:31:29 -08:00
phy phy: second round of phy fixes for v5.11 2021-02-10 10:39:23 +01:00
pinctrl This is the bulk of pin control changes for the v5.12 kernel. 2021-02-22 18:39:11 -08:00
platform Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00
pnp
power
powercap powercap: intel_rapl: Use topology interface in rapl_init_domains() 2021-02-12 16:53:01 +01:00
pps
ps3
ptp ptp: ptp_clockmatrix: clean-up - parenthesis around a == b are unnecessary 2021-02-17 13:49:26 -08:00
pwm
rapidio
ras
regulator - Core Frameworks 2021-02-22 09:29:42 -08:00
remoteproc remoteproc: qcom: pas: Add SM8350 PAS remoteprocs 2021-02-11 12:52:18 -06:00
reset ARM: SoC drivers for v5.12 2021-02-20 18:42:28 -08:00
rpmsg
rtc ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
s390 SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
sbus
scsi SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
sh
siox
slimbus
soc This is all driver updates, the majority of which is a bunch of new Qualcomm 2021-02-22 09:45:23 -08:00
soundwire soundwire: intel: fix possible crash when no device is detected 2021-02-11 10:49:52 +05:30
spi powerpc updates for 5.12 2021-02-22 14:34:00 -08:00
spmi spmi: spmi-pmic-arb: Fix hw_irq overflow 2021-02-12 12:26:46 +01:00
ssb
staging Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00
target SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
tc
tee Simplify i2c acess in OP-TEE driver 2021-02-09 16:10:49 +01:00
thermal - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
thunderbolt thunderbolt: Changes for v5.12 merge window 2021-02-09 13:00:07 +01:00
tty Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
uio uio: uio_pci_generic: don't fail probe if pdev->irq equals to IRQ_NOTCONNECTED 2021-02-09 12:25:32 +01:00
usb Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
vdpa
vfio VFIO updates for v5.12-rc1 2021-02-24 10:43:40 -08:00
vhost
video video: fbdev: acornfb: remove free_unused_pages() 2021-02-24 13:38:31 -08:00
virt virt: acrn: Introduce an interface for Service VM to control vCPU 2021-02-09 10:58:19 +01:00
virtio virtio-mem: check against mhp_get_pluggable_range() which memory we can hotplug 2021-02-26 09:41:01 -08:00
visorbus
vlynq
vme vme: make remove callback return void 2021-02-09 12:15:07 +01:00
w1
watchdog Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
xen mm/memory_hotplug: MEMHP_MERGE_RESOURCE -> MHP_MERGE_RESOURCE 2021-02-26 09:41:00 -08:00
zorro
Kconfig cxl/mem: Introduce a driver for CXL-2.0-Type-3 endpoints 2021-02-16 20:36:38 -08:00
Makefile Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00