Skip to content

Commit 6383cb4

Browse files
committed
Merge tag 'for-linus-6.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: - a bunch of minor cleanups - a patch adding irqfd support for virtio backends running as user daemon supporting Xen guests * tag 'for-linus-6.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: privcmd: Add support for irqfd xen/xenbus: Avoid a lockdep warning when adding a watch xen: Fix one kernel-doc comment xen: xenbus: Use helper function IS_ERR_OR_NULL() xen: Switch to use kmemdup() helper xen-pciback: Remove unused function declarations x86/xen: Make virt_to_pfn() a static inline xen: remove a confusing comment on auto-translated guest I/O xen/evtchn: Remove unused function declaration xen_set_affinity_evtchn()
2 parents 5420341 + f8941e6 commit 6383cb4

File tree

14 files changed

+320
-33
lines changed

14 files changed

+320
-33
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ static inline unsigned long bfn_to_local_pfn(unsigned long mfn)
295295

296296
/* VIRT <-> MACHINE conversion */
297297
#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
298-
#define virt_to_pfn(v) (PFN_DOWN(__pa(v)))
298+
static inline unsigned long virt_to_pfn(const void *v)
299+
{
300+
return PFN_DOWN(__pa(v));
301+
}
299302
#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
300303
#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
301304

arch/x86/xen/enlighten_pv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
523523
BUG_ON(size > PAGE_SIZE);
524524
BUG_ON(va & ~PAGE_MASK);
525525

526-
pfn = virt_to_pfn(va);
526+
pfn = virt_to_pfn((void *)va);
527527
mfn = pfn_to_mfn(pfn);
528528

529529
pte = pfn_pte(pfn, PAGE_KERNEL_RO);

arch/x86/xen/mmu_pv.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,13 +2202,13 @@ static void xen_zap_pfn_range(unsigned long vaddr, unsigned int order,
22022202
mcs = __xen_mc_entry(0);
22032203

22042204
if (in_frames)
2205-
in_frames[i] = virt_to_mfn(vaddr);
2205+
in_frames[i] = virt_to_mfn((void *)vaddr);
22062206

22072207
MULTI_update_va_mapping(mcs.mc, vaddr, VOID_PTE, 0);
2208-
__set_phys_to_machine(virt_to_pfn(vaddr), INVALID_P2M_ENTRY);
2208+
__set_phys_to_machine(virt_to_pfn((void *)vaddr), INVALID_P2M_ENTRY);
22092209

22102210
if (out_frames)
2211-
out_frames[i] = virt_to_pfn(vaddr);
2211+
out_frames[i] = virt_to_pfn((void *)vaddr);
22122212
}
22132213
xen_mc_issue(0);
22142214
}
@@ -2250,7 +2250,7 @@ static void xen_remap_exchanged_ptes(unsigned long vaddr, int order,
22502250
MULTI_update_va_mapping(mcs.mc, vaddr,
22512251
mfn_pte(mfn, PAGE_KERNEL), flags);
22522252

2253-
set_phys_to_machine(virt_to_pfn(vaddr), mfn);
2253+
set_phys_to_machine(virt_to_pfn((void *)vaddr), mfn);
22542254
}
22552255

22562256
xen_mc_issue(0);
@@ -2310,12 +2310,6 @@ int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
23102310
int success;
23112311
unsigned long vstart = (unsigned long)phys_to_virt(pstart);
23122312

2313-
/*
2314-
* Currently an auto-translated guest will not perform I/O, nor will
2315-
* it require PAE page directories below 4GB. Therefore any calls to
2316-
* this function are redundant and can be ignored.
2317-
*/
2318-
23192313
if (unlikely(order > MAX_CONTIG_ORDER))
23202314
return -ENOMEM;
23212315

@@ -2327,7 +2321,7 @@ int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
23272321
xen_zap_pfn_range(vstart, order, in_frames, NULL);
23282322

23292323
/* 2. Get a new contiguous memory extent. */
2330-
out_frame = virt_to_pfn(vstart);
2324+
out_frame = virt_to_pfn((void *)vstart);
23312325
success = xen_exchange_memory(1UL << order, 0, in_frames,
23322326
1, order, &out_frame,
23332327
address_bits);
@@ -2360,7 +2354,7 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
23602354
spin_lock_irqsave(&xen_reservation_lock, flags);
23612355

23622356
/* 1. Find start MFN of contiguous extent. */
2363-
in_frame = virt_to_mfn(vstart);
2357+
in_frame = virt_to_mfn((void *)vstart);
23642358

23652359
/* 2. Zap current PTEs. */
23662360
xen_zap_pfn_range(vstart, order, NULL, out_frames);

arch/x86/xen/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static void __init xen_do_set_identity_and_remap_chunk(
340340

341341
WARN_ON(size == 0);
342342

343-
mfn_save = virt_to_mfn(buf);
343+
mfn_save = virt_to_mfn((void *)buf);
344344

345345
for (ident_pfn_iter = start_pfn, remap_pfn_iter = remap_pfn;
346346
ident_pfn_iter < ident_end_pfn;
@@ -503,7 +503,7 @@ void __init xen_remap_memory(void)
503503
unsigned long pfn_s = ~0UL;
504504
unsigned long len = 0;
505505

506-
mfn_save = virt_to_mfn(buf);
506+
mfn_save = virt_to_mfn((void *)buf);
507507

508508
while (xen_remap_mfn != INVALID_P2M_ENTRY) {
509509
/* Map the remap information */

drivers/xen/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ config XEN_PRIVCMD
269269
disaggregated Xen setups this driver might be needed for other
270270
domains, too.
271271

272+
config XEN_PRIVCMD_IRQFD
273+
bool "Xen irqfd support"
274+
depends on XEN_PRIVCMD && XEN_VIRTIO && EVENTFD
275+
help
276+
Using the irqfd mechanism a virtio backend running in a daemon can
277+
speed up interrupt injection into a guest.
278+
272279
config XEN_ACPI_PROCESSOR
273280
tristate "Xen ACPI processor"
274281
depends on XEN && XEN_PV_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ

drivers/xen/grant-table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ EXPORT_SYMBOL_GPL(gnttab_pages_clear_private);
10441044

10451045
/**
10461046
* gnttab_free_pages - free pages allocated by gnttab_alloc_pages()
1047-
* @nr_pages; number of pages to free
1047+
* @nr_pages: number of pages to free
10481048
* @pages: the pages
10491049
*/
10501050
void gnttab_free_pages(int nr_pages, struct page **pages)

0 commit comments

Comments
 (0)