]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/include/asm/xsave.h
x86, xsave: Use xsaveopt in context-switch path when supported
[karo-tx-linux.git] / arch / x86 / include / asm / xsave.h
index 0c72adc0cb151f04d15015ec47c1309ff82491a2..ec86c5fd6a6e2fc4dcdbf53fd95fb4bd8d14b393 100644 (file)
@@ -125,8 +125,11 @@ static inline void fpu_xsave(struct fpu *fpu)
 {
        /* This, however, we can work around by forcing the compiler to select
           an addressing mode that doesn't require extended registers. */
-       __asm__ __volatile__(".byte " REX_PREFIX "0x0f,0xae,0x27"
-                            : : "D" (&(fpu->state->xsave)),
-                                "a" (-1), "d"(-1) : "memory");
+       alternative_input(
+               ".byte " REX_PREFIX "0x0f,0xae,0x27",
+               ".byte " REX_PREFIX "0x0f,0xae,0x37",
+               X86_FEATURE_XSAVEOPT,
+               [fx] "D" (&fpu->state->xsave), "a" (-1), "d" (-1) :
+               "memory");
 }
 #endif