Skip to content

ARM branch predictor hardening

Tony Lindgren linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ARM branch predictor hardening
Quoted 17 lines · Marc Zyngier

Hi Tony,

Quoted 14 lines · Tony Lindgren
Quoted 12 lines · Marc Zyngier

This small series implements some basic BP hardening by invalidating the BTB on CPUs that are known to be susceptible to aliasing attacks.

These patches are closely modelled against what we do on arm64, although simpler as we can rely on an architected instruction to perform the invalidation.

The first patch reuses the Cortex-A8 BTB invalidation in switch_mm and generalises it to be used on all affected CPUs. The second perform the same invalidation on fatal signal delivery. The last one nukes it on guest exit, and results in some major surgery (kudos to Dimitris Papastamos who came up with the magic vector decoding sequence).

Quoted 4 lines
Quoted 2 lines

So if a Cortex-A8 has bootloder set the IBE bit, and kernel has ARM_ERRATA_430973 enabled, is Cortex-A8 already hardened then?

Almost. See the extra BTB invalidation in fault.c.

OK thanks. So for Cortex-A8, only patch "[PATCH 2/3] arm: Invalidate BTB on fatal signal for Cortex A8, A9, A12, A15 and A17" is needed if I read that right.

Regards,

Tony