Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1797781rwd; Thu, 25 May 2023 19:04:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5k2tYaZWwgMcjeHkNZy2DwRjLcsHvzahVT7+Uzrn6zWKdXDNVvZptG19DkA24UL+WKTc6F X-Received: by 2002:a05:6a20:728d:b0:101:4348:3e4e with SMTP id o13-20020a056a20728d00b0010143483e4emr223431pzk.42.1685066672871; Thu, 25 May 2023 19:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685066672; cv=none; d=google.com; s=arc-20160816; b=lG8CLzK3BzvgKdiMnTW+VCvzCeAh2VDybNHGEkIydbqATnP5tpOVxKa7MMSw1pWMEg h/mRIQG2Fk0X6smrPqiMV0mliAC/F5tRoyOmzdzF7UQsN3dXCb/PnFsUnP3dgVM+ylh8 bIzDR4rXPIfAoalzf+WDGQsdvSirY3wa+NSmpdgOtkDSEUKezQWMP5tZUKv8Nff7jXTs KkRIUiyPqZP3k6vzuLYbznX6ejS3a3eVV5X6UQ0bCA2JnkaCJGsvLMGtbVswNt5CEOVE c7QRmbVfkIfAE7yKY/XZW8f8LM3X/cwj/C9RhWqf22twEBSf6uwSujAAxqDB+n3U5Thh Hm4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=/Ue2H/AUaJD64pJwSZ8tBqJxtwlHAkcFIpYLuSW3738=; b=g9jZEny8LVDpRm4GbHZMTxkjzNO5d91CT0XGz236mJ7pLjIY/Wn1Z7LQKg6RZqRRzC 31UqJuTP0TQ/hGt5f3JhxuKyxAza58DRq8dF87Xpx2XaGDicnHeWpIIxuyb6BlEkme/u K7w4v3OWHaUNoqf7b25rPheB/RdKqb/KEgF4GlEg4u35pYFmbgCSkPy0orhM/4YrYZoI BAQQKe9chL3QGS5CTheqP9qnDBXl+0KUXvrsYoQc+m6OnNrucldeXLF2nhDwGoa+UxdB pOX/75af0zc+K0WxHNRN5D1dC3b1+kM+G4Hx7LWptKHR1C0A0opfx1JT79y06/+/MvXz gB3A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a637b50000000b005349008e6c1si2650280pgn.264.2023.05.25.19.03.53; Thu, 25 May 2023 19:04:32 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235295AbjEZB5q (ORCPT + 99 others); Thu, 25 May 2023 21:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjEZB5p (ORCPT ); Thu, 25 May 2023 21:57:45 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98789E7; Thu, 25 May 2023 18:57:43 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QS7H93JvJzqSSc; Fri, 26 May 2023 09:53:09 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 26 May 2023 09:57:41 +0800 Message-ID: <76b50214-fcf8-37fe-47c9-cfcaf7517048@huawei.com> Date: Fri, 26 May 2023 09:57:40 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] x86/mce: set MCE_IN_KERNEL_COPYIN for all MC-Safe Copy Content-Language: en-US To: Dave Hansen , Tony Luck , Borislav Petkov , Naoya Horiguchi CC: Thomas Gleixner , Ingo Molnar , Dave Hansen , , Andrew Morton , , , , References: <20230508022233.13890-1-wangkefeng.wang@huawei.com> <5570c23a-3b12-6685-cb0b-29fc1d58f541@intel.com> From: Kefeng Wang In-Reply-To: <5570c23a-3b12-6685-cb0b-29fc1d58f541@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,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 2023/5/26 1:18, Dave Hansen wrote: > On 5/7/23 19:22, Kefeng Wang wrote: >> Both EX_TYPE_FAULT_MCE_SAFE and EX_TYPE_DEFAULT_MCE_SAFE exception >> fixup types are used to identify fixups which allow in kernel #MC >> recovery, that is the Machine Check Safe Copy. >> >> For now, the MCE_IN_KERNEL_COPYIN flag is only set for EX_TYPE_COPY >> and EX_TYPE_UACCESS when copy from user, and corrupted page is >> isolated in this case, for MC-safe copy, memory_failure() is not >> always called, some places, like __wp_page_copy_user, copy_subpage, >> copy_user_gigantic_page and ksm_might_need_to_copy manually call >> memory_failure_queue() to cope with such unhandled error pages, >> recently coredump hwposion recovery support[1] is asked to do the >> same thing, and there are some other already existed MC-safe copy >> scenarios, eg, nvdimm, dm-writecache, dax, which has similar issue. > > That has to set some kind of record for run-on sentences. Could you > please try to rewrite this coherently? > >> The best way to fix them is set MCE_IN_KERNEL_COPYIN to MCE_SAFE >> exception, then kill_me_never() will be queued to call memory_failure() >> in do_machine_check() to isolate corrupted page, which avoid calling >> memory_failure_queue() after every MC-safe copy return. > > Could you try to send a v2 of this with a clear problem statement? > :( will try to make it more clear. > What is the end user visible effect of the problem and of your solution? The corrupted page won't be isolated for MC-safe copy scenario, and it could be accessed again by use application.