mirror-linux/drivers
Michael Kelley 5e7d8ddf2a hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
commit 6941f67ad3 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-31 16:17:07 -08:00
..
accessibility
acpi acpi: property: Let args be NULL in __acpi_node_get_property_reference 2024-01-25 15:27:46 -08:00
amba
android binder: fix race between mmput() and do_exit() 2024-01-25 15:27:39 -08:00
ata
atm atm: solos-pci: Fix potential deadlock on &tx_queue_lock 2023-12-20 17:00:16 +01:00
auxdisplay
base rtc: Extend timeout for waiting for UIP to clear to 1s 2024-01-31 16:17:01 -08:00
bcma
block rbd: don't move requests to the running list on errors 2024-01-31 16:17:07 -08:00
bluetooth Bluetooth: btmtkuart: fix recv_buf() return value 2024-01-25 15:27:30 -08:00
bus bus: mhi: host: Add spinlock to protect WP access when queueing TREs 2024-01-31 16:16:59 -08:00
cdrom
char hwrng: core - Fix page fault dead lock on mmap-ed hwrng 2024-01-31 16:16:58 -08:00
clk clk: si5341: fix an error code problem in si5341_output_clk_set_rate 2024-01-25 15:27:36 -08:00
clocksource clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings 2024-01-25 15:27:39 -08:00
comedi
connector
counter
cpufreq cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() 2024-01-25 15:27:20 -08:00
cpuidle
crypto crypto: sahara - do not resize req->src when doing hash operations 2024-01-25 15:27:23 -08:00
cxl cxl/region: fix x9 interleave typo 2024-01-25 15:27:48 -08:00
dax
dca
devfreq PM / devfreq: Fix buffer overflow in trans_stat_show 2024-01-31 16:16:58 -08:00
dio
dma dmaengine: fix NULL pointer in channel unregistration function 2024-01-31 16:17:00 -08:00
dma-buf
edac EDAC/thunderx: Fix possible out-of-bounds string access 2024-01-25 15:27:18 -08:00
eisa
extcon
firewire firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards 2024-01-10 17:10:35 +01:00
firmware firmware: meson_sm: populate platform devices from sm device tree data 2024-01-25 15:27:24 -08:00
fpga
fsi
gnss
gpio gpio: dwapb: mask/unmask IRQ when disable/enale it 2024-01-01 12:39:07 +00:00
gpu drm/amd/display: pbn_div need be updated for hotplug event 2024-01-31 16:17:03 -08:00
greybus
hid HID: wacom: Correct behavior when processing some confidence == false touches 2024-01-25 15:27:44 -08:00
hsi
hte
hv
hwmon hwmon: (corsair-psu) Fix probe when built-in 2024-01-20 11:50:06 +01:00
hwspinlock
hwtracing coresight: etm4x: Fix width of CCITMIN field 2024-01-20 11:50:11 +01:00
i2c i2c: s3c24xx: fix transferring more than one message in polling mode 2024-01-25 15:27:52 -08:00
i3c
idle
iio iio: adc: ad7091r: Enable internal vref if external vref is not supplied 2024-01-31 16:17:00 -08:00
infiniband IB/iser: Prevent invalidating wrong MR 2024-01-25 15:27:38 -08:00
input Input: atkbd - use ab83 as id when skipping the getid command 2024-01-25 15:27:39 -08:00
interconnect Revert "interconnect: qcom: sm8250: Enable sync_state" 2024-01-10 17:10:37 +01:00
iommu iommu/dma: Trace bounce buffer usage when mapping buffers 2024-01-25 15:27:43 -08:00
ipack
irqchip
isdn
leds leds: aw2013: Select missing dependency REGMAP_I2C 2024-01-25 15:27:45 -08:00
macintosh
mailbox
mcb
md Revert "Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"" 2024-01-25 15:27:52 -08:00
media media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run 2024-01-31 16:17:01 -08:00
memory
memstick
message
mfd mfd: intel-lpss: Fix the fractional clock divider flags 2024-01-25 15:27:45 -08:00
misc accel/habanalabs: fix information leak in sec_attest_info() 2024-01-25 15:27:37 -08:00
mmc mmc: mmc_spi: remove custom DMA mapped buffers 2024-01-31 16:17:01 -08:00
most
mtd mtd: Fix gluebi NULL pointer dereference caused by ftl notifier 2024-01-25 15:27:21 -08:00
mux
net hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes 2024-01-31 16:17:07 -08:00
nfc
ntb
nubus
nvdimm
nvme nvmet-tcp: Fix the H2C expected PDU len calculation 2024-01-25 15:27:48 -08:00
nvmem
of of: unittest: Fix of_count_phandle_with_args() expected value message 2024-01-25 15:27:38 -08:00
opp OPP: Pass rounded rate to _set_opp() 2024-01-31 16:16:58 -08:00
parisc parisc/power: Fix power soft-off button emulation on qemu 2024-01-31 16:16:59 -08:00
parport parport: parport_serial: Add Brainboxes device IDs and geometry 2024-01-20 11:50:11 +01:00
pci PCI: mediatek-gen3: Fix translation window size calculation 2024-01-25 15:27:48 -08:00
pcmcia
peci
perf
phy
pinctrl pinctrl: cy8c95x0: Fix get_pincfg 2024-01-20 11:50:09 +01:00
platform platform/x86/intel/vsec: Fix xa_alloc memory leak 2024-01-25 15:27:20 -08:00
pnp
power power: supply: bq256xx: fix some problem in bq256xx_hw_init 2024-01-25 15:27:45 -08:00
powercap powercap: DTPM: Fix missing cpufreq_cpu_put() calls 2023-12-13 18:39:21 +01:00
pps
ps3
ptp
pwm pwm: Fix out-of-bounds access in of_pwm_single_xlate() 2024-01-25 15:27:42 -08:00
rapidio
ras
regulator
remoteproc
reset reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning 2024-01-20 11:50:07 +01:00
rpmsg rpmsg: virtio: Free driver_override when rpmsg_remove() 2024-01-31 16:16:59 -08:00
rtc rtc: Extend timeout for waiting for UIP to clear to 1s 2024-01-31 16:17:01 -08:00
s390 s390/vfio-ap: let on_scan_complete() callback filter matrix and update guest's APCB 2024-01-31 16:16:59 -08:00
sbus
scsi scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State 2024-01-25 15:27:42 -08:00
sh
siox
slimbus
soc soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration 2024-01-25 15:27:28 -08:00
soundwire soundwire: stream: fix NULL pointer dereference for multi_link 2023-12-20 17:00:25 +01:00
spi spi: sh-msiof: Enforce fixed DTDL for R-Car H3 2024-01-25 15:27:20 -08:00
spmi spmi: mtk-pmif: Serialize PMIF status check and command submission 2024-01-25 15:27:47 -08:00
ssb
staging media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls 2024-01-25 15:27:32 -08:00
target scsi: target: core: add missing file_{start,end}_write() 2024-01-25 15:27:42 -08:00
tc
tee
thermal
thunderbolt thunderbolt: Fix memory leak in margining_port_remove() 2024-01-01 12:39:08 +00:00
tty serial: sc16is7xx: improve do/while loop in sc16is7xx_irq() 2024-01-31 16:17:02 -08:00
ufs scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan() 2024-01-31 16:17:00 -08:00
uio uio: Fix use-after-free in uio_open 2024-01-20 11:50:10 +01:00
usb usb: dwc3: gadget: Handle EP0 request dequeuing properly 2024-01-31 16:16:57 -08:00
vdpa vdpa: Fix an error handling path in eni_vdpa_probe() 2024-01-25 15:27:47 -08:00
vfio
vhost
video fbdev: flush deferred IO before closing 2024-01-25 15:27:42 -08:00
virt
virtio
vlynq
w1
watchdog watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused 2024-01-25 15:27:36 -08:00
xen
zorro
Kconfig
Makefile