From patchwork Wed Nov 6 13:04:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 841883 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5941F1D619E for ; Wed, 6 Nov 2024 13:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898305; cv=none; b=kaquZluLeFGntSFvXDuLM39c+zVlDVsI4dBD8gETrEIOVFnj+jaJ0jVxaEdNBWPOcahwk1JF05IwjP+oTERCmTSXIgegzaBOy1mjGGOFBfF1LZ+URKTyARzDVjZrKokgGDDEocOK5KjvvxzXiuWannJyzcI0aAi0Wr5weyNe2qE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898305; c=relaxed/simple; bh=r41l+nqKXUx08DDwDjlNtGJ7WvEcJB4eRA3PUeDo1GA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tKJ6aFcszwBkFBrQ+80TJpLRY/EGWWpGDkxcvX78a6fJ1SUyth0HT6YMmPpyeRzaOZU+ypZQy9nvkq8rEYcVD3DaFhg6WA+3TJCeqkHpuKrpbNP+sK7QecRUXnkkgXd7SCmpEi9KJB5bKKJX0UswTKvdITTsQreItpsp4LIrfeA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=VPNk5xvj; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="VPNk5xvj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1730898299; bh=B+DpJzUt5pgtyxVRT5MgXeyFDGbQoigs3Py0OrcwOvE=; h=From:To:Cc:Subject:Date:From; b=VPNk5xvjtYFlyRUdofY/HhRHBp4lQkzaONXCDrFDWh77HhouPj8EcPKpw5dJdp6zL 0/kKopZRW5A7LF6sNIgI+WHBfHys8KlGVP08FksOsy2v7/vYVBCb5eyUQ9ptgnBj4V 5P1Y5nxfArEPiqWTjyJVrrDuDtwFmnxoRpu2SkziZ5fQR6dKpZQxgbfRwOxwul2mok A/9e2DVkqhWGoD/zWfTWWT6f1+czly3LWjAWeAmA4kh9LrDUU2ittQqACZ+uej+n7C 2OaQscQDBpVzaF4GCJpe+eZ/kHTey7pvU9+qJurWuzjaeHMJTSzbwpaaacBLxLyWE1 y+ytXvFKYvh9A== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Xk55l23S6z4x04; Thu, 7 Nov 2024 00:04:59 +1100 (AEDT) From: Michael Ellerman To: Cc: Subject: [PATCH 1/5] selftests/powerpc: Lower run time of count_stcx_fail test Date: Thu, 7 Nov 2024 00:04:49 +1100 Message-ID: <20241106130453.1741013-1-mpe@ellerman.id.au> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The count_stcx_fail test runs for close to or just over 2 minutes, which means it sometimes times out. That's overkill for a test that just demonstrates some PMU counters are working. Drop the 64 billion instruction case, to lower the runtime to ~30s. Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/pmu/count_stcx_fail.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c index 2070a1e2b3a5..d8dd9a9c6c1b 100644 --- a/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c +++ b/tools/testing/selftests/powerpc/pmu/count_stcx_fail.c @@ -144,9 +144,6 @@ static int test_body(void) /* Run for 16Bi instructions */ FAIL_IF(do_count_loop(events, 16000000000, overhead, true)); - /* Run for 64Bi instructions */ - FAIL_IF(do_count_loop(events, 64000000000, overhead, true)); - event_close(&events[0]); event_close(&events[1]); From patchwork Wed Nov 6 13:04:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 841881 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDBCD1F893C for ; Wed, 6 Nov 2024 13:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898307; cv=none; b=WJXXJNQ4N79AWhjWjGdmNIIvFRknC2gD2jDMJC/4APU1uv5Z1YYa5X6kjcbyWT4CgPFC2BGLjNQoLO28iQZdp/oL28LH/Pp6dj0nMr1GQZhv1lEkqkzpJjCcJovINLepuS8A4o++dqa1aXMOpcWUeMkv6Yar5Rw6ATvTlcd82GY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898307; c=relaxed/simple; bh=p9k+QwwFZEJbuk8CSc9GJF9fyiJfctDLnu0ro/S2A/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KOxkEIaCeDFtqospxlhfaklq46LPbhs2w1OITcAKtkPkB5dDRsVXS1SJmetKJiK2PBj8RgWf+IC6jWJUiOGa0BTqTEXmv02u2EosAQrN8ywz3kUJxj4ZKlrcR53iDvCvr0dB5YUfbi6d6Fbm/2Z+KtXChsm4pS1H4Kfw88IqASA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=iWVeUSPc; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="iWVeUSPc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1730898299; bh=WfU8i/z+2ZqvHHntsfTG/VnP0MHf+Z8XIKjhNPJ5fWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iWVeUSPcHVe9oorAhYOt8dSN9TztcXYRACyYt3LwYLcH+4Pdl0eK9IC9iUWpZnoRV WQlr2umv/GZntTiD91nbsgKzL5/Qzv6Qy4fQDIe6c+O9nEGmyNiHOjV0gF2DNuKlTY eBFC4AQux0Hc04NQWNdxbad0loOnTc8aFpI28rr+yTbathxda62hwVD75SuI1tEMXY 1DrrbXxsoCjNMiQXaJ1W9HcadUTq8ZwutrK0dmq+jpKVvRQPJD086OnB78p5V/18E2 feqtbrEdVXkzWxHdSidN5SZKtHNFBqUkpftzIhZQWWzd8IaYSws1iqpPw5dF8wqbXV BdZWj3It4zkLA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Xk55l5jxnz4xPQ; Thu, 7 Nov 2024 00:04:59 +1100 (AEDT) From: Michael Ellerman To: Cc: Subject: [PATCH 2/5] selftests/powerpc: Give all tests 2 minutes timeout Date: Thu, 7 Nov 2024 00:04:50 +1100 Message-ID: <20241106130453.1741013-2-mpe@ellerman.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106130453.1741013-1-mpe@ellerman.id.au> References: <20241106130453.1741013-1-mpe@ellerman.id.au> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Each of the powerpc selftests runs with a timeout of 2 minutes by default (see tools/testing/selftests/powerpc/harness.c). But when tests are run with run_kselftest.sh it uses a timeout of 45 seconds, meaning some tests run OK standalone but fail when run with the test runner. So tell run_kselftest.sh to give each test 130 seconds, that should allow the tests to complete, or be killed by the powerpc test harness after 2 minutes. If for some reason the harness fails, or for the few tests that don't use the harness, the 130 second timeout should catch them if they get stuck. Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/alignment/settings | 1 + tools/testing/selftests/powerpc/cache_shape/settings | 1 + tools/testing/selftests/powerpc/copyloops/settings | 1 + tools/testing/selftests/powerpc/dexcr/settings | 1 + tools/testing/selftests/powerpc/dscr/settings | 1 + tools/testing/selftests/powerpc/lib/settings | 1 + tools/testing/selftests/powerpc/math/settings | 1 + tools/testing/selftests/powerpc/mce/settings | 1 + tools/testing/selftests/powerpc/mm/settings | 1 + tools/testing/selftests/powerpc/nx-gzip/settings | 1 + tools/testing/selftests/powerpc/papr_attributes/settings | 1 + tools/testing/selftests/powerpc/papr_sysparm/settings | 1 + tools/testing/selftests/powerpc/papr_vpd/settings | 1 + tools/testing/selftests/powerpc/pmu/settings | 1 + tools/testing/selftests/powerpc/primitives/settings | 1 + tools/testing/selftests/powerpc/ptrace/settings | 1 + tools/testing/selftests/powerpc/scripts/settings | 1 + tools/testing/selftests/powerpc/security/settings | 1 + tools/testing/selftests/powerpc/stringloops/settings | 1 + tools/testing/selftests/powerpc/switch_endian/settings | 1 + tools/testing/selftests/powerpc/syscalls/settings | 1 + tools/testing/selftests/powerpc/vphn/settings | 1 + 22 files changed, 22 insertions(+) create mode 100644 tools/testing/selftests/powerpc/alignment/settings create mode 100644 tools/testing/selftests/powerpc/cache_shape/settings create mode 100644 tools/testing/selftests/powerpc/copyloops/settings create mode 100644 tools/testing/selftests/powerpc/dexcr/settings create mode 100644 tools/testing/selftests/powerpc/dscr/settings create mode 100644 tools/testing/selftests/powerpc/lib/settings create mode 100644 tools/testing/selftests/powerpc/math/settings create mode 100644 tools/testing/selftests/powerpc/mce/settings create mode 100644 tools/testing/selftests/powerpc/mm/settings create mode 100644 tools/testing/selftests/powerpc/nx-gzip/settings create mode 100644 tools/testing/selftests/powerpc/papr_attributes/settings create mode 100644 tools/testing/selftests/powerpc/papr_sysparm/settings create mode 100644 tools/testing/selftests/powerpc/papr_vpd/settings create mode 100644 tools/testing/selftests/powerpc/pmu/settings create mode 100644 tools/testing/selftests/powerpc/primitives/settings create mode 100644 tools/testing/selftests/powerpc/ptrace/settings create mode 100644 tools/testing/selftests/powerpc/scripts/settings create mode 100644 tools/testing/selftests/powerpc/security/settings create mode 100644 tools/testing/selftests/powerpc/stringloops/settings create mode 100644 tools/testing/selftests/powerpc/switch_endian/settings create mode 100644 tools/testing/selftests/powerpc/syscalls/settings create mode 100644 tools/testing/selftests/powerpc/vphn/settings diff --git a/tools/testing/selftests/powerpc/alignment/settings b/tools/testing/selftests/powerpc/alignment/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/alignment/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/cache_shape/settings b/tools/testing/selftests/powerpc/cache_shape/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/cache_shape/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/copyloops/settings b/tools/testing/selftests/powerpc/copyloops/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/copyloops/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/dexcr/settings b/tools/testing/selftests/powerpc/dexcr/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/dexcr/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/dscr/settings b/tools/testing/selftests/powerpc/dscr/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/dscr/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/lib/settings b/tools/testing/selftests/powerpc/lib/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/lib/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/math/settings b/tools/testing/selftests/powerpc/math/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/math/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/mce/settings b/tools/testing/selftests/powerpc/mce/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/mce/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/mm/settings b/tools/testing/selftests/powerpc/mm/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/mm/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/nx-gzip/settings b/tools/testing/selftests/powerpc/nx-gzip/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/nx-gzip/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/papr_attributes/settings b/tools/testing/selftests/powerpc/papr_attributes/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/papr_attributes/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/papr_sysparm/settings b/tools/testing/selftests/powerpc/papr_sysparm/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/papr_sysparm/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/papr_vpd/settings b/tools/testing/selftests/powerpc/papr_vpd/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/papr_vpd/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/pmu/settings b/tools/testing/selftests/powerpc/pmu/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/pmu/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/primitives/settings b/tools/testing/selftests/powerpc/primitives/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/primitives/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/ptrace/settings b/tools/testing/selftests/powerpc/ptrace/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/ptrace/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/scripts/settings b/tools/testing/selftests/powerpc/scripts/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/scripts/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/security/settings b/tools/testing/selftests/powerpc/security/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/security/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/stringloops/settings b/tools/testing/selftests/powerpc/stringloops/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/stringloops/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/switch_endian/settings b/tools/testing/selftests/powerpc/switch_endian/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/switch_endian/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/syscalls/settings b/tools/testing/selftests/powerpc/syscalls/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/syscalls/settings @@ -0,0 +1 @@ +timeout=130 diff --git a/tools/testing/selftests/powerpc/vphn/settings b/tools/testing/selftests/powerpc/vphn/settings new file mode 100644 index 000000000000..2e8566183318 --- /dev/null +++ b/tools/testing/selftests/powerpc/vphn/settings @@ -0,0 +1 @@ +timeout=130 From patchwork Wed Nov 6 13:04:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 841226 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6301C1E133E for ; Wed, 6 Nov 2024 13:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898306; cv=none; b=ibCaoHtnaLiafuOmUuzpgr6BJRXuuxV8m5mMHO1rtgD9rfxoh1DBBnVD8aXIhc7JeXg+B3Sh4WdrkxSwzbnVYoRk0bYFc4lUUl/noCi0MJEXrixZb/Kt1MQ1EjfSTlb1MsSPoRfg2di11cp7DVCIASoS8K7+Cl2YohO7hcaenn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898306; c=relaxed/simple; bh=l8Q1vGCIoKfYGSDC1yH7dOX6TeIovQ3Au2Uep97oqDo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R1qg2G1Q7cc7bEM7qQUqrGgZNX4UD6DUWh/kDpWqIjoHpxf3mfG3eNhIuvZz6UOkrt6HZhPlv0Ni3e+uKx4umf4FJuuyM4xInwIHPYPqi03351tX6NYhMYNy1eh4PD6K9OVZoFdn4WZqI79T1l2Noiu7uHcNwL9wpAcpYHCYRN8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=ZbvhujQB; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="ZbvhujQB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1730898300; bh=gWi3uhGcloOwTYgGQh/KqDPknZHDL95CKVUKUmrlZBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZbvhujQB4eB1WiNH7s6IozVLIgYkcsc6iL3gC5Q5EBcvgpng+ZVtGaNW0pdllbGRG TLO9yIjsYUaXePmT0nEPbK6RD72GnRhVcvRxHYMNkjRQMTfKc2RE3P82xU9qVs63+P eA6u/F29xflAqJkoRsQskTJHx5dVir8smRwRHAKOboAJJ0oJ0ui7kjafMvawjJ4sfF rsc1aer4ol58BN1PwpKuBFEHjw9da7wsXu00LuY8cq+8OF5SR8dqupkKd3BhgudiGA 5iuQ1w9gtKaI+vFcnKM+Pvrz+GJk93nkLiCa5+39sKqxjfJc20Do0CEZGvAmJECiK+ E+01GxxokfjkQ== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Xk55m2JRrz4xR5; Thu, 7 Nov 2024 00:05:00 +1100 (AEDT) From: Michael Ellerman To: Cc: Subject: [PATCH 3/5] selftests/powerpc: Fix 32-bit BE build errors on Ubuntu 24.04 Date: Thu, 7 Nov 2024 00:04:51 +1100 Message-ID: <20241106130453.1741013-3-mpe@ellerman.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106130453.1741013-1-mpe@ellerman.id.au> References: <20241106130453.1741013-1-mpe@ellerman.id.au> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Starting with Ubuntu 24.04, building the selftests with the big endian compiler (which defaults to 32-bit) fails with errors: stack_expansion_ldst.c:178:37: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'rlim_t' {aka 'long long unsigned int'} subpage_prot.c:214:38: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'off_t' {aka 'long long int'} Prior to 24.04 rlim_t was long unsigned int, and off_t was long int. Cast to unsigned long long and long long before passing to printf to avoid the errors. Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c | 2 +- tools/testing/selftests/powerpc/mm/subpage_prot.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c b/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c index ed9143990888..9c0d343d7137 100644 --- a/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c +++ b/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c @@ -175,7 +175,7 @@ static int test(void) page_size = getpagesize(); getrlimit(RLIMIT_STACK, &rlimit); - printf("Stack rlimit is 0x%lx\n", rlimit.rlim_cur); + printf("Stack rlimit is 0x%llx\n", (unsigned long long)rlimit.rlim_cur); printf("Testing loads ...\n"); test_one_type(LOAD, page_size, rlimit.rlim_cur); diff --git a/tools/testing/selftests/powerpc/mm/subpage_prot.c b/tools/testing/selftests/powerpc/mm/subpage_prot.c index 3ae77ba93208..8cf9fd5fed1c 100644 --- a/tools/testing/selftests/powerpc/mm/subpage_prot.c +++ b/tools/testing/selftests/powerpc/mm/subpage_prot.c @@ -211,8 +211,8 @@ int test_file(void) perror("failed to map file"); return 1; } - printf("allocated %s for 0x%lx bytes at %p\n", - file_name, filesize, fileblock); + printf("allocated %s for 0x%llx bytes at %p\n", + file_name, (long long)filesize, fileblock); printf("testing file map...\n"); From patchwork Wed Nov 6 13:04:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 841882 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC3E51F9413 for ; Wed, 6 Nov 2024 13:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898306; cv=none; b=Hq2Q0795EQZITBIrz1ySO7x75mC20hBJzmoUQoQE4SFbIJRFuSvPnB9xUqst6c/tmXgTTd6CMiBDht3KgaL9Kc88IfC6xb/iIBGxMuvmNWKoJQtkcagbc7i3o34jnS/gp/P9Dxnb5O8r50EZRZZxT5QorPldzQv9KcQ5pZcqkNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898306; c=relaxed/simple; bh=i7MiKgj5PZI5/D7cKMTNOlgDFHng4HO19l7BB3vVgXs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W5aPHzavmz8WO0aN5fSSHZoMxVXmX/xAyMaZlLG/7fhXT7Wg7dQGP0BQKW3kSQMyKJeEMOTzcdIo0QNml/yPDYRy9vpqNv/QDt7HleRGoP99jJygm2zxFG/3B1JZmn5f3842hY+Xx8XsDbqVF+2MdnC7AnF11Sox0gGREkSJD28= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=SQL7HMtK; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="SQL7HMtK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1730898300; bh=qW1N95F/0dD6RAC3La/bvo9UN0+AgyqUeekkAk1k6sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQL7HMtKB9Hzn2YPrMPHbq0vPs6NsVSht0OT7tdD9x+9gug0bqDOx2Userp1YqU0A LaITNIBj5YA3tobZeSvf/fXVFfKCSlzKhf6AsEucgkuv4yGEIXZC++LFbPIKEhkOWo Yv9D/o4f1Eb1zvzlIdtljGnWAuhU/g85s4dx31LInHY0NcYKNIX+QbqDXEStRSIvSF JyT/H1dDoWLoCt20RshW3skimRp5SCQ0cKNecMoUfrUcynaMxT1T7ykOPnSitDMfhC 5st1y+65BuGhidC/ebn1oASoEX6uQwIoz8pY6xNmUmAZwCs/1Iytw7vU68+m0oBlZZ T40dKXJADn3Hw== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Xk55m5vnLz4xRj; Thu, 7 Nov 2024 00:05:00 +1100 (AEDT) From: Michael Ellerman To: Cc: Subject: [PATCH 4/5] selftests/powerpc: Return errors from all tests Date: Thu, 7 Nov 2024 00:04:52 +1100 Message-ID: <20241106130453.1741013-4-mpe@ellerman.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106130453.1741013-1-mpe@ellerman.id.au> References: <20241106130453.1741013-1-mpe@ellerman.id.au> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Fix some tests which weren't returning an error code from main. Although these tests only ever return success, they can still fail if they time out and the harness kills them. If that happens they still return success to the shell, which is incorrect and confuses the higher level error reporting. Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/signal/sigfuz.c | 2 +- .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 2 +- tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/powerpc/signal/sigfuz.c b/tools/testing/selftests/powerpc/signal/sigfuz.c index 08f9afe3b95c..c101b1391696 100644 --- a/tools/testing/selftests/powerpc/signal/sigfuz.c +++ b/tools/testing/selftests/powerpc/signal/sigfuz.c @@ -321,5 +321,5 @@ int main(int argc, char **argv) if (!args) args = ARG_COMPLETE; - test_harness(signal_fuzzer, "signal_fuzzer"); + return test_harness(signal_fuzzer, "signal_fuzzer"); } diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c index 421cb082f6be..0a4bc479ae39 100644 --- a/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c +++ b/tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c @@ -176,5 +176,5 @@ int tm_signal_context_force_tm(void) int main(int argc, char **argv) { - test_harness(tm_signal_context_force_tm, "tm_signal_context_force_tm"); + return test_harness(tm_signal_context_force_tm, "tm_signal_context_force_tm"); } diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c index 06b801906f27..968864b052ec 100644 --- a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c +++ b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c @@ -46,6 +46,5 @@ int tm_signal_sigreturn_nt(void) int main(int argc, char **argv) { - test_harness(tm_signal_sigreturn_nt, "tm_signal_sigreturn_nt"); + return test_harness(tm_signal_sigreturn_nt, "tm_signal_sigreturn_nt"); } - From patchwork Wed Nov 6 13:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 841225 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51E171F941B for ; Wed, 6 Nov 2024 13:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898307; cv=none; b=tHgN80jwZgXm07U11P5FoFX4MohE6RzKnV9atpXITb7gDJMLyvOIXFCDhhobZQuQ5lqevCbYdDmemBU1Fbk31Qn9MohEwKB1sFkuLBnOFatFBmE8zNpMr7gW8jBMolP8QYypAoice2qzAe916xYre2FvtGMH25LHYMwAn/dEPn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898307; c=relaxed/simple; bh=IUyLura+YDqAklyADUCc9Yv1q4Dxr8XAwILHeqDSIAA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lUrCkRD81Qlk+75S6iN+tu+lwuq9ktCyq+3kw2Vkn6TgIavd8OORjP9llbmq3dhchFC9VzDlsN0SxLN4B1Jp8UYr2zjXW8+3r81uEkXQtpPpGO5u0G/snXHjtDdTNRCdpOSS97npowjgkpfTBArfPr2kK/eHaAtaAG/1ZmTbA6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=gv0tLdHm; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="gv0tLdHm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1730898301; bh=oEc126lVY8sqIE1oH16a792a7OULOP+M/PDQo12uYUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gv0tLdHmaT1OUnl5g29n/lmsztFYL6Ahesi8b1OCqc/hJCdJfcgjAqq9YLLHKz5tE xxgbn/XzFFzoOn6LSlR/QanbTPNciiKYobOhET/slcyYTUU4WLNrWoKLLf4u6UNOTe GIo+YeSG9PRB7DzKfW8wngDpLuZzdu0TCPpvRAuMFGy4gq1xjd7IEzNPeO8QYJEGD6 SHIUV3n6UCi6LwX+YM9VayQRJHa2Ggz+cNdq9iun0PF3kHWM6D66br9j2AU6XZ5F2V Tk26su/1wqcD0h9Oz0i1NPVJMQDWNqv5IN89hxrTcLgq/lzvb7Bga72UCKuAm7Yv2+ rNlhTB+cGU/cA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Xk55n2LJmz4xc7; Thu, 7 Nov 2024 00:05:01 +1100 (AEDT) From: Michael Ellerman To: Cc: Subject: [PATCH 5/5] selftests/powerpc: Detect taint change in mitigation patching test Date: Thu, 7 Nov 2024 00:04:53 +1100 Message-ID: <20241106130453.1741013-5-mpe@ellerman.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106130453.1741013-1-mpe@ellerman.id.au> References: <20241106130453.1741013-1-mpe@ellerman.id.au> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Currently the mitigation patching test errors out if the kernel is tainted prior to the test running. That causes the test to fail unnecessarily if some other test has caused the kernel to be tainted, or if a proprietary or force module is loaded for example. Instead just warn if the kernel is tainted to begin with, and only report a change in the taint state as an error in the test. Signed-off-by: Michael Ellerman --- .../selftests/powerpc/security/mitigation-patching.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/powerpc/security/mitigation-patching.sh b/tools/testing/selftests/powerpc/security/mitigation-patching.sh index f43aa4b77fba..9a4612e2e953 100755 --- a/tools/testing/selftests/powerpc/security/mitigation-patching.sh +++ b/tools/testing/selftests/powerpc/security/mitigation-patching.sh @@ -36,8 +36,7 @@ fi tainted=$(cat /proc/sys/kernel/tainted) if [[ "$tainted" -ne 0 ]]; then - echo "Error: kernel already tainted!" >&2 - exit 1 + echo "Warning: kernel already tainted! ($tainted)" >&2 fi mitigations="barrier_nospec stf_barrier count_cache_flush rfi_flush entry_flush uaccess_flush" @@ -68,9 +67,10 @@ fi echo "Waiting for timeout ..." wait +orig_tainted=$tainted tainted=$(cat /proc/sys/kernel/tainted) -if [[ "$tainted" -ne 0 ]]; then - echo "Error: kernel became tainted!" >&2 +if [[ "$tainted" != "$orig_tainted" ]]; then + echo "Error: kernel newly tainted, before ($orig_tainted) after ($tainted)" >&2 exit 1 fi