Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21305259rwd; Thu, 29 Jun 2023 14:08:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BEryFB+qB2XbbgCMSE7N0LzCf1VUkPtzdRDqXcGUjhEewq+BL4WS4yGuwC/EPvi3JYbuy X-Received: by 2002:a05:6a20:4f24:b0:126:1700:f6eb with SMTP id gi36-20020a056a204f2400b001261700f6ebmr777966pzb.16.1688072906321; Thu, 29 Jun 2023 14:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688072906; cv=none; d=google.com; s=arc-20160816; b=JPSsN9BXu6ygBKNC0zRKuZNKDbxKTFu1Fkqd7EBGu80hzVppnuT26d7FcNY2W6EM46 48bh8NFgS45adYMxU+Nhnwm8N5+V6AnCYAM352KJAKsmJIQAfONyCRbJ2heClNvliOEo IyhnYzOda6MW12sUTea/F1VBG4FpJxD29gwcuibCNBARcpV1D8b/73VW26PtVSkjGPOZ CcSG03rXcUklDTBGnS0k8bMhHb53ze3Ru5+3CNRC3WyBYC+vSFJUfkSqPtn5Zq+djORX TR2bTVpsquFA28+/p8/dK8Oll0orYfOJmdCsjV2gJFWkmX2LOA1VpGc6s+J4FUJz+dBY yXQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=yLzMk6njG0VUm6oo8ECi7NNqjOvlkj+YcLB9LCE7+MA=; fh=eRaYFbc68TLHCmej1r/Q9kziindMZl6i1kh9xMHvl2k=; b=gHro5TVw3ClxWmdZQxTMvan28rZzlUTSpKx/YKmaSjoNXNSgFs4p++jE7yk7mXXg3p 4fuU/HnSB+e3P2OAycChoVHFbP8DVFjVghPSWWlCX5VAdjVXjCwTlBJk6rUEBhq+qV1z BMlqs3hKtTUVt2PuAC4A+rGhPkrsuSN89PoFZk+2ggFmKy9owT+PxUNwTumladqOxCU8 sEiNchIWzgW63fbLRkROF2RLjaSjuYeWZDycUwEjHHb71rvKmQ/2Eyh9H3Ri71JT/82+ 6HnXTjAjVG7+YXXd8ZR6A5pFQks1RDqmpvY2Q/WS6Ac1DwL1cPApL9hfliT0sTf1DssZ 4AMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=vd6FO9RK; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a634d07000000b005533cf1fdbfsi11862974pgb.629.2023.06.29.14.08.13; Thu, 29 Jun 2023 14:08:26 -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=@google.com header.s=20221208 header.b=vd6FO9RK; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbjF2UwE (ORCPT + 99 others); Thu, 29 Jun 2023 16:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232316AbjF2Uu7 (ORCPT ); Thu, 29 Jun 2023 16:50:59 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25FFF359E for ; Thu, 29 Jun 2023 13:50:58 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-c118efd0c36so1740762276.0 for ; Thu, 29 Jun 2023 13:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688071857; x=1690663857; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=yLzMk6njG0VUm6oo8ECi7NNqjOvlkj+YcLB9LCE7+MA=; b=vd6FO9RKLDqV//QD3xfOnLM9ABYCd6dUPJXpRHT4NX5noS8/sUBwSo898iH3nVkB0i DtNAyV+Pi6bgq0S9jGXWkBhQ9/YdQKbSPEohpFeN8NdUWPbX25v+l+vYnpTa7r6jcPht dbVhBKQwNHFgV1WouNWGszv4XwOpqInDK4ouCSz6Ak/7s9gGDRqjeI3/ZhamBO61VWCa Z6gPSDN+iIv39tWkyOgXo6urQM1zLyzmqO53tLfzCPB+LOgT197q6GD2uuEhk9CDZuub vqBRd9kZ1XKyBS+VrCDyZJ59YXT8sSu0AY+uPtiN0Du5fb03DdmO0Rm9zeWUxhbXnaCv j0ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688071857; x=1690663857; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yLzMk6njG0VUm6oo8ECi7NNqjOvlkj+YcLB9LCE7+MA=; b=gflIpOzKfp124eXcDxj+Qb1p8N6gtQsPfY/5kocwFbUpC+WinNKEWVj9JT9Q1gWnvq DaLtelj5/l7tbKi4kDhJzc2XFDJFmYTVPQGGrZtZ+i5mTiuReKVOyWmVhOuOJkn9VOx3 tXDrWuyS/s796p3M9zco1Hazdz/Ce9c5wzTJFMVpfjHFtkiwAwvZbx2KuEHfEIgVJfRT mui5qpNu4gMXNlX+Zle4ii/Mqb8GZ8p8NDKKdHhhyGC563TgkklJfq5kzx1Rp9+mNbDY A2sA5znLTdVLmzFnWCXGTF+d0uCjfuqLlP5/TpRF0orIkrEwGzqAa4wjMzLIczoIlCaD rt1w== X-Gm-Message-State: ABy/qLYnS4d+CKR/sxAn7JyD81Hz0rZhq6R3TdUpMNwa2J9Bf/zRqdO6 X7VUTMQbyfaP+Pg1quy/ndGnXp00hoP8/IevEh71 X-Received: from axel.svl.corp.google.com ([2620:15c:2a3:200:e20f:5917:3efa:d4bb]) (user=axelrasmussen job=sendgmr) by 2002:a05:6902:1105:b0:bc3:cdb7:4ec8 with SMTP id o5-20020a056902110500b00bc3cdb74ec8mr74829ybu.6.1688071857157; Thu, 29 Jun 2023 13:50:57 -0700 (PDT) Date: Thu, 29 Jun 2023 13:50:40 -0700 In-Reply-To: <20230629205040.665834-1-axelrasmussen@google.com> Mime-Version: 1.0 References: <20230629205040.665834-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230629205040.665834-6-axelrasmussen@google.com> Subject: [PATCH v2 6/6] mm: userfaultfd: add basic documentation for UFFDIO_POISON From: Axel Rasmussen To: 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, Axel Rasmussen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 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 +doesn't have a memory error in the exact same spot. + QEMU/KVM ======== -- 2.41.0.255.g8b1d071c50-goog