linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
@ 2021-12-07 13:05 Thadeu Lima de Souza Cascardo
  2021-12-15  0:24 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2021-12-07 13:05 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kselftest, mpe

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>
---
 tools/testing/selftests/powerpc/security/spectre_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/powerpc/security/spectre_v2.c b/tools/testing/selftests/powerpc/security/spectre_v2.c
index adc2b7294e5f..83647b8277e7 100644
--- a/tools/testing/selftests/powerpc/security/spectre_v2.c
+++ b/tools/testing/selftests/powerpc/security/spectre_v2.c
@@ -193,7 +193,7 @@ int spectre_v2_test(void)
 			 * We are not vulnerable and reporting otherwise, so
 			 * missing such a mismatch is safe.
 			 */
-			if (state == VULNERABLE)
+			if (miss_percent > 95)
 				return 4;
 
 			return 1;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
  2021-12-07 13:05 [PATCH] selftests/powerpc/spectre_v2: Return skip code when miss_percent is high Thadeu Lima de Souza Cascardo
@ 2021-12-15  0:24 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2021-12-15  0:24 UTC (permalink / raw)
  To: linuxppc-dev, Thadeu Lima de Souza Cascardo; +Cc: linux-kselftest, mpe

On Tue, 7 Dec 2021 10:05:57 -0300, Thadeu Lima de Souza Cascardo wrote:
> 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%.
> 
> [...]

Applied to powerpc/next.

[1/1] selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
      https://git.kernel.org/powerpc/c/3c42e9542050d49610077e083c7c3f5fd5e26820

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-15  0:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 13:05 [PATCH] selftests/powerpc/spectre_v2: Return skip code when miss_percent is high Thadeu Lima de Souza Cascardo
2021-12-15  0:24 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).