Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp674841rdf; Fri, 3 Nov 2023 11:25:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxrLot4NcpXpXYaBpm7yv5VWiYKknaKXNXUmZuVWI1/gt4Sm7F7fYQKJ7tgzwx7MWNMVIg X-Received: by 2002:a17:902:e746:b0:1cc:5468:3284 with SMTP id p6-20020a170902e74600b001cc54683284mr4584119plf.23.1699035958538; Fri, 03 Nov 2023 11:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699035958; cv=none; d=google.com; s=arc-20160816; b=HRPX1aN2J6iQ53SKpz1yZ+aLWlpDzEd2Vkb0djOf5Uc6qMxGZEzAse4edpM1zCAznY v4RM+uGtGU2IaFhP5PvWrTBG5xUXFE6gOPYGj6yf80ztvGdJBBCCQKrkS9zBm+Ql6WAL 77qtq+iqqNcjdX0PR+0/YihLjpNNUZiKolhd6ItvVRNX8wWmr3J9lZ0kMX+92fV4UnkB BlUvVqMtfpViD7w+y0srU0uVlESl3ozh+SEDLgRf6zCQQXKknt+Pu7mxdB4MsSP6Xymp k/nrS2W/dSV3nHQXW5kdvFItLuIXc05jvbWYF5PGWcd+vNYV2X+e9BQK9KbQaSAhPhMs N5VQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=9iQG08993XrX7Nwnf1v18SlzHpDJ6J/uM/Qv+u375sM=; fh=2nku4DAfq3jqS3UGSH906T5FjOAfOquYeygmhc5lnWw=; b=XC75AgyFWAjSfP0JML2cLi4IPY8F+A13P50qXdzL6Mo2bKHdRn+dP0HdgSLF4gN0Iw n0XOmIgAgJYhAlUb+2E93W0dYTngZA0jxbiBPLXzyhFeIGbFSsNr9gpYBi74FfBl6kOj DzKFpZYlSMTYPYYxIiEwpvqHOylzsOULkAT/lp/AM5vrdeK6zIBiHbUJgrCVm+iQN7m0 3z2Cx1fLXJTII9u/IVJk1yppjpMaVLU3seHJnDw4n5IPYXuoi5HlpDNzatHJ7HgWS5rx 7qRtyOMIGac0VHNZMhZvrS8OE7RwlaoH7vCVUB54PKcmesn81gE+lQIYOPfZchzgaajv dj7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=m1jmSbYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j3-20020a170902da8300b001a6ef92d441si2079712plx.599.2023.11.03.11.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 11:25:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=m1jmSbYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D3B5882E74F1; Fri, 3 Nov 2023 11:25:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234077AbjKCSYS (ORCPT + 99 others); Fri, 3 Nov 2023 14:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232839AbjKCSYR (ORCPT ); Fri, 3 Nov 2023 14:24:17 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A18DB; Fri, 3 Nov 2023 11:24:11 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 11:25:24 -0700 (PDT) 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(); -- 2.42.0