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 0AE3EE7D0A2 for ; Thu, 21 Sep 2023 20:02:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231488AbjIUUCh (ORCPT ); Thu, 21 Sep 2023 16:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231557AbjIUUCO (ORCPT ); Thu, 21 Sep 2023 16:02:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46A1A72B9; Thu, 21 Sep 2023 10:22:38 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 23993176B; Thu, 21 Sep 2023 09:29:10 -0700 (PDT) Received: from [10.1.34.154] (XHFQ2J9959.cambridge.arm.com [10.1.34.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3FD333F59C; Thu, 21 Sep 2023 09:28:29 -0700 (PDT) Message-ID: <637361bb-dd56-4085-a427-86fd76480de5@arm.com> Date: Thu, 21 Sep 2023 17:28:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 8/8] selftests/mm: add uffd unit test for UFFDIO_POISON Content-Language: en-GB To: Axel Rasmussen , Alexander Viro , Andrew Morton , Brian Geffon , Christian Brauner , David Hildenbrand , Gaosheng Cui , Huang Ying , Hugh Dickins , James Houghton , "Jan Alexander Steffens (heftig)" , Jiaqi Yan , Jonathan Corbet , Kefeng Wang , "Liam R. Howlett" , Miaohe Lin , Mike Kravetz , "Mike Rapoport (IBM)" , Muchun Song , Nadav Amit , Naoya Horiguchi , Peter Xu , Shuah Khan , Suleiman Souhlal , Suren Baghdasaryan , "T.J. Alumbaugh" , Yu Zhao , ZhangPeng Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org References: <20230707215540.2324998-1-axelrasmussen@google.com> <20230707215540.2324998-9-axelrasmussen@google.com> From: Ryan Roberts In-Reply-To: <20230707215540.2324998-9-axelrasmussen@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 07/07/2023 22:55, 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. > > Acked-by: Peter Xu > Signed-off-by: Axel Rasmussen Hi, FYI, when running this test on arm64 it provokes a kernel panic. I've posted a fix along with a detailed explanation at [1]. [1] https://lore.kernel.org/linux-arm-kernel/20230921162007.1630149-1-ryan.roberts@arm.com/ Thanks, Ryan