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 CF492C433EF for ; Thu, 21 Apr 2022 08:50:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E6426B0073; Thu, 21 Apr 2022 04:50:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 696E86B0074; Thu, 21 Apr 2022 04:50:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5371C6B0075; Thu, 21 Apr 2022 04:50:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 463576B0073 for ; Thu, 21 Apr 2022 04:50:50 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1C895148B for ; Thu, 21 Apr 2022 08:50:50 +0000 (UTC) X-FDA: 79380265860.09.2648064 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 9D43CA0019 for ; Thu, 21 Apr 2022 08:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650531049; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/9GOgKbTaKLpjisKA5uiBPW2PYHrqd+UofqKoU0ytW8=; b=UM9w0IA7CbpVCoNUTKyl5ZXjkMDsTrBh87EuCOhou5OnqNVe1J93TlAhfoBlfqK5sHgcbd r0Ya0cPUs/d7d7SVt/hLCMztV6dsAT5p2ahrMHQD/OdZi7KzcQwB09EWup/qMZoCM/nODF 2Y5/aTgk2xnlwdhohdxonbPGYGE87Vg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-iPjMQVQLOv6yACeDzS13GA-1; Thu, 21 Apr 2022 04:50:48 -0400 X-MC-Unique: iPjMQVQLOv6yACeDzS13GA-1 Received: by mail-wm1-f69.google.com with SMTP id bh11-20020a05600c3d0b00b003928fe7ba07so2134008wmb.6 for ; Thu, 21 Apr 2022 01:50:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=/9GOgKbTaKLpjisKA5uiBPW2PYHrqd+UofqKoU0ytW8=; b=IlIbg8cUfY7QKR8K+rMjMetu8SjXvkm+1bUlMo+fNEhAVQCWoWJU9ktGTBTXQG4T65 d/ev9ldGZ3bu4Ixw2drZfelYUOgNZAvKLS88WFuOsu9nSrD9YgCKhaIFtD3sqG9HLQqP j9NrVLjamhRpSgGFfnriDBk6je/x29hHHSDEWEhbNqFtvPcFawy66oXD0IZGgmLjgc7l 6Yi2TAoJ5mOOeFMP9GBUu3XgrRaKR6LIMA5mngJyf9raIYcYHUp1Aq1BZ+6XFqq+QhDZ z64Xqb7Paxa4FnTZBD1y8v+cth+RFkIs8oP8WVlfE6D9/OnXVjv2WrcN2cx7f5ASeQGy 6xRQ== X-Gm-Message-State: AOAM533CcnrdwwR/EC4t4AZJMEnjDAWuVf3mV8yCkVXOPziZWr7pDrVs ocDGM+GVqHyECzjMkJOQOlRzSzevDn30FwbknPFgp5UFjddrcWhnMLdPceKwFEAArCly7kKOBXE iCot++e5fo9E= X-Received: by 2002:a5d:6251:0:b0:20a:b1de:627c with SMTP id m17-20020a5d6251000000b0020ab1de627cmr4744818wrv.100.1650531046750; Thu, 21 Apr 2022 01:50:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKFLs1xBNEuxsOzGJ6kr1aswBBF3UzmV1rUTNavKT9f4etZ83OsiQoPegkDw48HatLMKviUw== X-Received: by 2002:a5d:6251:0:b0:20a:b1de:627c with SMTP id m17-20020a5d6251000000b0020ab1de627cmr4744789wrv.100.1650531046421; Thu, 21 Apr 2022 01:50:46 -0700 (PDT) Received: from ?IPV6:2003:cb:c702:de00:711b:76af:b335:9b70? (p200300cbc702de00711b76afb3359b70.dip0.t-ipconnect.de. [2003:cb:c702:de00:711b:76af:b335:9b70]) by smtp.gmail.com with ESMTPSA id i14-20020a0560001ace00b0020aac00f862sm1741182wry.98.2022.04.21.01.50.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Apr 2022 01:50:45 -0700 (PDT) Message-ID: <022fe906-054d-43b4-14d4-a4c1cb7527af@redhat.com> Date: Thu, 21 Apr 2022 10:50:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 To: "Zhuo, Qiuxu" , "Hansen, Dave" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "Luck, Tony" , Dave Hansen , "Lutomirski, Andy" , Peter Zijlstra , Andrew Morton , Naoya Horiguchi , Christian Borntraeger Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "open list:HWPOISON MEMORY FAILURE HANDLING" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" References: <20220420210009.65666-1-qiuxu.zhuo@intel.com> <3720f7d9-a4f3-214c-1dea-f8ffc837c1da@intel.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 1/1] x86/mm: Forbid the zero page once it has uncorrectable errors In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9D43CA0019 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UM9w0IA7; spf=none (imf15.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: nptfcpiumhff8w1k4dodnbc6hgtfdiam X-HE-Tag: 1650531047-997421 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: On 21.04.22 09:53, Zhuo, Qiuxu wrote: >> From: Hansen, Dave >> ... >> Subject: Re: [PATCH 1/1] x86/mm: Forbid the zero page once it has >> uncorrectable errors >> ... >> There are lots of pages which are entirely fatal if they have uncorrectable errors. >> On my laptop, if there were an error, there is a 0.00000596% chance it will be in >> the zero page. >> >> Why is this worth special casing this one page? > > Hi Dave, > > Yes, this is a rare problem. Just feel that the fix is simple, so post it here to see whether you'll consider it 😊. Just some background information. mm_forbids_zeropage() exists for the sole purpose of s390x/kvm not being able to use the shared zeropage for a KVM guest because the storage keys associated with the shared zeropage could result in trouble. So s390x/kvm has to make sure that no shared zeropage is mapped into the process. See fa41ba0d08de ("s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs") for details. @Christian a) with keyless guests we could actually use the shared zeropage because the guest cannot possibly enable storage keys, correct? b) Why is there no mm_forbids_zeropage() check in mfill_zeropage_pte()? Maybe I'm missing something, but looks like we can still place the shared zeropage into a KVM guest via uffd. In general, there are more place that will use the shared zeropage, most notably, fs/dax.c will place the shared zeropage for holes and would still use it on x86-64. IIRC, s390x doesn't use it. /proc/vmcore will map the zeropage to user space for areas that are not RAM, so you could still stumble over it there and trigger a MCE. Last but not least, the huge shared zeropage would suffer from similar problems. Also, I wonder if the generic code change in mm/memory-failure.c is correct as it touches common code and you only mess with the x86 zeropage. But I did not look into the details. So the code here at least isn't complete. So I'm not convinced this change is worth it. -- Thanks, David / dhildenb