selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 7 Dec 2021 13:05:57 +0000 (10:05 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 11:02:34 +0000 (12:02 +0100)
commit6009ca52f886fa03d52eeccdb2c49399db999146
tree333c7d8f07028de317cc8e8b8d9fcb5e415b9878
parentae00af6368846a69edf9d54a46c6e2df18e556c0
selftests/powerpc/spectre_v2: Return skip code when miss_percent is high

[ Upstream commit 3c42e9542050d49610077e083c7c3f5fd5e26820 ]

A mis-match between reported and actual mitigation is not restricted to the
Vulnerable case. The guest might also report the mitigation as "Software
count cache flush" and the host will still mitigate with branch cache
disabled.

So, instead of skipping depending on the detected mitigation, simply skip
whenever the detected miss_percent is the expected one for a fully
mitigated system, that is, above 95%.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211207130557.40566-1-cascardo@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/powerpc/security/spectre_v2.c