Commit 8085fcd
x86/traps: Make exc_double_fault() consistently noreturn
The CONFIG_X86_ESPFIX64 version of exc_double_fault() can return to its
caller, but the !CONFIG_X86_ESPFIX64 version never does. In the latter
case the compiler and/or objtool may consider it to be implicitly
noreturn.
However, due to the currently inflexible way objtool detects noreturns,
a function's noreturn status needs to be consistent across configs.
The current workaround for this issue is to suppress unreachable
warnings for exc_double_fault()'s callers. Unfortunately that can
result in ORC coverage gaps and potentially worse issues like inert
static calls and silently disabled CPU mitigations.
Instead, prevent exc_double_fault() from ever being implicitly marked
noreturn by forcing a return behind a never-taken conditional.
Until a more integrated noreturn detection method exists, this is likely
the least objectionable workaround.
Fixes: 55eeab2 ("objtool: Ignore exc_double_fault() __noreturn warnings")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Brendan Jackman <jackmanb@google.com>
Link: https://lore.kernel.org/r/d1f4026f8dc35d0de6cc61f2684e0cb6484009d1.1741975349.git.jpoimboe@kernel.org1 parent e20ab7d commit 8085fcd
2 files changed
+18
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
382 | 397 | | |
383 | 398 | | |
384 | 399 | | |
| |||
514 | 529 | | |
515 | 530 | | |
516 | 531 | | |
517 | | - | |
| 532 | + | |
| 533 | + | |
518 | 534 | | |
519 | 535 | | |
520 | 536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4460 | 4460 | | |
4461 | 4461 | | |
4462 | 4462 | | |
4463 | | - | |
4464 | | - | |
4465 | | - | |
4466 | | - | |
4467 | | - | |
4468 | | - | |
4469 | | - | |
4470 | | - | |
4471 | | - | |
4472 | | - | |
4473 | | - | |
4474 | | - | |
4475 | | - | |
4476 | | - | |
4477 | | - | |
4478 | | - | |
4479 | | - | |
4480 | | - | |
4481 | | - | |
4482 | | - | |
4483 | | - | |
4484 | | - | |
4485 | | - | |
4486 | | - | |
4487 | | - | |
4488 | | - | |
4489 | | - | |
4490 | | - | |
4491 | | - | |
4492 | 4463 | | |
4493 | 4464 | | |
4494 | 4465 | | |
| |||
4505 | 4476 | | |
4506 | 4477 | | |
4507 | 4478 | | |
4508 | | - | |
| 4479 | + | |
4509 | 4480 | | |
4510 | 4481 | | |
4511 | 4482 | | |
| |||
0 commit comments