From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38FA4C77B72 for ; Wed, 12 Apr 2023 20:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229874AbjDLUDs (ORCPT ); Wed, 12 Apr 2023 16:03:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbjDLUDT (ORCPT ); Wed, 12 Apr 2023 16:03:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA3FE4C08 for ; Wed, 12 Apr 2023 13:03:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 86E7363136 for ; Wed, 12 Apr 2023 20:03:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4870C433D2; Wed, 12 Apr 2023 20:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1681329798; bh=Es/L48clKckA/Y/6TX+z+AC8h+cUKmPy0kpoZZREkBM=; h=Date:To:From:Subject:From; b=MOMYaeX7dQ6WDhM7fKZDJ+T2Rd8qXBD3L9p/WspbN+Dtpu710+5rohsYwIAXUVl1i KV8dbLG0oDw0BknH2QXtPgSuFVWj298kcJETroTmDrV0Aurv6BvixX/owLneRQC/lt TLjBJt7JUelqBW59PYhIiDJv6vbsrdEQIcoYnu38= Date: Wed, 12 Apr 2023 13:03:17 -0700 To: mm-commits@vger.kernel.org, zokeefe@google.com, rppt@kernel.org, mike.kravetz@oracle.com, david@redhat.com, axelrasmussen@google.com, 0x7f454c46@gmail.com, peterx@redhat.com, akpm@linux-foundation.org From: Andrew Morton Subject: + selftests-mm-workaround-no-way-to-detect-uffd-minor-wp.patch added to mm-unstable branch Message-Id: <20230412200317.E4870C433D2@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: selftests/mm: workaround no way to detect uffd-minor + wp has been added to the -mm mm-unstable branch. Its filename is selftests-mm-workaround-no-way-to-detect-uffd-minor-wp.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-workaround-no-way-to-detect-uffd-minor-wp.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Peter Xu Subject: selftests/mm: workaround no way to detect uffd-minor + wp Date: Wed, 12 Apr 2023 12:45:17 -0400 Userfaultfd minor+wp mode was very recently added. The test will fail on the old kernels at ioctl(UFFDIO_CONTINUE) which is misterious. Unfortunately there's no feature bit to detect for this support. Add a hack to leverage WP_UNPOPULATED to detect whether that feature existed, since WP_UNPOPULATED was merged right after minor+wp. Link: https://lkml.kernel.org/r/20230412164517.329152-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Zach O'Keefe Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/uffd-unit-tests.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/tools/testing/selftests/mm/uffd-unit-tests.c~selftests-mm-workaround-no-way-to-detect-uffd-minor-wp +++ a/tools/testing/selftests/mm/uffd-unit-tests.c @@ -780,7 +780,13 @@ uffd_test_case_t uffd_tests[] = { .mem_targets = MEM_SHMEM | MEM_HUGETLB, .uffd_feature_required = UFFD_FEATURE_MINOR_HUGETLBFS | UFFD_FEATURE_MINOR_SHMEM | - UFFD_FEATURE_PAGEFAULT_FLAG_WP, + UFFD_FEATURE_PAGEFAULT_FLAG_WP | + /* + * HACK: here we leveraged WP_UNPOPULATED to detect whether + * minor mode supports wr-protect. There's no feature flag + * for it so this is the best we can test against. + */ + UFFD_FEATURE_WP_UNPOPULATED, }, { .name = "minor-collapse", _ Patches currently in -mm which might be from peterx@redhat.com are mm-khugepaged-check-again-on-anon-uffd-wp-during-isolation.patch revert-userfaultfd-dont-fail-on-unrecognized-features.patch selftests-mm-update-gitignore-with-two-missing-tests.patch selftests-mm-dump-a-summary-in-run_vmtestssh.patch selftests-mm-merge-utilh-into-vm_utilh.patch selftests-mm-use-test_gen_progs-where-proper.patch selftests-mm-link-vm_utilc-always.patch selftests-mm-merge-default_huge_page_size-into-one.patch selftests-mm-use-pm_-macros-in-vm_utilsh.patch selftests-mm-reuse-pagemap_get_entry-in-vm_utilh.patch selftests-mm-test-uffdio_zeropage-only-when-hugetlb.patch selftests-mm-drop-test_uffdio_zeropage_eexist.patch selftests-mm-create-uffd-common.patch selftests-mm-split-uffd-tests-into-uffd-stress-and-uffd-unit-tests.patch selftests-mm-uffd_register.patch selftests-mm-uffd_open_devsys.patch selftests-mm-uffdio_api-test.patch selftests-mm-drop-global-mem_fd-in-uffd-tests.patch selftests-mm-drop-global-hpage_size-in-uffd-tests.patch selftests-mm-rename-uffd_stats-to-uffd_args.patch selftests-mm-let-uffd_handle_page_fault-take-wp-parameter.patch selftests-mm-allow-allocate_area-to-fail-properly.patch selftests-mm-add-framework-for-uffd-unit-test.patch selftests-mm-move-uffd-pagemap-test-to-unit-test.patch selftests-mm-move-uffd-minor-test-to-unit-test.patch selftests-mm-move-uffd-sig-events-tests-into-uffd-unit-tests.patch selftests-mm-move-zeropage-test-into-uffd-unit-tests.patch selftests-mm-workaround-no-way-to-detect-uffd-minor-wp.patch selftests-mm-allow-uffd-test-to-skip-properly-with-no-privilege.patch selftests-mm-drop-sys-dev-test-in-uffd-stress-test.patch selftests-mm-add-shmem-private-test-to-uffd-stress.patch selftests-mm-add-uffdio-register-ioctls-test.patch