]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Further LTO cleanup
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jul 2017 12:13:49 +0000 (13:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jul 2017 12:13:49 +0000 (13:13 +0100)
Drop __used annotations for extable handlers, and use an "X" constraint.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/pv/traps.c
tests/invlpg/main.c
tests/selftest/main.c

index 71c8409f60f39decbbec7e027485d5feb41dcc5f..4a772f8b435f2fe75e64f0cc2d55dba0f6bcc871 100644 (file)
@@ -71,8 +71,7 @@ int xtf_set_idte(unsigned int vector, struct xtf_idte *idte)
 }
 
 #ifdef __i386__
-static bool __used ex_pf_user(struct cpu_regs *regs,
-                              const struct extable_entry *ex)
+static bool ex_pf_user(struct cpu_regs *regs, const struct extable_entry *ex)
 {
     if ( regs->entry_vector == X86_EXC_PF && read_cr2() == 0xfff )
     {
@@ -159,7 +158,8 @@ void arch_init_traps(void)
                       _ASM_EXTABLE_HANDLER(1b,    3b, ex_pf_user)
                       _ASM_EXTABLE_HANDLER(0xfff, 2b, ex_pf_user)
                       : "+a" (leaked)
-                      : [ptr] "r" (0xfff));
+                      : [ptr] "r" (0xfff),
+                        "X" (ex_pf_user));
 
         if ( leaked )
             panic("Xen's SMEP/SMAP settings leaked into guest context.\n"
index 7abfcb5ea0ef1c46139fb3c355bf0533396e3b8b..67429be14a4d31fab23d8db6cdfec84687daf359 100644 (file)
@@ -100,8 +100,7 @@ const char test_title[] = "Invlpg tests";
  * Custom extable handler, linked to all `invlpg` instruction which are
  * expected not to fault.
  */
-static bool __used ex_fail(struct cpu_regs *regs,
-                           const struct extable_entry *ex)
+static bool ex_fail(struct cpu_regs *regs, const struct extable_entry *ex)
 {
     char buf[16];
 
@@ -136,7 +135,8 @@ static unsigned int invlpg_refill(void)
                   : [zero] "q" (0),
                     [ad]   "i" (_PAGE_AD),
                     [pte1] "m" (pae_l1_identmap[1]),
-                    [pte2] "m" (pae_l1_identmap[2])
+                    [pte2] "m" (pae_l1_identmap[2]),
+                    "X" (ex_fail)
                   : "memory");
 
     return ((test_ad(pae_l1_identmap[1]) << 0) |
@@ -158,7 +158,8 @@ static unsigned int invlpg_fs_refill(void)
                   : [zero] "q" (0),
                     [ad]   "i" (_PAGE_AD),
                     [pte1] "m" (pae_l1_identmap[1]),
-                    [pte2] "m" (pae_l1_identmap[2])
+                    [pte2] "m" (pae_l1_identmap[2]),
+                    "X" (ex_fail)
                   : "memory");
 
     return ((test_ad(pae_l1_identmap[1]) << 0) |
@@ -261,7 +262,7 @@ static void invlpg_fs_checked(unsigned long linear)
     asm volatile (_ASM_MAYBE_XEN_FEP
                   "1: invlpg %%fs:(%0); 2:"
                   _ASM_EXTABLE_HANDLER(1b, 2b, ex_fail)
-                  :: "r" (linear));
+                  :: "r" (linear), "X" (ex_fail));
 }
 
 static void test_no_fault(void)
index 322b357afa9da2b8fe1d6668a02e4c85f95514be..bb12afcf95e404534464fa17c4d384a01f0db7e5 100644 (file)
@@ -212,8 +212,8 @@ static void test_unhandled_exception_hook(void)
 }
 
 static bool test_extable_handler_handler_run;
-static bool __used test_extable_handler_handler(struct cpu_regs *regs,
-                                                const struct extable_entry *ex)
+static bool test_extable_handler_handler(struct cpu_regs *regs,
+                                         const struct extable_entry *ex)
 {
     test_extable_handler_handler_run = true;
     regs->ip = ex->fixup;
@@ -226,7 +226,8 @@ static void test_extable_handler(void)
 
     asm volatile ("1: ud2a; 2:"
                   _ASM_EXTABLE_HANDLER(1b, 2b,
-                                       test_extable_handler_handler));
+                                       test_extable_handler_handler)
+                  :: "X" (test_extable_handler_handler));
 
     if ( !test_extable_handler_handler_run )
         xtf_failure("Fail: Custom handler didn't run\n");