• Ingo Molnar's avatar
    x86/alternatives, x86/fpu: Add 'alternatives_patched' debug flag and use it in xsave_state() · 5e907bb0
    Ingo Molnar authored
    We'd like to use xsave_state() earlier, but its SYSTEM_BOOTING check
    is too imprecise.
    
    The real condition that xsave_state() would like to check is whether
    alternative XSAVE instructions were patched into the kernel image
    already.
    
    Add such a (read-mostly) debug flag and use it in xsave_state().
    
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Fenghua Yu <fenghua.yu@intel.com>
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    5e907bb0
alternative.c 19.4 KB