Skip to content

Commit 4ccbe91

Browse files
committed
Merge tag 'for-linus-5.19-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull more xen updates from Juergen Gross: "Two cleanup patches for Xen related code and (more important) an update of MAINTAINERS for Xen, as Boris Ostrovsky decided to step down" * tag 'for-linus-5.19-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: replace xen_remap() with memremap() MAINTAINERS: Update Xen maintainership xen: switch gnttab_end_foreign_access() to take a struct page pointer
2 parents 45b2e5a + 41925b1 commit 4ccbe91

File tree

16 files changed

+48
-52
lines changed

16 files changed

+48
-52
lines changed

MAINTAINERS

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21744,23 +21744,29 @@ F: arch/arm64/include/asm/xen/
2174421744
F: arch/arm64/xen/
2174521745

2174621746
XEN HYPERVISOR INTERFACE
21747-
M: Boris Ostrovsky <[email protected]>
2174821747
M: Juergen Gross <[email protected]>
21749-
R: Stefano Stabellini <[email protected]>
21748+
M: Stefano Stabellini <[email protected]>
21749+
R: Oleksandr Tyshchenko <[email protected]>
2175021750
L: [email protected] (moderated for non-subscribers)
2175121751
S: Supported
2175221752
T: git git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
2175321753
F: Documentation/ABI/stable/sysfs-hypervisor-xen
2175421754
F: Documentation/ABI/testing/sysfs-hypervisor-xen
21755-
F: arch/x86/include/asm/pvclock-abi.h
21756-
F: arch/x86/include/asm/xen/
21757-
F: arch/x86/platform/pvh/
21758-
F: arch/x86/xen/
2175921755
F: drivers/*/xen-*front.c
2176021756
F: drivers/xen/
2176121757
F: include/uapi/xen/
2176221758
F: include/xen/
2176321759

21760+
XEN HYPERVISOR X86
21761+
M: Juergen Gross <[email protected]>
21762+
R: Boris Ostrovsky <[email protected]>
21763+
L: [email protected] (moderated for non-subscribers)
21764+
S: Supported
21765+
F: arch/x86/include/asm/pvclock-abi.h
21766+
F: arch/x86/include/asm/xen/
21767+
F: arch/x86/platform/pvh/
21768+
F: arch/x86/xen/
21769+
2176421770
XEN NETWORK BACKEND DRIVER
2176521771
M: Wei Liu <[email protected]>
2176621772
M: Paul Durrant <[email protected]>

arch/x86/include/asm/xen/page.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,6 @@ unsigned long arbitrary_virt_to_mfn(void *vaddr);
347347
void make_lowmem_page_readonly(void *vaddr);
348348
void make_lowmem_page_readwrite(void *vaddr);
349349

350-
#define xen_remap(cookie, size) ioremap((cookie), (size))
351-
#define xen_unmap(cookie) iounmap((cookie))
352-
353350
static inline bool xen_arch_need_swiotlb(struct device *dev,
354351
phys_addr_t phys,
355352
dma_addr_t dev_addr)

drivers/block/xen-blkfront.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo)
12211221
list_del(&persistent_gnt->node);
12221222
if (persistent_gnt->gref != INVALID_GRANT_REF) {
12231223
gnttab_end_foreign_access(persistent_gnt->gref,
1224-
0UL);
1224+
NULL);
12251225
rinfo->persistent_gnts_c--;
12261226
}
12271227
if (info->feature_persistent)
@@ -1244,7 +1244,7 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo)
12441244
rinfo->shadow[i].req.u.rw.nr_segments;
12451245
for (j = 0; j < segs; j++) {
12461246
persistent_gnt = rinfo->shadow[i].grants_used[j];
1247-
gnttab_end_foreign_access(persistent_gnt->gref, 0UL);
1247+
gnttab_end_foreign_access(persistent_gnt->gref, NULL);
12481248
if (info->feature_persistent)
12491249
__free_page(persistent_gnt->page);
12501250
kfree(persistent_gnt);
@@ -1259,7 +1259,7 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo)
12591259

12601260
for (j = 0; j < INDIRECT_GREFS(segs); j++) {
12611261
persistent_gnt = rinfo->shadow[i].indirect_grants[j];
1262-
gnttab_end_foreign_access(persistent_gnt->gref, 0UL);
1262+
gnttab_end_foreign_access(persistent_gnt->gref, NULL);
12631263
__free_page(persistent_gnt->page);
12641264
kfree(persistent_gnt);
12651265
}

drivers/input/misc/xen-kbdfront.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ static int xenkbd_connect_backend(struct xenbus_device *dev,
481481
error_evtchan:
482482
xenbus_free_evtchn(dev, evtchn);
483483
error_grant:
484-
gnttab_end_foreign_access(info->gref, 0UL);
484+
gnttab_end_foreign_access(info->gref, NULL);
485485
info->gref = -1;
486486
return ret;
487487
}
@@ -492,7 +492,7 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info)
492492
unbind_from_irqhandler(info->irq, info);
493493
info->irq = -1;
494494
if (info->gref >= 0)
495-
gnttab_end_foreign_access(info->gref, 0UL);
495+
gnttab_end_foreign_access(info->gref, NULL);
496496
info->gref = -1;
497497
}
498498

drivers/net/xen-netfront.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ static void xennet_release_tx_bufs(struct netfront_queue *queue)
13861386
queue->tx_skbs[i] = NULL;
13871387
get_page(queue->grant_tx_page[i]);
13881388
gnttab_end_foreign_access(queue->grant_tx_ref[i],
1389-
(unsigned long)page_address(queue->grant_tx_page[i]));
1389+
queue->grant_tx_page[i]);
13901390
queue->grant_tx_page[i] = NULL;
13911391
queue->grant_tx_ref[i] = INVALID_GRANT_REF;
13921392
add_id_to_list(&queue->tx_skb_freelist, queue->tx_link, i);
@@ -1418,8 +1418,7 @@ static void xennet_release_rx_bufs(struct netfront_queue *queue)
14181418
* foreign access is ended (which may be deferred).
14191419
*/
14201420
get_page(page);
1421-
gnttab_end_foreign_access(ref,
1422-
(unsigned long)page_address(page));
1421+
gnttab_end_foreign_access(ref, page);
14231422
queue->grant_rx_ref[id] = INVALID_GRANT_REF;
14241423

14251424
kfree_skb(skb);
@@ -1760,7 +1759,7 @@ static void xennet_end_access(int ref, void *page)
17601759
{
17611760
/* This frees the page as a side-effect */
17621761
if (ref != INVALID_GRANT_REF)
1763-
gnttab_end_foreign_access(ref, (unsigned long)page);
1762+
gnttab_end_foreign_access(ref, virt_to_page(page));
17641763
}
17651764

17661765
static void xennet_disconnect_backend(struct netfront_info *info)

drivers/tty/hvc/hvc_xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int xen_hvm_console_init(void)
253253
if (r < 0 || v == 0)
254254
goto err;
255255
gfn = v;
256-
info->intf = xen_remap(gfn << XEN_PAGE_SHIFT, XEN_PAGE_SIZE);
256+
info->intf = memremap(gfn << XEN_PAGE_SHIFT, XEN_PAGE_SIZE, MEMREMAP_WB);
257257
if (info->intf == NULL)
258258
goto err;
259259
info->vtermno = HVC_COOKIE;

drivers/xen/gntalloc.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op,
175175

176176
static void __del_gref(struct gntalloc_gref *gref)
177177
{
178-
unsigned long addr;
179-
180178
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
181179
uint8_t *tmp = kmap_local_page(gref->page);
182180
tmp[gref->notify.pgoff] = 0;
@@ -190,10 +188,9 @@ static void __del_gref(struct gntalloc_gref *gref)
190188
gref->notify.flags = 0;
191189

192190
if (gref->gref_id) {
193-
if (gref->page) {
194-
addr = (unsigned long)page_to_virt(gref->page);
195-
gnttab_end_foreign_access(gref->gref_id, addr);
196-
} else
191+
if (gref->page)
192+
gnttab_end_foreign_access(gref->gref_id, gref->page);
193+
else
197194
gnttab_free_grant_reference(gref->gref_id);
198195
}
199196

drivers/xen/gntdev-dmabuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ static void dmabuf_imp_end_foreign_access(u32 *refs, int count)
524524

525525
for (i = 0; i < count; i++)
526526
if (refs[i] != INVALID_GRANT_REF)
527-
gnttab_end_foreign_access(refs[i], 0UL);
527+
gnttab_end_foreign_access(refs[i], NULL);
528528
}
529529

530530
static void dmabuf_imp_free_storage(struct gntdev_dmabuf *gntdev_dmabuf)

drivers/xen/grant-table.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ int gnttab_try_end_foreign_access(grant_ref_t ref)
430430
}
431431
EXPORT_SYMBOL_GPL(gnttab_try_end_foreign_access);
432432

433-
void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page)
433+
void gnttab_end_foreign_access(grant_ref_t ref, struct page *page)
434434
{
435435
if (gnttab_try_end_foreign_access(ref)) {
436-
if (page != 0)
437-
put_page(virt_to_page(page));
436+
if (page)
437+
put_page(page);
438438
} else
439-
gnttab_add_deferred(ref, page ? virt_to_page(page) : NULL);
439+
gnttab_add_deferred(ref, page);
440440
}
441441
EXPORT_SYMBOL_GPL(gnttab_end_foreign_access);
442442

@@ -632,15 +632,15 @@ int gnttab_setup_auto_xlat_frames(phys_addr_t addr)
632632
if (xen_auto_xlat_grant_frames.count)
633633
return -EINVAL;
634634

635-
vaddr = xen_remap(addr, XEN_PAGE_SIZE * max_nr_gframes);
635+
vaddr = memremap(addr, XEN_PAGE_SIZE * max_nr_gframes, MEMREMAP_WB);
636636
if (vaddr == NULL) {
637637
pr_warn("Failed to ioremap gnttab share frames (addr=%pa)!\n",
638638
&addr);
639639
return -ENOMEM;
640640
}
641641
pfn = kcalloc(max_nr_gframes, sizeof(pfn[0]), GFP_KERNEL);
642642
if (!pfn) {
643-
xen_unmap(vaddr);
643+
memunmap(vaddr);
644644
return -ENOMEM;
645645
}
646646
for (i = 0; i < max_nr_gframes; i++)
@@ -659,7 +659,7 @@ void gnttab_free_auto_xlat_frames(void)
659659
if (!xen_auto_xlat_grant_frames.count)
660660
return;
661661
kfree(xen_auto_xlat_grant_frames.pfn);
662-
xen_unmap(xen_auto_xlat_grant_frames.vaddr);
662+
memunmap(xen_auto_xlat_grant_frames.vaddr);
663663

664664
xen_auto_xlat_grant_frames.pfn = NULL;
665665
xen_auto_xlat_grant_frames.count = 0;

drivers/xen/pvcalls-front.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
238238
spin_unlock(&bedata->socket_lock);
239239

240240
for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++)
241-
gnttab_end_foreign_access(map->active.ring->ref[i], 0);
242-
gnttab_end_foreign_access(map->active.ref, 0);
241+
gnttab_end_foreign_access(map->active.ring->ref[i], NULL);
242+
gnttab_end_foreign_access(map->active.ref, NULL);
243243
free_page((unsigned long)map->active.ring);
244244

245245
kfree(map);
@@ -1117,7 +1117,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev)
11171117
}
11181118
}
11191119
if (bedata->ref != -1)
1120-
gnttab_end_foreign_access(bedata->ref, 0);
1120+
gnttab_end_foreign_access(bedata->ref, NULL);
11211121
kfree(bedata->ring.sring);
11221122
kfree(bedata);
11231123
xenbus_switch_state(dev, XenbusStateClosed);

0 commit comments

Comments
 (0)