From patchwork Fri Aug 9 07:56:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13758501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E134C52D71 for ; Fri, 9 Aug 2024 07:57:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29CC36B009A; Fri, 9 Aug 2024 03:57:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 24CC16B009C; Fri, 9 Aug 2024 03:57:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13BAD6B009E; Fri, 9 Aug 2024 03:57:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EBA286B009A for ; Fri, 9 Aug 2024 03:57:22 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A6E65160A9D for ; Fri, 9 Aug 2024 07:57:22 +0000 (UTC) X-FDA: 82431951924.05.233F390 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf26.hostedemail.com (Postfix) with ESMTP id C7BEF140004 for ; Fri, 9 Aug 2024 07:57:19 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=baoEat06; spf=pass (imf26.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723190207; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=icKPXt17t9Kx30jQW8DqzSUWcb+Xzik3rs56lRblVGo=; b=WhO7x5jjOomKHjCE40kna09LIgfvgx4e/Hk3gFYfT98ECP/dVWecSZT94lH1a5oIH3hCF3 Y2bgSH5wIzppwk8E+YUjw6TnWZ9Y+ya+fAgjfQ0aTD9sFqCM+AM15uMVF5YEecLBcBwRV1 iINTKSQJhVAVjTZ6pRr2B9XKdBoVMfE= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=baoEat06; spf=pass (imf26.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1723190207; a=rsa-sha256; cv=pass; b=8ON53/l11c2F5TnIQF4ojJ08lSQsmf7mT165HcqIVeCWJnxm4CFrvjI4khU32UlL5F09rw Q1fb/xtkdu6nwrLw/st4xAd5trX8ieysIwUnw6Ssq/2B0RjvgLWydRlQSJz25LuSDcpKp1 Eus2dhfeCctYety0UV97yv2ktBEc6vY= ARC-Seal: i=1; a=rsa-sha256; t=1723190225; cv=none; d=zohomail.com; s=zohoarc; b=hc7RzBokHDN2N9oNmXMxZQ2W2gtcn4BfdhAo7EGb5VOW/IWpn5FKeke0G3JR3FfxuGc/GLuxIeuWp1mKevBXTQ0yoFe2a3zPSkk4IfDoQP2BBOb/X8Ai/p74KrUBb/mkUhitK0oBT9/ylttChDbd4jVtbdN09YT58hqqQivyvas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723190225; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=icKPXt17t9Kx30jQW8DqzSUWcb+Xzik3rs56lRblVGo=; b=S+rqzHnzIgpu9k8DyzqRY6iDpo22yYa5iGor6HDiruYIyTjdobZ2Ss7L20DnlrFjjZQKRQ9KrAQwxqrA8NZueRUT922z+kf2V44ZP1POeZgP7+rdvsJtDGSkJY/F4AjqomZBwl8EVzETE/LICgSEJCjNikVE/0Xklu6ipCKfzIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1723190225; s=zohomail; d=collabora.com; i=usama.anjum@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=icKPXt17t9Kx30jQW8DqzSUWcb+Xzik3rs56lRblVGo=; b=baoEat06HZ2Q4x+RKme432Zc7LrqBMAMUPE0jUd68CNpaX4vyylF3E5BbSbBCd78 J3hjUfJbGvhCJtRM4e62TTgXeA9M9qfQRAQJRyqEO3Si3TsxoO6fb3Alsn8U+1LhW4O kG9VU8VXXd+Hhv3AjWM/56WC0h6yuPivTzf2tGt4= Received: by mx.zohomail.com with SMTPS id 1723190224501788.7935482020652; Fri, 9 Aug 2024 00:57:04 -0700 (PDT) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou , James Bottomley , Mike Rapoport Cc: Muhammad Usama Anjum , kernel@collabora.com, stable@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH] selftests: memfd_secret: don't build memfd_secret test on unsupported arches Date: Fri, 9 Aug 2024 12:56:42 +0500 Message-Id: <20240809075642.403247-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-ZohoMailClient: External X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: C7BEF140004 X-Stat-Signature: z53nd7snw9za5rczxw49icdcjh3ca3r4 X-HE-Tag: 1723190239-925488 X-HE-Meta: U2FsdGVkX1+6HEBpnt7BQesF2n7FQ7FTVzmhGKE6wChfNK7F2XiK9pTDHyKDslmqc7t8TZyvd966sH57Esy1GN/rOwB3bkzZWPaS+E+ZootAg3bQ3S0XCcMGC3nT+gD4ObV3vybcKD5Gw1F/JoR4jX1FzsiYy0eyLBRP2RqC36h525gd1e6mKU9VJBLO5DM8aqZc4Zz2b9xsJ0WEV4GKkxEw4SormsFLwPbASg4bZF5mkGW3c4ayTJgVfxMMK1GLLnrfg5/bnBUpse0nALlQaH06Be4mmjtIds+HuOmC/ou4VHOzcdB4/e84QOfF3qJU5TV9DRHj/lDbKKnxLeYmZBVSmS3Lmff+MqDoqqrbNes9I0B7jNe08M4t4NCF0okuk49IIOo0rc8f2BcdZfHCkZjWPJkp0mZes6S2wSgEeEj85uvWsSi6nHC4YaKENKk5Kcxy6Q2h/0APzuS7jKNZmvvhaeDjbtDxdQySSJTRKVjzRhAorrbYUeR1uhUMklZaAsS873yvEMWYwuihQRiWUEjRSNj+DtQWe1EIYqP3iR8NdHUsPO2YQakZ/PavSbVKAjTQ6GEHv00RLWm6QW5vHCbKDaOCNDoVjXFl0zCcpIDhH18iXjXNI7Mf0k7HwBKJQnedYKs/BpVD4xYxiqdaJ8l2bzyjo0FiT4SKOT4Le4tKKWs0+/o1QjJ/YPpla6IxixXGiPHwt+TOvIdUaTlQ+p3V0SowA9svFePRo0LD6UtWjkIgsHxv3SGuHSLxGoNxZGsVevAn0Zd6aVO31oUON2CZtfX7HeMCFsZuROPe2pcIYdfQ/0+ClXqBGoSGN6rO1hmu3Qi3zioeEYNwuNM2IesUbq947t6BQpT2DTvVwahKMYb6fmslM2voyvwzwmgf82mHRl8ZSJxNrOFsQKh//lSgttmfQh4RQYe87sdf5TZoWscL12PmH7KIZRDdIDY7XJ0xb7njKWTS1i1Xt4e lJp7gj/B LoUa8qW3xCR29RHgV4eXLeHiv9zHkjlJ/lQobBfB+LgFi9KXUm6+bDf1vDkI9lCcq6SwMwXUV05M3bgM3NJ4cF2eZJUh4DHXm972sM29NQLIlKOsXl5pyXhuoXI3xicv/FH84KpbMRcuO6vScSuicUtDp6xgBpB+vQmaZZ5EAmSnOc11uqPYYtm8EY5F33DVDAHoFXHE5L+vTB4nEcAbBpfrFVaickMsDDxMOuzydRBVoXPu0pMR5pKqJHoW50xyJu63Mi5hSmrLONjdi//oihX0/2lquf3j7PLkTo2srCRcLDP2IunYHzCksTsdaRrCwk+K2c/yCro5eMSS92FXoXeR5yawLtKBB9VzoCq/WYBXLRpjIMZR3SpR1AzrhEZ6NQKSLgvZt+gcVmaVa830EWOJOsg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: [1] mentions that memfd_secret is only supported on arm64, riscv, x86 and x86_64 for now. It doesn't support other architectures. I found the build error on arm and decided to send the fix as it was creating noise on KernelCI. Hence I'm adding condition that memfd_secret should only be compiled on supported architectures. Also check in run_vmtests script if memfd_secret binary is present before executing it. [1] https://lore.kernel.org/all/20210518072034.31572-7-rppt@kernel.org/ Cc: stable@vger.kernel.org Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)") Signed-off-by: Muhammad Usama Anjum Reviewed-by: Shuah Khan Acked-by: Mike Rapoport (Microsoft) --- tools/testing/selftests/mm/Makefile | 2 ++ tools/testing/selftests/mm/run_vmtests.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 1a83b70e84535..4ea188be0588a 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -53,7 +53,9 @@ TEST_GEN_FILES += madv_populate TEST_GEN_FILES += map_fixed_noreplace TEST_GEN_FILES += map_hugetlb TEST_GEN_FILES += map_populate +ifneq (,$(filter $(ARCH),arm64 riscv riscv64 x86 x86_64)) TEST_GEN_FILES += memfd_secret +endif TEST_GEN_FILES += migration TEST_GEN_FILES += mkdirty TEST_GEN_FILES += mlock-random-test diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 03ac4f2e1cce6..36045edb10dea 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -374,8 +374,11 @@ CATEGORY="hmm" run_test bash ./test_hmm.sh smoke # MADV_POPULATE_READ and MADV_POPULATE_WRITE tests CATEGORY="madv_populate" run_test ./madv_populate +if [ -x ./memfd_secret ] +then (echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 2>&1) | tap_prefix CATEGORY="memfd_secret" run_test ./memfd_secret +fi # KSM KSM_MERGE_TIME_HUGE_PAGES test with size of 100 CATEGORY="ksm" run_test ./ksm_tests -H -s 100