Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1310578rwd; Thu, 25 May 2023 10:41:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7pupAO5RcfPtaUsXmKxhykExQNwh6/HaSngqAV56/Pqgjnqj2IZKpsCCi4bhcPlV3ex+Gw X-Received: by 2002:a17:902:bc82:b0:1a9:4fa1:2747 with SMTP id bb2-20020a170902bc8200b001a94fa12747mr2387600plb.47.1685036518093; Thu, 25 May 2023 10:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685036518; cv=none; d=google.com; s=arc-20160816; b=jg5vbgcn1SrGToltCBkak+mklV2PUVY7IDHz6bhNaO0eqMOVBFq5sAiHPE0Qs8wpXZ Uigc+QGovP2S9BuI6D0QXjwT6S9i/0c1DG/kIAWs1i4zEEenJUxq7mDwGqF15y3DFv3l gp2Knk0wLEZyh3BaaT4BaNkXO6ulVHHfH3uluByulO2TWP+tOed+kQD14el0JXIDPs8x zMyyvNYDyvozdO3E48ibEdKjNjK++DqpaovvUoUGdHgpaNnNeL7LvF5DbP+/iWBW5YFW SX1VEdZF/YbwmV5ylZ07m3E6d21THcPqB3YSDLUDxpVCFmrLc+Oe5c+QXyNuwC4ON68w QjLg== 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:dkim-signature; bh=4pgu1PDV2itx5lNkUSwyPSEwx0sFGbR2ORpA8UttGWo=; b=gqoaouqzqHA/AiaGYfdXBnWoDwrQjDjjKRMJyTH7UJWkkxh/Xx7iwQzysXuUPJX5g+ 97Z1Xmk20BOC8BsGuSZqb/dXUb+LHM0urqmNdjIsf/zrJPuu4oJCL3Gh/h81S4BgOkng /3RYN/Jnn0nC1yZn9v4P/jWRK1TRogjNtFspAiEcJVBwPVAqdmm4O8BAbcsgG/MMPcD4 s3KVZgON/vej+NLzQ12X7y4TbyAAcFIp7YQ4PNDrIBZhkEqRn8yq0uRhTzb3NxuTTF16 gRnkrjS3L2SdajllsqNcDymzj+nv3pZbtdLcibUM58cOBuwdrcmt0qDWvhwphbH3vJ0z CwWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eR+dyxto; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u13-20020a17090341cd00b001a664075202si2130519ple.542.2023.05.25.10.41.43; Thu, 25 May 2023 10:41:58 -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=@intel.com header.s=Intel header.b=eR+dyxto; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240958AbjEYRSs (ORCPT + 99 others); Thu, 25 May 2023 13:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240877AbjEYRS2 (ORCPT ); Thu, 25 May 2023 13:18:28 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7AD2195; Thu, 25 May 2023 10:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685035105; x=1716571105; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Fx5cirxrz+HpUTDvn+zJBzDpeIbw64NeczyJDswoBq4=; b=eR+dyxtogv3qdq0CT8QoYKxHY3FW8sXasXZPssoaCkn+97irSL3ATdrn W4q808IrJVH93oHilrzgdEbX3uf9sl2YYHI6n5FL3nCwPyRuuidrZQy2g GRr+XWBSPypI06nHsdHejjTCLsxpktOxmGlWsoD9b9ZwCnodBYiLaok4S hjOv0iVr1YWR6y8deBmUMeVyfZo+IqX6KdTfNmlkS1GcCafFcMhrtIUny 8U0CiuMGPKQi2DNjzbpc8SjtCt9qrZW8QJGwEZNzj3fxHP0FT/9IjHiEB rPq4385YrvD9ljgnG2wyTFIxH3NvhnWCkICLhEtO0tfA4JK4hTlZkOI6w g==; X-IronPort-AV: E=McAfee;i="6600,9927,10721"; a="357206470" X-IronPort-AV: E=Sophos;i="6.00,191,1681196400"; d="scan'208";a="357206470" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2023 10:18:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10721"; a="704871231" X-IronPort-AV: E=Sophos;i="6.00,191,1681196400"; d="scan'208";a="704871231" Received: from shuklaas-mobl1.amr.corp.intel.com (HELO [10.212.186.148]) ([10.212.186.148]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2023 10:18:23 -0700 Message-ID: <5570c23a-3b12-6685-cb0b-29fc1d58f541@intel.com> Date: Thu, 25 May 2023 10:18:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] x86/mce: set MCE_IN_KERNEL_COPYIN for all MC-Safe Copy Content-Language: en-US To: Kefeng Wang , Tony Luck , 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, jane.chu@oracle.com References: <20230508022233.13890-1-wangkefeng.wang@huawei.com> From: Dave Hansen In-Reply-To: <20230508022233.13890-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 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? What is the end user visible effect of the problem and of your solution?