From patchwork Fri Nov 8 13:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 841844 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BF3E01E0B66 for ; Fri, 8 Nov 2024 13:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073765; cv=none; b=TPy/uGsvd/d2s3kpqtwPo1SUf/mMLSQ9N+hYG4r0vYvrcn6iC/TydrO00dnWCkl9fn4Hx2LjVSLiaJKYQvf9CrU7rlD0pJ7LsV37PY86mQh1QJ6mUYRPJ0ojP6jyIffgIKC4GEXltW3EyRx4wppKYrPRCSbnSfOdOKkWZspHaac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073765; c=relaxed/simple; bh=tJ4CagG0kCLicdZr6lrfKCXoz9QRktQ/nPKITTd51BA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lhAW2cQGgxCVcxTkUINkqOFKjKLuxPZmoHpiIrXfJjyGYRLzW0ve7t3XcyAR+iPPUzm6XeaUrq5uvGo7Uqh/Lx2Dw6PdHrj2N5gAirVRYa2ooDcLKN+teRjJS4oDQtGnr+qOIzMSVfsX/E+fe7Z51uf3fsrliyhv0+AIUN061u4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CBAEC4CED4; Fri, 8 Nov 2024 13:49:24 +0000 (UTC) From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org Cc: Shuah Khan , Mark Brown , Will Deacon , linux-kselftest@vger.kernel.org Subject: [PATCH 1/4] kselftest/arm64: Fix printf() compiler warnings in the arm64 fp tests Date: Fri, 8 Nov 2024 13:49:17 +0000 Message-Id: <20241108134920.1233992-2-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241108134920.1233992-1-catalin.marinas@arm.com> References: <20241108134920.1233992-1-catalin.marinas@arm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lots of incorrect length modifiers, missing arguments or conversion specifiers. Fix them. Cc: Shuah Khan Cc: Mark Brown Signed-off-by: Catalin Marinas Reviewed-by: Mark Brown --- tools/testing/selftests/arm64/fp/sve-ptrace.c | 16 +++++++++------- tools/testing/selftests/arm64/fp/za-ptrace.c | 8 +++++--- tools/testing/selftests/arm64/fp/zt-ptrace.c | 8 +++++--- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index 6d61992fe8a0..577b6e05e860 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -82,10 +82,12 @@ static void fill_buf(char *buf, size_t size) static int do_child(void) { if (ptrace(PTRACE_TRACEME, -1, NULL, NULL)) - ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno)); + ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s (%d)\n", + strerror(errno), errno); if (raise(SIGSTOP)) - ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno)); + ksft_exit_fail_msg("raise(SIGSTOP) failed: %s (%d)\n", + strerror(errno), errno); return EXIT_SUCCESS; } @@ -340,7 +342,7 @@ static void ptrace_set_sve_get_sve_data(pid_t child, data_size = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE); write_buf = malloc(data_size); if (!write_buf) { - ksft_test_result_fail("Error allocating %d byte buffer for %s VL %u\n", + ksft_test_result_fail("Error allocating %ld byte buffer for %s VL %u\n", data_size, type->name, vl); return; } @@ -441,7 +443,7 @@ static void ptrace_set_sve_get_fpsimd_data(pid_t child, data_size = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE); write_buf = malloc(data_size); if (!write_buf) { - ksft_test_result_fail("Error allocating %d byte buffer for %s VL %u\n", + ksft_test_result_fail("Error allocating %ld byte buffer for %s VL %u\n", data_size, type->name, vl); return; } @@ -545,7 +547,7 @@ static void ptrace_set_fpsimd_get_sve_data(pid_t child, read_sve = read_buf; if (read_sve->vl != vl) { - ksft_test_result_fail("Child VL != expected VL %d\n", + ksft_test_result_fail("Child VL != expected VL: %u != %u\n", read_sve->vl, vl); goto out; } @@ -555,7 +557,7 @@ static void ptrace_set_fpsimd_get_sve_data(pid_t child, case SVE_PT_REGS_FPSIMD: expected_size = SVE_PT_FPSIMD_SIZE(vq, SVE_PT_REGS_FPSIMD); if (read_sve_size < expected_size) { - ksft_test_result_fail("Read %d bytes, expected %d\n", + ksft_test_result_fail("Read %ld bytes, expected %ld\n", read_sve_size, expected_size); goto out; } @@ -571,7 +573,7 @@ static void ptrace_set_fpsimd_get_sve_data(pid_t child, case SVE_PT_REGS_SVE: expected_size = SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE); if (read_sve_size < expected_size) { - ksft_test_result_fail("Read %d bytes, expected %d\n", + ksft_test_result_fail("Read %ld bytes, expected %ld\n", read_sve_size, expected_size); goto out; } diff --git a/tools/testing/selftests/arm64/fp/za-ptrace.c b/tools/testing/selftests/arm64/fp/za-ptrace.c index ac27d87396fc..08c777f87ea2 100644 --- a/tools/testing/selftests/arm64/fp/za-ptrace.c +++ b/tools/testing/selftests/arm64/fp/za-ptrace.c @@ -48,10 +48,12 @@ static void fill_buf(char *buf, size_t size) static int do_child(void) { if (ptrace(PTRACE_TRACEME, -1, NULL, NULL)) - ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno)); + ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s (%d)", + strerror(errno), errno); if (raise(SIGSTOP)) - ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno)); + ksft_exit_fail_msg("raise(SIGSTOP) failed: %s (%d)\n", + strerror(errno), errno); return EXIT_SUCCESS; } @@ -201,7 +203,7 @@ static void ptrace_set_get_data(pid_t child, unsigned int vl) data_size = ZA_PT_SIZE(vq); write_buf = malloc(data_size); if (!write_buf) { - ksft_test_result_fail("Error allocating %d byte buffer for VL %u\n", + ksft_test_result_fail("Error allocating %ld byte buffer for VL %u\n", data_size, vl); return; } diff --git a/tools/testing/selftests/arm64/fp/zt-ptrace.c b/tools/testing/selftests/arm64/fp/zt-ptrace.c index 996d9614a131..584b8d59b7ea 100644 --- a/tools/testing/selftests/arm64/fp/zt-ptrace.c +++ b/tools/testing/selftests/arm64/fp/zt-ptrace.c @@ -43,10 +43,12 @@ static void fill_buf(char *buf, size_t size) static int do_child(void) { if (ptrace(PTRACE_TRACEME, -1, NULL, NULL)) - ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno)); + ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s (%d)\n", + strerror(errno), errno); if (raise(SIGSTOP)) - ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno)); + ksft_exit_fail_msg("raise(SIGSTOP) failed: %s (%d)\n", + strerror(errno), errno); return EXIT_SUCCESS; } @@ -231,7 +233,7 @@ static void ptrace_enable_za_via_zt(pid_t child) /* Should have register data */ if (za_out->size < ZA_PT_SIZE(vq)) { ksft_print_msg("ZA data less than expected: %u < %u\n", - za_out->size, ZA_PT_SIZE(vq)); + za_out->size, (unsigned int)ZA_PT_SIZE(vq)); fail = true; vq = 0; } From patchwork Fri Nov 8 13:49:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 842221 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6D1541EF937 for ; Fri, 8 Nov 2024 13:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073767; cv=none; b=JMdSkvWBQJ/HXWTj0Pj83vb8f2Tk4kdIR/OVRJwDQK4wlkyxGXJolDXDAs/9PF3z/qkP+FK5Z1uzRgHsLaxYc+TAaGkOMMUOl/3uto6UN8+EJDs0/Lqpoq9F6axftMTbKf+p5Gl5cydk8qd64srzjsKvkU+653RoKTRLqhwfsr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073767; c=relaxed/simple; bh=9bKsogD2OWhfTMBzSLX1Yk0aZ1Ch1C6TsE6iHtWB2vs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=q14j83pouUcC/tTLX/JGUElHGolL2vaBKcEURItysE5qiqm7zifzwmX2yqAgdQ58u5MnBNlCyHwnygDT/IQW61jaV/gcGpteC6FnKU5mq1BUbibjGb8eF6PQeBEKO7ETEKAN6eB87m1KWsgHXPV7YgL5ABg+puoAzenLu+ver2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC906C4CECD; Fri, 8 Nov 2024 13:49:25 +0000 (UTC) From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org Cc: Shuah Khan , Mark Brown , Will Deacon , linux-kselftest@vger.kernel.org Subject: [PATCH 2/4] kselftest/arm64: Fix printf() warning in the arm64 MTE prctl() test Date: Fri, 8 Nov 2024 13:49:18 +0000 Message-Id: <20241108134920.1233992-3-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241108134920.1233992-1-catalin.marinas@arm.com> References: <20241108134920.1233992-1-catalin.marinas@arm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 While prctl() returns an 'int', the PR_MTE_TCF_MASK is defined as unsigned long which results in the larger type following a bitwise 'and' operation. Cast the printf() argument to 'int'. Cc: Shuah Khan Cc: Mark Brown Signed-off-by: Catalin Marinas --- tools/testing/selftests/arm64/mte/check_prctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/mte/check_prctl.c b/tools/testing/selftests/arm64/mte/check_prctl.c index f139a33a43ef..51e3f41a54d1 100644 --- a/tools/testing/selftests/arm64/mte/check_prctl.c +++ b/tools/testing/selftests/arm64/mte/check_prctl.c @@ -85,7 +85,7 @@ void set_mode_test(const char *name, int hwcap2, int mask) ksft_test_result_pass("%s\n", name); } else { ksft_print_msg("Got %x, expected %x\n", - (ret & PR_MTE_TCF_MASK), mask); + (int)(ret & PR_MTE_TCF_MASK), mask); ksft_test_result_fail("%s\n", name); } } From patchwork Fri Nov 8 13:49:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 841843 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 959941F12F9 for ; Fri, 8 Nov 2024 13:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073768; cv=none; b=C+slVuEzco/V/qHZH6/8zLE8D6cvHv/nrf1RxJYt3WF6X0bz3qDe/QI3+st2r8GMBC7pMKVVDQs22qImcbwUwqyFiGhO1HatzrXBp8ys1Pj6KQPVSN3/Xy3YjnH9yBii6E28xc42QVZGs/WhPNKA36Sp++/fQL1iZe0GFxO/Fks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073768; c=relaxed/simple; bh=ix5Fxx/i8DQLOqBdQFnrhKj5pOZdSBccJOJpOmxypdw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U3ho6Dwv3QQZRZeOPB490evWvw0/gVVJGaRVbUsOuGio0oaqq6nrxIFxqhbynHBY3vWgu+MjrlBD5JZpKfcffhodN0xIsE99PlObWMRlR2twwdpXPZztJL2hO3Q4v8cWd7kf5AUiTCOdWHKg6x5Y33GMh+y4T9i2R6Y25IJpXJs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5867AC4CED3; Fri, 8 Nov 2024 13:49:27 +0000 (UTC) From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org Cc: Shuah Khan , Mark Brown , Will Deacon , linux-kselftest@vger.kernel.org Subject: [PATCH 3/4] kselftest/arm64: Fix printf() compiler warnings in the arm64 syscall-abi.c tests Date: Fri, 8 Nov 2024 13:49:19 +0000 Message-Id: <20241108134920.1233992-4-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241108134920.1233992-1-catalin.marinas@arm.com> References: <20241108134920.1233992-1-catalin.marinas@arm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Fix the incorrect length modifiers in arm64/abi/syscall-abi.c. Cc: Shuah Khan Cc: Mark Brown Signed-off-by: Catalin Marinas Reviewed-by: Mark Brown --- tools/testing/selftests/arm64/abi/syscall-abi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/arm64/abi/syscall-abi.c b/tools/testing/selftests/arm64/abi/syscall-abi.c index d704511a0955..5ec9a18ec802 100644 --- a/tools/testing/selftests/arm64/abi/syscall-abi.c +++ b/tools/testing/selftests/arm64/abi/syscall-abi.c @@ -81,7 +81,7 @@ static int check_gpr(struct syscall_cfg *cfg, int sve_vl, int sme_vl, uint64_t s */ for (i = 9; i < ARRAY_SIZE(gpr_in); i++) { if (gpr_in[i] != gpr_out[i]) { - ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %llx != %llx\n", + ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %lx != %lx\n", cfg->name, sve_vl, i, gpr_in[i], gpr_out[i]); errors++; @@ -112,7 +112,7 @@ static int check_fpr(struct syscall_cfg *cfg, int sve_vl, int sme_vl, if (!sve_vl && !(svcr & SVCR_SM_MASK)) { for (i = 0; i < ARRAY_SIZE(fpr_in); i++) { if (fpr_in[i] != fpr_out[i]) { - ksft_print_msg("%s Q%d/%d mismatch %llx != %llx\n", + ksft_print_msg("%s Q%d/%d mismatch %lx != %lx\n", cfg->name, i / 2, i % 2, fpr_in[i], fpr_out[i]); @@ -294,13 +294,13 @@ static int check_svcr(struct syscall_cfg *cfg, int sve_vl, int sme_vl, int errors = 0; if (svcr_out & SVCR_SM_MASK) { - ksft_print_msg("%s Still in SM, SVCR %llx\n", + ksft_print_msg("%s Still in SM, SVCR %lx\n", cfg->name, svcr_out); errors++; } if ((svcr_in & SVCR_ZA_MASK) != (svcr_out & SVCR_ZA_MASK)) { - ksft_print_msg("%s PSTATE.ZA changed, SVCR %llx != %llx\n", + ksft_print_msg("%s PSTATE.ZA changed, SVCR %lx != %lx\n", cfg->name, svcr_in, svcr_out); errors++; } From patchwork Fri Nov 8 13:49:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 842220 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 681E01EF098 for ; Fri, 8 Nov 2024 13:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073770; cv=none; b=qDnXU+dMdX1sWdkSF+j2MsW6wSYKliGYQ49/5jEWfRSR/HjILWf8kOh6CCQLZ6nB4prkwONuC3OLzAZfKcYhs1gIc2bsg5IpDva8M8I2p34vlv2LV5GSQURvqjlMlKGf6z/A2y4Ou6sHfRPtzRpWmD5/31GQVHgd+SYqdDd4bLQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073770; c=relaxed/simple; bh=1oejkrjc90HVTjmm/gZTKFFAXSGfBoJXAnsx7NI55H0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ql5WZkNILGbJa1iR6fu41HpgafrPr5XA8ZV186fOgbhODaLvzoJKrazh6GXgXfHQ8Yg48EJF/FoXfoIYcWdus11Kw51nWTr91/IgjDyzFJMc/8ssVroy88QVkkuPZxQtkftuLTWZDw3nSbahxCFNtqZg9uCsS1h+7T6ILDIroYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8748C4CED7; Fri, 8 Nov 2024 13:49:28 +0000 (UTC) From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org Cc: Shuah Khan , Mark Brown , Will Deacon , linux-kselftest@vger.kernel.org Subject: [PATCH 4/4] kselftest/arm64: Fix compilation of SME instructions in the arm64 fp tests Date: Fri, 8 Nov 2024 13:49:20 +0000 Message-Id: <20241108134920.1233992-5-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241108134920.1233992-1-catalin.marinas@arm.com> References: <20241108134920.1233992-1-catalin.marinas@arm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SMSTOP/SMSTART require the SME arch extension for the assembler. Add '.arch_extension sme' to za-test.S and zt-test.S. Cc: Shuah Khan Cc: Mark Brown Signed-off-by: Catalin Marinas --- tools/testing/selftests/arm64/fp/za-test.S | 1 + tools/testing/selftests/arm64/fp/zt-test.S | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/testing/selftests/arm64/fp/za-test.S b/tools/testing/selftests/arm64/fp/za-test.S index f902e6ef9077..9ebeab6ce5c0 100644 --- a/tools/testing/selftests/arm64/fp/za-test.S +++ b/tools/testing/selftests/arm64/fp/za-test.S @@ -16,6 +16,7 @@ #include "sme-inst.h" .arch_extension sve +.arch_extension sme #define MAXVL 2048 #define MAXVL_B (MAXVL / 8) diff --git a/tools/testing/selftests/arm64/fp/zt-test.S b/tools/testing/selftests/arm64/fp/zt-test.S index c96cb7c2ad4b..ad550463d31d 100644 --- a/tools/testing/selftests/arm64/fp/zt-test.S +++ b/tools/testing/selftests/arm64/fp/zt-test.S @@ -12,6 +12,7 @@ #include "sme-inst.h" .arch_extension sve +.arch_extension sme #define ZT_SZ 512 #define ZT_B (ZT_SZ / 8)