No description
Find a file
Michael Kelley db5f1f1fb8 PCI: hv: Fix ring buffer size calculation
[ Upstream commit b5ff74c1ef ]

For a physical PCI device that is passed through to a Hyper-V guest VM,
current code specifies the VMBus ring buffer size as 4 pages.  But this
is an inappropriate dependency, since the amount of ring buffer space
needed is unrelated to PAGE_SIZE. For example, on x86 the ring buffer
size ends up as 16 Kbytes, while on ARM64 with 64 Kbyte pages, the ring
size bloats to 256 Kbytes. The ring buffer for PCI pass-thru devices
is used for only a few messages during device setup and removal, so any
space above a few Kbytes is wasted.

Fix this by declaring the ring buffer size to be a fixed 16 Kbytes.
Furthermore, use the VMBUS_RING_SIZE() macro so that the ring buffer
header is properly accounted for, and so the size is rounded up to a
page boundary, using the page size for which the kernel is built. While
w/64 Kbyte pages this results in a 64 Kbyte ring buffer header plus a
64 Kbyte ring buffer, that's the smallest possible with that page size.
It's still 128 Kbytes better than the current code.

Link: https://lore.kernel.org/linux-pci/20240216202240.251818-1-mhklinux@outlook.com
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Long Li <longli@microsoft.com>
Cc: <stable@vger.kernel.org> # 5.15.x
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:28:30 +02:00
arch sparc32: Fix parport build with sparc32 2024-04-03 15:28:29 +02:00
block block: Fix page refcounts for unaligned buffers in __bio_release_pages() 2024-04-03 15:28:27 +02:00
certs
crypto crypto: jitter - fix CRYPTO_JITTERENTROPY help text 2024-03-26 18:19:52 -04:00
Documentation docs: Restore "smart quotes" for quotes 2024-04-03 15:28:22 +02:00
drivers PCI: hv: Fix ring buffer size calculation 2024-04-03 15:28:30 +02:00
fs NFS: Read unlock folio on nfs_page_create_from_folio() error 2024-04-03 15:28:29 +02:00
include nfs: fix UAF in direct writes 2024-04-03 15:28:29 +02:00
init modules: wait do_free_init correctly 2024-03-26 18:19:55 -04:00
io_uring io_uring: fix mshot io-wq checks 2024-04-03 15:28:29 +02:00
ipc
kernel serial: Lock console when calling into driver before registration 2024-04-03 15:28:26 +02:00
lib pci_iounmap(): Fix MMIO mapping leak 2024-04-03 15:28:17 +02:00
LICENSES
mm mm: swap: fix race between free_swap_and_cache() and swapoff() 2024-04-03 15:28:27 +02:00
net mac802154: fix llsec key resources release in mac802154_llsec_key_del 2024-04-03 15:28:27 +02:00
rust rust: upgrade to Rust 1.73.0 2024-02-16 19:10:43 +01:00
samples work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
scripts kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-03 15:28:29 +02:00
security landlock: Warn once if a Landlock action is requested while disabled 2024-04-03 15:28:27 +02:00
sound ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates 2024-03-26 18:20:07 -04:00
tools selftests/mqueue: Set timeout to 180 seconds 2024-04-03 15:28:20 +02:00
usr
virt KVM: Always flush async #PF workqueue when vCPU is being destroyed 2024-04-03 15:28:18 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: add Catherine as xfs maintainer for 6.6.y 2024-02-16 19:10:43 +01:00
Makefile Linux 6.6.23 2024-03-26 18:22:53 -04:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.