Message ID | 20230412164517.329152-1-peterx@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 6FE74C77B6E for <linux-mm@archiver.kernel.org>; Wed, 12 Apr 2023 16:45:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0DE38900005; Wed, 12 Apr 2023 12:45:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 08DD0900003; Wed, 12 Apr 2023 12:45:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E99BC900005; Wed, 12 Apr 2023 12:45:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DB096900003 for <linux-mm@kvack.org>; Wed, 12 Apr 2023 12:45:25 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9EBB61C4795 for <linux-mm@kvack.org>; Wed, 12 Apr 2023 16:45:25 +0000 (UTC) X-FDA: 80673314610.13.CEAD976 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 8EBAB140017 for <linux-mm@kvack.org>; Wed, 12 Apr 2023 16:45:23 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PyMZP+gf; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf26.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681317923; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7ndlAQp34To4na8gq5wbdyyXxzaHqcVWVuJagrtwfaA=; b=GCA5/bRUqeS6TF7F1a/4QzJYoWr6n+ck1SVW7/IxpHcvMSSID0VYne4J1xLEJsyLabDl0S 3Zn6gtWEINw3XLxfmWquHPzZ4kwsQc8oS8hkEblEb2ANs81jRwHGFmN74iqgk76MasKKtI chM0koLd0pSQFnG6rNHmv7w8reC1wec= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PyMZP+gf; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf26.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681317923; a=rsa-sha256; cv=none; b=v5/4DGuinp26i/qGC8nGSq/GAWKVYRA5O2B6hok560ok0yygO+kPxs3/dNNByr5F3Kfz2c RuqmYba7BYiYvBxhQIwxkOnnD5IIbVDwT+68k1sDQlXSeoP1Nco6qpy017RQ52F+G6QeIl YLitPCqBfNLE6kZmHtMLkIbVG5vXfAc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681317922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ndlAQp34To4na8gq5wbdyyXxzaHqcVWVuJagrtwfaA=; b=PyMZP+gf0C/Uuc62+RD3oB7i9rHY7shJxxg6E7s1VFyy/AlTAW4B7l4Rm/vIVrriCxI2jg fuaYbBfpGs8BlPwTwrjT74YfXNdKPryFCQMZJO/BB6xWk9CtYfQLvnBgQwpLup0dnWXGCy +HxXWFwIxxQIQKvucjzZh5Q2wAx0XZ4= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-jv9yAtG9NBeRfBDJXglzXA-1; Wed, 12 Apr 2023 12:45:22 -0400 X-MC-Unique: jv9yAtG9NBeRfBDJXglzXA-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-5ea572ef499so7660026d6.1 for <linux-mm@kvack.org>; Wed, 12 Apr 2023 09:45:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681317920; x=1683909920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ndlAQp34To4na8gq5wbdyyXxzaHqcVWVuJagrtwfaA=; b=eM3za2NWitILMIQK4jH2SjAa958etiO7sAT+3DcoOZXvrzjhl+fmV/ZrvvK9BmqLVh X35ut8gXXWRwSdgqTZlw+4HC8btYTg92Uc0+zwb1DNY9GDK9UWtJ6NSRqMmlrALrqKr+ x02mZYddjSDUgQH4RKlH6SGRfiwD9SjBQ9Kf5Xl/bY3825Vy2hDRAuXaJb3bQkbx/15I 7FI6DSc3iFJ8ig6Ca7QMDOATqJz0EB/PD1atz3AZazQ5uyVZIZOgmfeDsR/XbjhnlZPI hEvH4w7Y6nYu6tBBRcZ1hd5eOUQsX4ZUkz1BPqKhJ9uxOyRCfUqruZAl1UQoS4E1XdPC o/hQ== X-Gm-Message-State: AAQBX9fozjZCryNSu0WmKoalWqLGOxg8+DpKzmfhVrpNgJSLGfS3o5Gc rK4PLAimDPVx38sJK22FKq42Z4OXy2vKq8ipjqY84HFV60hFZT1vDA4z0Tk98t2FQp3WNFcd0wO J54apnwy6/iJPJW/3BN9fg/RKxsFp8A8lb2kzTw5BwC3gc0WhNUKi3tA6wsNPAQWwI9ef X-Received: by 2002:ad4:5de6:0:b0:5da:b965:1efd with SMTP id jn6-20020ad45de6000000b005dab9651efdmr27671987qvb.2.1681317920428; Wed, 12 Apr 2023 09:45:20 -0700 (PDT) X-Google-Smtp-Source: AKy350YZb2K0e1JvXEoA25aoHQ/nvgMcYX1GQMHOJJJS45iAA64autN1RPeNtWC+riOtge78epKXPA== X-Received: by 2002:ad4:5de6:0:b0:5da:b965:1efd with SMTP id jn6-20020ad45de6000000b005dab9651efdmr27671945qvb.2.1681317919979; Wed, 12 Apr 2023 09:45:19 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-40-70-52-229-124.dsl.bell.ca. [70.52.229.124]) by smtp.gmail.com with ESMTPSA id cw8-20020ad44dc8000000b005ef465ad69bsm319693qvb.23.2023.04.12.09.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 09:45:19 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Nadav Amit <nadav.amit@gmail.com>, Mike Rapoport <rppt@linux.vnet.ibm.com>, Leonardo Bras Soares Passos <lsoaresp@redhat.com>, peterx@redhat.com, David Hildenbrand <david@redhat.com>, Axel Rasmussen <axelrasmussen@google.com>, Andrea Arcangeli <aarcange@redhat.com>, Mike Kravetz <mike.kravetz@oracle.com>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v2 27/31] selftests/mm: Workaround no way to detect uffd-minor + wp Date: Wed, 12 Apr 2023 12:45:17 -0400 Message-Id: <20230412164517.329152-1-peterx@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230412163922.327282-1-peterx@redhat.com> References: <20230412163922.327282-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Rspamd-Queue-Id: 8EBAB140017 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: j3jahdwhs3xwpeffpnd5tzkrthdtkwfc X-HE-Tag: 1681317923-206440 X-HE-Meta: U2FsdGVkX1/bmKZ5inArr3c9E6ig+dfc86mxThJelsXelGnNptJGx4cDrmvR5RJhSZEBtneV97Bt7LcpwqgxL4Cp1BT7vIpH8x8zEfFQhdVd+YBw040VWSpeh3SzEa7pDOV0TuFGh/iJeOw6Ku3gzrHYbXKyoLUV7gK/yArraRvwZrvKwYxPRtZJGG4KSSJUeZRaAaKn6NlAH/6yd7X58YnLfXqWRhuEGfNrIMHlZO0x+0kHVuoN77ENA8SBHG6Xn1g20eQXFpnjL1XnLBpVVKBM/dcBs8FXE/IjhocGCWxf1pC9GDBCsx3OkXUD/61xWoD3zGO47Bv22Ggww0JmRYnSB/GQ8XQKO2dhNxDEqVCBUqqR52W4VOY1D0ZpqVLkaj7PJJZywTq8Lrj6n5xSxmJiN38IJNX7/NNDICvlYkEYDCnSWLT4xK+Z4V0IHPKfRseX5UF3yxa6Zy/nzQ93kK4/BlRApn+FIFyotRG/thE0E7zl5YQ33jK1+0h7KaiB28FbkKg/ZhodtozY16YHvh+4akKpQyZGilcjnqsaCgVBhYfQz8/5KsQ05JCmzAO3/degeACsh7r80W3xvyKZHudgDdxJb2wRuA/aLi6aoJiVv9NvQyh6mrbeTzK8GfPpheXvdjQ4zttDuAGOIKbQ/pRLTE+ZN3QNe3k13d+TABivts2r0+1wmzp+T9yGE9pEw6S+mREF2HHcCMxJPBSupDtgdanYeiqC0oOZO5dQegPuNAPbleiP3sJ/pTDPhLF9LjM/zvqLp9tbPMsx8bUku9s3uh6AEqhIJRHd2CVLd0IRxEfwb24i4ZfJiPx8NMRmmfYeNyHMxqIAYYLHqel7CiDnv0CuduK2Aw5Rfeez8DHb65IQIJJV4T+4qnooUqUCs0+mi9jgDk/HBQrwbk1b52QuRi6FlRHtbjSPDUQjbJL5t8MC/UnrmOXV4heE3iA1WVoIWbkTLvD4xyzPttG CyG1fVSN 6IhjgxtW1wPir6T7NGzXzBLCvHtTVWEIuBWrdzrxu1iVKsigKNc6ne9U7dUM8wJ306J2tHIBq0Bs5cWiaLZSgAp9ey9IMG9Aa19f9OSMHm285BlcfpBN2ZYHzBeTdgivxrbAAU/hz/JXj+LNIVl180UuG61j0ECMwanOH4MlLhvRFe9vIuqcQSjQge5DX47r13gueGSP/kxmQARjL/JJJoXm02U993MNJWCnRRXGv7ABG8a+f2i08x7IY+4K5lmcLgqZdnlXdZhKWLU5hR0r1rArozBA5saR4ZB8iOVg871Ttmvrddv9he+0PfaT9dPqI0tRUQC4zCzOpqX63Exrb/PmHWKuqpUUO91LMIQgeRY0tm2PHPvgHBYaqegZhaU5R/p321bhIscJKF97SzAl+J0beAifgyHh456LD3f26CB7INtAiIAbN6d7EoAgV67swZm18r/W6hgUwb65emrVIlafEKreQ1B3BKhnK 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: <linux-mm.kvack.org> |
Series |
selftests/mm: Split / Refactor userfault test
|
expand
|
diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index 160bd8ccda55..a33d6c928eeb 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/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",
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. Signed-off-by: Peter Xu <peterx@redhat.com> --- tools/testing/selftests/mm/uffd-unit-tests.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)