Commit 8e334d7
arm64: smp: unify task and sp setup
Once we enable the MMU, we have to initialize:
* SP_EL0 to point at the active task
* SP to point at the active task's stack
* SCS_SP to point at the active task's shadow stack
For all tasks (including init_task), this information can be derived
from the task's task_struct.
Let's unify __primary_switched and __secondary_switched to consistently
acquire this information from the relevant task_struct. At the same
time, let's fold this together with initializing a task's final frame.
There should be no functional change as a result of this patch.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Suzuki Poulose <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210520115031.18509-6-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>1 parent 3305e7f commit 8e334d7
1 file changed
Lines changed: 15 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
398 | 400 | | |
399 | 401 | | |
400 | 402 | | |
401 | 403 | | |
402 | 404 | | |
403 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
404 | 410 | | |
| 411 | + | |
405 | 412 | | |
406 | 413 | | |
| 414 | + | |
| 415 | + | |
407 | 416 | | |
408 | 417 | | |
409 | 418 | | |
| |||
412 | 421 | | |
413 | 422 | | |
414 | 423 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 424 | + | |
| 425 | + | |
419 | 426 | | |
420 | 427 | | |
421 | 428 | | |
422 | 429 | | |
423 | 430 | | |
424 | | - | |
| 431 | + | |
425 | 432 | | |
426 | 433 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
| |||
459 | 462 | | |
460 | 463 | | |
461 | 464 | | |
462 | | - | |
463 | | - | |
| 465 | + | |
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
| |||
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
| 653 | + | |
657 | 654 | | |
658 | 655 | | |
659 | 656 | | |
| |||
0 commit comments