Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6169799ybe; Tue, 17 Sep 2019 22:02:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsdi4/p/xoOm0bvU6saB1G0P21AuxtEN/ZVEx47+PP7vR6claE/nH0L4Z8jNB0OK1UsADt X-Received: by 2002:a50:ac0d:: with SMTP id v13mr8220504edc.189.1568782936497; Tue, 17 Sep 2019 22:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568782936; cv=none; d=google.com; s=arc-20160816; b=exIwYL+KmopVn5LHGgbZPGNu0I0mUqu0pwFsOFZM/3MfKcm3Wtodm9ZDxHSvNG9PBd aE9So67ZEkWjr55UoLNSfbFz3bee5577rEsdzPwwwKuOzcO5E2HjsoYof9MPijVZ1S2o 7f0fi2aG89Ulbozkl8iO1EzTjc81LiGnTaHOUowo9cfdCvs+YqQLhW9NlArHmMco/7RF d7cEzW0mYSfBh65WtKaAASi3bl36c4vWYioBDyp0AlcuDsTM+a/UKDW2cBK9aiwSLrC9 C6GitmeM1sHLyXUZaFPQfHmc2gMF7xdvpd54ayHaNzvjbbqUIJhGsG/26XdTsD4QLyEx 74XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mf5c9nqe51/vkldsMK+N+OpcfaNL0VXXNwIYYaq0jAA=; b=HSfHFwVA3H/kIrOHZHENNtzeZBF6boz2ecii/z3wnaqM9Rm7NeiL5Chn/4Z3pF8K3T +Aqphgta4kpsvVRDaSiz8nMpG2bqQUaSOIM92d712dmMGI93pP2YHFFajwkYxaNVMJYo EKpX/TMa1ADOZ5IlejmkFCsxSNlQmYGL9HC1HOYegmWfpkUrCyHpwcl0r002/TJwujnD cfFsjpIy7iBIZj+aT63mvfal+iCUoVFYJo9MoycSYPJcwg/AbzYYV034NAIUiuNo1cGx CO0rMCW62LPLwVWD+fZmKAalqv2L0Lw9SKcfbWRS5lILubxEyeXMKQSW8DLNjTL5ybVC ZhtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y49si2626524edb.138.2019.09.17.22.01.39; Tue, 17 Sep 2019 22:02:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730589AbfIQQhH (ORCPT + 99 others); Tue, 17 Sep 2019 12:37:07 -0400 Received: from mga18.intel.com ([134.134.136.126]:4489 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726794AbfIQQhH (ORCPT ); Tue, 17 Sep 2019 12:37:07 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 09:37:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,517,1559545200"; d="scan'208";a="201866500" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.68]) by fmsmga001.fm.intel.com with ESMTP; 17 Sep 2019 09:37:05 -0700 Date: Tue, 17 Sep 2019 09:37:05 -0700 From: "Luck, Tony" To: Tony W Wang-oc Cc: "Borislav Petkov (bp@alien8.de)" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "yazen.ghannam@amd.com" , "vishal.l.verma@intel.com" , "qiuxu.zhuo@intel.com" , David Wang , "Cooper Yan(BJ-RD)" , "Qiyuan Wang(BJ-RD)" , "Herry Yang(BJ-RD)" Subject: Re: [PATCH v3 4/4] x86/mce: Add Zhaoxin LMCE support Message-ID: <20190917163704.GA1922@agluck-desk2.amr.corp.intel.com> References: <1da27840413348febf301ef39305de12@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1da27840413348febf301ef39305de12@zhaoxin.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 17, 2019 at 06:54:05AM +0000, Tony W Wang-oc wrote: > But have a question about below codes: > if (mcgstatus & MCG_STATUS_RIPV) { > mce_wrmsrl(MSR_IA32_MCG_STATUS, 0); > return true; > } > These seems require all #MC exception errors set MCG_STATUS_RIPV = 1 > in order to skip synchronize which "return true;" actually does for this. > > As Intel SDM show, "Recoverable-not-continuable SRAR Type" errors may > set MCG_STATUS_RIPV = 0, PCC = 0. When these #MC errors broadcast > to offline CPU, may cause kernel panic with synchronize timeout (offline > CPU can't skip synchronize in this case). > > Could "return true;" outside the if-case? > if (mcgstatus & MCG_STATUS_RIPV) { > mce_wrmsrl(MSR_IA32_MCG_STATUS, 0); > } > return true; If RIPV bit is not set in mcgstatus, then where will the CPU return to if you simply return from the #MC handler? RIPV=1 means that the CPU pushed a valid return instruction pointer onto the stack. E.g. in the not-continuable case you mention above? The CPU will likely do something undefined if you try to continue a not-continuable instruction. -Tony