diff options
Diffstat (limited to 'arch/x86/include/asm/cpufeature.h')
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 90a54851aedc..9b1df43dadbb 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -418,6 +418,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
418 | " .word %P0\n" /* 1: do replace */ | 418 | " .word %P0\n" /* 1: do replace */ |
419 | " .byte 2b - 1b\n" /* source len */ | 419 | " .byte 2b - 1b\n" /* source len */ |
420 | " .byte 0\n" /* replacement len */ | 420 | " .byte 0\n" /* replacement len */ |
421 | " .byte 0\n" /* pad len */ | ||
421 | ".previous\n" | 422 | ".previous\n" |
422 | /* skipping size check since replacement size = 0 */ | 423 | /* skipping size check since replacement size = 0 */ |
423 | : : "i" (X86_FEATURE_ALWAYS) : : t_warn); | 424 | : : "i" (X86_FEATURE_ALWAYS) : : t_warn); |
@@ -432,6 +433,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
432 | " .word %P0\n" /* feature bit */ | 433 | " .word %P0\n" /* feature bit */ |
433 | " .byte 2b - 1b\n" /* source len */ | 434 | " .byte 2b - 1b\n" /* source len */ |
434 | " .byte 0\n" /* replacement len */ | 435 | " .byte 0\n" /* replacement len */ |
436 | " .byte 0\n" /* pad len */ | ||
435 | ".previous\n" | 437 | ".previous\n" |
436 | /* skipping size check since replacement size = 0 */ | 438 | /* skipping size check since replacement size = 0 */ |
437 | : : "i" (bit) : : t_no); | 439 | : : "i" (bit) : : t_no); |
@@ -457,6 +459,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
457 | " .word %P1\n" /* feature bit */ | 459 | " .word %P1\n" /* feature bit */ |
458 | " .byte 2b - 1b\n" /* source len */ | 460 | " .byte 2b - 1b\n" /* source len */ |
459 | " .byte 4f - 3f\n" /* replacement len */ | 461 | " .byte 4f - 3f\n" /* replacement len */ |
462 | " .byte 0\n" /* pad len */ | ||
460 | ".previous\n" | 463 | ".previous\n" |
461 | ".section .discard,\"aw\",@progbits\n" | 464 | ".section .discard,\"aw\",@progbits\n" |
462 | " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */ | 465 | " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */ |
@@ -491,23 +494,28 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit) | |||
491 | */ | 494 | */ |
492 | asm_volatile_goto("1: .byte 0xe9\n .long %l[t_dynamic] - 2f\n" | 495 | asm_volatile_goto("1: .byte 0xe9\n .long %l[t_dynamic] - 2f\n" |
493 | "2:\n" | 496 | "2:\n" |
497 | ".skip -(((5f-4f) - (2b-1b)) > 0) * " | ||
498 | "((5f-4f) - (2b-1b)),0x90\n" | ||
499 | "3:\n" | ||
494 | ".section .altinstructions,\"a\"\n" | 500 | ".section .altinstructions,\"a\"\n" |
495 | " .long 1b - .\n" /* src offset */ | 501 | " .long 1b - .\n" /* src offset */ |
496 | " .long 3f - .\n" /* repl offset */ | 502 | " .long 4f - .\n" /* repl offset */ |
497 | " .word %P1\n" /* always replace */ | 503 | " .word %P1\n" /* always replace */ |
498 | " .byte 2b - 1b\n" /* src len */ | 504 | " .byte 3b - 1b\n" /* src len */ |
499 | " .byte 4f - 3f\n" /* repl len */ | 505 | " .byte 5f - 4f\n" /* repl len */ |
506 | " .byte 3b - 2b\n" /* pad len */ | ||
500 | ".previous\n" | 507 | ".previous\n" |
501 | ".section .altinstr_replacement,\"ax\"\n" | 508 | ".section .altinstr_replacement,\"ax\"\n" |
502 | "3: .byte 0xe9\n .long %l[t_no] - 2b\n" | 509 | "4: .byte 0xe9\n .long %l[t_no] - 2b\n" |
503 | "4:\n" | 510 | "5:\n" |
504 | ".previous\n" | 511 | ".previous\n" |
505 | ".section .altinstructions,\"a\"\n" | 512 | ".section .altinstructions,\"a\"\n" |
506 | " .long 1b - .\n" /* src offset */ | 513 | " .long 1b - .\n" /* src offset */ |
507 | " .long 0\n" /* no replacement */ | 514 | " .long 0\n" /* no replacement */ |
508 | " .word %P0\n" /* feature bit */ | 515 | " .word %P0\n" /* feature bit */ |
509 | " .byte 2b - 1b\n" /* src len */ | 516 | " .byte 3b - 1b\n" /* src len */ |
510 | " .byte 0\n" /* repl len */ | 517 | " .byte 0\n" /* repl len */ |
518 | " .byte 0\n" /* pad len */ | ||
511 | ".previous\n" | 519 | ".previous\n" |
512 | : : "i" (bit), "i" (X86_FEATURE_ALWAYS) | 520 | : : "i" (bit), "i" (X86_FEATURE_ALWAYS) |
513 | : : t_dynamic, t_no); | 521 | : : t_dynamic, t_no); |
@@ -527,6 +535,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit) | |||
527 | " .word %P2\n" /* always replace */ | 535 | " .word %P2\n" /* always replace */ |
528 | " .byte 2b - 1b\n" /* source len */ | 536 | " .byte 2b - 1b\n" /* source len */ |
529 | " .byte 4f - 3f\n" /* replacement len */ | 537 | " .byte 4f - 3f\n" /* replacement len */ |
538 | " .byte 0\n" /* pad len */ | ||
530 | ".previous\n" | 539 | ".previous\n" |
531 | ".section .discard,\"aw\",@progbits\n" | 540 | ".section .discard,\"aw\",@progbits\n" |
532 | " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */ | 541 | " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */ |
@@ -541,6 +550,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit) | |||
541 | " .word %P1\n" /* feature bit */ | 550 | " .word %P1\n" /* feature bit */ |
542 | " .byte 4b - 3b\n" /* src len */ | 551 | " .byte 4b - 3b\n" /* src len */ |
543 | " .byte 6f - 5f\n" /* repl len */ | 552 | " .byte 6f - 5f\n" /* repl len */ |
553 | " .byte 0\n" /* pad len */ | ||
544 | ".previous\n" | 554 | ".previous\n" |
545 | ".section .discard,\"aw\",@progbits\n" | 555 | ".section .discard,\"aw\",@progbits\n" |
546 | " .byte 0xff + (6f-5f) - (4b-3b)\n" /* size check */ | 556 | " .byte 0xff + (6f-5f) - (4b-3b)\n" /* size check */ |