[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] x86/traps: use only one stub function for l/cstar



And place it into .text.cold.

Requested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
v2: use #define
---
 xen/arch/x86/x86_64/traps.c | 11 ++++-------
 xen/include/xen/init.h      |  1 +
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 4d506e2c18..bf7870ef6d 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -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)
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index db06c76fdf..c6b453adfe 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -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")
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.