Skip to content

Commit bf98ecb

Browse files
committed
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() ...
2 parents 4287af3 + 501586e commit bf98ecb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+496
-968
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6379,6 +6379,13 @@
63796379
improve timer resolution at the expense of processing
63806380
more timer interrupts.
63816381

6382+
xen.balloon_boot_timeout= [XEN]
6383+
The time (in seconds) to wait before giving up to boot
6384+
in case initial ballooning fails to free enough memory.
6385+
Applies only when running as HVM or PVH guest and
6386+
started with less memory configured than allowed at
6387+
max. Default is 180.
6388+
63826389
xen.event_eoi_delay= [XEN]
63836390
How long to delay EOI handling in case of event
63846391
storms (jiffies). Default is 10.

arch/arm/xen/enlighten.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op);
442442
EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op);
443443
EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op);
444444
EXPORT_SYMBOL_GPL(HYPERVISOR_vcpu_op);
445-
EXPORT_SYMBOL_GPL(HYPERVISOR_tmem_op);
446445
EXPORT_SYMBOL_GPL(HYPERVISOR_platform_op_raw);
447446
EXPORT_SYMBOL_GPL(HYPERVISOR_multicall);
448447
EXPORT_SYMBOL_GPL(HYPERVISOR_vm_assist);

arch/arm/xen/hypercall.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ HYPERCALL2(hvm_op);
8888
HYPERCALL2(memory_op);
8989
HYPERCALL2(physdev_op);
9090
HYPERCALL3(vcpu_op);
91-
HYPERCALL1(tmem_op);
9291
HYPERCALL1(platform_op_raw);
9392
HYPERCALL2(multicall);
9493
HYPERCALL2(vm_assist);

arch/arm64/xen/hypercall.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ HYPERCALL2(hvm_op);
8080
HYPERCALL2(memory_op);
8181
HYPERCALL2(physdev_op);
8282
HYPERCALL3(vcpu_op);
83-
HYPERCALL1(tmem_op);
8483
HYPERCALL1(platform_op_raw);
8584
HYPERCALL2(multicall);
8685
HYPERCALL2(vm_assist);

arch/x86/include/asm/paravirt_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,9 @@ void paravirt_leave_lazy_mmu(void);
577577
void paravirt_flush_lazy_mmu(void);
578578

579579
void _paravirt_nop(void);
580+
void paravirt_BUG(void);
580581
u64 _paravirt_ident_64(u64);
582+
unsigned long paravirt_ret0(void);
581583

582584
#define paravirt_nop ((void *)_paravirt_nop)
583585

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

Lines changed: 102 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ privcmd_call(unsigned int call,
248248
return res;
249249
}
250250

251+
#ifdef CONFIG_XEN_PV
251252
static inline int
252253
HYPERVISOR_set_trap_table(struct trap_info *table)
253254
{
@@ -280,6 +281,107 @@ HYPERVISOR_callback_op(int cmd, void *arg)
280281
return _hypercall2(int, callback_op, cmd, arg);
281282
}
282283

284+
static inline int
285+
HYPERVISOR_set_debugreg(int reg, unsigned long value)
286+
{
287+
return _hypercall2(int, set_debugreg, reg, value);
288+
}
289+
290+
static inline unsigned long
291+
HYPERVISOR_get_debugreg(int reg)
292+
{
293+
return _hypercall1(unsigned long, get_debugreg, reg);
294+
}
295+
296+
static inline int
297+
HYPERVISOR_update_descriptor(u64 ma, u64 desc)
298+
{
299+
return _hypercall2(int, update_descriptor, ma, desc);
300+
}
301+
302+
static inline int
303+
HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
304+
unsigned long flags)
305+
{
306+
return _hypercall3(int, update_va_mapping, va, new_val.pte, flags);
307+
}
308+
309+
static inline int
310+
HYPERVISOR_set_segment_base(int reg, unsigned long value)
311+
{
312+
return _hypercall2(int, set_segment_base, reg, value);
313+
}
314+
315+
static inline void
316+
MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
317+
{
318+
mcl->op = __HYPERVISOR_fpu_taskswitch;
319+
mcl->args[0] = set;
320+
321+
trace_xen_mc_entry(mcl, 1);
322+
}
323+
324+
static inline void
325+
MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
326+
pte_t new_val, unsigned long flags)
327+
{
328+
mcl->op = __HYPERVISOR_update_va_mapping;
329+
mcl->args[0] = va;
330+
mcl->args[1] = new_val.pte;
331+
mcl->args[2] = flags;
332+
333+
trace_xen_mc_entry(mcl, 3);
334+
}
335+
336+
static inline void
337+
MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
338+
struct desc_struct desc)
339+
{
340+
mcl->op = __HYPERVISOR_update_descriptor;
341+
mcl->args[0] = maddr;
342+
mcl->args[1] = *(unsigned long *)&desc;
343+
344+
trace_xen_mc_entry(mcl, 2);
345+
}
346+
347+
static inline void
348+
MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
349+
int count, int *success_count, domid_t domid)
350+
{
351+
mcl->op = __HYPERVISOR_mmu_update;
352+
mcl->args[0] = (unsigned long)req;
353+
mcl->args[1] = count;
354+
mcl->args[2] = (unsigned long)success_count;
355+
mcl->args[3] = domid;
356+
357+
trace_xen_mc_entry(mcl, 4);
358+
}
359+
360+
static inline void
361+
MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
362+
int *success_count, domid_t domid)
363+
{
364+
mcl->op = __HYPERVISOR_mmuext_op;
365+
mcl->args[0] = (unsigned long)op;
366+
mcl->args[1] = count;
367+
mcl->args[2] = (unsigned long)success_count;
368+
mcl->args[3] = domid;
369+
370+
trace_xen_mc_entry(mcl, 4);
371+
}
372+
373+
static inline void
374+
MULTI_stack_switch(struct multicall_entry *mcl,
375+
unsigned long ss, unsigned long esp)
376+
{
377+
mcl->op = __HYPERVISOR_stack_switch;
378+
mcl->args[0] = ss;
379+
mcl->args[1] = esp;
380+
381+
trace_xen_mc_entry(mcl, 2);
382+
}
383+
#endif
384+
283385
static inline int
284386
HYPERVISOR_sched_op(int cmd, void *arg)
285387
{
@@ -308,26 +410,6 @@ HYPERVISOR_platform_op(struct xen_platform_op *op)
308410
return _hypercall1(int, platform_op, op);
309411
}
310412

311-
static __always_inline int
312-
HYPERVISOR_set_debugreg(int reg, unsigned long value)
313-
{
314-
return _hypercall2(int, set_debugreg, reg, value);
315-
}
316-
317-
static __always_inline unsigned long
318-
HYPERVISOR_get_debugreg(int reg)
319-
{
320-
return _hypercall1(unsigned long, get_debugreg, reg);
321-
}
322-
323-
static inline int
324-
HYPERVISOR_update_descriptor(u64 ma, u64 desc)
325-
{
326-
if (sizeof(u64) == sizeof(long))
327-
return _hypercall2(int, update_descriptor, ma, desc);
328-
return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
329-
}
330-
331413
static inline long
332414
HYPERVISOR_memory_op(unsigned int cmd, void *arg)
333415
{
@@ -340,18 +422,6 @@ HYPERVISOR_multicall(void *call_list, uint32_t nr_calls)
340422
return _hypercall2(int, multicall, call_list, nr_calls);
341423
}
342424

343-
static inline int
344-
HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
345-
unsigned long flags)
346-
{
347-
if (sizeof(new_val) == sizeof(long))
348-
return _hypercall3(int, update_va_mapping, va,
349-
new_val.pte, flags);
350-
else
351-
return _hypercall4(int, update_va_mapping, va,
352-
new_val.pte, new_val.pte >> 32, flags);
353-
}
354-
355425
static inline int
356426
HYPERVISOR_event_channel_op(int cmd, void *arg)
357427
{
@@ -394,14 +464,6 @@ HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
394464
return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
395465
}
396466

397-
#ifdef CONFIG_X86_64
398-
static inline int
399-
HYPERVISOR_set_segment_base(int reg, unsigned long value)
400-
{
401-
return _hypercall2(int, set_segment_base, reg, value);
402-
}
403-
#endif
404-
405467
static inline int
406468
HYPERVISOR_suspend(unsigned long start_info_mfn)
407469
{
@@ -422,13 +484,6 @@ HYPERVISOR_hvm_op(int op, void *arg)
422484
return _hypercall2(unsigned long, hvm_op, op, arg);
423485
}
424486

425-
static inline int
426-
HYPERVISOR_tmem_op(
427-
struct tmem_op *op)
428-
{
429-
return _hypercall1(int, tmem_op, op);
430-
}
431-
432487
static inline int
433488
HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
434489
{
@@ -446,88 +501,4 @@ HYPERVISOR_dm_op(
446501
return ret;
447502
}
448503

449-
static inline void
450-
MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
451-
{
452-
mcl->op = __HYPERVISOR_fpu_taskswitch;
453-
mcl->args[0] = set;
454-
455-
trace_xen_mc_entry(mcl, 1);
456-
}
457-
458-
static inline void
459-
MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
460-
pte_t new_val, unsigned long flags)
461-
{
462-
mcl->op = __HYPERVISOR_update_va_mapping;
463-
mcl->args[0] = va;
464-
if (sizeof(new_val) == sizeof(long)) {
465-
mcl->args[1] = new_val.pte;
466-
mcl->args[2] = flags;
467-
} else {
468-
mcl->args[1] = new_val.pte;
469-
mcl->args[2] = new_val.pte >> 32;
470-
mcl->args[3] = flags;
471-
}
472-
473-
trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 3 : 4);
474-
}
475-
476-
static inline void
477-
MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
478-
struct desc_struct desc)
479-
{
480-
mcl->op = __HYPERVISOR_update_descriptor;
481-
if (sizeof(maddr) == sizeof(long)) {
482-
mcl->args[0] = maddr;
483-
mcl->args[1] = *(unsigned long *)&desc;
484-
} else {
485-
u32 *p = (u32 *)&desc;
486-
487-
mcl->args[0] = maddr;
488-
mcl->args[1] = maddr >> 32;
489-
mcl->args[2] = *p++;
490-
mcl->args[3] = *p;
491-
}
492-
493-
trace_xen_mc_entry(mcl, sizeof(maddr) == sizeof(long) ? 2 : 4);
494-
}
495-
496-
static inline void
497-
MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
498-
int count, int *success_count, domid_t domid)
499-
{
500-
mcl->op = __HYPERVISOR_mmu_update;
501-
mcl->args[0] = (unsigned long)req;
502-
mcl->args[1] = count;
503-
mcl->args[2] = (unsigned long)success_count;
504-
mcl->args[3] = domid;
505-
506-
trace_xen_mc_entry(mcl, 4);
507-
}
508-
509-
static inline void
510-
MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
511-
int *success_count, domid_t domid)
512-
{
513-
mcl->op = __HYPERVISOR_mmuext_op;
514-
mcl->args[0] = (unsigned long)op;
515-
mcl->args[1] = count;
516-
mcl->args[2] = (unsigned long)success_count;
517-
mcl->args[3] = domid;
518-
519-
trace_xen_mc_entry(mcl, 4);
520-
}
521-
522-
static inline void
523-
MULTI_stack_switch(struct multicall_entry *mcl,
524-
unsigned long ss, unsigned long esp)
525-
{
526-
mcl->op = __HYPERVISOR_stack_switch;
527-
mcl->args[0] = ss;
528-
mcl->args[1] = esp;
529-
530-
trace_xen_mc_entry(mcl, 2);
531-
}
532-
533504
#endif /* _ASM_X86_XEN_HYPERCALL_H */

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@ void xen_arch_register_cpu(int num);
6262
void xen_arch_unregister_cpu(int num);
6363
#endif
6464

65+
#ifdef CONFIG_PVH
66+
void __init xen_pvh_init(struct boot_params *boot_params);
67+
#endif
68+
6569
#endif /* _ASM_X86_XEN_HYPERVISOR_H */

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,6 @@ static inline int __init pci_xen_initial_domain(void)
2222
return -1;
2323
}
2424
#endif
25-
#ifdef CONFIG_XEN_DOM0
26-
int xen_find_device_domain_owner(struct pci_dev *dev);
27-
int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
28-
int xen_unregister_device_domain_owner(struct pci_dev *dev);
29-
#else
30-
static inline int xen_find_device_domain_owner(struct pci_dev *dev)
31-
{
32-
return -1;
33-
}
34-
static inline int xen_register_device_domain_owner(struct pci_dev *dev,
35-
uint16_t domain)
36-
{
37-
return -1;
38-
}
39-
static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
40-
{
41-
return -1;
42-
}
43-
#endif
4425

4526
#if defined(CONFIG_PCI_MSI)
4627
#if defined(CONFIG_PCI_XEN)

arch/x86/kernel/paravirt.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,25 @@ asm (".pushsection .entry.text, \"ax\"\n"
4646
".type _paravirt_nop, @function\n\t"
4747
".popsection");
4848

49+
/* stub always returning 0. */
50+
asm (".pushsection .entry.text, \"ax\"\n"
51+
".global paravirt_ret0\n"
52+
"paravirt_ret0:\n\t"
53+
"xor %" _ASM_AX ", %" _ASM_AX ";\n\t"
54+
"ret\n\t"
55+
".size paravirt_ret0, . - paravirt_ret0\n\t"
56+
".type paravirt_ret0, @function\n\t"
57+
".popsection");
58+
59+
4960
void __init default_banner(void)
5061
{
5162
printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
5263
pv_info.name);
5364
}
5465

5566
/* Undefined instruction for dealing with missing ops pointers. */
56-
static void paravirt_BUG(void)
67+
noinstr void paravirt_BUG(void)
5768
{
5869
BUG();
5970
}

0 commit comments

Comments
 (0)