Message ID | 20230330160833.3107602-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 9EA15C6FD1D for <linux-mm@archiver.kernel.org>; Thu, 30 Mar 2023 16:08:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A243900009; Thu, 30 Mar 2023 12:08:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 652AD6B009D; Thu, 30 Mar 2023 12:08:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417B5900009; Thu, 30 Mar 2023 12:08:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 28C046B009C for <linux-mm@kvack.org>; Thu, 30 Mar 2023 12:08:40 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D53A9C0EF9 for <linux-mm@kvack.org>; Thu, 30 Mar 2023 16:08:39 +0000 (UTC) X-FDA: 80626047558.03.F90FA6E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id A901B16003A for <linux-mm@kvack.org>; Thu, 30 Mar 2023 16:08:37 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XZxtd29E; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.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=1680192517; 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=IPQaNGX43g5m/+6Rf9W/FOC5JWY5QcIX+G5qmLnnQxA=; b=q9MpT+U12gK9dhjsiYQnoddtZlfPURqrkiokDcJBjslold0yuOORWb/BvaOip41bGd2EWJ jmyzMOdQSjbBz2+QimVTLcRDTL2jL4mRD1GwtIOzi97KuQKB25IQK9Eju7P+9f7mRduCND EqKIcAHSziphCyg+evT8yoLsxUqR8KA= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XZxtd29E; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.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=1680192517; a=rsa-sha256; cv=none; b=GbT9fSB+a+iAHTs4WaUUfO0UEu1V8CG5Kn5ZdmgqNdLLOcdnufDdROPFHfTlokJHjIDMn4 tJsLWxscggG43l+sFERycZ1AtEhxioBShLxqihaGCGMjID+rglEgHyE2oyCi6MBMf77GYo zst9Hz46+LN2ZsJZsPwkdqci+srN3Zc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680192517; 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=IPQaNGX43g5m/+6Rf9W/FOC5JWY5QcIX+G5qmLnnQxA=; b=XZxtd29EV7X/aey/mcStsQsHBoV1FSsBCGu7bT6eU6aRwNnYl/0kgDlHsHcb9q2QxYt2wD 01ee02/w8LIh8XiNw3TJmx5/A9c859kUjG6qHl3AWlifbHKSd/I6nCdkI9pMzYpB22sXDD JXL3Q7ksnI1qs+oCP5K9ZBaBP30sP/o= 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-612-2Eyp-qOaN5-K8TOaVxDiVw-1; Thu, 30 Mar 2023 12:08:35 -0400 X-MC-Unique: 2Eyp-qOaN5-K8TOaVxDiVw-1 Received: by mail-qv1-f70.google.com with SMTP id g14-20020ad457ae000000b005aab630eb8eso8493509qvx.13 for <linux-mm@kvack.org>; Thu, 30 Mar 2023 09:08:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680192515; 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=IPQaNGX43g5m/+6Rf9W/FOC5JWY5QcIX+G5qmLnnQxA=; b=ziBkBIVXGDa8cRoq9ZlJCOSG6dZEph21guPbU5lTvoe4SkAe1NMnoR8CuWbuuxgy38 6qBsURqk5Aekp65UapqIXy0i8+tiaSheKSAE6HBaqFoPdMU5QQ/BFiWXTVJ87gHl0RQt tIV//8ghbQ/nSr5PY0Dh2TumAh3yf9fqh+BpJSlWo43HCO9v/EX930uLyiDt4V3OlI5n tQosJK2Zz+Mo0lEWBVWG2HMp587+43dYN6R5jOW20vCpULLM3Dh1jX//57gtHUw/UDQr RonMgW7VRJ3dvFQmcv2rJQq1H4pOKTI9Gl4JjV2RFCu+xs/TPDWtf+wIBOAIuNSfRB79 47rQ== X-Gm-Message-State: AAQBX9dZTThYQyZx6ZI/NEkHuJyToEpUdu/53UzlMvvOOEp5kpNbRh0f xnAM6x2P19iVVr0GFpQY0fFtibgTvSJv3maEcMhaFKU7fx72aQswYz0uX98KQNwQkMARBYssuCa DRzyDkvQ8yZc= X-Received: by 2002:a05:622a:1894:b0:3e4:d3cc:4211 with SMTP id v20-20020a05622a189400b003e4d3cc4211mr4416045qtc.3.1680192515336; Thu, 30 Mar 2023 09:08:35 -0700 (PDT) X-Google-Smtp-Source: AKy350aRBS/3Ba03nR6/rH7+O6OKnPp5UZSkwf7AEEAgfK8oTfxGPLAAS7vHG57dqP9Xg/7Bnp679A== X-Received: by 2002:a05:622a:1894:b0:3e4:d3cc:4211 with SMTP id v20-20020a05622a189400b003e4d3cc4211mr4416001qtc.3.1680192515042; Thu, 30 Mar 2023 09:08:35 -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 l18-20020ac84a92000000b003e3860f12f7sm9484075qtq.56.2023.03.30.09.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 09:08:34 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mike Kravetz <mike.kravetz@oracle.com>, Mike Rapoport <rppt@linux.vnet.ibm.com>, Andrea Arcangeli <aarcange@redhat.com>, peterx@redhat.com, Leonardo Bras Soares Passos <lsoaresp@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, David Hildenbrand <david@redhat.com>, Axel Rasmussen <axelrasmussen@google.com>, Nadav Amit <nadav.amit@gmail.com> Subject: [PATCH 26/29] selftests/mm: Workaround no way to detect uffd-minor + wp Date: Thu, 30 Mar 2023 12:08:33 -0400 Message-Id: <20230330160833.3107602-1-peterx@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230330155707.3106228-1-peterx@redhat.com> References: <20230330155707.3106228-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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A901B16003A X-Stat-Signature: cytgoy83b8kk4o548yk1hcz41s8gucqa X-HE-Tag: 1680192517-407831 X-HE-Meta: U2FsdGVkX180nsbpBPZz8sTAjZ2Rk/9+fV0ALxqXHiI5IbyHR0uZZujWdNHP7inxvCRZ/9yjJaEhjYqyTQBwAeDhb1X9Cfhf0HutV3TY3/siaJ5sBKMiAKrBL/IhMas37HIqePMSRAfmTGB/HOFEk31BHCd94AePuDyGurNq9MzDLayXB4HpWDU5snOhfw7VTD2zoDl7vrOJNKa+n00b2S9D4WlrkWUAN0+QaRf1oXVRsSaS2gNSr3M5p2Lm7vgMgBZSJKfMXntEp9ZlfiP0DmE+j7jP/yOGSCKORRvUm28pWOqhTYqQYMyqBDnk2vBV6B0W2tJy51pti71x8zchfv66K+coJszsM5fCPu4ls0pRDU3p49SulrIFukygDc9kcXRG87Kiek0peYu2t2Sro+YfsETnWFH8uUQtaZ04FKTZC3zmVqtvfjOzz87urb9S5po42XbJLv8EbPIYqK31mCzlPMG3ac4tGkAtuVK73ifjAztZOLmUXqxO7/rE0CFyhZForzGzcRXGh4B910jAe1ZX1XH81TjVrl0smRpaFj1zAAAxTaF3bcd3aOokOG6KZs6qssKQr3Vf55prPQoUoOYI6q4ethF9KJIa8XBztGLNhi1/L6lWKeZ7QNKHGy1o5Xo+vfepA9tXfw+k0Kt9Es/AoeZehuoGcM4N2id6xiajyKvHUoVleRIQQxrEkcyUZfN0P/Tizjawmv+ni6ujrX9FwzGBoE3NUaxPIoiuoyhq/lk+3nXhonxL7Bf7FDke3/38laqc8qOgLR4tXUsdkX6MJ+CgSTvCse2lML9IugCwEzEJwBSr2SjKkxAhhQmBE1x5qOJr7bEzqL26sT9tCYATYKctV+mAFUqlArM4YtM3AkdS0bq/9ajRbRaA0mkxglwAQBzZSKgkCY+Fy3wX5flHrsui+55DIXIhz9tHR8py9E7HX7mUtFTrj7fgwpJAcrwZr0CWTwvqnAMO3Hh bMjSP4JZ VPY/8egQ/02qFOz03F+mo99C7mS1xn4RpCR4vlUl1g9hJhGkg+cno77dySqYmR1DweOKuzexnmBgKNwOMx42wj7riBIJG0HHDz1RM0fPWhN8hzgXwW88d+sk+ti1kIHq1HU/RBIrEd6zAsHib13CVyTL/tBvik7qsuiBJy01M6gvwnIY6oilGUYc303NX2lPJ564jxdjXVuad1vw1c5/eo9SBreuIag/wJASXbAp3h+DgOhSJ8PlxbAax/4oeD3M/1esP0Uhln09r2RkxNg92AIURDCM9K3L6GMsVXI4KXNV2Br/Wzq8yt7MQAvTSY1lCuVyqqWKd3hHpfQakLuVbW5Lfp/lT4OpZFBE9xMH1IKYbqnMEBuTQX363NouK8EAZtEiby6Yzk5NsYAA/sSo69DX6gKrlwOIfeu3WcFhiZHwLttCCs9XlWzpQwok18UeivYNSU65BY5PKynwXvnimisRNPCGm5dw7NHTK 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 376dfa320b6f..82fd3aaa06c2 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -784,7 +784,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(-)