Subject: Re: [PATCH] selftests/powerpc: Add a test of spectre_v2 mitigations

From: Michael Ellerman <[email-masked]>
Date: Thu, 7 Nov 2019 14:45:33 +1100 (AEDT)

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 <[email-masked]>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/c790c3d2b0ec5979d83451d0688d1cd07e23d8ba

cheers