[PATCH] selftests/powerpc: Add a test of spectre_v2 mitigations
Michael Ellerman
patch-notifications at ellerman.id.au
Thu Nov 7 14:45:33 AEDT 2019
On Mon, 2019-05-20 at 10:55:20 UTC, Michael Ellerman wrote:
> This test uses the PMU to count branch prediction hits/misses for a
> known loop, and compare the result to the reported spectre v2
> mitigation.
>
> This gives us a way of sanity checking that the reported mitigation is
> actually in effect.
>
> Sample output for some cases, eg:
>
> Power9:
> sysfs reports: 'Vulnerable'
> PM_BR_PRED_CCACHE: result 368 running/enabled 5792777124
> PM_BR_MPRED_CCACHE: result 319 running/enabled 5792775546
> PM_BR_PRED_PCACHE: result 2147483281 running/enabled 5792773128
> PM_BR_MPRED_PCACHE: result 213604201 running/enabled 5792771640
> Miss percent 9 %
> OK - Measured branch prediction rates match reported spectre v2 mitigation.
...
>
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/c790c3d2b0ec5979d83451d0688d1cd07e23d8ba
cheers
More information about the Linuxppc-dev
mailing list