x86/cet: Fix build on newer versions of GCC
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Aug 2021 10:38:07 +0000 (11:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Aug 2021 11:55:48 +0000 (12:55 +0100)
commit54c9736382e0d558a6acd820e44185e020131c48
tree4e26d48511edf75ed0c3b590a57266e8f29c647c
parent35727551c0703493a2240e967cffc3063b13d49c
x86/cet: Fix build on newer versions of GCC

Some versions of GCC complain with:

  traps.c:405:22: error: 'get_shstk_bottom' defined but not used [-Werror=unused-function]
   static unsigned long get_shstk_bottom(unsigned long sp)
                        ^~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Change #ifdef to if ( IS_ENABLED(...) ) to make the sole user of
get_shstk_bottom() visible to the compiler.

Fixes: 35727551c070 ("x86/cet: Fix shskt manipulation error with BUGFRAME_{warn,run_fn}")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Compile-tested-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
xen/arch/x86/traps.c