Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28192686rwd; Tue, 4 Jul 2023 14:57:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlHaIIzarJc9l8rWuWqNJGlWBta1d30TbSPj9Cn2NRAwbcdTCvtqYKksdYV5fiT1bRDKspYk X-Received: by 2002:a5e:9901:0:b0:786:98bd:66d4 with SMTP id t1-20020a5e9901000000b0078698bd66d4mr4345724ioj.15.1688507839569; Tue, 04 Jul 2023 14:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688507839; cv=none; d=google.com; s=arc-20160816; b=PmoHVgr+WMColcGxrg8VOA7zU6QLsDiNVAnh03cBG7WGO/DxWVxupGGZh540NhTFVQ gJNbyyizWhCQTpQZRS/IKHySZkdzXwp8c/oj3E/R1Qm3IWo/YY/p4elHNBUMB38+CC6K L+mD+goRZuGphfoDBSIJrqfD5neUG8RdHSe5lUQxZcTVm+F6iKxlqfLb6L//ISxi8hjS iQiTvBrC1XsS5YQbggR+DWt4EJfOLc+FwuW7pRLZbjDLeNJ2PZGmpVRytE9omRa4qDUc or6uwtj8fjJkmTbij47nX3adCPn8LnjcNu4VVpStZ68hDWxyr5+mYndQ+VZHmVQriodJ EBgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y8bJxR2hg9jZOo9xJJwily7Z9DBcJ34R5Ty+xrrHVZo=; fh=0t4louP/8+xP3ORiRbUZtig8/xKb5OX3R1/WptJFEDo=; b=ymMExLrBzEHAsMgNsxK487v7JOE+6JsLzIOXSK6URpo95uUzwjnSub2A5ZCq5G7SBZ K/jCibJdDNtjtILD7UqZkL/A6+N/71K0nfD9EPmXGDtLkzp9pSCu84hua/RwqBCfrY0Y 9wkWnkR0wURUnR8oVKJqlAcKfiJKoq5OlEI4+L2HGR/YkCrUsycvKGGhMgWpu2EQX6q0 kQwZYY9lmHmhEp+upyHCBUMPTODgxmtbKJMAcJtpN0ES/uPd1RF457PxkLE9AYZfzqFk 55MbMuwCNjbDDpm4oiPHcQpxvmNkyOjlm5GN5q2PMEVyc4DhEwefOCzkbk30Dtf7S24E AGAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cq1sTclz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t19-20020a63dd13000000b005572b563e65si21648824pgg.305.2023.07.04.14.57.04; Tue, 04 Jul 2023 14:57:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cq1sTclz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbjGDVQj (ORCPT + 99 others); Tue, 4 Jul 2023 17:16:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbjGDVQh (ORCPT ); Tue, 4 Jul 2023 17:16:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5301E10D7 for ; Tue, 4 Jul 2023 14:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688505354; 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: in-reply-to:in-reply-to:references:references; bh=Y8bJxR2hg9jZOo9xJJwily7Z9DBcJ34R5Ty+xrrHVZo=; b=cq1sTclzrKy5GRRZ6BowhtHGn2GJSmXuR003H402e6szEhHzB8GOxTfXWEu0/45G2ZgGwP bsc9eNiS2MsGn7aNaxIXHd6NUuqLaLJxnbmBGxdPCunMFqMirUAxiKA240UjBGZ9/VXb8q FLnsBhx48NpdZy2Ep9jhGpKszoPvr3E= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-69sUd3qbN4e3c4L3NLB5BQ-1; Tue, 04 Jul 2023 17:15:53 -0400 X-MC-Unique: 69sUd3qbN4e3c4L3NLB5BQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-62dd79f63e0so13514876d6.0 for ; Tue, 04 Jul 2023 14:15:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688505352; x=1691097352; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Y8bJxR2hg9jZOo9xJJwily7Z9DBcJ34R5Ty+xrrHVZo=; b=hbJr2bVBkwtv+AKFa4O/svjXbewkBfku4ueZXfxcsF+HfQTgY/grFgip0IJCW30LXR aE5dWwvGOSYld59n7+rdK+o3/Jbn11qLZKChQBKTa9KaWQqbTBFjQU/xW7a29JgtKs0J ucqhgoGkxGhViM9knq/yQKygEggjdnV4KafT4C3JFxAeqX08Mw5kTABJJHU3wiHn7LPv xp+Hh4YQyYufh1Ph7J2ToOPSAYJDykCHTXDsEW6I3JOyR9KVsuu8IHWxeqNxdQ+/9Yn0 ed4KNfXo0i7DDXn8WP7nQmcMth6Er8cTPfEycwwrXTgBK2RtqrYyFh0QJtaHKiNC76rV +o7A== X-Gm-Message-State: ABy/qLak3n7VofMe3QM3qWhhRdRcIFEI9bVvIBcUyCPDZDLfMTW8mfup KdGWBfnSxiwaSX3eAn0/LR4xwumC4RRPHdjL0hS9fhxBy2zSZNk7BUuLs5VGMFpDkpP/GGJFaz8 0OQsjOoHvEslchwz3cR9i0NxX X-Received: by 2002:a05:6214:2685:b0:635:d9d0:cccf with SMTP id gm5-20020a056214268500b00635d9d0cccfmr15299202qvb.4.1688505352758; Tue, 04 Jul 2023 14:15:52 -0700 (PDT) X-Received: by 2002:a05:6214:2685:b0:635:d9d0:cccf with SMTP id gm5-20020a056214268500b00635d9d0cccfmr15299183qvb.4.1688505352469; Tue, 04 Jul 2023 14:15:52 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id px11-20020a056214050b00b006238f82cde4sm12696617qvb.108.2023.07.04.14.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 14:15:52 -0700 (PDT) Date: Tue, 4 Jul 2023 17:15:50 -0400 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Andrew Morton , Christian Brauner , David Hildenbrand , Huang Ying , Hugh Dickins , James Houghton , Jiaqi Yan , Jonathan Corbet , "Liam R. Howlett" , Miaohe Lin , Mike Kravetz , "Mike Rapoport (IBM)" , Muchun Song , Nadav Amit , Naoya Horiguchi , Shuah Khan , ZhangPeng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 5/6] selftests/mm: add uffd unit test for UFFDIO_POISON Message-ID: References: <20230629205040.665834-1-axelrasmussen@google.com> <20230629205040.665834-5-axelrasmussen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230629205040.665834-5-axelrasmussen@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 29, 2023 at 01:50:39PM -0700, Axel Rasmussen wrote: > The test is pretty basic, and exercises UFFDIO_POISON straightforwardly. > We register a region with userfaultfd, in missing fault mode. For each > fault, we either UFFDIO_COPY a zeroed page (odd pages) or UFFDIO_POISON > (even pages). We do this mix to test "something like a real use case", > where guest memory would be some mix of poisoned and non-poisoned pages. > > We read each page in the region, and assert that the odd pages are > zeroed as expected, and the even pages yield a SIGBUS as expected. > > Why UFFDIO_COPY instead of UFFDIO_ZEROPAGE? Because hugetlb doesn't > support UFFDIO_ZEROPAGE, and we don't want to have special case code. > > Signed-off-by: Axel Rasmussen Acked-by: Peter Xu -- Peter Xu