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
6379 improve timer resolution at the expense of processing6379 improve timer resolution at the expense of processing
6380 more timer interrupts.6380 more timer interrupts.
6381 6381
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
6382 xen.event_eoi_delay= [XEN]6389 xen.event_eoi_delay= [XEN]
6383 How long to delay EOI handling in case of event6390 How long to delay EOI handling in case of event
6384 storms (jiffies). Default is 10.6391 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
442EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);442EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
443EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);443EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
444EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);444EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);
445EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op);
446EXPORT_SYMBOL_GPL(HYPERVISOR_platform_op_raw);445EXPORT_SYMBOL_GPL(HYPERVISOR_platform_op_raw);
447EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);446EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);
448EXPORT_SYMBOL_GPL(HYPERVISOR_vm_assist);447EXPORT_SYMBOL_GPL(HYPERVISOR_vm_assist);
arch/arm/xen/hypercall.S+0−1
@@ -88,7 +88,6 @@ HYPERCALL2(hvm_op); · 87 unmodified lines
88HYPERCALL2(memory_op);88HYPERCALL2(memory_op);
89HYPERCALL2(physdev_op);89HYPERCALL2(physdev_op);
90HYPERCALL3(vcpu_op);90HYPERCALL3(vcpu_op);
91HYPERCALL1(tmem_op);
92HYPERCALL1(platform_op_raw);91HYPERCALL1(platform_op_raw);
93HYPERCALL2(multicall);92HYPERCALL2(multicall);
94HYPERCALL2(vm_assist);93HYPERCALL2(vm_assist);
arch/arm64/xen/hypercall.S+0−1
@@ -80,7 +80,6 @@ HYPERCALL2(hvm_op); · 79 unmodified lines
80HYPERCALL2(memory_op);80HYPERCALL2(memory_op);
81HYPERCALL2(physdev_op);81HYPERCALL2(physdev_op);
82HYPERCALL3(vcpu_op);82HYPERCALL3(vcpu_op);
83HYPERCALL1(tmem_op);
84HYPERCALL1(platform_op_raw);83HYPERCALL1(platform_op_raw);
85HYPERCALL2(multicall);84HYPERCALL2(multicall);
86HYPERCALL2(vm_assist);85HYPERCALL2(vm_assist);
arch/x86/include/asm/paravirt_types.h+2−0
@@ -577,7 +577,9 @@ void paravirt_leave_lazy_mmu(void); · 576 unmodified lines
577void paravirt_flush_lazy_mmu(void);577void paravirt_flush_lazy_mmu(void);
578 578
579void _paravirt_nop(void);579void _paravirt_nop(void);
580void paravirt_BUG(void);
580u64 _paravirt_ident_64(u64);581u64 _paravirt_ident_64(u64);
582unsigned long paravirt_ret0(void);
581 583
582#define paravirt_nop ((void *)_paravirt_nop)584#define paravirt_nop ((void *)_paravirt_nop)
583 585
arch/x86/include/asm/xen/hypercall.h+102−131
@@ -248,6 +248,7 @@ privcmd_call(unsigned int call, · 247 unmodified lines
248 return res;248 return res;
249}249}
250 250
251#ifdef CONFIG_XEN_PV
251static inline int252static inline int
252HYPERVISOR_set_trap_table(struct trap_info *table)253HYPERVISOR_set_trap_table(struct trap_info *table)
253{254{
@@ -280,6 +281,107 @@ HYPERVISOR_callback_op(int cmd, void *arg) · 26 unmodified lines
280 return _hypercall2(int, callback_op, cmd, arg);281 return _hypercall2(int, callback_op, cmd, arg);
281}282}
282 283
284static inline int
285HYPERVISOR_set_debugreg(int reg, unsigned long value)
286{
287 return _hypercall2(int, set_debugreg, reg, value);
288}
289
290static inline unsigned long
291HYPERVISOR_get_debugreg(int reg)
292{
293 return _hypercall1(unsigned long, get_debugreg, reg);
294}
295
296static inline int
297HYPERVISOR_update_descriptor(u64 ma, u64 desc)
298{
299 return _hypercall2(int, update_descriptor, ma, desc);
300}
301
302static inline int
303HYPERVISOR_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
309static inline int
310HYPERVISOR_set_segment_base(int reg, unsigned long value)
311{
312 return _hypercall2(int, set_segment_base, reg, value);
313}
314
315static inline void
316MULTI_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
324static inline void
325MULTI_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
336static inline void
337MULTI_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
347static inline void
348MULTI_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
360static inline void
361MULTI_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
373static inline void
374MULTI_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
283static inline int385static inline int
284HYPERVISOR_sched_op(int cmd, void *arg)386HYPERVISOR_sched_op(int cmd, void *arg)
285{387{
@@ -308,26 +410,6 @@ HYPERVISOR_platform_op(struct xen_platform_op *op) · 22 unmodified lines
308 return _hypercall1(int, platform_op, op);410 return _hypercall1(int, platform_op, op);
309}411}
310 412
311static __always_inline int
312HYPERVISOR_set_debugreg(int reg, unsigned long value)
313{
314 return _hypercall2(int, set_debugreg, reg, value);
315}
316
317static __always_inline unsigned long
318HYPERVISOR_get_debugreg(int reg)
319{
320 return _hypercall1(unsigned long, get_debugreg, reg);
321}
322
323static inline int
324HYPERVISOR_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
331static inline long413static inline long
332HYPERVISOR_memory_op(unsigned int cmd, void *arg)414HYPERVISOR_memory_op(unsigned int cmd, void *arg)
333{415{
@@ -340,18 +422,6 @@ HYPERVISOR_multicall(void *call_list, uint32_t nr_calls) · 6 unmodified lines
340 return _hypercall2(int, multicall, call_list, nr_calls);422 return _hypercall2(int, multicall, call_list, nr_calls);
341}423}
342 424
343static inline int
344HYPERVISOR_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
355static inline int425static inline int
356HYPERVISOR_event_channel_op(int cmd, void *arg)426HYPERVISOR_event_channel_op(int cmd, void *arg)
357{427{
@@ -394,14 +464,6 @@ HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args) · 36 unmodified lines
394 return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);464 return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
395}465}
396 466
397#ifdef CONFIG_X86_64
398static inline int
399HYPERVISOR_set_segment_base(int reg, unsigned long value)
400{
401 return _hypercall2(int, set_segment_base, reg, value);
402}
403#endif
404
405static inline int467static inline int
406HYPERVISOR_suspend(unsigned long start_info_mfn)468HYPERVISOR_suspend(unsigned long start_info_mfn)
407{469{
@@ -422,13 +484,6 @@ HYPERVISOR_hvm_op(int op, void *arg) · 14 unmodified lines
422 return _hypercall2(unsigned long, hvm_op, op, arg);484 return _hypercall2(unsigned long, hvm_op, op, arg);
423}485}
424 486
425static inline int
426HYPERVISOR_tmem_op(
427 struct tmem_op *op)
428{
429 return _hypercall1(int, tmem_op, op);
430}
431
432static inline int487static inline int
433HYPERVISOR_xenpmu_op(unsigned int op, void *arg)488HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
434{489{
@@ -446,88 +501,4 @@ HYPERVISOR_dm_op( · 11 unmodified lines
446 return ret;501 return ret;
447}502}
448 503
449static inline void
450MULTI_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
458static inline void
459MULTI_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
476static inline void
477MULTI_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
496static inline void
497MULTI_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
509static inline void
510MULTI_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
522static inline void
523MULTI_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
533#endif /* _ASM_X86_XEN_HYPERCALL_H */504#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
62void xen_arch_unregister_cpu(int num);62void xen_arch_unregister_cpu(int num);
63#endif63#endif
64 64
65#ifdef CONFIG_PVH
66void __init xen_pvh_init(struct boot_params *boot_params);
67#endif
68
65#endif /* _ASM_X86_XEN_HYPERVISOR_H */69#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
22 return -1;22 return -1;
23}23}
24#endif24#endif
25#ifdef CONFIG_XEN_DOM0
26int xen_find_device_domain_owner(struct pci_dev *dev);
27int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
28int xen_unregister_device_domain_owner(struct pci_dev *dev);
29#else
30static inline int xen_find_device_domain_owner(struct pci_dev *dev)
31{
32 return -1;
33}
34static inline int xen_register_device_domain_owner(struct pci_dev *dev,
35 uint16_t domain)
36{
37 return -1;
38}
39static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
40{
41 return -1;
42}
43#endif
44 25
45#if defined(CONFIG_PCI_MSI)26#if defined(CONFIG_PCI_MSI)
46#if defined(CONFIG_PCI_XEN)27#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
46 ".type _paravirt_nop, @function\n\t"46 ".type _paravirt_nop, @function\n\t"
47 ".popsection");47 ".popsection");
48 48
49/* stub always returning 0. */
50asm (".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
49void __init default_banner(void)60void __init default_banner(void)
50{61{
51 printk(KERN_INFO "Booting paravirtualized kernel on %s\n",62 printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
@@ -53,7 +64,7 @@ void __init default_banner(void) · 1 unmodified line
53}64}
54 65
55/* Undefined instruction for dealing with missing ops pointers. */66/* Undefined instruction for dealing with missing ops pointers. */
56static void paravirt_BUG(void)67noinstr void paravirt_BUG(void)
57{68{
58 BUG();69 BUG();
59}70}
arch/x86/pci/xen.c+1−75
@@ -23,6 +23,7 @@ · 22 unmodified lines
23 23
24#include <xen/features.h>24#include <xen/features.h>
25#include <xen/events.h>25#include <xen/events.h>
26#include <xen/pci.h>
26#include <asm/xen/pci.h>27#include <asm/xen/pci.h>
27#include <asm/xen/cpuid.h>28#include <asm/xen/cpuid.h>
28#include <asm/apic.h>29#include <asm/apic.h>
@@ -585,78 +586,3 @@ int __init pci_xen_initial_domain(void) · 556 unmodified lines
585}586}
586#endif587#endif
587 588
588#ifdef CONFIG_XEN_DOM0
589
590struct xen_device_domain_owner {
591 domid_t domain;
592 struct pci_dev *dev;
593 struct list_head list;
594};
595
596static DEFINE_SPINLOCK(dev_domain_list_spinlock);
597static struct list_head dev_domain_list = LIST_HEAD_INIT(dev_domain_list);
598
599static 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
610int 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}
622EXPORT_SYMBOL_GPL(xen_find_device_domain_owner);
623
624int 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}
644EXPORT_SYMBOL_GPL(xen_register_device_domain_owner);
645
646int 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}
661EXPORT_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
31 * Pointer to the xen_vcpu_info structure or31 * Pointer to the xen_vcpu_info structure or
32 * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info32 * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info
33 * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info33 * 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 point34 * but during boot it is switched to point to xen_vcpu_info.
35 * to xen_vcpu_info. The pointer is used in __xen_evtchn_do_upcall to35 * The pointer is used in __xen_evtchn_do_upcall to acknowledge pending events.
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 *
45 */36 */
46DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);37DEFINE_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 */
53DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);38DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
54 39
55/* Linux <-> Xen vCPU id mapping */40/* Linux <-> Xen vCPU id mapping */
@@ -84,21 +69,6 @@ EXPORT_SYMBOL(xen_start_flags); · 28 unmodified lines
84 */69 */
85struct shared_info *HYPERVISOR_shared_info = &xen_dummy_shared_info;70struct shared_info *HYPERVISOR_shared_info = &xen_dummy_shared_info;
86 71
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 */
100int xen_have_vcpu_info_placement = 1;
101
102static int xen_cpu_up_online(unsigned int cpu)72static int xen_cpu_up_online(unsigned int cpu)
103{73{
104 xen_init_lock_cpu(cpu);74 xen_init_lock_cpu(cpu);
@@ -124,10 +94,8 @@ int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int), · 19 unmodified lines
124 return rc >= 0 ? 0 : rc;94 return rc >= 0 ? 0 : rc;
125}95}
126 96
127static int xen_vcpu_setup_restore(int cpu)97static void xen_vcpu_setup_restore(int cpu)
128{98{
129 int rc = 0;
130
131 /* Any per_cpu(xen_vcpu) is stale, so reset it */99 /* Any per_cpu(xen_vcpu) is stale, so reset it */
132 xen_vcpu_info_reset(cpu);100 xen_vcpu_info_reset(cpu);
133 101
@@ -136,11 +104,8 @@ static int xen_vcpu_setup_restore(int cpu) · 2 unmodified lines
136 * be handled by hotplug.104 * be handled by hotplug.
137 */105 */
138 if (xen_pv_domain() ||106 if (xen_pv_domain() ||
139 (xen_hvm_domain() && cpu_online(cpu))) {107 (xen_hvm_domain() && cpu_online(cpu)))
140 rc = xen_vcpu_setup(cpu);108 xen_vcpu_setup(cpu);
141 }
142
143 return rc;
144}109}
145 110
146/*111/*
@@ -150,7 +115,7 @@ static int xen_vcpu_setup_restore(int cpu) · 3 unmodified lines
150 */115 */
151void xen_vcpu_restore(void)116void xen_vcpu_restore(void)
152{117{
153 int cpu, rc;118 int cpu;
154 119
155 for_each_possible_cpu(cpu) {120 for_each_possible_cpu(cpu) {
156 bool other_cpu = (cpu != smp_processor_id());121 bool other_cpu = (cpu != smp_processor_id());
@@ -170,20 +135,9 @@ void xen_vcpu_restore(void) · 13 unmodified lines
170 if (xen_pv_domain() || xen_feature(XENFEAT_hvm_safe_pvclock))135 if (xen_pv_domain() || xen_feature(XENFEAT_hvm_safe_pvclock))
171 xen_setup_runstate_info(cpu);136 xen_setup_runstate_info(cpu);
172 137
173 rc = xen_vcpu_setup_restore(cpu);138 xen_vcpu_setup_restore(cpu);
174 if (rc)139
175 pr_emerg_once("vcpu restore failed for cpu=%d err=%d. "140 if (other_cpu && is_up &&
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) &&
187 HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL))141 HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL))
188 BUG();142 BUG();
189 }143 }
@@ -200,7 +154,7 @@ void xen_vcpu_info_reset(int cpu) · 10 unmodified lines
200 }154 }
201}155}
202 156
203int xen_vcpu_setup(int cpu)157void xen_vcpu_setup(int cpu)
204{158{
205 struct vcpu_register_vcpu_info info;159 struct vcpu_register_vcpu_info info;
206 int err;160 int err;
@@ -221,44 +175,26 @@ int xen_vcpu_setup(int cpu) · 14 unmodified lines
221 */175 */
222 if (xen_hvm_domain()) {176 if (xen_hvm_domain()) {
223 if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu))177 if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu))
224 return 0;178 return;
225 }179 }
226 180
227 if (xen_have_vcpu_info_placement) {181 vcpup = &per_cpu(xen_vcpu_info, cpu);
228 vcpup = &per_cpu(xen_vcpu_info, cpu);182 info.mfn = arbitrary_virt_to_mfn(vcpup);
229 info.mfn = arbitrary_virt_to_mfn(vcpup);183 info.offset = offset_in_page(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 }
257 184
258 if (!xen_have_vcpu_info_placement)185 /*
259 xen_vcpu_info_reset(cpu);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);
260 196
261 return ((per_cpu(xen_vcpu, cpu) == NULL) ? -ENODEV : 0);197 per_cpu(xen_vcpu, cpu) = vcpup;
262}198}
263 199
264void __init xen_banner(void)200void __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
163 per_cpu(xen_vcpu_id, cpu) = cpu_acpi_id(cpu);163 per_cpu(xen_vcpu_id, cpu) = cpu_acpi_id(cpu);
164 else164 else
165 per_cpu(xen_vcpu_id, cpu) = cpu;165 per_cpu(xen_vcpu_id, cpu) = cpu;
166 rc = xen_vcpu_setup(cpu);166 xen_vcpu_setup(cpu);
167 if (rc || !xen_have_vector_callback)167 if (!xen_have_vector_callback)
168 return rc;168 return 0;
169 169
170 if (xen_feature(XENFEAT_hvm_safe_pvclock))170 if (xen_feature(XENFEAT_hvm_safe_pvclock))
171 xen_setup_timer(cpu);171 xen_setup_timer(cpu);
arch/x86/xen/enlighten_pv.c+5−30
@@ -27,7 +27,6 @@ · 26 unmodified lines
27#include <linux/export.h>27#include <linux/export.h>
28#include <linux/mm.h>28#include <linux/mm.h>
29#include <linux/page-flags.h>29#include <linux/page-flags.h>
30#include <linux/highmem.h>
31#include <linux/pci.h>30#include <linux/pci.h>
32#include <linux/gfp.h>31#include <linux/gfp.h>
33#include <linux/edd.h>32#include <linux/edd.h>
@@ -993,31 +992,13 @@ void __init xen_setup_vcpu_info_placement(void) · 959 unmodified lines
993 for_each_possible_cpu(cpu) {992 for_each_possible_cpu(cpu) {
994 /* Set up direct vCPU id mapping for PV guests. */993 /* Set up direct vCPU id mapping for PV guests. */
995 per_cpu(xen_vcpu_id, cpu) = cpu;994 per_cpu(xen_vcpu_id, cpu) = cpu;
996 995 xen_vcpu_setup(cpu);
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);
1006 }996 }
1007 997
1008 /*998 pv_ops.irq.save_fl = __PV_IS_CALLEE_SAVE(xen_save_fl_direct);
1009 * xen_vcpu_setup managed to place the vcpu_info within the999 pv_ops.irq.irq_disable = __PV_IS_CALLEE_SAVE(xen_irq_disable_direct);
1010 * percpu area for all cpus, so make use of it.1000 pv_ops.irq.irq_enable = __PV_IS_CALLEE_SAVE(xen_irq_enable_direct);
1011 */1001 pv_ops.mmu.read_cr2 = __PV_IS_CALLEE_SAVE(xen_read_cr2_direct);
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 }
1021}1002}
1022 1003
1023static const struct pv_info xen_info __initconst = {1004static const struct pv_info xen_info __initconst = {
@@ -1247,12 +1228,6 @@ asmlinkage __visible void __init xen_start_kernel(void) · 223 unmodified lines
1247 __supported_pte_mask &= ~_PAGE_GLOBAL;1228 __supported_pte_mask &= ~_PAGE_GLOBAL;
1248 __default_kernel_pte_mask &= ~_PAGE_GLOBAL;1229 __default_kernel_pte_mask &= ~_PAGE_GLOBAL;
1249 1230
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
1256 /* Get mfn list */1231 /* Get mfn list */
1257 xen_build_dynamic_phys_to_machine();1232 xen_build_dynamic_phys_to_machine();
1258 1233
arch/x86/xen/irq.c+4−58
@@ -24,60 +24,6 @@ noinstr void xen_force_evtchn_callback(void) · 23 unmodified lines
24 (void)HYPERVISOR_xen_version(0, NULL);24 (void)HYPERVISOR_xen_version(0, NULL);
25}25}
26 26
27asmlinkage __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
45asmlinkage __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
56asmlinkage __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
81static void xen_safe_halt(void)27static void xen_safe_halt(void)
82{28{
83 /* Blocking includes an implicit local_irq_enable(). */29 /* Blocking includes an implicit local_irq_enable(). */
@@ -96,10 +42,10 @@ static void xen_halt(void) · 12 unmodified lines
96 42
97static const typeof(pv_ops) xen_irq_ops __initconst = {43static const typeof(pv_ops) xen_irq_ops __initconst = {
98 .irq = {44 .irq = {
99 45 /* Initial interrupt flag handling only called while interrupts off. */
100 .save_fl = PV_CALLEE_SAVE(xen_save_fl),46 .save_fl = __PV_IS_CALLEE_SAVE(paravirt_ret0),
101 .irq_disable = PV_CALLEE_SAVE(xen_irq_disable),47 .irq_disable = __PV_IS_CALLEE_SAVE(paravirt_nop),
102 .irq_enable = PV_CALLEE_SAVE(xen_irq_enable),48 .irq_enable = __PV_IS_CALLEE_SAVE(paravirt_BUG),
103 49
104 .safe_halt = xen_safe_halt,50 .safe_halt = xen_safe_halt,
105 .halt = xen_halt,51 .halt = xen_halt,
arch/x86/xen/mmu_pv.c+37−15
@@ -41,7 +41,6 @@ · 40 unmodified lines
41 * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 200741 * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007
42 */42 */
43#include <linux/sched/mm.h>43#include <linux/sched/mm.h>
44#include <linux/highmem.h>
45#include <linux/debugfs.h>44#include <linux/debugfs.h>
46#include <linux/bug.h>45#include <linux/bug.h>
47#include <linux/vmalloc.h>46#include <linux/vmalloc.h>
@@ -86,8 +85,10 @@ · 38 unmodified lines
86#include "mmu.h"85#include "mmu.h"
87#include "debugfs.h"86#include "debugfs.h"
88 87
88#ifdef CONFIG_X86_VSYSCALL_EMULATION
89/* l3 pud for userspace vsyscall mapping */89/* l3 pud for userspace vsyscall mapping */
90static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;90static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
91#endif
91 92
92/*93/*
93 * Protects atomic reservation decrease/increase against concurrent increases.94 * 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
241 * Associate a virtual page frame with a given physical page frame242 * Associate a virtual page frame with a given physical page frame
242 * and protection flags for that frame.243 * and protection flags for that frame.
243 */244 */
244void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)245void __init set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
245{246{
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();
247}250}
248 251
249static bool xen_batched_set_pte(pte_t *ptep, pte_t pteval)252static 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
789static void __init xen_after_bootmem(void)792static void __init xen_after_bootmem(void)
790{793{
791 static_branch_enable(&xen_struct_pages_ready);794 static_branch_enable(&xen_struct_pages_ready);
795#ifdef CONFIG_X86_VSYSCALL_EMULATION
792 SetPagePinned(virt_to_page(level3_user_vsyscall));796 SetPagePinned(virt_to_page(level3_user_vsyscall));
797#endif
793 xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP);798 xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP);
794}799}
795 800
@@ -1192,6 +1197,13 @@ static void __init xen_pagetable_p2m_setup(void) · 396 unmodified lines
1192 1197
1193static void __init xen_pagetable_init(void)1198static void __init xen_pagetable_init(void)
1194{1199{
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
1195 paging_init();1207 paging_init();
1196 xen_post_allocator_init();1208 xen_post_allocator_init();
1197 1209
@@ -1421,10 +1433,18 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd) · 223 unmodified lines
1421 *1433 *
1422 * Many of these PTE updates are done on unpinned and writable pages1434 * Many of these PTE updates are done on unpinned and writable pages
1423 * and doing a hypercall for these is unnecessary and expensive. At1435 * 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,1436 * this point it is rarely possible to tell if a page is pinned, so
1425 * so always write the PTE directly and rely on Xen trapping and1437 * mostly write the PTE directly and rely on Xen trapping and
1426 * emulating any updates as necessary.1438 * emulating any updates as necessary.
1427 */1439 */
1440static 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
1428__visible pte_t xen_make_pte_init(pteval_t pte)1448__visible pte_t xen_make_pte_init(pteval_t pte)
1429{1449{
1430 unsigned long pfn;1450 unsigned long pfn;
@@ -1446,11 +1466,6 @@ __visible pte_t xen_make_pte_init(pteval_t pte) · 15 unmodified lines
1446}1466}
1447PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte_init);1467PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte_init);
1448 1468
1449static void __init xen_set_pte_init(pte_t *ptep, pte_t pte)
1450{
1451 __xen_set_pte(ptep, pte);
1452}
1453
1454/* Early in boot, while setting up the initial pagetable, assume1469/* Early in boot, while setting up the initial pagetable, assume
1455 everything is pinned. */1470 everything is pinned. */
1456static void __init xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)1471static 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
1750 set_page_prot(init_top_pgt, PAGE_KERNEL_RO);1765 set_page_prot(init_top_pgt, PAGE_KERNEL_RO);
1751 set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);1766 set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
1752 set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);1767 set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
1753 set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
1754 set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);1768 set_page_prot(level2_ident_pgt, PAGE_KERNEL_RO);
1755 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);1769 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
1756 set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);1770 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
1767 /* Unpin Xen-provided one */1781 /* Unpin Xen-provided one */
1768 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));1782 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
1769 1783
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
1770 /*1791 /*
1771 * At this stage there can be no user pgd, and no page structure to1792 * At this stage there can be no user pgd, and no page structure to
1772 * attach it to, so make sure we just set kernel pgd.1793 * 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
1999static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot)2020static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot)
2000{2021{
2001 pte_t pte;2022 pte_t pte;
2023 unsigned long vaddr;
2002 2024
2003 phys >>= PAGE_SHIFT;2025 phys >>= PAGE_SHIFT;
2004 2026
@@ -2039,15 +2061,15 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) · 34 unmodified lines
2039 break;2061 break;
2040 }2062 }
2041 2063
2042 __native_set_fixmap(idx, pte);2064 vaddr = __fix_to_virt(idx);
2065 if (HYPERVISOR_update_va_mapping(vaddr, pte, UVMF_INVLPG))
2066 BUG();
2043 2067
2044#ifdef CONFIG_X86_VSYSCALL_EMULATION2068#ifdef CONFIG_X86_VSYSCALL_EMULATION
2045 /* Replicate changes to map the vsyscall page into the user2069 /* Replicate changes to map the vsyscall page into the user
2046 pagetable vsyscall mapping. */2070 pagetable vsyscall mapping. */
2047 if (idx == VSYSCALL_PAGE) {2071 if (idx == VSYSCALL_PAGE)
2048 unsigned long vaddr = __fix_to_virt(idx);
2049 set_pte_vaddr_pud(level3_user_vsyscall, vaddr, pte);2072 set_pte_vaddr_pud(level3_user_vsyscall, vaddr, pte);
2050 }
2051#endif2073#endif
2052}2074}
2053 2075
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
306 BUG();306 BUG();
307 }307 }
308 308
309 /* Update kernel mapping, but not for highmem. */
310 if (pfn >= PFN_UP(__pa(high_memory - 1)))
311 return;
312
313 if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT),309 if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT),
314 mfn_pte(mfn, PAGE_KERNEL), 0)) {310 mfn_pte(mfn, PAGE_KERNEL), 0)) {
315 WARN(1, "Failed to update kernel mapping for mfn=%ld pfn=%ld\n",311 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
429 }425 }
430 426
431 /*427 /*
432 * If the PFNs are currently mapped, the VA mapping also needs428 * If the PFNs are currently mapped, their VA mappings need to be
433 * to be updated to be 1:1.429 * zapped.
434 */430 */
435 for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++)431 for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++)
436 (void)HYPERVISOR_update_va_mapping(432 (void)HYPERVISOR_update_va_mapping(
437 (unsigned long)__va(pfn << PAGE_SHIFT),433 (unsigned long)__va(pfn << PAGE_SHIFT),
438 mfn_pte(pfn, PAGE_KERNEL_IO), 0);434 native_make_pte(0), 0);
439 435
440 return remap_pfn;436 return remap_pfn;
441}437}
arch/x86/xen/smp.c+0−28
@@ -121,34 +121,10 @@ int xen_smp_intr_init(unsigned int cpu) · 120 unmodified lines
121 121
122void __init xen_smp_cpus_done(unsigned int max_cpus)122void __init xen_smp_cpus_done(unsigned int max_cpus)
123{123{
124 int cpu, rc, count = 0;
125
126 if (xen_hvm_domain())124 if (xen_hvm_domain())
127 native_smp_cpus_done(max_cpus);125 native_smp_cpus_done(max_cpus);
128 else126 else
129 calculate_max_logical_packages();127 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);
152}128}
153 129
154void xen_smp_send_reschedule(int cpu)130void xen_smp_send_reschedule(int cpu)
@@ -268,20 +244,16 @@ void xen_send_IPI_allbutself(int vector) · 113 unmodified lines
268 244
269static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)245static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
270{246{
271 irq_enter();
272 generic_smp_call_function_interrupt();247 generic_smp_call_function_interrupt();
273 inc_irq_stat(irq_call_count);248 inc_irq_stat(irq_call_count);
274 irq_exit();
275 249
276 return IRQ_HANDLED;250 return IRQ_HANDLED;
277}251}
278 252
279static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)253static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)
280{254{
281 irq_enter();
282 generic_smp_call_function_single_interrupt();255 generic_smp_call_function_single_interrupt();
283 inc_irq_stat(irq_call_count);256 inc_irq_stat(irq_call_count);
284 irq_exit();
285 257
286 return IRQ_HANDLED;258 return IRQ_HANDLED;
287}259}
arch/x86/xen/smp_pv.c+0−2
@@ -458,10 +458,8 @@ static void xen_pv_stop_other_cpus(int wait) · 457 unmodified lines
458 458
459static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id)459static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id)
460{460{
461 irq_enter();
462 irq_work_run();461 irq_work_run();
463 inc_irq_stat(apic_irq_work_irqs);462 inc_irq_stat(apic_irq_work_irqs);
464 irq_exit();
465 463
466 return IRQ_HANDLED;464 return IRQ_HANDLED;
467}465}
arch/x86/xen/xen-head.S+6−6
@@ -45,13 +45,13 @@ SYM_CODE_START(startup_xen) · 44 unmodified lines
45 45
46 /* Clear .bss */46 /* Clear .bss */
47 xor %eax,%eax47 xor %eax,%eax
48 mov $__bss_start, %_ASM_DI48 mov $__bss_start, %rdi
49 mov $__bss_stop, %_ASM_CX49 mov $__bss_stop, %rcx
50 sub %_ASM_DI, %_ASM_CX50 sub %rdi, %rcx
51 shr $__ASM_SEL(2, 3), %_ASM_CX51 shr $3, %rcx
52 rep __ASM_SIZE(stos)52 rep stosq
53 53
54 mov %_ASM_SI, xen_start_info54 mov %rsi, xen_start_info
55 mov initial_stack(%rip), %rsp55 mov initial_stack(%rip), %rsp
56 56
57 /* Set up %gs.57 /* 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
76 76
77bool xen_vcpu_stolen(int vcpu);77bool xen_vcpu_stolen(int vcpu);
78 78
79extern int xen_have_vcpu_info_placement;79void xen_vcpu_setup(int cpu);
80
81int xen_vcpu_setup(int cpu);
82void xen_vcpu_info_reset(int cpu);80void xen_vcpu_info_reset(int cpu);
83void xen_setup_vcpu_info_placement(void);81void xen_setup_vcpu_info_placement(void);
84 82
drivers/xen/Kconfig+24−0
@@ -181,10 +181,34 @@ config SWIOTLB_XEN · 180 unmodified lines
181 select DMA_OPS181 select DMA_OPS
182 select SWIOTLB182 select SWIOTLB
183 183
184config XEN_PCI_STUB
185 bool
186
187config 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
184config XEN_PCIDEV_BACKEND207config XEN_PCIDEV_BACKEND
185 tristate "Xen PCI-device backend driver"208 tristate "Xen PCI-device backend driver"
186 depends on PCI && X86 && XEN209 depends on PCI && X86 && XEN
187 depends on XEN_BACKEND210 depends on XEN_BACKEND
211 select XEN_PCI_STUB
188 default m212 default m
189 help213 help
190 The PCI device backend driver allows the kernel to export arbitrary214 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
24obj-$(CONFIG_XEN_PVHVM_GUEST) += platform-pci.o24obj-$(CONFIG_XEN_PVHVM_GUEST) += platform-pci.o
25obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o25obj-$(CONFIG_SWIOTLB_XEN) += swiotlb-xen.o
26obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o26obj-$(CONFIG_XEN_MCE_LOG) += mcelog.o
27obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback/27obj-$(CONFIG_XEN_PCI_STUB) += xen-pciback/
28obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o28obj-$(CONFIG_XEN_PRIVCMD) += xen-privcmd.o
29obj-$(CONFIG_XEN_ACPI_PROCESSOR) += xen-acpi-processor.o29obj-$(CONFIG_XEN_ACPI_PROCESSOR) += xen-acpi-processor.o
30obj-$(CONFIG_XEN_EFI) += efi.o30obj-$(CONFIG_XEN_EFI) += efi.o
drivers/xen/balloon.c+78−35
@@ -58,6 +58,7 @@ · 57 unmodified lines
58#include <linux/percpu-defs.h>58#include <linux/percpu-defs.h>
59#include <linux/slab.h>59#include <linux/slab.h>
60#include <linux/sysctl.h>60#include <linux/sysctl.h>
61#include <linux/moduleparam.h>
61 62
62#include <asm/page.h>63#include <asm/page.h>
63#include <asm/tlb.h>64#include <asm/tlb.h>
@@ -73,9 +74,14 @@ · 9 unmodified lines
73#include <xen/page.h>74#include <xen/page.h>
74#include <xen/mem-reservation.h>75#include <xen/mem-reservation.h>
75 76
76static int xen_hotplug_unpopulated;77#undef MODULE_PARAM_PREFIX
78#define MODULE_PARAM_PREFIX "xen."
79
80static uint __read_mostly balloon_boot_timeout = 180;
81module_param(balloon_boot_timeout, uint, 0444);
77 82
78#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG83#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
84static int xen_hotplug_unpopulated;
79 85
80static struct ctl_table balloon_table[] = {86static struct ctl_table balloon_table[] = {
81 {87 {
@@ -108,6 +114,8 @@ static struct ctl_table xen_root[] = { · 26 unmodified lines
108 { }114 { }
109};115};
110 116
117#else
118#define xen_hotplug_unpopulated 0
111#endif119#endif
112 120
113/*121/*
@@ -125,12 +133,12 @@ static struct ctl_table xen_root[] = { · 11 unmodified lines
125 * BP_ECANCELED: error, balloon operation canceled.133 * BP_ECANCELED: error, balloon operation canceled.
126 */134 */
127 135
128enum bp_state {136static enum bp_state {
129 BP_DONE,137 BP_DONE,
130 BP_WAIT,138 BP_WAIT,
131 BP_EAGAIN,139 BP_EAGAIN,
132 BP_ECANCELED140 BP_ECANCELED
133};141} balloon_state = BP_DONE;
134 142
135/* Main waiting point for xen-balloon thread. */143/* Main waiting point for xen-balloon thread. */
136static DECLARE_WAIT_QUEUE_HEAD(balloon_thread_wq);144static DECLARE_WAIT_QUEUE_HEAD(balloon_thread_wq);
@@ -199,18 +207,15 @@ static struct page *balloon_next_page(struct page *page) · 62 unmodified lines
199 return list_entry(next, struct page, lru);207 return list_entry(next, struct page, lru);
200}208}
201 209
202static enum bp_state update_schedule(enum bp_state state)210static void update_schedule(void)
203{211{
204 if (state == BP_WAIT)212 if (balloon_state == BP_WAIT || balloon_state == BP_ECANCELED)
205 return BP_WAIT;213 return;
206
207 if (state == BP_ECANCELED)
208 return BP_ECANCELED;
209 214
210 if (state == BP_DONE) {215 if (balloon_state == BP_DONE) {
211 balloon_stats.schedule_delay = 1;216 balloon_stats.schedule_delay = 1;
212 balloon_stats.retry_count = 1;217 balloon_stats.retry_count = 1;
213 return BP_DONE;218 return;
214 }219 }
215 220
216 ++balloon_stats.retry_count;221 ++balloon_stats.retry_count;
@@ -219,7 +224,8 @@ static enum bp_state update_schedule(enum bp_state state) · 2 unmodified lines
219 balloon_stats.retry_count > balloon_stats.max_retry_count) {224 balloon_stats.retry_count > balloon_stats.max_retry_count) {
220 balloon_stats.schedule_delay = 1;225 balloon_stats.schedule_delay = 1;
221 balloon_stats.retry_count = 1;226 balloon_stats.retry_count = 1;
222 return BP_ECANCELED;227 balloon_state = BP_ECANCELED;
228 return;
223 }229 }
224 230
225 balloon_stats.schedule_delay <<= 1;231 balloon_stats.schedule_delay <<= 1;
@@ -227,7 +233,7 @@ static enum bp_state update_schedule(enum bp_state state) · 1 unmodified line
227 if (balloon_stats.schedule_delay > balloon_stats.max_schedule_delay)233 if (balloon_stats.schedule_delay > balloon_stats.max_schedule_delay)
228 balloon_stats.schedule_delay = balloon_stats.max_schedule_delay;234 balloon_stats.schedule_delay = balloon_stats.max_schedule_delay;
229 235
230 return BP_EAGAIN;236 balloon_state = BP_EAGAIN;
231}237}
232 238
233#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG239#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
494 * Stop waiting if either state is BP_DONE and ballooning action is500 * Stop waiting if either state is BP_DONE and ballooning action is
495 * needed, or if the credit has changed while state is not BP_DONE.501 * needed, or if the credit has changed while state is not BP_DONE.
496 */502 */
497static bool balloon_thread_cond(enum bp_state state, long credit)503static bool balloon_thread_cond(long credit)
498{504{
499 if (state == BP_DONE)505 if (balloon_state == BP_DONE)
500 credit = 0;506 credit = 0;
501 507
502 return current_credit() != credit || kthread_should_stop();508 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
510 */516 */
511static int balloon_thread(void *unused)517static int balloon_thread(void *unused)
512{518{
513 enum bp_state state = BP_DONE;
514 long credit;519 long credit;
515 unsigned long timeout;520 unsigned long timeout;
516 521
517 set_freezable();522 set_freezable();
518 for (;;) {523 for (;;) {
519 switch (state) {524 switch (balloon_state) {
520 case BP_DONE:525 case BP_DONE:
521 case BP_ECANCELED:526 case BP_ECANCELED:
522 timeout = 3600 * HZ;527 timeout = 3600 * HZ;
@@ -532,7 +537,7 @@ static int balloon_thread(void *unused) · 9 unmodified lines
532 credit = current_credit();537 credit = current_credit();
533 538
534 wait_event_freezable_timeout(balloon_thread_wq,539 wait_event_freezable_timeout(balloon_thread_wq,
535 balloon_thread_cond(state, credit), timeout);540 balloon_thread_cond(credit), timeout);
536 541
537 if (kthread_should_stop())542 if (kthread_should_stop())
538 return 0;543 return 0;
@@ -543,22 +548,23 @@ static int balloon_thread(void *unused) · 4 unmodified lines
543 548
544 if (credit > 0) {549 if (credit > 0) {
545 if (balloon_is_inflated())550 if (balloon_is_inflated())
546 state = increase_reservation(credit);551 balloon_state = increase_reservation(credit);
547 else552 else
548 state = reserve_additional_memory();553 balloon_state = reserve_additional_memory();
549 }554 }
550 555
551 if (credit < 0) {556 if (credit < 0) {
552 long n_pages;557 long n_pages;
553 558
554 n_pages = min(-credit, si_mem_available());559 n_pages = min(-credit, si_mem_available());
555 state = decrease_reservation(n_pages, GFP_BALLOON);560 balloon_state = decrease_reservation(n_pages,
556 if (state == BP_DONE && n_pages != -credit &&561 GFP_BALLOON);
562 if (balloon_state == BP_DONE && n_pages != -credit &&
557 n_pages < totalreserve_pages)563 n_pages < totalreserve_pages)
558 state = BP_EAGAIN;564 balloon_state = BP_EAGAIN;
559 }565 }
560 566
561 state = update_schedule(state);567 update_schedule();
562 568
563 mutex_unlock(&balloon_mutex);569 mutex_unlock(&balloon_mutex);
564 570
@@ -575,7 +581,8 @@ void balloon_set_new_target(unsigned long target) · 10 unmodified lines
575}581}
576EXPORT_SYMBOL_GPL(balloon_set_new_target);582EXPORT_SYMBOL_GPL(balloon_set_new_target);
577 583
578static int add_ballooned_pages(int nr_pages)584#ifndef CONFIG_XEN_UNPOPULATED_ALLOC
585static int add_ballooned_pages(unsigned int nr_pages)
579{586{
580 enum bp_state st;587 enum bp_state st;
581 588
@@ -603,14 +610,14 @@ static int add_ballooned_pages(int nr_pages) · 21 unmodified lines
603}610}
604 611
605/**612/**
606 * alloc_xenballooned_pages - get pages that have been ballooned out613 * xen_alloc_unpopulated_pages - get pages that have been ballooned out
607 * @nr_pages: Number of pages to get614 * @nr_pages: Number of pages to get
608 * @pages: pages returned615 * @pages: pages returned
609 * @return 0 on success, error otherwise616 * @return 0 on success, error otherwise
610 */617 */
611int alloc_xenballooned_pages(int nr_pages, struct page **pages)618int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages)
612{619{
613 int pgno = 0;620 unsigned int pgno = 0;
614 struct page *page;621 struct page *page;
615 int ret;622 int ret;
616 623
@@ -645,7 +652,7 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages) · 28 unmodified lines
645 return 0;652 return 0;
646 out_undo:653 out_undo:
647 mutex_unlock(&balloon_mutex);654 mutex_unlock(&balloon_mutex);
648 free_xenballooned_pages(pgno, pages);655 xen_free_unpopulated_pages(pgno, pages);
649 /*656 /*
650 * NB: free_xenballooned_pages will only subtract pgno pages, but since657 * NB: free_xenballooned_pages will only subtract pgno pages, but since
651 * target_unpopulated is incremented with nr_pages at the start we need658 * 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
654 balloon_stats.target_unpopulated -= nr_pages - pgno;661 balloon_stats.target_unpopulated -= nr_pages - pgno;
655 return ret;662 return ret;
656}663}
657EXPORT_SYMBOL(alloc_xenballooned_pages);664EXPORT_SYMBOL(xen_alloc_unpopulated_pages);
658 665
659/**666/**
660 * free_xenballooned_pages - return pages retrieved with get_ballooned_pages667 * xen_free_unpopulated_pages - return pages retrieved with get_ballooned_pages
661 * @nr_pages: Number of pages668 * @nr_pages: Number of pages
662 * @pages: pages to return669 * @pages: pages to return
663 */670 */
664void free_xenballooned_pages(int nr_pages, struct page **pages)671void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages)
665{672{
666 int i;673 unsigned int i;
667 674
668 mutex_lock(&balloon_mutex);675 mutex_lock(&balloon_mutex);
669 676
@@ -680,9 +687,9 @@ void free_xenballooned_pages(int nr_pages, struct page **pages) · 10 unmodified lines
680 687
681 mutex_unlock(&balloon_mutex);688 mutex_unlock(&balloon_mutex);
682}689}
683EXPORT_SYMBOL(free_xenballooned_pages);690EXPORT_SYMBOL(xen_free_unpopulated_pages);
684 691
685#if defined(CONFIG_XEN_PV) && !defined(CONFIG_XEN_UNPOPULATED_ALLOC)692#if defined(CONFIG_XEN_PV)
686static void __init balloon_add_region(unsigned long start_pfn,693static void __init balloon_add_region(unsigned long start_pfn,
687 unsigned long pages)694 unsigned long pages)
688{695{
@@ -705,6 +712,7 @@ static void __init balloon_add_region(unsigned long start_pfn, · 16 unmodified lines
705 balloon_stats.total_pages += extra_pfn_end - start_pfn;712 balloon_stats.total_pages += extra_pfn_end - start_pfn;
706}713}
707#endif714#endif
715#endif
708 716
709static int __init balloon_init(void)717static int __init balloon_init(void)
710{718{
@@ -765,3 +773,38 @@ static int __init balloon_init(void) · 54 unmodified lines
765 return 0;773 return 0;
766}774}
767subsys_initcall(balloon_init);775subsys_initcall(balloon_init);
776
777static 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}
810late_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
35 for (i = 0; i < count; i++) {35 for (i = 0; i < count; i++) {
36 struct page *page = pages[i];36 struct page *page = pages[i];
37 unsigned long pfn = page_to_pfn(page);37 unsigned long pfn = page_to_pfn(page);
38 int ret;
38 39
39 BUG_ON(!page);40 BUG_ON(!page);
40 41
@@ -46,16 +47,10 @@ void __xenmem_reservation_va_mapping_update(unsigned long count, · 5 unmodified lines
46 47
47 set_phys_to_machine(pfn, frames[i]);48 set_phys_to_machine(pfn, frames[i]);
48 49
49 /* Link back into the page tables if not highmem. */50 ret = HYPERVISOR_update_va_mapping(
50 if (!PageHighMem(page)) {51 (unsigned long)__va(pfn << PAGE_SHIFT),
51 int ret;52 mfn_pte(frames[i], PAGE_KERNEL), 0);
52 53 BUG_ON(ret);
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 }
59 }54 }
60}55}
61EXPORT_SYMBOL_GPL(__xenmem_reservation_va_mapping_update);56EXPORT_SYMBOL_GPL(__xenmem_reservation_va_mapping_update);
@@ -68,6 +63,7 @@ void __xenmem_reservation_va_mapping_reset(unsigned long count, · 6 unmodified lines
68 for (i = 0; i < count; i++) {63 for (i = 0; i < count; i++) {
69 struct page *page = pages[i];64 struct page *page = pages[i];
70 unsigned long pfn = page_to_pfn(page);65 unsigned long pfn = page_to_pfn(page);
66 int ret;
71 67
72 /*68 /*
73 * We don't support PV MMU when Linux and Xen are using69 * 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
75 */71 */
76 BUILD_BUG_ON(XEN_PAGE_SIZE != PAGE_SIZE);72 BUILD_BUG_ON(XEN_PAGE_SIZE != PAGE_SIZE);
77 73
78 if (!PageHighMem(page)) {74 ret = HYPERVISOR_update_va_mapping(
79 int ret;75 (unsigned long)__va(pfn << PAGE_SHIFT),
76 __pte_ma(0), 0);
77 BUG_ON(ret);
80 78
81 ret = HYPERVISOR_update_va_mapping(
82 (unsigned long)__va(pfn << PAGE_SHIFT),
83 __pte_ma(0), 0);
84 BUG_ON(ret);
85 }
86 __set_phys_to_machine(pfn, INVALID_P2M_ENTRY);79 __set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
87 }80 }
88}81}
drivers/xen/pci.c+76−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
8#include <linux/pci.h>8#include <linux/pci.h>
9#include <linux/acpi.h>9#include <linux/acpi.h>
10#include <linux/pci-acpi.h>10#include <linux/pci-acpi.h>
11#include <xen/pci.h>
11#include <xen/xen.h>12#include <xen/xen.h>
12#include <xen/interface/physdev.h>13#include <xen/interface/physdev.h>
13#include <xen/interface/xen.h>14#include <xen/interface/xen.h>
@@ -254,3 +255,78 @@ static int xen_mcfg_late(void) · 240 unmodified lines
254 return 0;255 return 0;
255}256}
256#endif257#endif
258
259#ifdef CONFIG_XEN_DOM0
260struct xen_device_domain_owner {
261 domid_t domain;
262 struct pci_dev *dev;
263 struct list_head list;
264};
265
266static DEFINE_SPINLOCK(dev_domain_list_spinlock);
267static struct list_head dev_domain_list = LIST_HEAD_INIT(dev_domain_list);
268
269static 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
280int 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}
292EXPORT_SYMBOL_GPL(xen_find_device_domain_owner);
293
294int 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}
314EXPORT_SYMBOL_GPL(xen_register_device_domain_owner);
315
316int 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}
331EXPORT_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
465 write_unlock_bh(&mappass->sock->sk->sk_callback_lock);465 write_unlock_bh(&mappass->sock->sk->sk_callback_lock);
466 }466 }
467 sock_release(mappass->sock);467 sock_release(mappass->sock);
468 flush_workqueue(mappass->wq);
469 destroy_workqueue(mappass->wq);468 destroy_workqueue(mappass->wq);
470 kfree(mappass);469 kfree(mappass);
471 470
drivers/xen/xen-acpi-processor.c+3−3
@@ -450,7 +450,7 @@ static struct acpi_processor_performance __percpu *acpi_perf_data; · 449 unmodified lines
450 450
451static void free_acpi_perf_data(void)451static void free_acpi_perf_data(void)
452{452{
453 unsigned int i;453 int i;
454 454
455 /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */455 /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
456 for_each_possible_cpu(i)456 for_each_possible_cpu(i)
@@ -462,7 +462,7 @@ static void free_acpi_perf_data(void) · 5 unmodified lines
462static int xen_upload_processor_pm_data(void)462static int xen_upload_processor_pm_data(void)
463{463{
464 struct acpi_processor *pr_backup = NULL;464 struct acpi_processor *pr_backup = NULL;
465 unsigned int i;465 int i;
466 int rc = 0;466 int rc = 0;
467 467
468 pr_info("Uploading Xen processor PM info\n");468 pr_info("Uploading Xen processor PM info\n");
@@ -518,7 +518,7 @@ static struct syscore_ops xap_syscore_ops = { · 49 unmodified lines
518 518
519static int __init xen_acpi_processor_init(void)519static int __init xen_acpi_processor_init(void)
520{520{
521 unsigned int i;521 int i;
522 int rc;522 int rc;
523 523
524 if (!xen_initial_domain())524 if (!xen_initial_domain())
drivers/xen/xen-pciback/Makefile+7−0
@@ -1,5 +1,12 @@
1# SPDX-License-Identifier: GPL-2.01# 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.
2obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o8obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o
9obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o
3 10
4xen-pciback-y := pci_stub.o pciback_ops.o xenbus.o11xen-pciback-y := pci_stub.o pciback_ops.o xenbus.o
5xen-pciback-y += conf_space.o conf_space_header.o \12xen-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
160 }160 }
161 161
162out:162out:
163 return ERR_PTR(err);163 return err ? ERR_PTR(err) : NULL;
164}164}
165 165
166static const struct config_field caplist_pm[] = {166static 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
236 else {236 else {
237 pos = (offset - PCI_BASE_ADDRESS_0) / 4;237 pos = (offset - PCI_BASE_ADDRESS_0) / 4;
238 if (pos && (res[pos - 1].flags & IORESOURCE_MEM_64)) {238 if (pos && (res[pos - 1].flags & IORESOURCE_MEM_64)) {
239 bar->val = res[pos - 1].start >> 32;239 /*
240 bar->len_val = -resource_size(&res[pos - 1]) >> 32;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;
241 return bar;245 return bar;
242 }246 }
243 }247 }
drivers/xen/xen-pciback/pci_stub.c+2−1
@@ -19,7 +19,8 @@ · 18 unmodified lines
19#include <linux/sched.h>19#include <linux/sched.h>
20#include <linux/atomic.h>20#include <linux/atomic.h>
21#include <xen/events.h>21#include <xen/events.h>
22#include <asm/xen/pci.h>22#include <xen/pci.h>
23#include <xen/xen.h>
23#include <asm/xen/hypervisor.h>24#include <asm/xen/hypervisor.h>
24#include <xen/interface/physdev.h>25#include <xen/interface/physdev.h>
25#include "pciback.h"26#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
71 struct pci_dev *dev);71 struct pci_dev *dev);
72void pcistub_put_pci_dev(struct pci_dev *dev);72void pcistub_put_pci_dev(struct pci_dev *dev);
73 73
74static inline bool xen_pcibk_pv_support(void)
75{
76 return IS_ENABLED(CONFIG_XEN_PCIDEV_BACKEND);
77}
78
74/* Ensure a device is turned off or reset */79/* Ensure a device is turned off or reset */
75void xen_pcibk_reset_device(struct pci_dev *pdev);80void xen_pcibk_reset_device(struct pci_dev *pdev);
76 81
drivers/xen/xen-pciback/xenbus.c+6−2
@@ -14,7 +14,7 @@ · 13 unmodified lines
14#include <linux/workqueue.h>14#include <linux/workqueue.h>
15#include <xen/xenbus.h>15#include <xen/xenbus.h>
16#include <xen/events.h>16#include <xen/events.h>
17#include <asm/xen/pci.h>17#include <xen/pci.h>
18#include "pciback.h"18#include "pciback.h"
19 19
20#define INVALID_EVTCHN_IRQ (-1)20#define INVALID_EVTCHN_IRQ (-1)
@@ -743,6 +743,9 @@ const struct xen_pcibk_backend *__read_mostly xen_pcibk_backend; · 722 unmodified lines
743 743
744int __init xen_pcibk_xenbus_register(void)744int __init xen_pcibk_xenbus_register(void)
745{745{
746 if (!xen_pcibk_pv_support())
747 return 0;
748
746 xen_pcibk_backend = &xen_pcibk_vpci_backend;749 xen_pcibk_backend = &xen_pcibk_vpci_backend;
747 if (passthrough)750 if (passthrough)
748 xen_pcibk_backend = &xen_pcibk_passthrough_backend;751 xen_pcibk_backend = &xen_pcibk_passthrough_backend;
@@ -752,5 +755,6 @@ int __init xen_pcibk_xenbus_register(void) · 3 unmodified lines
752 755
753void __exit xen_pcibk_xenbus_unregister(void)756void __exit xen_pcibk_xenbus_unregister(void)
754{757{
755 xenbus_unregister_driver(&xen_pcibk_driver);758 if (xen_pcibk_pv_support())
759 xenbus_unregister_driver(&xen_pcibk_driver);
756}760}
include/xen/arm/hypercall.h+0−15
@@ -53,7 +53,6 @@ unsigned long HYPERVISOR_hvm_op(int op, void *arg); · 52 unmodified lines
53int HYPERVISOR_memory_op(unsigned int cmd, void *arg);53int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
54int HYPERVISOR_physdev_op(int cmd, void *arg);54int HYPERVISOR_physdev_op(int cmd, void *arg);
55int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);55int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
56int HYPERVISOR_tmem_op(void *arg);
57int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);56int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
58int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,57int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
59 struct xen_dm_op_buf *bufs);58 struct xen_dm_op_buf *bufs);
@@ -74,18 +73,4 @@ HYPERVISOR_suspend(unsigned long start_info_mfn) · 14 unmodified lines
74 return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);73 return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
75}74}
76 75
77static inline void
78MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
79 unsigned int new_val, unsigned long flags)
80{
81 BUG();
82}
83
84static inline void
85MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
86 int count, int *success_count, domid_t domid)
87{
88 BUG();
89}
90
91#endif /* _ASM_ARM_XEN_HYPERCALL_H */76#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
26 26
27void balloon_set_new_target(unsigned long target);27void balloon_set_new_target(unsigned long target);
28 28
29int alloc_xenballooned_pages(int nr_pages, struct page **pages);
30void free_xenballooned_pages(int nr_pages, struct page **pages);
31
32#ifdef CONFIG_XEN_BALLOON29#ifdef CONFIG_XEN_BALLOON
33void xen_balloon_init(void);30void xen_balloon_init(void);
34#else31#else
include/xen/interface/callback.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * callback.h3 * callback.h
3 *4 *
4 * Register guest OS callbacks with Xen.5 * Register guest OS callbacks with Xen.
5 *6 *
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 *
24 * Copyright (c) 2006, Ian Campbell7 * Copyright (c) 2006, Ian Campbell
25 */8 */
26 9
include/xen/interface/elfnote.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * elfnote.h3 * elfnote.h
3 *4 *
4 * Definitions used for the Xen ELF notes.5 * Definitions used for the Xen ELF notes.
5 *6 *
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 *
24 * Copyright (c) 2006, Ian Campbell, XenSource Ltd.7 * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
25 */8 */
26 9
include/xen/interface/event_channel.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/******************************************************************************2/******************************************************************************
3 * event_channel.h3 * event_channel.h
4 *4 *
include/xen/interface/features.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/******************************************************************************2/******************************************************************************
3 * features.h3 * features.h
4 *4 *
include/xen/interface/grant_table.h+1−18
@@ -1,27 +1,10 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * grant_table.h3 * grant_table.h
3 *4 *
4 * Interface for granting foreign access to page frames, and receiving5 * Interface for granting foreign access to page frames, and receiving
5 * page-ownership transfers.6 * page-ownership transfers.
6 *7 *
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 *
25 * Copyright (c) 2004, K A Fraser8 * Copyright (c) 2004, K A Fraser
26 */9 */
27 10
include/xen/interface/hvm/dm_op.h+1−18
@@ -1,23 +1,6 @@
1/* SPDX-License-Identifier: MIT */
1/*2/*
2 * Copyright (c) 2016, Citrix Systems Inc3 * 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.
21 */4 */
22 5
23#ifndef __XEN_PUBLIC_HVM_DM_OP_H__6#ifndef __XEN_PUBLIC_HVM_DM_OP_H__
include/xen/interface/hvm/hvm_op.h+1−19
@@ -1,22 +1,4 @@
1/*1/* SPDX-License-Identifier: MIT */
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 */
20 2
21#ifndef __XEN_PUBLIC_HVM_HVM_OP_H__3#ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
22#define __XEN_PUBLIC_HVM_HVM_OP_H__4#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 */
1/*2/*
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 *
20 * Copyright (c) 2015, Roger Pau Monne <roger.pau@citrix.com>3 * Copyright (c) 2015, Roger Pau Monne <roger.pau@citrix.com>
21 */4 */
22 5
include/xen/interface/hvm/params.h+1−19
@@ -1,22 +1,4 @@
1/*1/* SPDX-License-Identifier: MIT */
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 */
20 2
21#ifndef __XEN_PUBLIC_HVM_PARAMS_H__3#ifndef __XEN_PUBLIC_HVM_PARAMS_H__
22#define __XEN_PUBLIC_HVM_PARAMS_H__4#define __XEN_PUBLIC_HVM_PARAMS_H__
include/xen/interface/hvm/start_info.h+1−18
@@ -1,22 +1,5 @@
1/* SPDX-License-Identifier: MIT */
1/*2/*
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 *
20 * Copyright (c) 2016, Citrix Systems, Inc.3 * Copyright (c) 2016, Citrix Systems, Inc.
21 */4 */
22 5
include/xen/interface/io/9pfs.h+1−18
@@ -1,24 +1,7 @@
1/* SPDX-License-Identifier: MIT */
1/*2/*
2 * 9pfs.h -- Xen 9PFS transport3 * 9pfs.h -- Xen 9PFS transport
3 *4 *
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 *
22 * Copyright (C) 2017 Stefano Stabellini <stefano@aporeto.com>5 * Copyright (C) 2017 Stefano Stabellini <stefano@aporeto.com>
23 */6 */
24 7
include/xen/interface/io/blkif.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/******************************************************************************2/******************************************************************************
3 * blkif.h3 * blkif.h
4 *4 *
include/xen/interface/io/console.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/******************************************************************************2/******************************************************************************
3 * console.h3 * console.h
4 *4 *
include/xen/interface/io/displif.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * displif.h3 * displif.h
3 *4 *
4 * Unified display device I/O interface for Xen guest OSes.5 * Unified display device I/O interface for Xen guest OSes.
5 *6 *
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 *
24 * Copyright (C) 2016-2017 EPAM Systems Inc.7 * Copyright (C) 2016-2017 EPAM Systems Inc.
25 *8 *
26 * Authors: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>9 * Authors: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
include/xen/interface/io/fbif.h+1−18
@@ -1,24 +1,7 @@
1/* SPDX-License-Identifier: MIT */
1/*2/*
2 * fbif.h -- Xen virtual frame buffer device3 * fbif.h -- Xen virtual frame buffer device
3 *4 *
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 *
22 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>5 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
23 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>6 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
24 */7 */
include/xen/interface/io/kbdif.h+1−18
@@ -1,24 +1,7 @@
1/* SPDX-License-Identifier: MIT */
1/*2/*
2 * kbdif.h -- Xen virtual keyboard/mouse3 * kbdif.h -- Xen virtual keyboard/mouse
3 *4 *
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 *
22 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>5 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
23 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>6 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
24 */7 */
include/xen/interface/io/netif.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * xen_netif.h3 * xen_netif.h
3 *4 *
4 * Unified network-device I/O interface for Xen guest OSes.5 * Unified network-device I/O interface for Xen guest OSes.
5 *6 *
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 *
24 * Copyright (c) 2003-2004, Keir Fraser7 * Copyright (c) 2003-2004, Keir Fraser
25 */8 */
26 9
include/xen/interface/io/pciif.h+1−18
@@ -1,24 +1,7 @@
1/* SPDX-License-Identifier: MIT */
1/*2/*
2 * PCI Backend/Frontend Common Data Structures & Macros3 * PCI Backend/Frontend Common Data Structures & Macros
3 *4 *
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 *
22 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>5 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
23 */6 */
24#ifndef __XEN_PCI_COMMON_H__7#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 */
2#ifndef __XEN_PROTOCOLS_H__2#ifndef __XEN_PROTOCOLS_H__
3#define __XEN_PROTOCOLS_H__3#define __XEN_PROTOCOLS_H__
4 4
include/xen/interface/io/pvcalls.h+2−0
@@ -1,3 +1,5 @@
1/* SPDX-License-Identifier: MIT */
2
1#ifndef __XEN_PUBLIC_IO_XEN_PVCALLS_H__3#ifndef __XEN_PUBLIC_IO_XEN_PVCALLS_H__
2#define __XEN_PUBLIC_IO_XEN_PVCALLS_H__4#define __XEN_PUBLIC_IO_XEN_PVCALLS_H__
3 5
include/xen/interface/io/ring.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * ring.h3 * ring.h
3 *4 *
4 * Shared producer-consumer ring macros.5 * Shared producer-consumer ring macros.
5 *6 *
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 *
24 * Tim Deegan and Andrew Warfield November 2004.7 * Tim Deegan and Andrew Warfield November 2004.
25 */8 */
26 9
include/xen/interface/io/sndif.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * sndif.h3 * sndif.h
3 *4 *
4 * Unified sound-device I/O interface for Xen guest OSes.5 * Unified sound-device I/O interface for Xen guest OSes.
5 *6 *
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 *
24 * Copyright (C) 2013-2015 GlobalLogic Inc.7 * Copyright (C) 2013-2015 GlobalLogic Inc.
25 * Copyright (C) 2016-2017 EPAM Systems Inc.8 * Copyright (C) 2016-2017 EPAM Systems Inc.
26 *9 *
include/xen/interface/io/vscsiif.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * vscsiif.h3 * vscsiif.h
3 *4 *
4 * Based on the blkif.h code.5 * Based on the blkif.h code.
5 *6 *
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 *
24 * Copyright(c) FUJITSU Limited 2008.7 * Copyright(c) FUJITSU Limited 2008.
25 */8 */
26 9
include/xen/interface/io/xenbus.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/*****************************************************************************2/*****************************************************************************
3 * xenbus.h3 * xenbus.h
4 *4 *
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 */
2/*2/*
3 * Details of the "wire" protocol between Xen Store Daemon and client3 * Details of the "wire" protocol between Xen Store Daemon and client
4 * library or guest kernel.4 * 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 */
2/******************************************************************************2/******************************************************************************
3 * memory.h3 * memory.h
4 *4 *
include/xen/interface/nmi.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/******************************************************************************2/******************************************************************************
3 * nmi.h3 * nmi.h
4 *4 *
include/xen/interface/physdev.h+1−19
@@ -1,22 +1,4 @@
1/*1/* SPDX-License-Identifier: MIT */
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 */
20 2
21#ifndef __XEN_PUBLIC_PHYSDEV_H__3#ifndef __XEN_PUBLIC_PHYSDEV_H__
22#define __XEN_PUBLIC_PHYSDEV_H__4#define __XEN_PUBLIC_PHYSDEV_H__
include/xen/interface/platform.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * platform.h3 * platform.h
3 *4 *
4 * Hardware platform operations. Intended for use by domain-0 kernel.5 * Hardware platform operations. Intended for use by domain-0 kernel.
5 *6 *
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 *
24 * Copyright (c) 2002-2006, K Fraser7 * Copyright (c) 2002-2006, K Fraser
25 */8 */
26 9
include/xen/interface/sched.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * sched.h3 * sched.h
3 *4 *
4 * Scheduler state interactions5 * Scheduler state interactions
5 *6 *
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 *
24 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>7 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
25 */8 */
26 9
include/xen/interface/vcpu.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * vcpu.h3 * vcpu.h
3 *4 *
4 * VCPU initialisation, query, and hotplug.5 * VCPU initialisation, query, and hotplug.
5 *6 *
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 *
24 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>7 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
25 */8 */
26 9
include/xen/interface/version.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2/******************************************************************************2/******************************************************************************
3 * version.h3 * version.h
4 *4 *
include/xen/interface/xen-mca.h+1−0
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * arch-x86/mca.h3 * arch-x86/mca.h
3 * Guest OS machine check interface to x86 Xen.4 * Guest OS machine check interface to x86 Xen.
include/xen/interface/xen.h+1−18
@@ -1,26 +1,9 @@
1/* SPDX-License-Identifier: MIT */
1/******************************************************************************2/******************************************************************************
2 * xen.h3 * xen.h
3 *4 *
4 * Guest OS interface to Xen.5 * Guest OS interface to Xen.
5 *6 *
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 *
24 * Copyright (c) 2004, K A Fraser7 * Copyright (c) 2004, K A Fraser
25 */8 */
26 9
include/xen/interface/xenpmu.h+1−1
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: MIT */
2#ifndef __XEN_PUBLIC_XENPMU_H__2#ifndef __XEN_PUBLIC_XENPMU_H__
3#define __XEN_PUBLIC_XENPMU_H__3#define __XEN_PUBLIC_XENPMU_H__
4 4
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)
7int xen_find_device_domain_owner(struct pci_dev *dev);
8int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
9int xen_unregister_device_domain_owner(struct pci_dev *dev);
10#else
11static inline int xen_find_device_domain_owner(struct pci_dev *dev)
12{
13 return -1;
14}
15
16static inline int xen_register_device_domain_owner(struct pci_dev *dev,
17 uint16_t domain)
18{
19 return -1;
20}
21
22static 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
52extern u64 xen_saved_max_mem_size;52extern u64 xen_saved_max_mem_size;
53#endif53#endif
54 54
55#ifdef CONFIG_XEN_UNPOPULATED_ALLOC
56int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages);55int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages);
57void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages);56void 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
63 57
64#endif /* _XEN_XEN_H */58#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