#include <asm/monitor.h>
#include <asm/xstate.h>
-void svm_asm_do_resume(void);
+void noreturn svm_asm_do_resume(void);
u32 svm_feature_flags;
domain_crash(curr->domain);
}
+void noreturn vmx_asm_do_vmentry(void);
+
void vmx_do_resume(void)
{
struct vcpu *v = current;
!l1_table_offset((unsigned long)__2M_rwdata_end);
}
-static void noinline init_done(void)
+static void noreturn init_done(void)
{
void *va;
unsigned long start, end;
#define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
-#define switch_stack_and_jump(stack, fn) \
- asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" )
+#define switch_stack_and_jump(stack, fn) do { \
+ asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" ); \
+ unreachable(); \
+} while ( false )
#define reset_stack_and_jump(fn) switch_stack_and_jump(get_cpu_info(), fn)
# define SHADOW_STACK_WORK ""
#endif
+#if __GNUC__ >= 9
+# define ssaj_has_attr_noreturn(fn) __builtin_has_attribute(fn, __noreturn__)
+#else
+/* Simply can't check the property with older gcc. */
+# define ssaj_has_attr_noreturn(fn) true
+#endif
+
#define switch_stack_and_jump(fn, instr, constr) \
({ \
unsigned int tmp; \
+ (void)((fn) == (void (*)(void))NULL); \
+ BUILD_BUG_ON(!ssaj_has_attr_noreturn(fn)); \
__asm__ __volatile__ ( \
SHADOW_STACK_WORK \
"mov %[stk], %%rsp;" \
#define PI_xAPIC_NDST_MASK 0xFF00
void vmx_asm_vmexit_handler(struct cpu_user_regs);
-void vmx_asm_do_vmentry(void);
void vmx_intr_assist(void);
void noreturn vmx_do_resume(void);
void vmx_vlapic_msr_changed(struct vcpu *v);
void continue_running(
struct vcpu *same);
-void startup_cpu_idle_loop(void);
+void noreturn startup_cpu_idle_loop(void);
extern void (*pm_idle) (void);
extern void (*dead_idle) (void);