Skip to content

Commit cee03ca

Browse files
jgross1gregkh
authored andcommitted
xen/usb: don't use arbitrary_virt_to_machine()
arbitrary_virt_to_machine() is meant to be used in PV guests only. Replace its usage with virt_to_gfn(). Signed-off-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 61ef170 commit cee03ca

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/usb/host/xen-hcd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,14 +589,12 @@ static void xenhcd_gnttab_map(struct xenhcd_info *info, void *addr, int length,
589589
int nr_pages, int flags)
590590
{
591591
grant_ref_t ref;
592-
unsigned long buffer_mfn;
593592
unsigned int offset;
594593
unsigned int len = length;
595594
unsigned int bytes;
596595
int i;
597596

598597
for (i = 0; i < nr_pages; i++) {
599-
buffer_mfn = PFN_DOWN(arbitrary_virt_to_machine(addr).maddr);
600598
offset = offset_in_page(addr);
601599

602600
bytes = PAGE_SIZE - offset;
@@ -605,7 +603,7 @@ static void xenhcd_gnttab_map(struct xenhcd_info *info, void *addr, int length,
605603

606604
ref = gnttab_claim_grant_reference(gref_head);
607605
gnttab_grant_foreign_access_ref(ref, info->xbdev->otherend_id,
608-
buffer_mfn, flags);
606+
virt_to_gfn(addr), flags);
609607
seg[i].gref = ref;
610608
seg[i].offset = (__u16)offset;
611609
seg[i].length = (__u16)bytes;

0 commit comments

Comments
 (0)