Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3779008imm; Wed, 5 Sep 2018 06:01:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbFBVKyoQBABvogctUobWzAL99zpltqCeMbfHzsyySY1xt0kxKQjaWfTjCunwigF5iOgcBY X-Received: by 2002:a63:7217:: with SMTP id n23-v6mr36129238pgc.193.1536152475639; Wed, 05 Sep 2018 06:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536152475; cv=none; d=google.com; s=arc-20160816; b=WmeDM28B88OXkSx96tItd/LliMUXpE3D2TZMKSEiSFPElLPyzyraGa/8FvINtsQOpw sNeMSKuCpE6VF1Zvoxlo4ehY1uKhVvH3qrhX31Qlo8/IG+vwy2/2PtJSTer3d8kO4gmF ckjdZl0JALBiREQPPXAcnj98g/Z98QqlErWKvGmQL+XmhsYvmk2dKOdk0m7Brkv3aLuk z35e+MRF9PFMSN0GP90caFMvK1yryFrPPxCrnLYXfxGWdyzjVeWnJlqiW7CrFdG8BCED GdQqsdnk/Ie6qTWcY0M5we26+kh7YHY3/5xB+Dr49Gd0O5mWTHypvPyOpKp8Vj6twOs3 tyoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=3wTy/2ygxks6I3FwfPDWeuAeIMBmQp0fcKQkZmMpaNw=; b=Rb4Hmj8A3p88V8ZCaP37SzZY3lgvGA8hNrxBm3yN5XcrAarHGEQxCn3gDu3k7Vrkaf aTCgEPjLyRLKCF8NZAiH93/ClSw4znUs/uEP/qiQ1MJau4wQ7NQuZa6XuKAWzgrB4lbn UumQPj2QpYcl+Q1RF1ieDbf8XSyvEthxRF46CCwz57UQ6gbBe381NWxzd+Bhvy4zKro5 tX1dhnKnGs6iPh2egplqHHzicvJ3HdNb3/99/pCG3MsrSEC3vOl1S8vHGumGIlxTWxuK EHJSoOE2eO6GqQsciHsuo2En35Tk5Chu4PnThZLQZ8/aZPdvcUAmaMijRSQzaJp4KdZy hnng== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10-v6si1942452ply.267.2018.09.05.06.00.57; Wed, 05 Sep 2018 06:01:15 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727616AbeIERaB (ORCPT + 99 others); Wed, 5 Sep 2018 13:30:01 -0400 Received: from smtp20.cstnet.cn ([159.226.251.20]:51154 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725900AbeIERaA (ORCPT ); Wed, 5 Sep 2018 13:30:00 -0400 Received: from [172.20.20.131] (unknown [182.150.46.145]) by APP-10 (Coremail) with SMTP id tACowACXYu0s049bsFj9Bw--.18314S2; Wed, 05 Sep 2018 20:59:25 +0800 (CST) From: Pu Wen Subject: Re: [PATCH v5 10/16] x86/mce: enable Hygon support to MCE infrastructure To: Borislav Petkov Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, thomas.lendacky@amd.com, pbonzini@redhat.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-edac@vger.kernel.org References: <20180905092234.GC2237@zn.tnic> Message-ID: <01604799-b993-e530-817c-ad097d343fc4@hygon.cn> Date: Wed, 5 Sep 2018 20:59:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180905092234.GC2237@zn.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID: tACowACXYu0s049bsFj9Bw--.18314S2 X-Coremail-Antispam: 1UD129KBjvdXoW7XrWftFyxZF4fur45Jw18Krg_yoWfuwc_Wr 4UKrnruryUJr4Iga18Gr4093srJay09ryYq34Yqr42y34xKan2y3sFkFZFqw4FqFsxur4x uaykJFySya429jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbVkYjsxI4VW3JwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z2 80aVCY1x0267AKxVW8JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26F4j6r4UJw Am72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l c7I2V7IY0VAS07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJV W8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF 1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6x IIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAI cVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2Kf nxnUUI43ZEXa7IU8ec_3UUUUU== X-Originating-IP: [182.150.46.145] X-CM-SenderInfo: psxzv046klw03qof0z/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/5 17:22, Borislav Petkov wrote: >> @@ -214,6 +214,11 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } >> #endif >> >> +static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) >> +{ >> + return mce_amd_feature_init(c); >> +} >> + > > What happens if CONFIG_X86_MCE_AMD=n ? If CONFIG_X86_MCE_AMD=n, mce_hygon_feature_init will call the other one mce_amd_feature_init which is a null function and located in the else branch of "#ifdef CONFIG_X86_MCE_AMD". The compilation is OK and the kernel will run without MCE support. > In general, since you're using AMD code, you need to make CPU_SUP_HYGON > depend on a bunch of AMD config items like CONFIG_X86_MCE_AMD, > CONFIG_CPU_SUP_AMD, CONFIG_AMD_NB,... Audit your code and see what other > config items need to be selected. All right, will check all the config items which are necessary for CONFIG_CPU_SUP_HYGON. -- Regards, Pu Wen