]> Git Repo - linux.git/commit
arm64: entry-common: don't touch daif before bp-hardening
authorJames Morse <[email protected]>
Fri, 25 Oct 2019 16:42:16 +0000 (17:42 +0100)
committerCatalin Marinas <[email protected]>
Mon, 28 Oct 2019 11:22:54 +0000 (11:22 +0000)
commitbfe298745afc9548ad9344a9a3f26c81fd1a76c4
tree7f9a8c660d0ca94ff179e342a9bb2bb0c51c4887
parentafa7c0e5b965cdb945ad8a2e2973c6d7e19969f9
arm64: entry-common: don't touch daif before bp-hardening

The previous patches mechanically transformed the assembly version of
entry.S to entry-common.c for synchronous exceptions.

The C version of local_daif_restore() doesn't quite do the same thing
as the assembly versions if pseudo-NMI is in use. In particular,
| local_daif_restore(DAIF_PROCCTX_NOIRQ)
will still allow pNMI to be delivered. This is not the behaviour
do_el0_ia_bp_hardening() and do_sp_pc_abort() want as it should not
be possible for the PMU handler to run as an NMI until the bp-hardening
sequence has run.

The bp-hardening calls were placed where they are because this was the
first C code to run after the relevant exceptions. As we've now moved
that point earlier, move the checks and calls earlier too.

This makes it clearer that this stuff runs before any kind of exception,
and saves modifying PSTATE twice.

Signed-off-by: James Morse <[email protected]>
Reviewed-by: Mark Rutland <[email protected]>
Cc: Julien Thierry <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
arch/arm64/include/asm/processor.h
arch/arm64/kernel/entry-common.c
arch/arm64/mm/fault.c
This page took 0.072737 seconds and 4 git commands to generate.