Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp273755ybl; Tue, 27 Aug 2019 20:10:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD7bUApSq4sH1v24/lrpvrFj88hSLXdkwAWKUoxJ64RuQibCyK4gI2EiaZAQuthNASKiat X-Received: by 2002:a17:902:7441:: with SMTP id e1mr2177928plt.332.1566961830263; Tue, 27 Aug 2019 20:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566961830; cv=none; d=google.com; s=arc-20160816; b=P01hTFDxcHvdMH1AfjtGsfZu+Y2toW24h8Fc/8XoTBE6ZvMJ8MLwi2WLtjd7pH3PpM RSo7g1g/xd7iIF5ojY8u1S1cSHwSLM1IsneUPREVzWJ9sebvLs3fzDkbSXnwQBy+USPE Mgr9GSWKP55BZnNmFtULvKqz9e2YyoKsliBwvGw05jA80ShWbFYKYK/v1Gr5srUzCF95 RNaPuSsKdl9dQ8Y/oY7eS/9iYs9FPwSSZuxbAHSpEuW2bYzgbbpp2yyAP0kuaRnoQVaS 5t7ggpff/rUuxF/3X1y5ilIwC5iUdVc26ZuofW44ZkDmx6PhjRNcZ/u5y7BKgWnk1RNE w9WA== 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:from:references:cc:to:subject; bh=AE6raLOlQvgHVNHoWSKyxUTdti0A7Dq3eyzAv//VB4k=; b=awM/cUkGcABK6C3tC8+nE8D1t2qWqhYwiG1KQW9GvQwzzfu2kfqFzk2tr9/h2dMWDE wSJ8Ca6ivBm63X//Jh9Zm++bkDMoloBXYlRbuSmJuFHb98T4L1RB4q13JjJOaVZUuWSn AAyyj5mtcDOP9sB20fRAVXVlYyVAZIBr+rW26ykHC7B7KmKYf4ovErQC6ZD7zhMCq+sm uu3lJRFQ852T7py2QoPN4QoeDnITZrxAMnycudBDIC6EDLCau7BR+EUFRLhDQYHXQomi 4B8CSudUghaJOghwsjT+hePwgXuZUQMJd3zPrdssReeA7dbgBr5j7Agz+Arj6ZxgvIA4 Hgog== 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 k144si1169192pfd.34.2019.08.27.20.10.14; Tue, 27 Aug 2019 20:10:30 -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 S1726340AbfH1DJO (ORCPT + 99 others); Tue, 27 Aug 2019 23:09:14 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:42733 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726178AbfH1DJO (ORCPT ); Tue, 27 Aug 2019 23:09:14 -0400 X-IronPort-AV: E=Sophos;i="5.64,439,1559491200"; d="scan'208";a="74415566" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 Aug 2019 11:09:10 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 0C9974CE032B; Wed, 28 Aug 2019 11:09:10 +0800 (CST) Received: from [10.167.226.60] (10.167.226.60) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 28 Aug 2019 11:09:17 +0800 Subject: Re: [PATCH] x86/cpufeature: drop *_MASK_CEHCK To: Borislav Petkov , Dave Hansen CC: , , , , References: <20190827070550.15988-1-caoj.fnst@cn.fujitsu.com> <20190827074151.GA29752@zn.tnic> <57ef4cd4-dfb8-256b-dc88-3f57c43dfe89@intel.com> <20190827172015.GH29752@zn.tnic> From: Cao jin Message-ID: <6b7de083-4901-6a72-8d89-75ea3456ffb8@cn.fujitsu.com> Date: Wed, 28 Aug 2019 11:10:16 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190827172015.GH29752@zn.tnic> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.60] X-yoursite-MailScanner-ID: 0C9974CE032B.ABE68 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/28/19 1:20 AM, Borislav Petkov wrote: > On Tue, Aug 27, 2019 at 09:33:11AM -0700, Dave Hansen wrote: >> The point was that there are 5 files in the code that need to be changed >> if you change NCAPINTS: >> >> 1. arch/x86/include/asm/required-features.h >> 2. arch/x86/include/asm/disabled-features.h >> 3. tools/arch/x86/include/asm/disabled-features.h >> 4. tools/arch/x86/include/asm/required-features.h >> 5. arch/x86/include/asm/cpufeature.h (2 sites) >> >> Each of those sites has a compile-time check for NCAPINTS. The problem >> is that the *-features.h code doesn't get compiled directly so a >> BUILD_BUG_ON() doesn't work by itself. So, for the sites there, we put >> it somewhere that *will* get compiled: the macros that actually check >> the bits. >> >> It looks weird, but the end effect is good: If you change NCAPINTS, you >> get compile errors in 5 files and have to go edit those 5 files to fix >> it. Your patch makes it easier to introduce errors and miss one of >> those sites. > > ... and we wouldn't want to debug any strange bugs from missing a case. > So, Cao, I wouldn't mind having the gist of that above somewhere around > there in a comment explicitly. > A subtle issue hard to detect by eyes. Sure, on the way. -- Sincerely, Cao jin