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 01550EB64DA for ; Tue, 4 Jul 2023 21:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231179AbjGDVQj (ORCPT ); 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-Google-Smtp-Source: APBJJlGplsPlE6k/Ac9I4olk/6Quorme09kXiBKYGVccc9DwPZ/ze9ZJey/GJMFKHSw2A+5sGFeDSQ== 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> 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