[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<BN7PR02MB4148A6C1A29019D9B016D1FCD4B92@BN7PR02MB4148.namprd02.prod.outlook.com>
Date: Sun, 20 Apr 2025 23:57:04 +0000
From: Michael Kelley <mhklinux@...look.com>
To: "longli@...uxonhyperv.com" <longli@...uxonhyperv.com>, "K. Y. Srinivasan"
<kys@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu
<wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>, "linux-hyperv@...r.kernel.org"
<linux-hyperv@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: Long Li <longli@...rosoft.com>
Subject: RE: [PATCH 0/2] Fix uio_hv_generic on 64k page systems
From: longli@...uxonhyperv.com <longli@...uxonhyperv.com>
>
The Subject line of this cover letter is a bit too narrow in scope. The scope
should be any page size larger than 4K. For example, the arm64 architecture
permits a page size of 16K, and Linux kernels built that way work just fine
on Hyper-V arm64 hosts. Perhaps:
Fix uio_hv_generic for guests with page size > 4 KiB
> UIO framework requires the device memory aligned to page boundary.
> Hyper-V may allocate some memory that is Hyper-V page aligned (4k)
> but not system page aligned.
>
> Fix this by having Hyper-V always allocate those pages on system page
> boundary and expose them to user-mode.
Also within the scope of making uio_hv_generic work with page size > 4KiB,
there's an issue with the ring size. When hv_dev_ring_size() returns 0,
hv_uio_probe() uses 2 MiB as the ring size. That works OK with the larger
page sizes. But when hv_dev_ring_size() returns a specific value, it might
not work. The fcopy device returns 16 KiB, which will fail. hv_uio_probe()
needs to use the VMBUS_RING_SIZE() macro to increase the ring size if
necessary to handle the larger ring header that results if the page size
is > 4 KiB. You might want to include such a patch in this series.
Separately, tools/hv/vmbus_bufring.c needs work to operate correctly on
arm64 and with page sizes > 4 KiB. But that's probably a different patch
series.
Michael
>
> Long Li (2):
> Drivers: hv: Allocate interrupt and monitor pages aligned to system
> page boundary
> uio_hv_generic: Use correct size for interrupt and monitor pages
>
> drivers/hv/hv_common.c | 29 +++++++----------------------
> drivers/uio/uio_hv_generic.c | 4 ++--
> 2 files changed, 9 insertions(+), 24 deletions(-)
>
> --
> 2.34.1
>
Powered by blists - more mailing lists