Skip to content

Commit 044164b

Browse files
Thadeu Lima de Souza Cascardogregkh
authored andcommitted
selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
[ Upstream commit 3c42e95 ] 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>
1 parent 21125e0 commit 044164b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/testing/selftests/powerpc/security/spectre_v2.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int spectre_v2_test(void)
193193
* We are not vulnerable and reporting otherwise, so
194194
* missing such a mismatch is safe.
195195
*/
196-
if (state == VULNERABLE)
196+
if (miss_percent > 95)
197197
return 4;
198198

199199
return 1;

0 commit comments

Comments
 (0)