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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3F8BEB64D9 for ; Thu, 29 Jun 2023 21:04:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DFD28D0003; Thu, 29 Jun 2023 17:04:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48FF68D0001; Thu, 29 Jun 2023 17:04:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3579F8D0003; Thu, 29 Jun 2023 17:04:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 266EE8D0001 for ; Thu, 29 Jun 2023 17:04:36 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E7537B07DF for ; Thu, 29 Jun 2023 21:04:35 +0000 (UTC) X-FDA: 80957014110.19.0DEC756 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf26.hostedemail.com (Postfix) with ESMTP id 34A65140013 for ; Thu, 29 Jun 2023 21:04:32 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=LAqUkWtZ; dmarc=none; spf=none (imf26.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688072673; 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=J/Le96Hd+j13NdY/bbUKc97A6Qhb9OOEKINA5FlMdBc=; b=bqJ/1Bu/JCZ9YMustY9snF1lAOr/Gl7iuQmpu/56+SdHpvMviJDgGrJ6XgHC4PZ3UdJX5O bn5XRmoGXGP+vfaUex5nTUDQn5z3ru37uBjsz+x/TGRTAuUHwc1tBTuiuOp79p1anJwtxs vQCGD/GyXZY7EJioa2wgXtQoGXYrIOA= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=LAqUkWtZ; dmarc=none; spf=none (imf26.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688072673; a=rsa-sha256; cv=none; b=G83BI5O4jlIzLCgxPNF7MoJUezG3scpgVlFfrpFWyvrzztmGRVFg5OOQaFlSbVt4nJjUpJ K0pVMMz4WcRkjJITNCj+D7mi58J+Xw4+3rklGVa1jWg2YDb9fGEh4ve8RVPlvTXtD20kut tkxf8dafv2Z7nUciE74OiDJfcw5aFro= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=J/Le96Hd+j13NdY/bbUKc97A6Qhb9OOEKINA5FlMdBc=; b=LAqUkWtZd0VW1y8npxGmiGyUTa 9dDtUf/A+7L/tlqLJHfjtdSEPxEJlPDpIyPBhYqg19uZcsfLFjOc8twD1U01P2danEgyfygbhyaZL ia3N3kO6fcyvYbSiI4PjbKyhYR0g7YTfiNIjMWEGpGbdigtikSyXVSbM/PaDMYq22qIyFsYEVWWkQ r91INYFie1dEFLqBtswXaA9MW47K81cIpkVyKkTcHIhAlU9Fb9bhsjkpSdVkS+vbr/0VW5oZJNOvx bhg5cDkf54CCHr/WKD151rlnIuIgQl2Y4z1/NRfFDRfedUeeKeNvj4fTqDCl6F5ItPW6M8oLPQ0Q6 vniqQR2w==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qEyoE-002AzK-1P; Thu, 29 Jun 2023 21:04:10 +0000 Message-ID: <3cc9f07a-3105-27f9-176d-9deea975ce3c@infradead.org> Date: Thu, 29 Jun 2023 14:04:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 6/6] mm: userfaultfd: add basic documentation for UFFDIO_POISON Content-Language: en-US To: Axel Rasmussen , 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 , Peter Xu , Shuah Khan , 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: <20230629205040.665834-1-axelrasmussen@google.com> <20230629205040.665834-6-axelrasmussen@google.com> From: Randy Dunlap In-Reply-To: <20230629205040.665834-6-axelrasmussen@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 34A65140013 X-Stat-Signature: at4is4durwtutwrjjxfnjn5u8t6ebpjb X-Rspam-User: X-HE-Tag: 1688072672-939187 X-HE-Meta: U2FsdGVkX183LQ4TbgTipQWj1M1Q468WAtYAqi+oinGYVT+xDaBDqRwbtYIi0SMHzpqSKe6rYlCBbNN7BKfjEh4rMe0O5VpXU0YFb7XAKcJ6AmV3N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CrzJ9Gjok2Mds69a4X1IXmxGGq9yH26ryneS1NPCdUE2QNbuO9i7h2hG5jVE= 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: typo below. On 6/29/23 13:50, Axel Rasmussen wrote: > Just describe the feature at a really basic level. > > Signed-off-by: Axel Rasmussen > --- > Documentation/admin-guide/mm/userfaultfd.rst | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/Documentation/admin-guide/mm/userfaultfd.rst b/Documentation/admin-guide/mm/userfaultfd.rst > index 7c304e432205..b19053436369 100644 > --- a/Documentation/admin-guide/mm/userfaultfd.rst > +++ b/Documentation/admin-guide/mm/userfaultfd.rst > @@ -244,6 +244,21 @@ write-protected (so future writes will also result in a WP fault). These ioctls > support a mode flag (``UFFDIO_COPY_MODE_WP`` or ``UFFDIO_CONTINUE_MODE_WP`` > respectively) to configure the mapping this way. > > +Memory Poisioning Emulation > +--------------------------- > + > +In response to a fault (either missing or minor), an action userspace can > +take to "resolve" it is to issue a ``UFFDIO_POISON``. This will cause any > +future faulters to either get a SIGBUS, or in KVM's case the guest will > +receive an MCE as if there were hardware memory poisoning. > + > +This is used to emulate hardware memory poisoning. Imagine a VM running on a > +machine which experiences a real hardware memory error. Later, we live migrate > +the VM to another physical machine. Since we want the migration to be > +transparent to the guest, we want that same address range to act as if it was > +still poisoned, even though it's on a new physical host which ostentisbly ostensibly > +doesn't have a memory error in the exact same spot. > + > QEMU/KVM > ======== > -- ~Randy