Skip to contentSkip to conversation

xen: setup pv irq ops vector earlier

PATCH In review Juergen Gross 2 participants 3 messages Jul 12, 2018

Subsystems (3)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH v2 1/1 xen: setup pv irq ops vector earlier

Setting pv_irq_ops for Xen PV domains should be done as early as possible in order to support e.g. very early printk() usage.

The same applies to xen_vcpu_info_reset(0), as it is needed for the pv irq ops.

Move the call of xen_setup_machphys_mapping() after initializing the pv functions as it contains a WARN_ON(), too.

Remove the no longer necessary conditional in xen_init_irq_ops() from PVH V1 times to make clear this is a PV only function.

---
 arch/x86/xen/enlighten_pv.c | 24 +++++++++++-------------
 arch/x86/xen/irq.c          |  4 +---
 2 files changed, 12 insertions(+), 16 deletions(-)
arch/x86/xen/enlighten_pv.c +11 -13
index 4816b6f82a9a..439a94bf89ad 100644
@@ -1207,12 +1207,20 @@ asmlinkage __visible void __init xen_start_kernel(void)
 
 	xen_setup_features();
 
-	xen_setup_machphys_mapping();
-
 	/* Install Xen paravirt ops */
 	pv_info = xen_info;
 	pv_init_ops.patch = paravirt_patch_default;
 	pv_cpu_ops = xen_cpu_ops;
+	xen_init_irq_ops();
+
+	/*
+	 * Setup xen_vcpu early because it is needed for
+	 * local_irq_disable(), irqs_disabled(), e.g. in printk().
+	 *
+	 * Don't do the full vcpu_info placement stuff until we have
+	 * the cpu_possible_mask and a non-dummy shared_info.
+	 */
+	xen_vcpu_info_reset(0);
 
 	x86_platform.get_nmi_reason = xen_get_nmi_reason;
 
@@ -1225,6 +1233,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	 * Set up some pagetable state before starting to set any ptes.
 	 */
 
+	xen_setup_machphys_mapping();
 	xen_init_mmu_ops();
 
 	/* Prevent unwanted bits from being set in PTEs. */
@@ -1250,20 +1259,9 @@ asmlinkage __visible void __init xen_start_kernel(void)
 	get_cpu_cap(&boot_cpu_data);
 	x86_configure_nx();
 
-	xen_init_irq_ops();
-
 	/* Let's presume PV guests always boot on vCPU with id 0. */
 	per_cpu(xen_vcpu_id, 0) = 0;
 
-	/*
-	 * Setup xen_vcpu early because idt_setup_early_handler needs it for
-	 * local_irq_disable(), irqs_disabled().
-	 *
-	 * Don't do the full vcpu_info placement stuff until we have
-	 * the cpu_possible_mask and a non-dummy shared_info.
-	 */
-	xen_vcpu_info_reset(0);
-
 	idt_setup_early_handler();
 
 	xen_init_capabilities();
arch/x86/xen/irq.c +1 -3
index 74179852e46c..7515a19fd324 100644
@@ -128,8 +128,6 @@ static const struct pv_irq_ops xen_irq_ops __initconst = {
 
 void __init xen_init_irq_ops(void)
 {
-	/* For PVH we use default pv_irq_ops settings. */
-	if (!xen_feature(XENFEAT_hvm_callback_vector))
-		pv_irq_ops = xen_irq_ops;
+	pv_irq_ops = xen_irq_ops;
 	x86_init.irqs.intr_init = xen_init_IRQ;
 }
Signature · 1 line
2.13.7
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Juergen Gross

Setting pv_irq_ops for Xen PV domains should be done as early as possible in order to support e.g. very early printk() usage.

The same applies to xen_vcpu_info_reset(0), as it is needed for the pv irq ops.

Quoted 8 lines

Move the call of xen_setup_machphys_mapping() after initializing the pv functions as it contains a WARN_ON(), too.

Remove the no longer necessary conditional in xen_init_irq_ops() from PVH V1 times to make clear this is a PV only function.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Juergen Gross
Quoted 6 lines · Juergen Gross

Setting pv_irq_ops for Xen PV domains should be done as early as possible in order to support e.g. very early printk() usage.

The same applies to xen_vcpu_info_reset(0), as it is needed for the pv irq ops.

Quoted 8 lines

Move the call of xen_setup_machphys_mapping() after initializing the pv functions as it contains a WARN_ON(), too.

Remove the no longer necessary conditional in xen_init_irq_ops() from PVH V1 times to make clear this is a PV only function.