linux-stable/drivers
Michael Kelley 6941f67ad3 hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
Current code in netvsc_drv_init() incorrectly assumes that PAGE_SIZE
is 4 Kbytes, which is wrong on ARM64 with 16K or 64K page size. As a
result, the default VMBus ring buffer size on ARM64 with 64K page size
is 8 Mbytes instead of the expected 512 Kbytes. While this doesn't break
anything, a typical VM with 8 vCPUs and 8 netvsc channels wastes 120
Mbytes (8 channels * 2 ring buffers/channel * 7.5 Mbytes/ring buffer).

Unfortunately, the module parameter specifying the ring buffer size
is in units of 4 Kbyte pages. Ideally, it should be in units that
are independent of PAGE_SIZE, but backwards compatibility prevents
changing that now.

Fix this by having netvsc_drv_init() hardcode 4096 instead of using
PAGE_SIZE when calculating the ring buffer size in bytes. Also
use the VMBUS_RING_SIZE macro to ensure proper alignment when running
with page size larger than 4K.

Cc: <stable@vger.kernel.org> # 5.15.x
Fixes: 7aff79e297 ("Drivers: hv: Enable Hyper-V code to be built on ARM64")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20240122162028.348885-1-mhklinux@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-01-23 17:19:42 -08:00
..
accel drm-next for 6.8: 2024-01-12 11:32:19 -08:00
accessibility
acpi cxl for v6.8 2024-01-18 16:22:43 -08:00
amba
android Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
ata
atm
auxdisplay drm-next for 6.8: 2024-01-12 11:32:19 -08:00
base RTC for 6.8 2024-01-18 17:25:39 -08:00
bcma
block
bluetooth USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
bus Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
cache
cdrom
cdx
char TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
clk Only a couple new SoCs have support added this time, primarily for Qualcomm 2024-01-12 13:42:35 -08:00
clocksource
comedi
connector
counter
cpufreq Merge branches 'pm-sleep', 'pm-cpufreq' and 'pm-qos' into pm 2024-01-16 12:23:24 +01:00
cpuidle
crypto
cxl cxl/core: use sysfs_emit() for attr's _show() 2024-01-12 14:47:04 -08:00
dax
dca
devfreq
dio
dma IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
dma-buf
dpll dpll: fix register pin with unregistered parent pin 2024-01-22 11:01:11 +00:00
edac Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
eisa
extcon
firewire
firmware Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
fpga Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
fsi
gnss TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
gpio gpio fixes for v6.8-rc1 2024-01-18 17:03:51 -08:00
gpu This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
greybus TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
hid hid-for-linus-2024010801 2024-01-12 14:45:13 -08:00
hsi
hte
hv
hwmon hwmon: (npcm750-pwm-fan) Fix crash observed when instantiating nuvoton,npcm750-pwm-fan 2024-01-14 07:44:38 -08:00
hwspinlock
hwtracing
i2c This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
i3c
idle
iio TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
infiniband RDMA v6.8 merge window 2024-01-12 13:52:21 -08:00
input Input updates for 6.8 merge window: 2024-01-18 17:21:35 -08:00
interconnect Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
iommu iommufd for 6.8 2024-01-18 15:28:15 -08:00
ipack TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
irqchip
isdn
leds - New Drivers 2024-01-17 15:25:27 -08:00
macintosh
mailbox mediatek: add CMDQ support for mt8188 2024-01-17 15:39:32 -08:00
mcb
md
media This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
memory IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
memstick
message
mfd TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
misc This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
mmc TTY/Serial changes for 6.8-rc1 2024-01-18 11:37:24 -08:00
most
mtd This pull request contains updates for UBI and UBIFS: 2024-01-17 10:27:13 -08:00
mux
net hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes 2024-01-23 17:19:42 -08:00
nfc
ntb
nubus
nvdimm virtio: features, fixes 2024-01-18 16:44:03 -08:00
nvme
nvmem Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
of IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
opp
parisc
parport
pci cxl for v6.8 2024-01-18 16:22:43 -08:00
pcmcia
peci
perf
phy phy-for-6.8 2024-01-18 17:11:43 -08:00
pinctrl This is the main pin control pull request for the v6.8 kernel series. 2024-01-17 15:55:33 -08:00
platform USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
pmdomain Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
pnp More ACPI updates for 6.8-rc1 2024-01-17 14:37:40 -08:00
power
powercap
pps
ps3
ptp
pwm pwm: jz4740: Don't use dev_err_probe() in .request() 2024-01-12 18:25:05 +01:00
rapidio
ras
regulator pwm: Changes for v6.8-rc1 2024-01-12 14:59:50 -08:00
remoteproc
reset
rpmsg
rtc rtc: nuvoton: Compatible with NCT3015Y-R and NCT3018Y-R 2024-01-18 01:05:33 +01:00
s390 s390 updates for 6.8 merge window part 2 2024-01-18 14:11:25 -08:00
sbus
scsi virtio: features, fixes 2024-01-18 16:44:03 -08:00
sh
siox
slimbus
soc Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
soundwire soundwire updates for 6.7 2024-01-18 17:08:31 -08:00
spi
spmi
ssb
staging This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
target
tc
tee Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
thermal More thermal control updates for 6.8-rc1 2024-01-17 14:47:33 -08:00
thunderbolt USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
tty USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
ufs
uio
usb USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
vdpa virtio: features, fixes 2024-01-18 16:44:03 -08:00
vfio VFIO updates for v6.8-rc1 2024-01-18 15:57:25 -08:00
vhost virtio: features, fixes 2024-01-18 16:44:03 -08:00
video This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
virt Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
virtio virtio: features, fixes 2024-01-18 16:44:03 -08:00
w1
watchdog linux-watchdog 6.8-rc1 tag 2024-01-12 13:32:30 -08:00
xen xen: branch for v6.8-rc1 2024-01-17 13:41:38 -08:00
zorro
Kconfig
Makefile fbdev/intelfb: Remove driver 2024-01-12 12:38:37 +01:00