Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3683677rwd; Mon, 22 May 2023 18:46:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zC0SonlTCQcKCz1bgGU0m7kgrAKmg/bCIssEhdxb32h27gGC7MAiSEM1W+s6hgxxjB2hy X-Received: by 2002:a17:902:da8b:b0:1af:a3d4:26e2 with SMTP id j11-20020a170902da8b00b001afa3d426e2mr8603078plx.54.1684806368796; Mon, 22 May 2023 18:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684806368; cv=none; d=google.com; s=arc-20160816; b=T1gA+upacS6yWaiHS471nAH7o5/8GyxgucJ21F8fZIeiF1oZRkwLq8OynguLGRDZAM kyD+cYiLZGQpQw0xXDgHVPII2kJU2FTRmeDH+DVwk0mdaq4EOx43UAQSPpeSVW46aHkx kFAwguB68q9M+wSmSAPwRlLuJ+zoL5MsfniDLv+HTg2DOUCLbnyPqmh5XRHKAvoK3Qij HcrmRZoaqKgL96TN2NLD2CVoh9m2jHtEhBypZZhPbAhaPBgKbJ9P1g4RnaqCoDGT9JKV Z5Fe+Y1ag1UUwcxHPA+4/I7h3kfoMKHRMfDK51B1HbtpQyt9zp/jq6gFI85ZYwN8dnin s1CQ== 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=byqDs459Sl/fK/SzZ4kfxIsnTOQXyWJotZIBoYBtsZk=; b=BTt+YDTd0oToUcvLWD+bBRhhAPGh+xG7mFMtjXiBWutTpXM7MkuTgW6TOq7R3o1/Cq MdFc9n3NHhSficPNAuWjKHnj3PKNGUPIdSwnlkgzs56ydmH1djsffXs0AfOgBqAZYmSZ uiRFpeDh+oNxamDPj0eD9uvS0c/cqJY/GKDnXv2/k2+EfY6Y7pn+0VHrWBUDjeGdviGI egG8Lm7YgEKmGl8gcrOO2xl4hA5x+ZrGCUuFE+VO7wefs+WFY52lDKgyZnm/ZEdJPDZq L9SIr0opGBf3t+aPz+oLFU5RjQXzbpfa/XpHDnw8P0xvHwvJN/T58dVDn1eLzDJg3u1u qdkA== 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 u12-20020a17090341cc00b001ae6948b4a9si5844109ple.534.2023.05.22.18.45.56; Mon, 22 May 2023 18:46:08 -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 S234349AbjEWBe7 (ORCPT + 99 others); Mon, 22 May 2023 21:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234895AbjEWBey (ORCPT ); Mon, 22 May 2023 21:34:54 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A849B92; Mon, 22 May 2023 18:34:52 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QQGwG6MzRz18Ldb; Tue, 23 May 2023 09:30:22 +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; Tue, 23 May 2023 09:34:49 +0800 Message-ID: <0d3aeb09-5bc9-31bd-4f84-675ebddd9f03@huawei.com> Date: Tue, 23 May 2023 09:34:49 +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: "Luck, Tony" , Borislav Petkov , Naoya Horiguchi CC: Thomas Gleixner , Ingo Molnar , Dave Hansen , "x86@kernel.org" , Andrew Morton , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "chu, jane" References: <20230508022233.13890-1-wangkefeng.wang@huawei.com> <75d8452c-695b-b22a-30d0-15302cd072ef@huawei.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) 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,RCVD_IN_MSPIKE_H2,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/23 2:02, Luck, Tony wrote: >>> Is this patch in addition to, or instead of, the earlier core dump patch? >> >> This is an addition, in previous coredump patch, manually call >> memory_failure_queue() >> to be asked to cope with corrupted page, and it is similar to your >> "Copy-on-write poison recovery"[1], but after some discussion, I think >> we could add MCE_IN_KERNEL_COPYIN to all MC-safe copy, which will >> cope with corrupted page in the core do_machine_check() instead of >> do it one-by-one. > > Thanks for the context. I see how this all fits together now). > > Your patch looks good. > > Reviewed-by: Tony Luck Thanks for your confirm. > > -Tony > > One small observation from testing. I injected to an application which consumed > the poisoned data and was sent a SIGBUS. > > Kernel did not crash (hurrah!) Yes, no crash is always great. > > Console log said: > > [ 417.610930] mce: [Hardware Error]: Machine check events logged > [ 417.618372] Memory failure: 0x89167f: recovery action for dirty LRU page: Recovered > ... EDAC messages > [ 423.666918] MCE: Killing testprog:4770 due to hardware memory corruption fault at 7f8eccf35000 > > A core file was generated and saved in /var/lib/systemd/coredump > > But my shell (/bin/bash) only said: > > Bus error > > not > > Bus error (core dumped) No sure about the effect, but since there is kernel message and mcelog, it seems that there is no big deal for the different :) > > -Tony >