Skip to contentSkip to conversation

x86/traps: use only one stub function for l/cstar

PATCH In review Wei Liu 2 participants 2 messages Nov 9, 2018

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 x86/traps: use only one stub function for l/cstar

And place it into .text.cold.

---
v2: use #define

---
 xen/arch/x86/x86_64/traps.c | 11 ++++-------
 xen/include/xen/init.h      |  1 +
 2 files changed, 5 insertions(+), 7 deletions(-)
xen/arch/x86/x86_64/traps.c +4 -7
index 4d506e2c18..bf7870ef6d 100644
@@ -303,15 +303,12 @@ DEFINE_PER_CPU(struct stubs, stubs);
 void lstar_enter(void);
 void cstar_enter(void);
 #else
-static inline void lstar_enter(void)
+static void __cold star_enter(void)
 {
-    panic("%s called\n", __func__);
-}
-
-static inline void cstar_enter(void)
-{
-    panic("%s called\n", __func__);
+    panic("lstar/cstar\n");
 }
+#define lstar_enter star_enter
+#define cstar_enter star_enter
 #endif /* CONFIG_PV */
 
 void subarch_percpu_traps_init(void)
xen/include/xen/init.h +1 -0
index db06c76fdf..c6b453adfe 100644
@@ -9,6 +9,7 @@
  */
 #define __init            __text_section(".init.text")
 #define __exit            __text_section(".exit.text")
+#define __cold            __text_section(".text.cold")
 #define __initdata        __section(".init.data")
 #define __initconst       __section(".init.rodata")
 #define __initconstrel    __section(".init.rodata.rel")
Signature · 7 lines
2.11.0


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