Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28233277rwd; Tue, 4 Jul 2023 15:47:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHYTn7eQHA6TXjjzvhjmfNgfja+EZVslucT4d3800+19N+5fhLFCp0O2I0dVfq0Sf+XfFif X-Received: by 2002:a05:6808:eca:b0:3a3:c64f:3446 with SMTP id q10-20020a0568080eca00b003a3c64f3446mr2887959oiv.39.1688510865451; Tue, 04 Jul 2023 15:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688510865; cv=none; d=google.com; s=arc-20160816; b=YERByrtTTQ7tYR41os+cmdk2xNY4Hqe0zFz2NPfokYLu7eb6W6EfrMUcwATO92TMJw WxKwHGSxbi3ZLdXkEgc72ZHzjqupKmVk4W8R4EhjBkBexnXmjcMEkBLPkasCK4HhXqKq AXvErZUVXrchiiYSA2hL/n1cMT8ujshKCyLY8twL4nruhc0Q+O7eqr4qPwUYtWBkFQVu oP42NIWVc+MbqpZX8rZidj4+FtIRlw4Funmj2K4wp/Jjx3IXpO2f+FDGNrf59Xtn4WJQ yBjzS28rUnGB9XATo2GeGLA/wX6GBay2dLGHCKINHIIhrRRH/UvVZgc2LIAWElIj98kP DtHw== 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=VV04n37U8nBXKx7jlfEZg7R8H9gfvZ1yfEmW1FTRWAc=; fh=0t4louP/8+xP3ORiRbUZtig8/xKb5OX3R1/WptJFEDo=; b=rO+e21UjFYwfArsP/rzTFonPYPZQhtXH92xnuV4oybLVBT4733EGIyEzKK2hJ11bQ2 cKib4zL6yqeu6IWpLnGXob2Pme4qtjCCUnDSJNhTIdvgmm6YGnWxZlf69mwfgH3rka/d iO4qIkFf9xNbIs6FAapoHUY3eWJnCMzY7LrVe2cRGDZtN7sBdRzZog5s4y2zNRd/O5jS ZabkSj+77ibxpRFe3GunP6kX0Ti/ZkaxC4KI89Dy4C/5AQ29kS0GsUFLGrY8Dk4uh78C VFOaY1eiSnWf8JMB7v04Pl3/n6357m/Di55IZJgfWNahbpc2N9jbtMOxC5ThEOuhXfs3 3Rqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LDOmEEyx; 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 g36-20020a631124000000b0055bc4075c1dsi1178966pgl.317.2023.07.04.15.47.22; Tue, 04 Jul 2023 15:47:45 -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=LDOmEEyx; 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 S231159AbjGDVRl (ORCPT + 99 others); Tue, 4 Jul 2023 17:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjGDVRj (ORCPT ); Tue, 4 Jul 2023 17:17:39 -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 39165E2 for ; Tue, 4 Jul 2023 14:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688505412; 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=VV04n37U8nBXKx7jlfEZg7R8H9gfvZ1yfEmW1FTRWAc=; b=LDOmEEyxrmHT8Ccjq6ljx8l6JikH5iba0NFkW4DXzZm2iwyDN7r9WzkvQMDyYZV9Fp18tO pJYKNwL8T6oxnJv8CVJ7uN19vYt1ttOLA4F+Pejvqlv7K9bfo1DVeTby0lnjt7h0RlTGDA jkd2hfi4iLP2Gv2YBbarurcI+aFD33s= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-519-2nDJUH9FPRGNG9BZpNC2ig-1; Tue, 04 Jul 2023 17:16:51 -0400 X-MC-Unique: 2nDJUH9FPRGNG9BZpNC2ig-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-765ad67e600so108135485a.0 for ; Tue, 04 Jul 2023 14:16:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688505410; x=1691097410; 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=VV04n37U8nBXKx7jlfEZg7R8H9gfvZ1yfEmW1FTRWAc=; b=jSFjnrwl2cHMKsH+kEeOcWQhAhWlo+rqI/KvBGbSUOQmoi1TBMX0bZBYkkjSTpE6Cs hEmAq7pEOn7dGsSebedHVVw8BTlvYP9hiug4lNkFJ4/AY+Pak8i8IMll1G4pIj0eCSWD MQ0qIE/SYW5ialOd/hxqM4lwkiIFnQMuqyG1CwWSnaGZE3VKIDhw8QgeJwQDS2PHpIdX hEu9uy9fMnWTdYraw6Lbuj3Cd5CaXNcEW1HekFZ6GQzxQP0vcI/XJtADCWgOGJ1dc4Cv /98llb77QhKJ80s3xh6pz4HxTHv2/fQ/hAQN+oJTQsYWeslDzhQUP5sdd3PszaXlFIWW wZ0g== X-Gm-Message-State: AC+VfDyVBKa89e1nQZB9Nj7tu/RqpLSaUu2i2CIKbEV+XCQh8o+z4yxZ F03p9p0pQIC9LCbsxcwyJQYPtGtLDf9L8kgaQHxO/jknhrZ8pFHKxzfFU6HQywedGV1qyWz8T26 a5K6UveqZ30t6X1ra9PovNHod X-Received: by 2002:a05:620a:4487:b0:765:435c:a4fa with SMTP id x7-20020a05620a448700b00765435ca4famr20273156qkp.0.1688505410588; Tue, 04 Jul 2023 14:16:50 -0700 (PDT) X-Received: by 2002:a05:620a:4487:b0:765:435c:a4fa with SMTP id x7-20020a05620a448700b00765435ca4famr20273141qkp.0.1688505410353; Tue, 04 Jul 2023 14:16:50 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id i4-20020a05620a144400b0076728319575sm6994582qkl.27.2023.07.04.14.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 14:16:50 -0700 (PDT) Date: Tue, 4 Jul 2023 17:16:48 -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 6/6] mm: userfaultfd: add basic documentation for UFFDIO_POISON Message-ID: References: <20230629205040.665834-1-axelrasmussen@google.com> <20230629205040.665834-6-axelrasmussen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230629205040.665834-6-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=ham 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:40PM -0700, Axel Rasmussen wrote: > Just describe the feature at a really basic level. > > Signed-off-by: Axel Rasmussen The final enablement of the feature can be squashed into this doc update patch too. Acked-by: Peter Xu > --- > 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 > +doesn't have a memory error in the exact same spot. > + > QEMU/KVM > ======== > > -- > 2.41.0.255.g8b1d071c50-goog > -- Peter Xu