From patchwork Fri Nov 3 18:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13444878 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 AFC5BC4332F for ; Fri, 3 Nov 2023 18:24:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 017578D00C9; Fri, 3 Nov 2023 14:24:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F09B88D000C; Fri, 3 Nov 2023 14:24:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD1DC8D00C9; Fri, 3 Nov 2023 14:24:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CCDCA8D000C for ; Fri, 3 Nov 2023 14:24:14 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 949BC140251 for ; Fri, 3 Nov 2023 18:24:14 +0000 (UTC) X-FDA: 81417467628.18.78E7364 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by imf02.hostedemail.com (Postfix) with ESMTP id DBAD08000B for ; Fri, 3 Nov 2023 18:24:11 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=m1jmSbYF; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf02.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.172 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699035852; 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=9iQG08993XrX7Nwnf1v18SlzHpDJ6J/uM/Qv+u375sM=; b=d2Ufq/+1AOPLPuXnD96x5FHgOGflHxxu2o+xrSIYyWVSwtG5RMli0zaevMEVjosh4M8C3h E+YlCl4hqjAj59uVzaPFQJyWkoUhEZQ3FSM/ug6CLRd5bWa46D37Oq7Co2ifZ/ula2Jf6c cdym3nRKvmc/P50upzX2pTNgwBTwjKU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=m1jmSbYF; dmarc=pass (policy=quarantine) header.from=collabora.com; spf=pass (imf02.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.172 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699035852; a=rsa-sha256; cv=none; b=g6gvHq1mynJGuQZVYNfZdL874AeJ729VoW04/CmJlZSco2aetCysIWLufPmAwewh8BRNB0 xr0YXrwDJAT4yqmUZ/fvL9Lg4gZcknMx/lR6peD0ifvrAZjYEwu/jlzNvhcpeHeRv0nzIj pQARVuJtLbaTAQz+nJJVT/03Gw133ko= Received: from localhost.localdomain (cola.collaboradmins.com [195.201.22.229]) (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) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 09D8866073F9; Fri, 3 Nov 2023 18:24:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699035850; bh=WCwIVvIPo9o8DL2cD4gn2WucfUf+vrOIACI0R4C5a9I=; h=From:To:Cc:Subject:Date:From; b=m1jmSbYFalrqo28EWpqoUapQlUI504MP4D408EXWCQBVC8CQeq5eoFy+WbJr0o7U1 OGk0tK9iGbEm0RdPc9i9RNly/AqSB9ufH0Vp6PAblFFsg0p7bqZpTSCSk4xsosj7ou DO6VxofuNujdPgsCOiGrSxTmczL4zfnQs9RRkamqLeaZC++D6eX9Q6roBrM+UMCgou wKBf0YcQoyAfrUoJWwPjnphGHxjc6PybsS9symKd78k1q8yqWqwEjpqd5/NSKEvN0s Ie+NwHt9d5s54MkF6pV0UR3zfgeu/b6m4vcLhAqpYLaIOyKFazIUrcw7VHX4E8Mxps 0DmmzK5ow+DqQ== From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Muhammad Usama Anjum Cc: kernel@collabora.com, Ryan Roberts , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] selftests: mm: skip whole test instead of failure Date: Fri, 3 Nov 2023 23:23:41 +0500 Message-ID: <20231103182343.2874015-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: DBAD08000B X-Stat-Signature: b4518iaryw1cco4buf8noz7yp6fmi19r X-Rspam-User: X-HE-Tag: 1699035851-609666 X-HE-Meta: U2FsdGVkX19Vne3OFkbuZRFiBgcek6a3o3vX+TcC3o5JlNA5VlR9R+o8Ehi1JjJiEKhU0VujvNJUP9JGMcZKGJ7/V11yKAViCJG3E5N0HYhBpxiCi1Wf6S1UpVS017ciHCqwZwdMlL5D3v9VOXXHHB04Y46VuLBpbNpRkKbVGOR3lPCqFC5fNweKf60+iXrQkvJjIaOuiB+BkaPcADXMd4UEqH8BwJDcSE4SDuitX9i7UylVbv9G3nAADUXzTLuGl3nrNxGSpzgSzI0f8JDMnwYI9alublX6Y7RyVnyKq/iDdrX0/UWfokyXbtnDB4gDQsXDhsmqv0Kxq0MhWMDbPahaUIwPUBr39ZcREWEWbcH/lCNR5cYzYigRobL8Exxts6z6U8DS+brOOp8RxDgi6/OebrUu0eKgYroNKf9rm8ztH+rUkbFbT+UC10Ysw5uY2LxGX3hxMGtC8RvfCfKe4X5rSNVqhOOmAqIX2op47Lg3acMlVVtQuhpM+OOrjvKb+FFxX6cIk7jPGHf4Vlbe+YNsR7KiBvZtZfJFsyWHxi6L+lUoHCSx5RWDjaV5hTJ2ezvQvKeB9I2pZ9APYovzGIOKS4Jvhst1J/q4dCFWYrw7z6Aurr3OjUsKGyzynvep6AJM9tnKRCq7xjxCib5acuse44oTdQObh965GT8+8baZyIh7ryWtwN/hsCgdTevc0xXLaCp+Qr5S4Liw3O13X7Sdm6wTgpeB8tSvPBlyOcdkAymOUqIvvWQ/QkXUtiXDV9zPtksc3O/JjJ8z6b5kA8E5E49MHFEChOJ3yCEJcT+DYtZQ+4CLUM7WezKZAgePB0rKE9FbBRNMFItXL3M1urDdfxqr/mRvHZtI3+bZ0Ath28z18vdevf3C/oesEbfK2KuZYijOHirYKV1qnXImBK/6tEnDK8k8sUubfxCl1+0axrsZGDs2GVWYHJh6uwaZfAZ/WdjIShHvUNd34HR nfrits89 /W9QLty2TFtIvpZJfE92SHXcsdZCFYeETr7Wq6nzyfz4E/cotlHEYuNnUUXnyO06YwJ0yitCuOYD6j7hiBGWbCMVkz/hdQ14Z4bbzpMCV2v7g5Ef8hi/GFbWzG8REnfIBNTwG1K/htKdYS08SjEzy/A7kL/jB2Hr1XbsYfNQJM/A5t3i2CsSdnxoIoOFjOfIYvv+nyrZrGNu0Rtrm/M7fIwPA6GaXgrz/gBER5nJQr8ew4N7HLDPbshmyXCra9tQ+5b84M8GV/yQMEeLq7jOx78prHDUnOIwtknI4ZANZHf+GZrN0XXuQV4dULYTgiayXSI/TjeapctEWPRtxAShVOIDwwhJaPE4+miQo+j+92DW0XLU= 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: Some architectures don't support userfaultfd. Skip running the whole test on them instead of registering the failure. Reported-by: Ryan Roberts Closes: https://lore.kernel.org/all/f8463381-2697-49e9-9460-9dc73452830d@arm.com Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index 0161fb49fc6ef..f8685a2ea07e6 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -94,19 +94,19 @@ int init_uffd(void) uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY); if (uffd == -1) - ksft_exit_fail_msg("uffd syscall failed\n"); + return uffd; uffdio_api.api = UFFD_API; uffdio_api.features = UFFD_FEATURE_WP_UNPOPULATED | UFFD_FEATURE_WP_ASYNC | UFFD_FEATURE_WP_HUGETLBFS_SHMEM; if (ioctl(uffd, UFFDIO_API, &uffdio_api)) - ksft_exit_fail_msg("UFFDIO_API\n"); + return -1; if (!(uffdio_api.api & UFFDIO_REGISTER_MODE_WP) || !(uffdio_api.features & UFFD_FEATURE_WP_UNPOPULATED) || !(uffdio_api.features & UFFD_FEATURE_WP_ASYNC) || !(uffdio_api.features & UFFD_FEATURE_WP_HUGETLBFS_SHMEM)) - ksft_exit_fail_msg("UFFDIO_API error %llu\n", uffdio_api.api); + return -1; return 0; } @@ -1479,6 +1479,10 @@ int main(void) struct stat sbuf; ksft_print_header(); + + if (init_uffd()) + return ksft_exit_pass(); + ksft_set_plan(115); page_size = getpagesize(); @@ -1488,9 +1492,6 @@ int main(void) if (pagemap_fd < 0) return -EINVAL; - if (init_uffd()) - ksft_exit_fail_msg("uffd init failed\n"); - /* 1. Sanity testing */ sanity_tests_sd();