Skip to content

Commit c951ab8

Browse files
longlimsftliuw
authored andcommitted
uio_hv_generic: Use correct size for interrupt and monitor pages
Interrupt and monitor pages should be in Hyper-V page size (4k bytes). This can be different from the system page size. This size is read and used by the user-mode program to determine the mapped data region. An example of such user-mode program is the VMBus driver in DPDK. Cc: stable@vger.kernel.org Fixes: 95096f2 ("uio-hv-generic: new userspace i/o driver for VMBus") Signed-off-by: Long Li <longli@microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Link: https://lore.kernel.org/r/1746492997-4599-3-git-send-email-longli@linuxonhyperv.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <1746492997-4599-3-git-send-email-longli@linuxonhyperv.com>
1 parent 09eea7a commit c951ab8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/uio/uio_hv_generic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ hv_uio_probe(struct hv_device *dev,
274274
pdata->info.mem[INT_PAGE_MAP].name = "int_page";
275275
pdata->info.mem[INT_PAGE_MAP].addr
276276
= (uintptr_t)vmbus_connection.int_page;
277-
pdata->info.mem[INT_PAGE_MAP].size = PAGE_SIZE;
277+
pdata->info.mem[INT_PAGE_MAP].size = HV_HYP_PAGE_SIZE;
278278
pdata->info.mem[INT_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
279279

280280
pdata->info.mem[MON_PAGE_MAP].name = "monitor_page";
281281
pdata->info.mem[MON_PAGE_MAP].addr
282282
= (uintptr_t)vmbus_connection.monitor_pages[1];
283-
pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
283+
pdata->info.mem[MON_PAGE_MAP].size = HV_HYP_PAGE_SIZE;
284284
pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
285285

286286
if (channel->device_id == HV_NIC) {

0 commit comments

Comments
 (0)