History

Merge tag 'for-linus-5.16b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen updates from Juergen Gross: - a series to speed up the boot of Xen PV guests - some cleanups in Xen related code - replacement of license texts with the appropriate SPDX headers and fixing of wrong SPDX headers in Xen header files - a small series making paravirtualized interrupt masking much simpler and at the same time removing complaints of objtool - a fix for Xen ballooning hogging workqueues for too long - enablement of the Xen pciback driver for Arm - some further small fixes/enhancements * tag 'for-linus-5.16b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (22 commits) xen/balloon: fix unused-variable warning xen/balloon: rename alloc/free_xenballooned_pages xen/balloon: add late_initcall_sync() for initial ballooning done x86/xen: remove 32-bit awareness from startup_xen xen: remove highmem remnants xen: allow pv-only hypercalls only with CONFIG_XEN_PV x86/xen: remove 32-bit pv leftovers xen-pciback: allow compiling on other archs than x86 x86/xen: switch initial pvops IRQ functions to dummy ones x86/xen: remove xen_have_vcpu_info_placement flag x86/pvh: add prototype for xen_pvh_init() xen: Fix implicit type conversion xen: fix wrong SPDX headers of Xen related headers xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls x86/xen: Remove redundant irq_enter/exit() invocations xen-pciback: Fix return in pm_ctrl_init() xen/x86: restrict PV Dom0 identity mapping xen/x86: there's no highmem anymore in PV mode xen/x86: adjust handling of the L3 user vsyscall special page table xen/x86: adjust xen_set_fixmap() ...

Linus Torvalds committed 5 years ago

Commit bf98ecb2 parents 4287af3 501586e72 files · +496 −968Browse files

Unified · Split

72 files
  1. Documentation/admin-guide/kernel-parameters.txt +7 −0
  2. arch/arm/xen/enlighten.c +0 −1
  3. arch/arm/xen/hypercall.S +0 −1
  4. arch/arm64/xen/hypercall.S +0 −1
  5. arch/x86/include/asm/paravirt_types.h +2 −0
  6. arch/x86/include/asm/xen/hypercall.h +102 −131
  7. arch/x86/include/asm/xen/hypervisor.h +4 −0
  8. arch/x86/include/asm/xen/pci.h +0 −19
  9. arch/x86/kernel/paravirt.c +12 −1
  10. arch/x86/pci/xen.c +1 −75
  11. arch/x86/xen/enlighten.c +26 −90
  12. arch/x86/xen/enlighten_hvm.c +3 −3
  13. arch/x86/xen/enlighten_pv.c +5 −30
  14. arch/x86/xen/irq.c +4 −58
  15. arch/x86/xen/mmu_pv.c +37 −15
  16. arch/x86/xen/setup.c +3 −7
  17. arch/x86/xen/smp.c +0 −28
  18. arch/x86/xen/smp_pv.c +0 −2
  19. arch/x86/xen/xen-head.S +6 −6
  20. arch/x86/xen/xen-ops.h +1 −3
  21. drivers/xen/Kconfig +24 −0
  22. drivers/xen/Makefile +1 −1
  23. drivers/xen/balloon.c +78 −35
  24. drivers/xen/mem-reservation.c +10 −17
  25. drivers/xen/pci.c +76 −0
  26. drivers/xen/pvcalls-back.c +0 −1
  27. drivers/xen/xen-acpi-processor.c +3 −3
  28. drivers/xen/xen-pciback/Makefile +7 −0
  29. drivers/xen/xen-pciback/conf_space_capability.c +1 −1
  30. drivers/xen/xen-pciback/conf_space_header.c +6 −2
  31. drivers/xen/xen-pciback/pci_stub.c +2 −1
  32. drivers/xen/xen-pciback/pciback.h +5 −0
  33. drivers/xen/xen-pciback/xenbus.c +6 −2
  34. include/xen/arm/hypercall.h +0 −15
  35. include/xen/balloon.h +0 −3
  36. include/xen/interface/callback.h +1 −18
  37. include/xen/interface/elfnote.h +1 −18
  38. include/xen/interface/event_channel.h +1 −1
  39. include/xen/interface/features.h +1 −1
  40. include/xen/interface/grant_table.h +1 −18
  41. include/xen/interface/hvm/dm_op.h +1 −18
  42. include/xen/interface/hvm/hvm_op.h +1 −19
  43. include/xen/interface/hvm/hvm_vcpu.h +1 −18
  44. include/xen/interface/hvm/params.h +1 −19
  45. include/xen/interface/hvm/start_info.h +1 −18
  46. include/xen/interface/io/9pfs.h +1 −18
  47. include/xen/interface/io/blkif.h +1 −1
  48. include/xen/interface/io/console.h +1 −1
  49. include/xen/interface/io/displif.h +1 −18
  50. include/xen/interface/io/fbif.h +1 −18
  51. include/xen/interface/io/kbdif.h +1 −18
  52. include/xen/interface/io/netif.h +1 −18
  53. include/xen/interface/io/pciif.h +1 −18
  54. include/xen/interface/io/protocols.h +1 −1
  55. include/xen/interface/io/pvcalls.h +2 −0
  56. include/xen/interface/io/ring.h +1 −18
  57. include/xen/interface/io/sndif.h +1 −18
  58. include/xen/interface/io/vscsiif.h +1 −18
  59. include/xen/interface/io/xenbus.h +1 −1
  60. include/xen/interface/io/xs_wire.h +1 −1
  61. include/xen/interface/memory.h +1 −1
  62. include/xen/interface/nmi.h +1 −1
  63. include/xen/interface/physdev.h +1 −19
  64. include/xen/interface/platform.h +1 −18
  65. include/xen/interface/sched.h +1 −18
  66. include/xen/interface/vcpu.h +1 −18
  67. include/xen/interface/version.h +1 −1
  68. include/xen/interface/xen-mca.h +1 −0
  69. include/xen/interface/xen.h +1 −18
  70. include/xen/interface/xenpmu.h +1 −1
  71. include/xen/pci.h +28 −0
  72. include/xen/xen.h +0 −6
Documentation/admin-guide/kernel-parameters.txt+7−0
@@ -6379,6 +6379,13 @@ · 6378 unmodified lines
63796379 improve timer resolution at the expense of processing
63806380 more timer interrupts.
63816381
6382+ xen.balloon_boot_timeout= [XEN]
6383+ The time (in seconds) to wait before giving up to boot
6384+ in case initial ballooning fails to free enough memory.
6385+ Applies only when running as HVM or PVH guest and
6386+ started with less memory configured than allowed at
6387+ max. Default is 180.
6388+
63826389 xen.event_eoi_delay= [XEN]
63836390 How long to delay EOI handling in case of event
63846391 storms (jiffies). Default is 10.
arch/arm/xen/enlighten.c+0−1
@@ -442,7 +442,6 @@ EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op); · 441 unmodified lines
442442 EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
443443 EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
444444 EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);
445−EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op);
446445 EXPORT_SYMBOL_GPL(HYPERVISOR_platform_op_raw);
447446 EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);
448447 EXPORT_SYMBOL_GPL(HYPERVISOR_vm_assist);
arch/arm/xen/hypercall.S+0−1
@@ -88,7 +88,6 @@ HYPERCALL2(hvm_op); · 87 unmodified lines
8888 HYPERCALL2(memory_op);
8989 HYPERCALL2(physdev_op);
9090 HYPERCALL3(vcpu_op);
91−HYPERCALL1(tmem_op);
9291 HYPERCALL1(platform_op_raw);
9392 HYPERCALL2(multicall);
9493 HYPERCALL2(vm_assist);
arch/arm64/xen/hypercall.S+0−1
@@ -80,7 +80,6 @@ HYPERCALL2(hvm_op); · 79 unmodified lines
8080 HYPERCALL2(memory_op);
8181 HYPERCALL2(physdev_op);
8282 HYPERCALL3(vcpu_op);
83−HYPERCALL1(tmem_op);
8483 HYPERCALL1(platform_op_raw);
8584 HYPERCALL2(multicall);
8685 HYPERCALL2(vm_assist);
arch/x86/include/asm/paravirt_types.h+2−0
@@ -577,7 +577,9 @@ void paravirt_leave_lazy_mmu(void); · 576 unmodified lines
577577 void paravirt_flush_lazy_mmu(void);
578578
579579 void _paravirt_nop(void);
580+void paravirt_BUG(void);
580581 u64 _paravirt_ident_64(u64);
582+unsigned long paravirt_ret0(void);
581583
582584 #define paravirt_nop ((void *)_paravirt_nop)
583585
arch/x86/include/asm/xen/hypercall.h+102−131
@@ -248,6 +248,7 @@ privcmd_call(unsigned int call, · 247 unmodified lines
248248 return res;
249249 }
250250
251+#ifdef CONFIG_XEN_PV
251252 static inline int
252253 HYPERVISOR_set_trap_table(struct trap_info *table)
253254 {
@@ -280,6 +281,107 @@ HYPERVISOR_callback_op(int cmd, void *arg) · 26 unmodified lines
280281 return _hypercall2(int, callback_op, cmd, arg);
281282 }
282283
284+static inline int
285+HYPERVISOR_set_debugreg(int reg, unsigned long value)
286+{
287+ return _hypercall2(int, set_debugreg, reg, value);
288+}
289+
290+static inline unsigned long
291+HYPERVISOR_get_debugreg(int reg)
292+{
293+ return _hypercall1(unsigned long, get_debugreg, reg);
294+}
295+
296+static inline int
297+HYPERVISOR_update_descriptor(u64 ma, u64 desc)
298+{
299+ return _hypercall2(int, update_descriptor, ma, desc);
300+}
301+
302+static inline int
303+HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
304+ unsigned long flags)
305+{
306+ return _hypercall3(int, update_va_mapping, va, new_val.pte, flags);
307+}
308+
309+static inline int
310+HYPERVISOR_set_segment_base(int reg, unsigned long value)
311+{
312+ return _hypercall2(int, set_segment_base, reg, value);
313+}
314+
315+static inline void
316+MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
317+{
318+ mcl->op = __HYPERVISOR_fpu_taskswitch;
319+ mcl->args[0] = set;
320+
321+ trace_xen_mc_entry(mcl, 1);
322+}
323+
324+static inline void
325+MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
326+ pte_t new_val, unsigned long flags)
327+{
328+ mcl->op = __HYPERVISOR_update_va_mapping;
329+ mcl->args[0] = va;
330+ mcl->args[1] = new_val.pte;
331+ mcl->args[2] = flags;
332+
333+ trace_xen_mc_entry(mcl, 3);
334+}
335+
336+static inline void
337+MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
338+ struct desc_struct desc)
339+{
340+ mcl->op = __HYPERVISOR_update_descriptor;
341+ mcl->args[0] = maddr;
342+ mcl->args[1] = *(unsigned long *)&desc;
343+
344+ trace_xen_mc_entry(mcl, 2);
345+}
346+
347+static inline void
348+MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
349+ int count, int *success_count, domid_t domid)
350+{
351+ mcl->op = __HYPERVISOR_mmu_update;
352+ mcl->args[0] = (unsigned long)req;
353+ mcl->args[1] = count;
354+ mcl->args[2] = (unsigned long)success_count;
355+ mcl->args[3] = domid;
356+
357+ trace_xen_mc_entry(mcl, 4);
358+}
359+
360+static inline void
361+MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
362+ int *success_count, domid_t domid)
363+{
364+ mcl->op = __HYPERVISOR_mmuext_op;
365+ mcl->args[0] = (unsigned long)op;
366+ mcl->args[1] = count;
367+ mcl->args[2] = (unsigned long)success_count;
368+ mcl->args[3] = domid;
369+
370+ trace_xen_mc_entry(mcl, 4);
371+}
372+
373+static inline void
374+MULTI_stack_switch(struct multicall_entry *mcl,
375+ unsigned long ss, unsigned long esp)
376+{
377+ mcl->op = __HYPERVISOR_stack_switch;
378+ mcl->args[0] = ss;
379+ mcl->args[1] = esp;
380+
381+ trace_xen_mc_entry(mcl, 2);
382+}
383+#endif
384+
283385 static inline int
284386 HYPERVISOR_sched_op(int cmd, void *arg)
285387 {
@@ -308,26 +410,6 @@ HYPERVISOR_platform_op(struct xen_platform_op *op) · 22 unmodified lines
308410 return _hypercall1(int, platform_op, op);
309411 }
310412
311−static __always_inline int
312−HYPERVISOR_set_debugreg(int reg, unsigned long value)
313−{
314− return _hypercall2(int, set_debugreg, reg, value);
315−}
316−
317−static __always_inline unsigned long
318−HYPERVISOR_get_debugreg(int reg)
319−{
320− return _hypercall1(unsigned long, get_debugreg, reg);
321−}
322−
323−static inline int
324−HYPERVISOR_update_descriptor(u64 ma, u64 desc)
325−{
326− if (sizeof(u64) == sizeof(long))
327− return _hypercall2(int, update_descriptor, ma, desc);
328− return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
329−}
330−
331413 static inline long
332414 HYPERVISOR_memory_op(unsigned int cmd, void *arg)
333415 {
@@ -340,18 +422,6 @@ HYPERVISOR_multicall(void *call_list, uint32_t nr_calls) · 6 unmodified lines
340422 return _hypercall2(int, multicall, call_list, nr_calls);
341423 }
342424
343−static inline int
344−HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
345− unsigned long flags)
346−{
347− if (sizeof(new_val) == sizeof(long))
348− return _hypercall3(int, update_va_mapping, va,
349− new_val.pte, flags);
350− else
351− return _hypercall4(int, update_va_mapping, va,
352− new_val.pte, new_val.pte >> 32, flags);
353−}
354−
355425 static inline int
356426 HYPERVISOR_event_channel_op(int cmd, void *arg)
357427 {
@@ -394,14 +464,6 @@ HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args) · 36 unmodified lines
394464 return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
395465 }
396466
397−#ifdef CONFIG_X86_64
398−static inline int
399−HYPERVISOR_set_segment_base(int reg, unsigned long value)
400−{
401− return _hypercall2(int, set_segment_base, reg, value);
402−}
403−#endif
404−
405467 static inline int
406468 HYPERVISOR_suspend(unsigned long start_info_mfn)
407469 {
@@ -422,13 +484,6 @@ HYPERVISOR_hvm_op(int op, void *arg) · 14 unmodified lines
422484 return _hypercall2(unsigned long, hvm_op, op, arg);
423485 }
424486
425−static inline int
426−HYPERVISOR_tmem_op(
427− struct tmem_op *op)
428−{
429− return _hypercall1(int, tmem_op, op);
430−}
431−
432487 static inline int
433488 HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
434489 {
@@ -446,88 +501,4 @@ HYPERVISOR_dm_op( · 11 unmodified lines
446501 return ret;
447502 }
448503
449−static inline void
450−MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
451−{
452− mcl->op = __HYPERVISOR_fpu_taskswitch;
453− mcl->args[0] = set;
454−
455− trace_xen_mc_entry(mcl, 1);
456−}
457−
458−static inline void
459−MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
460− pte_t new_val, unsigned long flags)
461−{
462− mcl->op = __HYPERVISOR_update_va_mapping;
463− mcl->args[0] = va;
464− if (sizeof(new_val) == sizeof(long)) {
465− mcl->args[1] = new_val.pte;
466− mcl->args[2] = flags;
467− } else {
468− mcl->args[1] = new_val.pte;
469− mcl->args[2] = new_val.pte >> 32;
470− mcl->args[3] = flags;
471− }
472−
473− trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 3 : 4);
474−}
475−
476−static inline void
477−MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
478− struct desc_struct desc)
479−{
480− mcl->op = __HYPERVISOR_update_descriptor;
481− if (sizeof(maddr) == sizeof(long)) {
482− mcl->args[0] = maddr;
483− mcl->args[1] = *(unsigned long *)&desc;
484− } else {
485− u32 *p = (u32 *)&desc;
486−
487− mcl->args[0] = maddr;
488− mcl->args[1] = maddr >> 32;
489− mcl->args[2] = *p++;
490− mcl->args[3] = *p;
491− }
492−
493− trace_xen_mc_entry(mcl, sizeof(maddr) == sizeof(long) ? 2 : 4);
494−}
495−
496−static inline void
497−MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
498− int count, int *success_count, domid_t domid)
499−{
500− mcl->op = __HYPERVISOR_mmu_update;
501− mcl->args[0] = (unsigned long)req;
502− mcl->args[1] = count;
503− mcl->args[2] = (unsigned long)success_count;
504− mcl->args[3] = domid;
505−
506− trace_xen_mc_entry(mcl, 4);
507−}
508−
509−static inline void
510−MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
511− int *success_count, domid_t domid)
512−{
513− mcl->op = __HYPERVISOR_mmuext_op;
514− mcl->args[0] = (unsigned long)op;
515− mcl->args[1] = count;
516− mcl->args[2] = (unsigned long)success_count;
517− mcl->args[3] = domid;
518−
519− trace_xen_mc_entry(mcl, 4);
520−}
521−
522−static inline void
523−MULTI_stack_switch(struct multicall_entry *mcl,
524− unsigned long ss, unsigned long esp)
525−{
526− mcl->op = __HYPERVISOR_stack_switch;
527− mcl->args[0] = ss;
528− mcl->args[1] = esp;
529−
530− trace_xen_mc_entry(mcl, 2);
531−}
532−
533504 #endif /* _ASM_X86_XEN_HYPERCALL_H */
arch/x86/include/asm/xen/hypervisor.h+4−0
@@ -62,4 +62,8 @@ void xen_arch_register_cpu(int num); · 61 unmodified lines
6262 void xen_arch_unregister_cpu(int num);
6363 #endif
6464
65+#ifdef CONFIG_PVH
66+void __init xen_pvh_init(struct boot_params *boot_params);
67+#endif
68+
6569 #endif /* _ASM_X86_XEN_HYPERVISOR_H */
arch/x86/include/asm/xen/pci.h+0−19
@@ -22,25 +22,6 @@ static inline int __init pci_xen_initial_domain(void) · 21 unmodified lines
2222 return -1;
2323 }
2424 #endif
25−#ifdef CONFIG_XEN_DOM0
26−int xen_find_device_domain_owner(struct pci_dev *dev);
27−int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
28−int xen_unregister_device_domain_owner(struct pci_dev *dev);
29−#else
30−static inline int xen_find_device_domain_owner(struct pci_dev *dev)
31−{
32− return -1;
33−}
34−static inline int xen_register_device_domain_owner(struct pci_dev *dev,
35− uint16_t domain)
36−{
37− return -1;
38−}
39−static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
40−{
41− return -1;
42−}
43−#endif
4425
4526 #if defined(CONFIG_PCI_MSI)
4627 #if defined(CONFIG_PCI_XEN)
arch/x86/kernel/paravirt.c+12−1
@@ -46,6 +46,17 @@ asm (".pushsection .entry.text, \"ax\"\n" · 45 unmodified lines
4646 ".type _paravirt_nop, @function\n\t"
4747 ".popsection");
4848
49+/* stub always returning 0. */
50+asm (".pushsection .entry.text, \"ax\"\n"
51+ ".global paravirt_ret0\n"
52+ "paravirt_ret0:\n\t"
53+ "xor %" _ASM_AX ", %" _ASM_AX ";\n\t"
54+ "ret\n\t"
55+ ".size paravirt_ret0, . - paravirt_ret0\n\t"
56+ ".type paravirt_ret0, @function\n\t"
57+ ".popsection");
58+
59+
4960 void __init default_banner(void)
5061 {
5162 printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
@@ -53,7 +64,7 @@ void __init default_banner(void) · 1 unmodified line
5364 }
5465
5566 /* Undefined instruction for dealing with missing ops pointers. */
56−static void paravirt_BUG(void)
67+noinstr void paravirt_BUG(void)
5768 {
5869 BUG();
5970 }
arch/x86/pci/xen.c+1−75
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include <xen/features.h>
2525 #include <xen/events.h>
26+#include <xen/pci.h>
2627 #include <asm/xen/pci.h>
2728 #include <asm/xen/cpuid.h>
2829 #include <asm/apic.h>
@@ -585,78 +586,3 @@ int __init pci_xen_initial_domain(void) · 556 unmodified lines
585586 }
586587 #endif
587588
588−#ifdef CONFIG_XEN_DOM0
589−
590−struct xen_device_domain_owner {
591− domid_t domain;
592− struct pci_dev *dev;
593− struct list_head list;
594−};
595−
596−static DEFINE_SPINLOCK(dev_domain_list_spinlock);
597−static struct list_head dev_domain_list = LIST_HEAD_INIT(dev_domain_list);
598−
599−static struct xen_device_domain_owner *find_device(struct pci_dev *dev)
600−{
601− struct xen_device_domain_owner *owner;
602−
603− list_for_each_entry(owner, &dev_domain_list, list) {
604− if (owner->dev == dev)
605− return owner;
606− }
607− return NULL;
608−}
609−
610−int xen_find_device_domain_owner(struct pci_dev *dev)
611−{
612− struct xen_device_domain_owner *owner;
613− int domain = -ENODEV;
614−
615− spin_lock(&dev_domain_list_spinlock);
616− owner = find_device(dev);
617− if (owner)
618− domain = owner->domain;
619− spin_unlock(&dev_domain_list_spinlock);
620− return domain;
621−}
622−EXPORT_SYMBOL_GPL(xen_find_device_domain_owner);
623−
624−int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain)
625−{
626− struct xen_device_domain_owner *owner;
627−
628− owner = kzalloc(sizeof(struct xen_device_domain_owner), GFP_KERNEL);
629− if (!owner)
630− return -ENODEV;
631−
632− spin_lock(&dev_domain_list_spinlock);
633− if (find_device(dev)) {
634− spin_unlock(&dev_domain_list_spinlock);
635− kfree(owner);
636− return -EEXIST;
637− }
638− owner->domain = domain;
639− owner->dev = dev;
640− list_add_tail(&owner->list, &dev_domain_list);
641− spin_unlock(&dev_domain_list_spinlock);
642− return 0;
643−}
644−EXPORT_SYMBOL_GPL(xen_register_device_domain_owner);
645−
646−int xen_unregister_device_domain_owner(struct pci_dev *dev)
647−{
648− struct xen_device_domain_owner *owner;
649−
650− spin_lock(&dev_domain_list_spinlock);
651− owner = find_device(dev);
652− if (!owner) {
653− spin_unlock(&dev_domain_list_spinlock);
654− return -ENODEV;
655− }
656− list_del(&owner->list);
657− spin_unlock(&dev_domain_list_spinlock);
658− kfree(owner);
659− return 0;
660−}
661−EXPORT_SYMBOL_GPL(xen_unregister_device_domain_owner);
662−#endif /* CONFIG_XEN_DOM0 */
arch/x86/xen/enlighten.c+26−90
@@ -31,25 +31,10 @@ EXPORT_SYMBOL_GPL(hypercall_page); · 30 unmodified lines
3131 * Pointer to the xen_vcpu_info structure or
3232 * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info
3333 * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info
34− * but if the hypervisor supports VCPUOP_register_vcpu_info then it can point
35− * to xen_vcpu_info. The pointer is used in __xen_evtchn_do_upcall to
36− * acknowledge pending events.
37− * Also more subtly it is used by the patched version of irq enable/disable
38− * e.g. xen_irq_enable_direct and xen_iret in PV mode.
39− *
40− * The desire to be able to do those mask/unmask operations as a single
41− * instruction by using the per-cpu offset held in %gs is the real reason
42− * vcpu info is in a per-cpu pointer and the original reason for this
43− * hypercall.
44− *
34+ * but during boot it is switched to point to xen_vcpu_info.
35+ * The pointer is used in __xen_evtchn_do_upcall to acknowledge pending events.
4536 */
4637 DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
47−
48−/*
49− * Per CPU pages used if hypervisor supports VCPUOP_register_vcpu_info
50− * hypercall. This can be used both in PV and PVHVM mode. The structure
51− * overrides the default per_cpu(xen_vcpu, cpu) value.
52− */
5338 DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
5439
5540 /* Linux <-> Xen vCPU id mapping */
@@ -84,21 +69,6 @@ EXPORT_SYMBOL(xen_start_flags); · 28 unmodified lines
8469 */
8570 struct shared_info *HYPERVISOR_shared_info = &xen_dummy_shared_info;
8671
87−/*
88− * Flag to determine whether vcpu info placement is available on all
89− * VCPUs. We assume it is to start with, and then set it to zero on
90− * the first failure. This is because it can succeed on some VCPUs
91− * and not others, since it can involve hypervisor memory allocation,
92− * or because the guest failed to guarantee all the appropriate
93− * constraints on all VCPUs (ie buffer can't cross a page boundary).
94− *
95− * Note that any particular CPU may be using a placed vcpu structure,
96− * but we can only optimise if the all are.
97− *
98− * 0: not available, 1: available
99− */
100−int xen_have_vcpu_info_placement = 1;
101−
10272 static int xen_cpu_up_online(unsigned int cpu)
10373 {
10474 xen_init_lock_cpu(cpu);
@@ -124,10 +94,8 @@ int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int), · 19 unmodified lines
12494 return rc >= 0 ? 0 : rc;
12595 }
12696
127−static int xen_vcpu_setup_restore(int cpu)
97+static void xen_vcpu_setup_restore(int cpu)
12898 {
129− int rc = 0;
130−
13199 /* Any per_cpu(xen_vcpu) is stale, so reset it */
132100 xen_vcpu_info_reset(cpu);
133101
@@ -136,11 +104,8 @@ static int xen_vcpu_setup_restore(int cpu) · 2 unmodified lines
136104 * be handled by hotplug.
137105 */
138106 if (xen_pv_domain() ||
139− (xen_hvm_domain() && cpu_online(cpu))) {
140− rc = xen_vcpu_setup(cpu);
141− }
142−
143− return rc;
107+ (xen_hvm_domain() && cpu_online(cpu)))
108+ xen_vcpu_setup(cpu);
144109 }
145110
146111 /*
@@ -150,7 +115,7 @@ static int xen_vcpu_setup_restore(int cpu) · 3 unmodified lines
150115 */
151116 void xen_vcpu_restore(void)
152117 {
153− int cpu, rc;
118+ int cpu;
154119
155120 for_each_possible_cpu(cpu) {
156121 bool other_cpu = (cpu != smp_processor_id());
@@ -170,20 +135,9 @@ void xen_vcpu_restore(void) · 13 unmodified lines
170135 if (xen_pv_domain() || xen_feature(XENFEAT_hvm_safe_pvclock))
171136 xen_setup_runstate_info(cpu);
172137
173− rc = xen_vcpu_setup_restore(cpu);
174− if (rc)
175− pr_emerg_once("vcpu restore failed for cpu=%d err=%d. "
176− "System will hang.\n", cpu, rc);
177− /*
178− * In case xen_vcpu_setup_restore() fails, do not bring up the
179− * VCPU. This helps us avoid the resulting OOPS when the VCPU
180− * accesses pvclock_vcpu_time via xen_vcpu (which is NULL.)
181− * Note that this does not improve the situation much -- now the
182− * VM hangs instead of OOPSing -- with the VCPUs that did not
183− * fail, spinning in stop_machine(), waiting for the failed
184− * VCPUs to come up.
185− */
186− if (other_cpu && is_up && (rc == 0) &&
138+ xen_vcpu_setup_restore(cpu);
139+
140+ if (other_cpu && is_up &&
187141 HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL))
188142 BUG();
189143 }
@@ -200,7 +154,7 @@ void xen_vcpu_info_reset(int cpu) · 10 unmodified lines
200154 }
201155 }
202156
203−int xen_vcpu_setup(int cpu)
157+void xen_vcpu_setup(int cpu)
204158 {
205159 struct vcpu_register_vcpu_info info;
206160 int err;
@@ -221,44 +175,26 @@ int xen_vcpu_setup(int cpu) · 14 unmodified lines
221175 */
222176 if (xen_hvm_domain()) {
223177 if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu))
224− return 0;
178+ return;
225179 }
226180
227− if (xen_have_vcpu_info_placement) {
228− vcpup = &per_cpu(xen_vcpu_info, cpu);
229− info.mfn = arbitrary_virt_to_mfn(vcpup);
230− info.offset = offset_in_page(vcpup);
231−
232− /*
233− * Check to see if the hypervisor will put the vcpu_info
234− * structure where we want it, which allows direct access via
235− * a percpu-variable.
236− * N.B. This hypercall can _only_ be called once per CPU.
237− * Subsequent calls will error out with -EINVAL. This is due to
238− * the fact that hypervisor has no unregister variant and this
239− * hypercall does not allow to over-write info.mfn and
240− * info.offset.
241− */
242− err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info,
243− xen_vcpu_nr(cpu), &info);
244−
245− if (err) {
246− pr_warn_once("register_vcpu_info failed: cpu=%d err=%d\n",
247− cpu, err);
248− xen_have_vcpu_info_placement = 0;
249− } else {
250− /*
251− * This cpu is using the registered vcpu info, even if
252− * later ones fail to.
253− */
254− per_cpu(xen_vcpu, cpu) = vcpup;
255− }
256− }
181+ vcpup = &per_cpu(xen_vcpu_info, cpu);
182+ info.mfn = arbitrary_virt_to_mfn(vcpup);
183+ info.offset = offset_in_page(vcpup);
257184
258− if (!xen_have_vcpu_info_placement)
259− xen_vcpu_info_reset(cpu);
185+ /*
186+ * N.B. This hypercall can _only_ be called once per CPU.
187+ * Subsequent calls will error out with -EINVAL. This is due to
188+ * the fact that hypervisor has no unregister variant and this
189+ * hypercall does not allow to over-write info.mfn and
190+ * info.offset.
191+ */
192+ err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
193+ &info);
194+ if (err)
195+ panic("register_vcpu_info failed: cpu=%d err=%d\n", cpu, err);
260196
261− return ((per_cpu(xen_vcpu, cpu) == NULL) ? -ENODEV : 0);
197+ per_cpu(xen_vcpu, cpu) = vcpup;
262198 }
263199
264200 void __init xen_banner(void)
arch/x86/xen/enlighten_hvm.c+3−3
@@ -163,9 +163,9 @@ static int xen_cpu_up_prepare_hvm(unsigned int cpu) · 162 unmodified lines
163163 per_cpu(xen_vcpu_id, cpu) = cpu_acpi_id(cpu);
164164 else
165165 per_cpu(xen_vcpu_id, cpu) = cpu;
166− rc = xen_vcpu_setup(cpu);
167− if (rc || !xen_have_vector_callback)
168− return rc;
166+ xen_vcpu_setup(cpu);
167+ if (!xen_have_vector_callback)
168+ return 0;
169169
170170 if (xen_feature(XENFEAT_hvm_safe_pvclock))
171171 xen_setup_timer(cpu);
arch/x86/xen/enlighten_pv.c+5−30
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include <linux/export.h>
2828 #include <linux/mm.h>
2929 #include <linux/page-flags.h>
30−#include <linux/highmem.h>
3130 #include <linux/pci.h>
3231 #include <linux/gfp.h>
3332 #include <linux/edd.h>
@@ -993,31 +992,13 @@ void __init xen_setup_vcpu_info_placement(void) · 959 unmodified lines
993992 for_each_possible_cpu(cpu) {
994993 /* Set up direct vCPU id mapping for PV guests. */
995994 per_cpu(xen_vcpu_id, cpu) = cpu;
996−
997− /*
998− * xen_vcpu_setup(cpu) can fail -- in which case it
999− * falls back to the shared_info version for cpus
1000− * where xen_vcpu_nr(cpu) < MAX_VIRT_CPUS.
1001− *
1002− * xen_cpu_up_prepare_pv() handles the rest by failing
1003− * them in hotplug.
1004− */
1005− (void) xen_vcpu_setup(cpu);
995+ xen_vcpu_setup(cpu);
1006996 }
1007997
1008− /*
1009− * xen_vcpu_setup managed to place the vcpu_info within the
1010− * percpu area for all cpus, so make use of it.
1011− */
1012− if (xen_have_vcpu_info_placement) {
1013− pv_ops.irq.save_fl = __PV_IS_CALLEE_SAVE(xen_save_fl_direct);
1014− pv_ops.irq.irq_disable =
1015− __PV_IS_CALLEE_SAVE(xen_irq_disable_direct);
1016− pv_ops.irq.irq_enable =
1017− __PV_IS_CALLEE_SAVE(xen_irq_enable_direct);
1018− pv_ops.mmu.read_cr2 =
1019− __PV_IS_CALLEE_SAVE(xen_read_cr2_direct);
1020− }
998+ pv_ops.irq.save_fl = __PV_IS_CALLEE_SAVE(xen_save_fl_direct);
999+ pv_ops.irq.irq_disable = __PV_IS_CALLEE_SAVE(xen_irq_disable_direct);
1000+ pv_ops.irq.irq_enable = __PV_IS_CALLEE_SAVE(xen_irq_enable_direct);
1001+ pv_ops.mmu.read_cr2 = __PV_IS_CALLEE_SAVE(xen_read_cr2_direct);
10211002 }
10221003
10231004 static const struct pv_info xen_info __initconst = {
@@ -1247,12 +1228,6 @@ asmlinkage __visible void __init xen_start_kernel(void) · 223 unmodified lines
12471228 __supported_pte_mask &= ~_PAGE_GLOBAL;
12481229 __default_kernel_pte_mask &= ~_PAGE_GLOBAL;
12491230
1250− /*
1251− * Prevent page tables from being allocated in highmem, even
1252− * if CONFIG_HIGHPTE is enabled.
1253− */
1254− __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
1255−
12561231 /* Get mfn list */
12571232 xen_build_dynamic_phys_to_machine();
12581233
arch/x86/xen/irq.c+4−58
@@ -24,60 +24,6 @@ noinstr void xen_force_evtchn_callback(void) · 23 unmodified lines
2424 (void)HYPERVISOR_xen_version(0, NULL);
2525 }
2626
27−asmlinkage __visible noinstr unsigned long xen_save_fl(void)
28−{
29− struct vcpu_info *vcpu;
30− unsigned long flags;
31−
32− vcpu = this_cpu_read(xen_vcpu);
33−
34− /* flag has opposite sense of mask */
35− flags = !vcpu->evtchn_upcall_mask;
36−
37− /* convert to IF type flag
38− -0 -> 0x00000000
39− -1 -> 0xffffffff
40− */
41− return (-flags) & X86_EFLAGS_IF;
42−}
43−__PV_CALLEE_SAVE_REGS_THUNK(xen_save_fl, ".noinstr.text");
44−
45−asmlinkage __visible noinstr void xen_irq_disable(void)
46−{
47− /* There's a one instruction preempt window here. We need to
48− make sure we're don't switch CPUs between getting the vcpu
49− pointer and updating the mask. */
50− preempt_disable();
51− this_cpu_read(xen_vcpu)->evtchn_upcall_mask = 1;
52− preempt_enable_no_resched();
53−}
54−__PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable, ".noinstr.text");
55−
56−asmlinkage __visible noinstr void xen_irq_enable(void)
57−{
58− struct vcpu_info *vcpu;
59−
60− /*
61− * We may be preempted as soon as vcpu->evtchn_upcall_mask is
62− * cleared, so disable preemption to ensure we check for
63− * events on the VCPU we are still running on.
64− */
65− preempt_disable();
66−
67− vcpu = this_cpu_read(xen_vcpu);
68− vcpu->evtchn_upcall_mask = 0;
69−
70− /* Doesn't matter if we get preempted here, because any
71− pending event will get dealt with anyway. */
72−
73− barrier(); /* unmask then check (avoid races) */
74− if (unlikely(vcpu->evtchn_upcall_pending))
75− xen_force_evtchn_callback();
76−
77− preempt_enable();
78−}
79−__PV_CALLEE_SAVE_REGS_THUNK(xen_irq_enable, ".noinstr.text");
80−
8127 static void xen_safe_halt(void)
8228 {
8329 /* Blocking includes an implicit local_irq_enable(). */
@@ -96,10 +42,10 @@ static void xen_halt(void) · 12 unmodified lines
9642
9743 static const typeof(pv_ops) xen_irq_ops __initconst = {
9844 .irq = {
99−
100− .save_fl = PV_CALLEE_SAVE(xen_save_fl),
101− .irq_disable = PV_CALLEE_SAVE(xen_irq_disable),
102− .irq_enable = PV_CALLEE_SAVE(xen_irq_enable),
45+ /* Initial interrupt flag handling only called while interrupts off. */
46+ .save_fl = __PV_IS_CALLEE_SAVE(paravirt_ret0),
47+ .irq_disable = __PV_IS_CALLEE_SAVE(paravirt_nop),
48+ .irq_enable = __PV_IS_CALLEE_SAVE(paravirt_BUG),
10349
10450 .safe_halt = xen_safe_halt,
10551 .halt = xen_halt,
arch/x86/xen/mmu_pv.c+37−15
@@ -41,7 +41,6 @@ · 40 unmodified lines
4141 * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007
4242 */
4343 #include <linux/sched/mm.h>
44−#include <linux/highmem.h>
4544 #include <linux/debugfs.h>
4645 #include <linux/bug.h>
4746 #include <linux/vmalloc.h>
@@ -86,8 +85,10 @@ · 38 unmodified lines
8685 #include "mmu.h"
8786 #include "debugfs.h"
8887
88+#ifdef CONFIG_X86_VSYSCALL_EMULATION
8989 /* l3 pud for userspace vsyscall mapping */
9090 static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
91+#endif
9192
9293 /*
9394 * Protects atomic reservation decrease/increase against concurrent increases.
@@ -241,9 +242,11 @@ static void xen_set_pmd(pmd_t *ptr, pmd_t val) · 147 unmodified lines
241242 * Associate a virtual page frame with a given physical page frame
242243 * and protection flags for that frame.
243244 */
244−void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
245+void __init set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
245246 {
246− set_pte_vaddr(vaddr, mfn_pte(mfn, flags));
247+ if (HYPERVISOR_update_va_mapping(vaddr, mfn_pte(mfn, flags),
248+ UVMF_INVLPG))
249+ BUG();
247250 }
248251
249252 static bool xen_batched_set_pte(pte_t *ptep, pte_t pteval)
@@ -789,7 +792,9 @@ static void __init xen_mark_pinned(struct mm_struct *mm, struct page *page, · 539 unmodified lines
789792 static void __init xen_after_bootmem(void)
790793 {
791794 static_branch_enable(&xen_struct_pages_ready);
795+#ifdef CONFIG_X86_VSYSCALL_EMULATION
792796 SetPagePinned(virt_to_page(level3_user_vsyscall));
797+#endif
793798 xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP);
794799 }
795800
@@ -1192,6 +1197,13 @@ static void __init xen_pagetable_p2m_setup(void) · 396 unmodified lines
11921197
11931198 static void __init xen_pagetable_init(void)
11941199 {
1200+ /*
1201+ * The majority of further PTE writes is to pagetables already
1202+ * announced as such to Xen. Hence it is more efficient to use
1203+ * hypercalls for these updates.
1204+ */
1205+ pv_ops.mmu.set_pte = __xen_set_pte;
1206+
11951207 paging_init();
11961208 xen_post_allocator_init();
11971209
@@ -1421,10 +1433,18 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd) · 223 unmodified lines
14211433 *
14221434 * Many of these PTE updates are done on unpinned and writable pages
14231435 * and doing a hypercall for these is unnecessary and expensive. At
1424− * this point it is not possible to tell if a page is pinned or not,
1425− * so always write the PTE directly and rely on Xen trapping and
1436+ * this point it is rarely possible to tell if a page is pinned, so
1437+ * mostly write the PTE directly and rely on Xen trapping and
14261438 * emulating any updates as necessary.
14271439 */
1440+static void __init xen_set_pte_init(pte_t *ptep, pte_t pte)
1441+{
1442+ if (unlikely(is_early_ioremap_ptep(ptep)))
1443+ __xen_set_pte(ptep, pte);
1444+ else
1445+ native_set_pte(ptep, pte);
1446+}
1447+
14281448 __visible pte_t xen_make_pte_init(pteval_t pte)
14291449 {
14301450 unsigned long pfn;
@@ -1446,11 +1466,6 @@ __visible pte_t xen_make_pte_init(pteval_t pte) · 15 unmodified lines
14461466 }
14471467 PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte_init);
14481468
1449−static void __init xen_set_pte_init(pte_t *ptep, pte_t pte)
1450−{
1451− __xen_set_pte(ptep, pte);
1452−}
1453−
14541469 /* Early in boot, while setting up the initial pagetable, assume
14551470 everything is pinned. */
14561471 static void __init xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
@@ -1750,7 +1765,6 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) · 293 unmodified lines
17501765 set_page_prot(init_top_pgt, PAGE_KERNEL_RO);
17511766 set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
17521767 set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
1753− set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
17541768 set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);
17551769 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
17561770 set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
@@ -1767,6 +1781,13 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) · 10 unmodified lines
17671781 /* Unpin Xen-provided one */
17681782 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
17691783
1784+#ifdef CONFIG_X86_VSYSCALL_EMULATION
1785+ /* Pin user vsyscall L3 */
1786+ set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
1787+ pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE,
1788+ PFN_DOWN(__pa_symbol(level3_user_vsyscall)));
1789+#endif
1790+
17701791 /*
17711792 * At this stage there can be no user pgd, and no page structure to
17721793 * attach it to, so make sure we just set kernel pgd.
@@ -1999,6 +2020,7 @@ static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss; · 226 unmodified lines
19992020 static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot)
20002021 {
20012022 pte_t pte;
2023+ unsigned long vaddr;
20022024
20032025 phys >>= PAGE_SHIFT;
20042026
@@ -2039,15 +2061,15 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) · 34 unmodified lines
20392061 break;
20402062 }
20412063
2042− __native_set_fixmap(idx, pte);
2064+ vaddr = __fix_to_virt(idx);
2065+ if (HYPERVISOR_update_va_mapping(vaddr, pte, UVMF_INVLPG))
2066+ BUG();
20432067
20442068 #ifdef CONFIG_X86_VSYSCALL_EMULATION
20452069 /* Replicate changes to map the vsyscall page into the user
20462070 pagetable vsyscall mapping. */
2047− if (idx == VSYSCALL_PAGE) {
2048− unsigned long vaddr = __fix_to_virt(idx);
2071+ if (idx == VSYSCALL_PAGE)
20492072 set_pte_vaddr_pud(level3_user_vsyscall, vaddr, pte);
2050− }
20512073 #endif
20522074 }
20532075
arch/x86/xen/setup.c+3−7
@@ -306,10 +306,6 @@ static void __init xen_update_mem_tables(unsigned long pfn, unsigned long mfn) · 305 unmodified lines
306306 BUG();
307307 }
308308
309− /* Update kernel mapping, but not for highmem. */
310− if (pfn >= PFN_UP(__pa(high_memory - 1)))
311− return;
312−
313309 if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT),
314310 mfn_pte(mfn, PAGE_KERNEL), 0)) {
315311 WARN(1, "Failed to update kernel mapping for mfn=%ld pfn=%ld\n",
@@ -429,13 +425,13 @@ static unsigned long __init xen_set_identity_and_remap_chunk( · 113 unmodified lines
429425 }
430426
431427 /*
432− * If the PFNs are currently mapped, the VA mapping also needs
433− * to be updated to be 1:1.
428+ * If the PFNs are currently mapped, their VA mappings need to be
429+ * zapped.
434430 */
435431 for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++)
436432 (void)HYPERVISOR_update_va_mapping(
437433 (unsigned long)__va(pfn << PAGE_SHIFT),
438− mfn_pte(pfn, PAGE_KERNEL_IO), 0);
434+ native_make_pte(0), 0);
439435
440436 return remap_pfn;
441437 }
arch/x86/xen/smp.c+0−28
@@ -121,34 +121,10 @@ int xen_smp_intr_init(unsigned int cpu) · 120 unmodified lines
121121
122122 void __init xen_smp_cpus_done(unsigned int max_cpus)
123123 {
124− int cpu, rc, count = 0;
125−
126124 if (xen_hvm_domain())
127125 native_smp_cpus_done(max_cpus);
128126 else
129127 calculate_max_logical_packages();
130−
131− if (xen_have_vcpu_info_placement)
132− return;
133−
134− for_each_online_cpu(cpu) {
135− if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS)
136− continue;
137−
138− rc = remove_cpu(cpu);
139−
140− if (rc == 0) {
141− /*
142− * Reset vcpu_info so this cpu cannot be onlined again.
143− */
144− xen_vcpu_info_reset(cpu);
145− count++;
146− } else {
147− pr_warn("%s: failed to bring CPU %d down, error %d\n",
148− __func__, cpu, rc);
149− }
150− }
151− WARN(count, "%s: brought %d CPUs offline\n", __func__, count);
152128 }
153129
154130 void xen_smp_send_reschedule(int cpu)
@@ -268,20 +244,16 @@ void xen_send_IPI_allbutself(int vector) · 113 unmodified lines
268244
269245 static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
270246 {
271− irq_enter();
272247 generic_smp_call_function_interrupt();
273248 inc_irq_stat(irq_call_count);
274− irq_exit();
275249
276250 return IRQ_HANDLED;
277251 }
278252
279253 static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)
280254 {
281− irq_enter();
282255 generic_smp_call_function_single_interrupt();
283256 inc_irq_stat(irq_call_count);
284− irq_exit();
285257
286258 return IRQ_HANDLED;
287259 }
arch/x86/xen/smp_pv.c+0−2
@@ -458,10 +458,8 @@ static void xen_pv_stop_other_cpus(int wait) · 457 unmodified lines
458458
459459 static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id)
460460 {
461− irq_enter();
462461 irq_work_run();
463462 inc_irq_stat(apic_irq_work_irqs);
464− irq_exit();
465463
466464 return IRQ_HANDLED;
467465 }
arch/x86/xen/xen-head.S+6−6
@@ -45,13 +45,13 @@ SYM_CODE_START(startup_xen) · 44 unmodified lines
4545
4646 /* Clear .bss */
4747 xor %eax,%eax
48− mov $__bss_start, %_ASM_DI
49− mov $__bss_stop, %_ASM_CX
50− sub %_ASM_DI, %_ASM_CX
51− shr $__ASM_SEL(2, 3), %_ASM_CX
52− rep __ASM_SIZE(stos)
48+ mov $__bss_start, %rdi
49+ mov $__bss_stop, %rcx
50+ sub %rdi, %rcx
51+ shr $3, %rcx
52+ rep stosq
5353
54− mov %_ASM_SI, xen_start_info
54+ mov %rsi, xen_start_info
5555 mov initial_stack(%rip), %rsp
5656
5757 /* Set up %gs.
arch/x86/xen/xen-ops.h+1−3
@@ -76,9 +76,7 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id); · 75 unmodified lines
7676
7777 bool xen_vcpu_stolen(int vcpu);
7878
79−extern int xen_have_vcpu_info_placement;
80−
81−int xen_vcpu_setup(int cpu);
79+void xen_vcpu_setup(int cpu);
8280 void xen_vcpu_info_reset(int cpu);
8381 void xen_setup_vcpu_info_placement(void);
8482
drivers/xen/Kconfig+24−0
@@ -181,10 +181,34 @@ config SWIOTLB_XEN · 180 unmodified lines
181181 select DMA_OPS
182182 select SWIOTLB
183183
184+config XEN_PCI_STUB
185+ bool
186+
187+config XEN_PCIDEV_STUB
188+ tristate "Xen PCI-device stub driver"
189+ depends on PCI && !X86 && XEN
190+ depends on XEN_BACKEND
191+ select XEN_PCI_STUB
192+ default m
193+ help
194+ The PCI device stub driver provides limited version of the PCI
195+ device backend driver without para-virtualized support for guests.
196+ If you select this to be a module, you will need to make sure no
197+ other driver has bound to the device(s) you want to make visible to
198+ other guests.
199+
200+ The "hide" parameter (only applicable if backend driver is compiled
201+ into the kernel) allows you to bind the PCI devices to this module
202+ from the default device drivers. The argument is the list of PCI BDFs:
203+ xen-pciback.hide=(03:00.0)(04:00.0)
204+
205+ If in doubt, say m.
206+
184207 config XEN_PCIDEV_BACKEND
185208 tristate "Xen PCI-device backend driver"
186209 depends on PCI && X86 && XEN
187210 depends on XEN_BACKEND
211+ select XEN_PCI_STUB
188212 default m
189213 help
190214 The PCI device backend driver allows the kernel to export arbitrary
drivers/xen/Makefile+1−1
@@ -24,7 +24,7 @@ obj-$(CONFIG_XEN_SYS_HYPERVISOR) += sys-hypervisor.o · 23 unmodified lines
2424 obj-$(CONFIG_XEN_PVHVM_GUEST) += platform-pci.o
2525 obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o
2626 obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o
27−obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/
27+obj-$(CONFIG_XEN_PCI_STUB) += xen-pciback/
2828 obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o
2929 obj-$(CONFIG_XEN_ACPI_PROCESSOR) += xen-acpi-processor.o
3030 obj-$(CONFIG_XEN_EFI) += efi.o
drivers/xen/balloon.c+78−35
@@ -58,6 +58,7 @@ · 57 unmodified lines
5858 #include <linux/percpu-defs.h>
5959 #include <linux/slab.h>
6060 #include <linux/sysctl.h>
61+#include <linux/moduleparam.h>
6162
6263 #include <asm/page.h>
6364 #include <asm/tlb.h>
@@ -73,9 +74,14 @@ · 9 unmodified lines
7374 #include <xen/page.h>
7475 #include <xen/mem-reservation.h>
7576
76−static int xen_hotplug_unpopulated;
77+#undef MODULE_PARAM_PREFIX
78+#define MODULE_PARAM_PREFIX "xen."
79+
80+static uint __read_mostly balloon_boot_timeout = 180;
81+module_param(balloon_boot_timeout, uint, 0444);
7782
7883 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
84+static int xen_hotplug_unpopulated;
7985
8086 static struct ctl_table balloon_table[] = {
8187 {
@@ -108,6 +114,8 @@ static struct ctl_table xen_root[] = { · 26 unmodified lines
108114 { }
109115 };
110116
117+#else
118+#define xen_hotplug_unpopulated 0
111119 #endif
112120
113121 /*
@@ -125,12 +133,12 @@ static struct ctl_table xen_root[] = { · 11 unmodified lines
125133 * BP_ECANCELED: error, balloon operation canceled.
126134 */
127135
128−enum bp_state {
136+static enum bp_state {
129137 BP_DONE,
130138 BP_WAIT,
131139 BP_EAGAIN,
132140 BP_ECANCELED
133−};
141+} balloon_state = BP_DONE;
134142
135143 /* Main waiting point for xen-balloon thread. */
136144 static DECLARE_WAIT_QUEUE_HEAD(balloon_thread_wq);
@@ -199,18 +207,15 @@ static struct page *balloon_next_page(struct page *page) · 62 unmodified lines
199207 return list_entry(next, struct page, lru);
200208 }
201209
202−static enum bp_state update_schedule(enum bp_state state)
210+static void update_schedule(void)
203211 {
204− if (state == BP_WAIT)
205− return BP_WAIT;
206−
207− if (state == BP_ECANCELED)
208− return BP_ECANCELED;
212+ if (balloon_state == BP_WAIT || balloon_state == BP_ECANCELED)
213+ return;
209214
210− if (state == BP_DONE) {
215+ if (balloon_state == BP_DONE) {
211216 balloon_stats.schedule_delay = 1;
212217 balloon_stats.retry_count = 1;
213− return BP_DONE;
218+ return;
214219 }
215220
216221 ++balloon_stats.retry_count;
@@ -219,7 +224,8 @@ static enum bp_state update_schedule(enum bp_state state) · 2 unmodified lines
219224 balloon_stats.retry_count > balloon_stats.max_retry_count) {
220225 balloon_stats.schedule_delay = 1;
221226 balloon_stats.retry_count = 1;
222− return BP_ECANCELED;
227+ balloon_state = BP_ECANCELED;
228+ return;
223229 }
224230
225231 balloon_stats.schedule_delay <<= 1;
@@ -227,7 +233,7 @@ static enum bp_state update_schedule(enum bp_state state) · 1 unmodified line
227233 if (balloon_stats.schedule_delay > balloon_stats.max_schedule_delay)
228234 balloon_stats.schedule_delay = balloon_stats.max_schedule_delay;
229235
230− return BP_EAGAIN;
236+ balloon_state = BP_EAGAIN;
231237 }
232238
233239 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
@@ -494,9 +500,9 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) · 260 unmodified lines
494500 * Stop waiting if either state is BP_DONE and ballooning action is
495501 * needed, or if the credit has changed while state is not BP_DONE.
496502 */
497−static bool balloon_thread_cond(enum bp_state state, long credit)
503+static bool balloon_thread_cond(long credit)
498504 {
499− if (state == BP_DONE)
505+ if (balloon_state == BP_DONE)
500506 credit = 0;
501507
502508 return current_credit() != credit || kthread_should_stop();
@@ -510,13 +516,12 @@ static bool balloon_thread_cond(enum bp_state state, long credit) · 7 unmodified lines
510516 */
511517 static int balloon_thread(void *unused)
512518 {
513− enum bp_state state = BP_DONE;
514519 long credit;
515520 unsigned long timeout;
516521
517522 set_freezable();
518523 for (;;) {
519− switch (state) {
524+ switch (balloon_state) {
520525 case BP_DONE:
521526 case BP_ECANCELED:
522527 timeout = 3600 * HZ;
@@ -532,7 +537,7 @@ static int balloon_thread(void *unused) · 9 unmodified lines
532537 credit = current_credit();
533538
534539 wait_event_freezable_timeout(balloon_thread_wq,
535− balloon_thread_cond(state, credit), timeout);
540+ balloon_thread_cond(credit), timeout);
536541
537542 if (kthread_should_stop())
538543 return 0;
@@ -543,22 +548,23 @@ static int balloon_thread(void *unused) · 4 unmodified lines
543548
544549 if (credit > 0) {
545550 if (balloon_is_inflated())
546− state = increase_reservation(credit);
551+ balloon_state = increase_reservation(credit);
547552 else
548− state = reserve_additional_memory();
553+ balloon_state = reserve_additional_memory();
549554 }
550555
551556 if (credit < 0) {
552557 long n_pages;
553558
554559 n_pages = min(-credit, si_mem_available());
555− state = decrease_reservation(n_pages, GFP_BALLOON);
556− if (state == BP_DONE && n_pages != -credit &&
560+ balloon_state = decrease_reservation(n_pages,
561+ GFP_BALLOON);
562+ if (balloon_state == BP_DONE && n_pages != -credit &&
557563 n_pages < totalreserve_pages)
558− state = BP_EAGAIN;
564+ balloon_state = BP_EAGAIN;
559565 }
560566
561− state = update_schedule(state);
567+ update_schedule();
562568
563569 mutex_unlock(&balloon_mutex);
564570
@@ -575,7 +581,8 @@ void balloon_set_new_target(unsigned long target) · 10 unmodified lines
575581 }
576582 EXPORT_SYMBOL_GPL(balloon_set_new_target);
577583
578−static int add_ballooned_pages(int nr_pages)
584+#ifndef CONFIG_XEN_UNPOPULATED_ALLOC
585+static int add_ballooned_pages(unsigned int nr_pages)
579586 {
580587 enum bp_state st;
581588
@@ -603,14 +610,14 @@ static int add_ballooned_pages(int nr_pages) · 21 unmodified lines
603610 }
604611
605612 /**
606− * alloc_xenballooned_pages - get pages that have been ballooned out
613+ * xen_alloc_unpopulated_pages - get pages that have been ballooned out
607614 * @nr_pages: Number of pages to get
608615 * @pages: pages returned
609616 * @return 0 on success, error otherwise
610617 */
611−int alloc_xenballooned_pages(int nr_pages, struct page **pages)
618+int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages)
612619 {
613− int pgno = 0;
620+ unsigned int pgno = 0;
614621 struct page *page;
615622 int ret;
616623
@@ -645,7 +652,7 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages) · 28 unmodified lines
645652 return 0;
646653 out_undo:
647654 mutex_unlock(&balloon_mutex);
648− free_xenballooned_pages(pgno, pages);
655+ xen_free_unpopulated_pages(pgno, pages);
649656 /*
650657 * NB: free_xenballooned_pages will only subtract pgno pages, but since
651658 * target_unpopulated is incremented with nr_pages at the start we need
@@ -654,16 +661,16 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages) · 2 unmodified lines
654661 balloon_stats.target_unpopulated -= nr_pages - pgno;
655662 return ret;
656663 }
657−EXPORT_SYMBOL(alloc_xenballooned_pages);
664+EXPORT_SYMBOL(xen_alloc_unpopulated_pages);
658665
659666 /**
660− * free_xenballooned_pages - return pages retrieved with get_ballooned_pages
667+ * xen_free_unpopulated_pages - return pages retrieved with get_ballooned_pages
661668 * @nr_pages: Number of pages
662669 * @pages: pages to return
663670 */
664−void free_xenballooned_pages(int nr_pages, struct page **pages)
671+void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages)
665672 {
666− int i;
673+ unsigned int i;
667674
668675 mutex_lock(&balloon_mutex);
669676
@@ -680,9 +687,9 @@ void free_xenballooned_pages(int nr_pages, struct page **pages) · 10 unmodified lines
680687
681688 mutex_unlock(&balloon_mutex);
682689 }
683−EXPORT_SYMBOL(free_xenballooned_pages);
690+EXPORT_SYMBOL(xen_free_unpopulated_pages);
684691
685−#if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC)
692+#if defined(CONFIG_XEN_PV)
686693 static void __init balloon_add_region(unsigned long start_pfn,
687694 unsigned long pages)
688695 {
@@ -705,6 +712,7 @@ static void __init balloon_add_region(unsigned long start_pfn, · 16 unmodified lines
705712 balloon_stats.total_pages += extra_pfn_end - start_pfn;
706713 }
707714 #endif
715+#endif
708716
709717 static int __init balloon_init(void)
710718 {
@@ -765,3 +773,38 @@ static int __init balloon_init(void) · 54 unmodified lines
765773 return 0;
766774 }
767775 subsys_initcall(balloon_init);
776+
777+static int __init balloon_wait_finish(void)
778+{
779+ long credit, last_credit = 0;
780+ unsigned long last_changed = 0;
781+
782+ if (!xen_domain())
783+ return -ENODEV;
784+
785+ /* PV guests don't need to wait. */
786+ if (xen_pv_domain() || !current_credit())
787+ return 0;
788+
789+ pr_notice("Waiting for initial ballooning down having finished.\n");
790+
791+ while ((credit = current_credit()) < 0) {
792+ if (credit != last_credit) {
793+ last_changed = jiffies;
794+ last_credit = credit;
795+ }
796+ if (balloon_state == BP_ECANCELED) {
797+ pr_warn_once("Initial ballooning failed, %ld pages need to be freed.\n",
798+ -credit);
799+ if (jiffies - last_changed >= HZ * balloon_boot_timeout)
800+ panic("Initial ballooning failed!\n");
801+ }
802+
803+ schedule_timeout_interruptible(HZ / 10);
804+ }
805+
806+ pr_notice("Initial ballooning down finished.\n");
807+
808+ return 0;
809+}
810+late_initcall_sync(balloon_wait_finish);
drivers/xen/mem-reservation.c+10−17
@@ -35,6 +35,7 @@ void __xenmem_reservation_va_mapping_update(unsigned long count, · 34 unmodified lines
3535 for (i = 0; i < count; i++) {
3636 struct page *page = pages[i];
3737 unsigned long pfn = page_to_pfn(page);
38+ int ret;
3839
3940 BUG_ON(!page);
4041
@@ -46,16 +47,10 @@ void __xenmem_reservation_va_mapping_update(unsigned long count, · 5 unmodified lines
4647
4748 set_phys_to_machine(pfn, frames[i]);
4849
49− /* Link back into the page tables if not highmem. */
50− if (!PageHighMem(page)) {
51− int ret;
52−
53− ret = HYPERVISOR_update_va_mapping(
54− (unsigned long)__va(pfn << PAGE_SHIFT),
55− mfn_pte(frames[i], PAGE_KERNEL),
56− 0);
57− BUG_ON(ret);
58− }
50+ ret = HYPERVISOR_update_va_mapping(
51+ (unsigned long)__va(pfn << PAGE_SHIFT),
52+ mfn_pte(frames[i], PAGE_KERNEL), 0);
53+ BUG_ON(ret);
5954 }
6055 }
6156 EXPORT_SYMBOL_GPL(__xenmem_reservation_va_mapping_update);
@@ -68,6 +63,7 @@ void __xenmem_reservation_va_mapping_reset(unsigned long count, · 6 unmodified lines
6863 for (i = 0; i < count; i++) {
6964 struct page *page = pages[i];
7065 unsigned long pfn = page_to_pfn(page);
66+ int ret;
7167
7268 /*
7369 * We don't support PV MMU when Linux and Xen are using
@@ -75,14 +71,11 @@ void __xenmem_reservation_va_mapping_reset(unsigned long count, · 1 unmodified line
7571 */
7672 BUILD_BUG_ON(XEN_PAGE_SIZE != PAGE_SIZE);
7773
78− if (!PageHighMem(page)) {
79− int ret;
74+ ret = HYPERVISOR_update_va_mapping(
75+ (unsigned long)__va(pfn << PAGE_SHIFT),
76+ __pte_ma(0), 0);
77+ BUG_ON(ret);
8078
81− ret = HYPERVISOR_update_va_mapping(
82− (unsigned long)__va(pfn << PAGE_SHIFT),
83− __pte_ma(0), 0);
84− BUG_ON(ret);
85− }
8679 __set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
8780 }
8881 }
drivers/xen/pci.c+76−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/pci.h>
99 #include <linux/acpi.h>
1010 #include <linux/pci-acpi.h>
11+#include <xen/pci.h>
1112 #include <xen/xen.h>
1213 #include <xen/interface/physdev.h>
1314 #include <xen/interface/xen.h>
@@ -254,3 +255,78 @@ static int xen_mcfg_late(void) · 240 unmodified lines
254255 return 0;
255256 }
256257 #endif
258+
259+#ifdef CONFIG_XEN_DOM0
260+struct xen_device_domain_owner {
261+ domid_t domain;
262+ struct pci_dev *dev;
263+ struct list_head list;
264+};
265+
266+static DEFINE_SPINLOCK(dev_domain_list_spinlock);
267+static struct list_head dev_domain_list = LIST_HEAD_INIT(dev_domain_list);
268+
269+static struct xen_device_domain_owner *find_device(struct pci_dev *dev)
270+{
271+ struct xen_device_domain_owner *owner;
272+
273+ list_for_each_entry(owner, &dev_domain_list, list) {
274+ if (owner->dev == dev)
275+ return owner;
276+ }
277+ return NULL;
278+}
279+
280+int xen_find_device_domain_owner(struct pci_dev *dev)
281+{
282+ struct xen_device_domain_owner *owner;
283+ int domain = -ENODEV;
284+
285+ spin_lock(&dev_domain_list_spinlock);
286+ owner = find_device(dev);
287+ if (owner)
288+ domain = owner->domain;
289+ spin_unlock(&dev_domain_list_spinlock);
290+ return domain;
291+}
292+EXPORT_SYMBOL_GPL(xen_find_device_domain_owner);
293+
294+int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain)
295+{
296+ struct xen_device_domain_owner *owner;
297+
298+ owner = kzalloc(sizeof(struct xen_device_domain_owner), GFP_KERNEL);
299+ if (!owner)
300+ return -ENODEV;
301+
302+ spin_lock(&dev_domain_list_spinlock);
303+ if (find_device(dev)) {
304+ spin_unlock(&dev_domain_list_spinlock);
305+ kfree(owner);
306+ return -EEXIST;
307+ }
308+ owner->domain = domain;
309+ owner->dev = dev;
310+ list_add_tail(&owner->list, &dev_domain_list);
311+ spin_unlock(&dev_domain_list_spinlock);
312+ return 0;
313+}
314+EXPORT_SYMBOL_GPL(xen_register_device_domain_owner);
315+
316+int xen_unregister_device_domain_owner(struct pci_dev *dev)
317+{
318+ struct xen_device_domain_owner *owner;
319+
320+ spin_lock(&dev_domain_list_spinlock);
321+ owner = find_device(dev);
322+ if (!owner) {
323+ spin_unlock(&dev_domain_list_spinlock);
324+ return -ENODEV;
325+ }
326+ list_del(&owner->list);
327+ spin_unlock(&dev_domain_list_spinlock);
328+ kfree(owner);
329+ return 0;
330+}
331+EXPORT_SYMBOL_GPL(xen_unregister_device_domain_owner);
332+#endif
drivers/xen/pvcalls-back.c+0−1
@@ -465,7 +465,6 @@ static int pvcalls_back_release_passive(struct xenbus_device *dev, · 464 unmodified lines
465465 write_unlock_bh(&mappass->sock->sk->sk_callback_lock);
466466 }
467467 sock_release(mappass->sock);
468− flush_workqueue(mappass->wq);
469468 destroy_workqueue(mappass->wq);
470469 kfree(mappass);
471470
drivers/xen/xen-acpi-processor.c+3−3
@@ -450,7 +450,7 @@ static struct acpi_processor_performance __percpu *acpi_perf_data; · 449 unmodified lines
450450
451451 static void free_acpi_perf_data(void)
452452 {
453− unsigned int i;
453+ int i;
454454
455455 /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
456456 for_each_possible_cpu(i)
@@ -462,7 +462,7 @@ static void free_acpi_perf_data(void) · 5 unmodified lines
462462 static int xen_upload_processor_pm_data(void)
463463 {
464464 struct acpi_processor *pr_backup = NULL;
465− unsigned int i;
465+ int i;
466466 int rc = 0;
467467
468468 pr_info("Uploading Xen processor PM info\n");
@@ -518,7 +518,7 @@ static struct syscore_ops xap_syscore_ops = { · 49 unmodified lines
518518
519519 static int __init xen_acpi_processor_init(void)
520520 {
521− unsigned int i;
521+ int i;
522522 int rc;
523523
524524 if (!xen_initial_domain())
drivers/xen/xen-pciback/Makefile+7−0
@@ -1,5 +1,12 @@
11 # SPDX-License-Identifier: GPL-2.0
2+
3+# N.B. The below cannot be expressed with a single line using
4+# CONFIG_XEN_PCI_STUB as it always remains in "y" state,
5+# thus preventing the driver to be built as a module.
6+# Please note, that CONFIG_XEN_PCIDEV_BACKEND and
7+# CONFIG_XEN_PCIDEV_STUB are mutually exclusive.
28 obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o
9+obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o
310
411 xen-pciback-y := pci_stub.o pciback_ops.o xenbus.o
512 xen-pciback-y += conf_space.o conf_space_header.o \
drivers/xen/xen-pciback/conf_space_capability.c+1−1
@@ -160,7 +160,7 @@ static void *pm_ctrl_init(struct pci_dev *dev, int offset) · 159 unmodified lines
160160 }
161161
162162 out:
163− return ERR_PTR(err);
163+ return err ? ERR_PTR(err) : NULL;
164164 }
165165
166166 static const struct config_field caplist_pm[] = {
drivers/xen/xen-pciback/conf_space_header.c+6−2
@@ -236,8 +236,12 @@ static void *bar_init(struct pci_dev *dev, int offset) · 235 unmodified lines
236236 else {
237237 pos = (offset - PCI_BASE_ADDRESS_0) / 4;
238238 if (pos && (res[pos - 1].flags & IORESOURCE_MEM_64)) {
239− bar->val = res[pos - 1].start >> 32;
240− bar->len_val = -resource_size(&res[pos - 1]) >> 32;
239+ /*
240+ * Use ">> 16 >> 16" instead of direct ">> 32" shift
241+ * to avoid warnings on 32-bit architectures.
242+ */
243+ bar->val = res[pos - 1].start >> 16 >> 16;
244+ bar->len_val = -resource_size(&res[pos - 1]) >> 16 >> 16;
241245 return bar;
242246 }
243247 }
drivers/xen/xen-pciback/pci_stub.c+2−1
@@ -19,7 +19,8 @@ · 18 unmodified lines
1919 #include <linux/sched.h>
2020 #include <linux/atomic.h>
2121 #include <xen/events.h>
22−#include <asm/xen/pci.h>
22+#include <xen/pci.h>
23+#include <xen/xen.h>
2324 #include <asm/xen/hypervisor.h>
2425 #include <xen/interface/physdev.h>
2526 #include "pciback.h"
drivers/xen/xen-pciback/pciback.h+5−0
@@ -71,6 +71,11 @@ struct pci_dev *pcistub_get_pci_dev(struct xen_pcibk_device *pdev, · 70 unmodified lines
7171 struct pci_dev *dev);
7272 void pcistub_put_pci_dev(struct pci_dev *dev);
7373
74+static inline bool xen_pcibk_pv_support(void)
75+{
76+ return IS_ENABLED(CONFIG_XEN_PCIDEV_BACKEND);
77+}
78+
7479 /* Ensure a device is turned off or reset */
7580 void xen_pcibk_reset_device(struct pci_dev *pdev);
7681
drivers/xen/xen-pciback/xenbus.c+6−2
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #include <linux/workqueue.h>
1515 #include <xen/xenbus.h>
1616 #include <xen/events.h>
17−#include <asm/xen/pci.h>
17+#include <xen/pci.h>
1818 #include "pciback.h"
1919
2020 #define INVALID_EVTCHN_IRQ (-1)
@@ -743,6 +743,9 @@ const struct xen_pcibk_backend *__read_mostly xen_pcibk_backend; · 722 unmodified lines
743743
744744 int __init xen_pcibk_xenbus_register(void)
745745 {
746+ if (!xen_pcibk_pv_support())
747+ return 0;
748+
746749 xen_pcibk_backend = &xen_pcibk_vpci_backend;
747750 if (passthrough)
748751 xen_pcibk_backend = &xen_pcibk_passthrough_backend;
@@ -752,5 +755,6 @@ int __init xen_pcibk_xenbus_register(void) · 3 unmodified lines
752755
753756 void __exit xen_pcibk_xenbus_unregister(void)
754757 {
755− xenbus_unregister_driver(&xen_pcibk_driver);
758+ if (xen_pcibk_pv_support())
759+ xenbus_unregister_driver(&xen_pcibk_driver);
756760 }
include/xen/arm/hypercall.h+0−15
@@ -53,7 +53,6 @@ unsigned long HYPERVISOR_hvm_op(int op, void *arg); · 52 unmodified lines
5353 int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
5454 int HYPERVISOR_physdev_op(int cmd, void *arg);
5555 int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
56−int HYPERVISOR_tmem_op(void *arg);
5756 int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
5857 int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
5958 struct xen_dm_op_buf *bufs);
@@ -74,18 +73,4 @@ HYPERVISOR_suspend(unsigned long start_info_mfn) · 14 unmodified lines
7473 return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
7574 }
7675
77−static inline void
78−MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
79− unsigned int new_val, unsigned long flags)
80−{
81− BUG();
82−}
83−
84−static inline void
85−MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
86− int count, int *success_count, domid_t domid)
87−{
88− BUG();
89−}
90−
9176 #endif /* _ASM_ARM_XEN_HYPERCALL_H */
include/xen/balloon.h+0−3
@@ -26,9 +26,6 @@ extern struct balloon_stats balloon_stats; · 25 unmodified lines
2626
2727 void balloon_set_new_target(unsigned long target);
2828
29−int alloc_xenballooned_pages(int nr_pages, struct page **pages);
30−void free_xenballooned_pages(int nr_pages, struct page **pages);
31−
3229 #ifdef CONFIG_XEN_BALLOON
3330 void xen_balloon_init(void);
3431 #else
include/xen/interface/callback.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * callback.h
34 *
45 * Register guest OS callbacks with Xen.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2006, Ian Campbell
258 */
269
include/xen/interface/elfnote.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * elfnote.h
34 *
45 * Definitions used for the Xen ELF notes.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
258 */
269
include/xen/interface/event_channel.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * event_channel.h
44 *
include/xen/interface/features.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * features.h
44 *
include/xen/interface/grant_table.h+1−18
@@ -1,27 +1,10 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * grant_table.h
34 *
45 * Interface for granting foreign access to page frames, and receiving
56 * page-ownership transfers.
67 *
7− * Permission is hereby granted, free of charge, to any person obtaining a copy
8− * of this software and associated documentation files (the "Software"), to
9− * deal in the Software without restriction, including without limitation the
10− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11− * sell copies of the Software, and to permit persons to whom the Software is
12− * furnished to do so, subject to the following conditions:
13− *
14− * The above copyright notice and this permission notice shall be included in
15− * all copies or substantial portions of the Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23− * DEALINGS IN THE SOFTWARE.
24− *
258 * Copyright (c) 2004, K A Fraser
269 */
2710
include/xen/interface/hvm/dm_op.h+1−18
@@ -1,23 +1,6 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
23 * Copyright (c) 2016, Citrix Systems Inc
3− *
4− * Permission is hereby granted, free of charge, to any person obtaining a copy
5− * of this software and associated documentation files (the "Software"), to
6− * deal in the Software without restriction, including without limitation the
7− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8− * sell copies of the Software, and to permit persons to whom the Software is
9− * furnished to do so, subject to the following conditions:
10− *
11− * The above copyright notice and this permission notice shall be included in
12− * all copies or substantial portions of the Software.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20− * DEALINGS IN THE SOFTWARE.
214 */
225
236 #ifndef __XEN_PUBLIC_HVM_DM_OP_H__
include/xen/interface/hvm/hvm_op.h+1−19
@@ -1,22 +1,4 @@
1−/*
2− * Permission is hereby granted, free of charge, to any person obtaining a copy
3− * of this software and associated documentation files (the "Software"), to
4− * deal in the Software without restriction, including without limitation the
5− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6− * sell copies of the Software, and to permit persons to whom the Software is
7− * furnished to do so, subject to the following conditions:
8− *
9− * The above copyright notice and this permission notice shall be included in
10− * all copies or substantial portions of the Software.
11− *
12− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18− * DEALINGS IN THE SOFTWARE.
19− */
1+/* SPDX-License-Identifier: MIT */
202
213 #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
224 #define __XEN_PUBLIC_HVM_HVM_OP_H__
include/xen/interface/hvm/hvm_vcpu.h+1−18
@@ -1,22 +1,5 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
2− * Permission is hereby granted, free of charge, to any person obtaining a copy
3− * of this software and associated documentation files (the "Software"), to
4− * deal in the Software without restriction, including without limitation the
5− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6− * sell copies of the Software, and to permit persons to whom the Software is
7− * furnished to do so, subject to the following conditions:
8− *
9− * The above copyright notice and this permission notice shall be included in
10− * all copies or substantial portions of the Software.
11− *
12− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18− * DEALINGS IN THE SOFTWARE.
19− *
203 * Copyright (c) 2015, Roger Pau Monne <roger.pau@citrix.com>
214 */
225
include/xen/interface/hvm/params.h+1−19
@@ -1,22 +1,4 @@
1−/*
2− * Permission is hereby granted, free of charge, to any person obtaining a copy
3− * of this software and associated documentation files (the "Software"), to
4− * deal in the Software without restriction, including without limitation the
5− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6− * sell copies of the Software, and to permit persons to whom the Software is
7− * furnished to do so, subject to the following conditions:
8− *
9− * The above copyright notice and this permission notice shall be included in
10− * all copies or substantial portions of the Software.
11− *
12− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18− * DEALINGS IN THE SOFTWARE.
19− */
1+/* SPDX-License-Identifier: MIT */
202
213 #ifndef __XEN_PUBLIC_HVM_PARAMS_H__
224 #define __XEN_PUBLIC_HVM_PARAMS_H__
include/xen/interface/hvm/start_info.h+1−18
@@ -1,22 +1,5 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
2− * Permission is hereby granted, free of charge, to any person obtaining a copy
3− * of this software and associated documentation files (the "Software"), to
4− * deal in the Software without restriction, including without limitation the
5− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6− * sell copies of the Software, and to permit persons to whom the Software is
7− * furnished to do so, subject to the following conditions:
8− *
9− * The above copyright notice and this permission notice shall be included in
10− * all copies or substantial portions of the Software.
11− *
12− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18− * DEALINGS IN THE SOFTWARE.
19− *
203 * Copyright (c) 2016, Citrix Systems, Inc.
214 */
225
include/xen/interface/io/9pfs.h+1−18
@@ -1,24 +1,7 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
23 * 9pfs.h -- Xen 9PFS transport
34 *
4− * Permission is hereby granted, free of charge, to any person obtaining a copy
5− * of this software and associated documentation files (the "Software"), to
6− * deal in the Software without restriction, including without limitation the
7− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8− * sell copies of the Software, and to permit persons to whom the Software is
9− * furnished to do so, subject to the following conditions:
10− *
11− * The above copyright notice and this permission notice shall be included in
12− * all copies or substantial portions of the Software.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20− * DEALINGS IN THE SOFTWARE.
21− *
225 * Copyright (C) 2017 Stefano Stabellini <stefano@aporeto.com>
236 */
247
include/xen/interface/io/blkif.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * blkif.h
44 *
include/xen/interface/io/console.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * console.h
44 *
include/xen/interface/io/displif.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * displif.h
34 *
45 * Unified display device I/O interface for Xen guest OSes.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (C) 2016-2017 EPAM Systems Inc.
258 *
269 * Authors: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
include/xen/interface/io/fbif.h+1−18
@@ -1,24 +1,7 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
23 * fbif.h -- Xen virtual frame buffer device
34 *
4− * Permission is hereby granted, free of charge, to any person obtaining a copy
5− * of this software and associated documentation files (the "Software"), to
6− * deal in the Software without restriction, including without limitation the
7− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8− * sell copies of the Software, and to permit persons to whom the Software is
9− * furnished to do so, subject to the following conditions:
10− *
11− * The above copyright notice and this permission notice shall be included in
12− * all copies or substantial portions of the Software.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20− * DEALINGS IN THE SOFTWARE.
21− *
225 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
236 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
247 */
include/xen/interface/io/kbdif.h+1−18
@@ -1,24 +1,7 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
23 * kbdif.h -- Xen virtual keyboard/mouse
34 *
4− * Permission is hereby granted, free of charge, to any person obtaining a copy
5− * of this software and associated documentation files (the "Software"), to
6− * deal in the Software without restriction, including without limitation the
7− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8− * sell copies of the Software, and to permit persons to whom the Software is
9− * furnished to do so, subject to the following conditions:
10− *
11− * The above copyright notice and this permission notice shall be included in
12− * all copies or substantial portions of the Software.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20− * DEALINGS IN THE SOFTWARE.
21− *
225 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
236 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
247 */
include/xen/interface/io/netif.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * xen_netif.h
34 *
45 * Unified network-device I/O interface for Xen guest OSes.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2003-2004, Keir Fraser
258 */
269
include/xen/interface/io/pciif.h+1−18
@@ -1,24 +1,7 @@
1+/* SPDX-License-Identifier: MIT */
12 /*
23 * PCI Backend/Frontend Common Data Structures & Macros
34 *
4− * Permission is hereby granted, free of charge, to any person obtaining a copy
5− * of this software and associated documentation files (the "Software"), to
6− * deal in the Software without restriction, including without limitation the
7− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8− * sell copies of the Software, and to permit persons to whom the Software is
9− * furnished to do so, subject to the following conditions:
10− *
11− * The above copyright notice and this permission notice shall be included in
12− * all copies or substantial portions of the Software.
13− *
14− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20− * DEALINGS IN THE SOFTWARE.
21− *
225 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
236 */
247 #ifndef __XEN_PCI_COMMON_H__
include/xen/interface/io/protocols.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 #ifndef __XEN_PROTOCOLS_H__
33 #define __XEN_PROTOCOLS_H__
44
include/xen/interface/io/pvcalls.h+2−0
@@ -1,3 +1,5 @@
1+/* SPDX-License-Identifier: MIT */
2+
13 #ifndef __XEN_PUBLIC_IO_XEN_PVCALLS_H__
24 #define __XEN_PUBLIC_IO_XEN_PVCALLS_H__
35
include/xen/interface/io/ring.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * ring.h
34 *
45 * Shared producer-consumer ring macros.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Tim Deegan and Andrew Warfield November 2004.
258 */
269
include/xen/interface/io/sndif.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * sndif.h
34 *
45 * Unified sound-device I/O interface for Xen guest OSes.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (C) 2013-2015 GlobalLogic Inc.
258 * Copyright (C) 2016-2017 EPAM Systems Inc.
269 *
include/xen/interface/io/vscsiif.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * vscsiif.h
34 *
45 * Based on the blkif.h code.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright(c) FUJITSU Limited 2008.
258 */
269
include/xen/interface/io/xenbus.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /*****************************************************************************
33 * xenbus.h
44 *
include/xen/interface/io/xs_wire.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /*
33 * Details of the "wire" protocol between Xen Store Daemon and client
44 * library or guest kernel.
include/xen/interface/memory.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * memory.h
44 *
include/xen/interface/nmi.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * nmi.h
44 *
include/xen/interface/physdev.h+1−19
@@ -1,22 +1,4 @@
1−/*
2− * Permission is hereby granted, free of charge, to any person obtaining a copy
3− * of this software and associated documentation files (the "Software"), to
4− * deal in the Software without restriction, including without limitation the
5− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6− * sell copies of the Software, and to permit persons to whom the Software is
7− * furnished to do so, subject to the following conditions:
8− *
9− * The above copyright notice and this permission notice shall be included in
10− * all copies or substantial portions of the Software.
11− *
12− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18− * DEALINGS IN THE SOFTWARE.
19− */
1+/* SPDX-License-Identifier: MIT */
202
213 #ifndef __XEN_PUBLIC_PHYSDEV_H__
224 #define __XEN_PUBLIC_PHYSDEV_H__
include/xen/interface/platform.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * platform.h
34 *
45 * Hardware platform operations. Intended for use by domain-0 kernel.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2002-2006, K Fraser
258 */
269
include/xen/interface/sched.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * sched.h
34 *
45 * Scheduler state interactions
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
258 */
269
include/xen/interface/vcpu.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * vcpu.h
34 *
45 * VCPU initialisation, query, and hotplug.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
258 */
269
include/xen/interface/version.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 /******************************************************************************
33 * version.h
44 *
include/xen/interface/xen-mca.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * arch-x86/mca.h
34 * Guest OS machine check interface to x86 Xen.
include/xen/interface/xen.h+1−18
@@ -1,26 +1,9 @@
1+/* SPDX-License-Identifier: MIT */
12 /******************************************************************************
23 * xen.h
34 *
45 * Guest OS interface to Xen.
56 *
6− * Permission is hereby granted, free of charge, to any person obtaining a copy
7− * of this software and associated documentation files (the "Software"), to
8− * deal in the Software without restriction, including without limitation the
9− * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10− * sell copies of the Software, and to permit persons to whom the Software is
11− * furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice shall be included in
14− * all copies or substantial portions of the Software.
15− *
16− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19− * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22− * DEALINGS IN THE SOFTWARE.
23− *
247 * Copyright (c) 2004, K A Fraser
258 */
269
include/xen/interface/xenpmu.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: MIT */
22 #ifndef __XEN_PUBLIC_XENPMU_H__
33 #define __XEN_PUBLIC_XENPMU_H__
44
include/xen/pci.h+28−0
@@ -0,0 +1,28 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef __XEN_PCI_H__
4+#define __XEN_PCI_H__
5+
6+#if defined(CONFIG_XEN_DOM0)
7+int xen_find_device_domain_owner(struct pci_dev *dev);
8+int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
9+int xen_unregister_device_domain_owner(struct pci_dev *dev);
10+#else
11+static inline int xen_find_device_domain_owner(struct pci_dev *dev)
12+{
13+ return -1;
14+}
15+
16+static inline int xen_register_device_domain_owner(struct pci_dev *dev,
17+ uint16_t domain)
18+{
19+ return -1;
20+}
21+
22+static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
23+{
24+ return -1;
25+}
26+#endif
27+
28+#endif
include/xen/xen.h+0−6
@@ -52,13 +52,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, · 51 unmodified lines
5252 extern u64 xen_saved_max_mem_size;
5353 #endif
5454
55−#ifdef CONFIG_XEN_UNPOPULATED_ALLOC
5655 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages);
5756 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages);
58−#else
59−#define xen_alloc_unpopulated_pages alloc_xenballooned_pages
60−#define xen_free_unpopulated_pages free_xenballooned_pages
61−#include <xen/balloon.h>
62−#endif
6357
6458 #endif /* _XEN_XEN_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t