]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/traps: Introduce new init APIs
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 28 Dec 2024 14:56:40 +0000 (14:56 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 6 Jan 2025 14:19:10 +0000 (14:19 +0000)
xen/arch/x86/include/asm/traps.h
xen/arch/x86/setup.c
xen/arch/x86/traps-init.c

index 825f7441c86e62fb941d480b5d8e59cf5edc06ce..0c813927c31c50405f1e4959b982dffc746e3c36 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef ASM_TRAP_H
 #define ASM_TRAP_H
 
+void early_traps_init(void);
+void traps_init(void);
 void percpu_traps_init(void);
 
 const char *vector_name(unsigned int vec);
index a1d80f237c1c44aa0297cf73208e3eb2a6653857..e5d742ce3ef54651eb85ae0f264bb9c28de02af7 100644 (file)
@@ -1093,8 +1093,7 @@ void asmlinkage __init noreturn __start_xen(void)
 
     percpu_init_areas();
 
-    init_idt_traps();
-    load_system_tables();
+    early_traps_init();
 
     smp_prepare_boot_cpu();
     sort_exception_tables();
@@ -2016,7 +2015,7 @@ void asmlinkage __init noreturn __start_xen(void)
                                            &this_cpu(stubs).mfn);
     BUG_ON(!this_cpu(stubs.addr));
 
-    trap_init();
+    traps_init(); /* Needs stubs allocated. */
 
     cpu_init();
 
index 2eef8c577c0410d41aa79e2ad32964bb83acff4f..90338d561b377ac1cc39e7a9d598b29be01f9f90 100644 (file)
@@ -2,6 +2,8 @@
 /*
  * Configuration of event handling for all CPUs.
  */
+#include <xen/init.h>
+
 #include <asm/idt.h>
 #include <asm/msr.h>
 #include <asm/page.h>
 
 DEFINE_PER_CPU_READ_MOSTLY(idt_entry_t *, idt);
 
+/*
+ * Configure basic exception handling.  This is prior to parsing the command
+ * line or configuring a console, and needs to be as simple as possible.
+ */
+void __init early_traps_init(void)
+{
+    init_idt_traps();
+    load_system_tables();
+}
+
+/*
+ * Configure complete exception, interrupt and syscall handling.
+ */
+void __init traps_init(void)
+{
+    trap_init();
+}
+
+/*
+ * Set up per-CPU linkage registers for exception, interrupt and syscall
+ * handling.
+ */
 void percpu_traps_init(void)
 {
     subarch_percpu_traps_init();