Skip to content

Commit 0ce0bba

Browse files
committed
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. Cc: <[email protected]> # 4.14 Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent e69b5d3 commit 0ce0bba

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

arch/x86/xen/enlighten_pv.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,12 +1207,20 @@ asmlinkage __visible void __init xen_start_kernel(void)
12071207

12081208
xen_setup_features();
12091209

1210-
xen_setup_machphys_mapping();
1211-
12121210
/* Install Xen paravirt ops */
12131211
pv_info = xen_info;
12141212
pv_init_ops.patch = paravirt_patch_default;
12151213
pv_cpu_ops = xen_cpu_ops;
1214+
xen_init_irq_ops();
1215+
1216+
/*
1217+
* Setup xen_vcpu early because it is needed for
1218+
* local_irq_disable(), irqs_disabled(), e.g. in printk().
1219+
*
1220+
* Don't do the full vcpu_info placement stuff until we have
1221+
* the cpu_possible_mask and a non-dummy shared_info.
1222+
*/
1223+
xen_vcpu_info_reset(0);
12161224

12171225
x86_platform.get_nmi_reason = xen_get_nmi_reason;
12181226

@@ -1225,6 +1233,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
12251233
* Set up some pagetable state before starting to set any ptes.
12261234
*/
12271235

1236+
xen_setup_machphys_mapping();
12281237
xen_init_mmu_ops();
12291238

12301239
/* Prevent unwanted bits from being set in PTEs. */
@@ -1250,20 +1259,9 @@ asmlinkage __visible void __init xen_start_kernel(void)
12501259
get_cpu_cap(&boot_cpu_data);
12511260
x86_configure_nx();
12521261

1253-
xen_init_irq_ops();
1254-
12551262
/* Let's presume PV guests always boot on vCPU with id 0. */
12561263
per_cpu(xen_vcpu_id, 0) = 0;
12571264

1258-
/*
1259-
* Setup xen_vcpu early because idt_setup_early_handler needs it for
1260-
* local_irq_disable(), irqs_disabled().
1261-
*
1262-
* Don't do the full vcpu_info placement stuff until we have
1263-
* the cpu_possible_mask and a non-dummy shared_info.
1264-
*/
1265-
xen_vcpu_info_reset(0);
1266-
12671265
idt_setup_early_handler();
12681266

12691267
xen_init_capabilities();

arch/x86/xen/irq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ static const struct pv_irq_ops xen_irq_ops __initconst = {
128128

129129
void __init xen_init_irq_ops(void)
130130
{
131-
/* For PVH we use default pv_irq_ops settings. */
132-
if (!xen_feature(XENFEAT_hvm_callback_vector))
133-
pv_irq_ops = xen_irq_ops;
131+
pv_irq_ops = xen_irq_ops;
134132
x86_init.irqs.intr_init = xen_init_IRQ;
135133
}

0 commit comments

Comments
 (0)