Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3654325pxb; Mon, 24 Jan 2022 14:32:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCSnzcaiFXDv2r/rnEL4VdvCNkQ9/O3jYETd9S9g4tYBniRXoCMMECP/Crr5HKSyhl6WJp X-Received: by 2002:a05:6a00:1a15:b0:4c2:838d:e9b4 with SMTP id g21-20020a056a001a1500b004c2838de9b4mr15707097pfv.66.1643063544451; Mon, 24 Jan 2022 14:32:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063544; cv=none; d=google.com; s=arc-20160816; b=XdQp2Fj2ElTWNXUOlVQThlSlh+pcUXv8VhdaLfvxSIOisaZhtLU+T3uJrdfb0VF+mz bBiwaGPzstdWWKAK+MHgy1W+/xjtRRPDbrUsPdmvtf3aWndQUPybjmFgjk4wVPeejS+7 ybGks4+//E7E/h0HSCiNkNjpd4wtdYXCoHsZk3UZSpDUe/dNuNnXPpyL+7qxjm2JDqCY XkPjSa9gE0WNSWRTlMYV3PPG8kJiGNbqbTACzx/uHzcHjb1CznOQTsHyr9ksvPzEYQw+ Xa6mh7HvRHidRhib7CjRlGKCmRy0MI62sR6QsL+ekZui8Sti0VDKIjA+/Ci0iGPKn/yw iBfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T5JMj0ivmWPsD3xxK7ko8AogNoCHsi1FhKeNHQ1uSFc=; b=W4BzDxQBqfeIglyVyV6B3CTm2sF70KLalZHECBC0yqzPGKlrkKWMB51EXtsBvOUbml Z6riwWO5mqSrhjQwZLbYbIltMvEmK8RMRUDrknAg7KLmVuo82ZKa/gqmoEQgXxqy6iks qVA6A04heJqFvGjZyunVAD+vnVb+aATKmQGgDcc03Kj+R/uAOqhm9JcYgDH3FGh/UtiT uCx4uHl4bmN6UYL+YC1snMJErS6uK6s+nCDx+Nix7H5KOdlwN7s59uz2hGM0BbOMjjh0 UtU1R8gzBzH7e2PLe82lEpG0dBtvaYBCqlt7TovLpZcjmnjFasnpgqxD9VkfW6M0nhZF fyag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ffvYRmmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 74si14812487pgc.808.2022.01.24.14.32.12; Mon, 24 Jan 2022 14:32:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ffvYRmmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1587054AbiAXW1l (ORCPT + 99 others); Mon, 24 Jan 2022 17:27:41 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:46524 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1454595AbiAXVdM (ORCPT ); Mon, 24 Jan 2022 16:33:12 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 13D22B811A2; Mon, 24 Jan 2022 21:33:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DC72C340E4; Mon, 24 Jan 2022 21:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059989; bh=/+mI8nrRREij5JDaj6gEO/h76K+KA7kZdaVgSdBD+Fk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ffvYRmmz1BJ87zeF91rOMUXr4NP78YwEemb97a/a/XrLGLXJoO2q2B5ukTJPZsIYW fm3Tko9FpAyvnCVnJkFTfhj/kON1i/uAWH+XSN0OVLnLBDEeVG6oIWUwjLL5VEp4AS A6Ss25KrLbcjPZKcyufEoNbas5fa3TTz41VbMsmU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thadeu Lima de Souza Cascardo , Michael Ellerman , Sasha Levin Subject: [PATCH 5.16 0759/1039] selftests/powerpc/spectre_v2: Return skip code when miss_percent is high Date: Mon, 24 Jan 2022 19:42:28 +0100 Message-Id: <20220124184150.840757878@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thadeu Lima de Souza Cascardo [ 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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211207130557.40566-1-cascardo@canonical.com Signed-off-by: Sasha Levin --- 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 adc2b7294e5fd..83647b8277e7d 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.34.1