aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/cpufeature.h78
1 files changed, 39 insertions, 39 deletions
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 70eddb3922ff..910a30699ffb 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -148,45 +148,45 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);
148 */ 148 */
149static __always_inline __pure bool _static_cpu_has(u16 bit) 149static __always_inline __pure bool _static_cpu_has(u16 bit)
150{ 150{
151 asm_volatile_goto("1: jmp 6f\n" 151 asm_volatile_goto("1: jmp 6f\n"
152 "2:\n" 152 "2:\n"
153 ".skip -(((5f-4f) - (2b-1b)) > 0) * " 153 ".skip -(((5f-4f) - (2b-1b)) > 0) * "
154 "((5f-4f) - (2b-1b)),0x90\n" 154 "((5f-4f) - (2b-1b)),0x90\n"
155 "3:\n" 155 "3:\n"
156 ".section .altinstructions,\"a\"\n" 156 ".section .altinstructions,\"a\"\n"
157 " .long 1b - .\n" /* src offset */ 157 " .long 1b - .\n" /* src offset */
158 " .long 4f - .\n" /* repl offset */ 158 " .long 4f - .\n" /* repl offset */
159 " .word %P1\n" /* always replace */ 159 " .word %P1\n" /* always replace */
160 " .byte 3b - 1b\n" /* src len */ 160 " .byte 3b - 1b\n" /* src len */
161 " .byte 5f - 4f\n" /* repl len */ 161 " .byte 5f - 4f\n" /* repl len */
162 " .byte 3b - 2b\n" /* pad len */ 162 " .byte 3b - 2b\n" /* pad len */
163 ".previous\n" 163 ".previous\n"
164 ".section .altinstr_replacement,\"ax\"\n" 164 ".section .altinstr_replacement,\"ax\"\n"
165 "4: jmp %l[t_no]\n" 165 "4: jmp %l[t_no]\n"
166 "5:\n" 166 "5:\n"
167 ".previous\n" 167 ".previous\n"
168 ".section .altinstructions,\"a\"\n" 168 ".section .altinstructions,\"a\"\n"
169 " .long 1b - .\n" /* src offset */ 169 " .long 1b - .\n" /* src offset */
170 " .long 0\n" /* no replacement */ 170 " .long 0\n" /* no replacement */
171 " .word %P0\n" /* feature bit */ 171 " .word %P0\n" /* feature bit */
172 " .byte 3b - 1b\n" /* src len */ 172 " .byte 3b - 1b\n" /* src len */
173 " .byte 0\n" /* repl len */ 173 " .byte 0\n" /* repl len */
174 " .byte 0\n" /* pad len */ 174 " .byte 0\n" /* pad len */
175 ".previous\n" 175 ".previous\n"
176 ".section .altinstr_aux,\"ax\"\n" 176 ".section .altinstr_aux,\"ax\"\n"
177 "6:\n" 177 "6:\n"
178 " testb %[bitnum],%[cap_byte]\n" 178 " testb %[bitnum],%[cap_byte]\n"
179 " jnz %l[t_yes]\n" 179 " jnz %l[t_yes]\n"
180 " jmp %l[t_no]\n" 180 " jmp %l[t_no]\n"
181 ".previous\n" 181 ".previous\n"
182 : : "i" (bit), "i" (X86_FEATURE_ALWAYS), 182 : : "i" (bit), "i" (X86_FEATURE_ALWAYS),
183 [bitnum] "i" (1 << (bit & 7)), 183 [bitnum] "i" (1 << (bit & 7)),
184 [cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3]) 184 [cap_byte] "m" (((const char *)boot_cpu_data.x86_capability)[bit >> 3])
185 : : t_yes, t_no); 185 : : t_yes, t_no);
186 t_yes: 186t_yes:
187 return true; 187 return true;
188 t_no: 188t_no:
189 return false; 189 return false;
190} 190}
191 191
192#define static_cpu_has(bit) \ 192#define static_cpu_has(bit) \