Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5842426ybl; Tue, 27 Aug 2019 10:23:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvq4urd/x8z74SSkWNBC8PfAuxIywCAQvCIRfCKYDcNXgp//IGnCK2Y+liF8+Fl0SceaBn X-Received: by 2002:a17:902:bd4a:: with SMTP id b10mr25219230plx.219.1566926599597; Tue, 27 Aug 2019 10:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566926599; cv=none; d=google.com; s=arc-20160816; b=P74Hhnwj//gXRw7b2nkTsp57FF1CnvIg+dgBIX5oQAGv0ffSEiunkvz1qfLDjAMVNZ EkMCnhGudSL49Jv5HCHQLlW9H3CeNdgcepQwcLncO3uKPYXGTR5/IEMyaDdZszC0crib XeSahy/5378KYqE/lf0dpq74zhDZ+W+kFiarDzJOlo2VTW6pM8HlfG4Q/yTNGezPhimQ GjHjfqiYVJY1TBWyLBeWY9T+cUYp1YclPGLyigXliWkuVMgsV7pJzWHLehS64A2YYiGY KNBwW/41Yonhw+69a4AZD54Rmq4mImL4kR18cbI9fPuSoJd7tSG+79WJQdB1jAL/sd42 f5gQ== 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:dkim-signature; bh=YaqbGp0XBJdS0umSwE5W3KtfIGLESRC+Mk1lRrN80Nw=; b=VeTLVu3NtZdeSfN+XpSjUlHCRgdLIlRahkyJNEmlD1xcqdTKSw3A2nqmgkthJZ7P+5 gGdZSmPLGgRc+3duaNgL8GgNFB6oV1cSi1p+0lrOxFzasntj8OLtaOI5d3QtW60AbHIM qIOCg8+/2iDKWVugSKohBhsx1hsW4YDKGcLZNS+mnj9V1/pwF50TPXgKa+xbJ/vWL0Kn XuWLH5Sd03e9nubR+fT9B1wy5l5N9qktifNWTiJ/Iw0SpJGiBCzloiY0LsG/c45WguDQ cdQLd2zBLn91NqVWUroLwUDWKVFzMrk6PHfA4Z6Vkzm5DBPVRbbp9y7xaGDkYv0PIgLe cmqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=KE8hSczx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si12231484pga.260.2019.08.27.10.23.04; Tue, 27 Aug 2019 10:23:19 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=KE8hSczx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730339AbfH0RUW (ORCPT + 99 others); Tue, 27 Aug 2019 13:20:22 -0400 Received: from mail.skyhub.de ([5.9.137.197]:48370 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbfH0RUV (ORCPT ); Tue, 27 Aug 2019 13:20:21 -0400 Received: from zn.tnic (p200300EC2F0CD000E87EFDD0E5C1CB0E.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:d000:e87e:fdd0:e5c1:cb0e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DE33F1EC0B89; Tue, 27 Aug 2019 19:20:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1566926420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=YaqbGp0XBJdS0umSwE5W3KtfIGLESRC+Mk1lRrN80Nw=; b=KE8hSczxAabemJlwy28FGXThUxxTxlB9BDOh1DOsooW3j3ls0prdkWnIsI+h+Y/mTe/5uN sjrY3889QCJVkzW7SxnL+2188FXbA3QfneYlLAl6HCg601MT3SNM/YqwmBVng2Z5YRuUNu UMmpwTx04ZRDIlEqKhGKoYMjpB2KKp4= Date: Tue, 27 Aug 2019 19:20:15 +0200 From: Borislav Petkov To: Dave Hansen Cc: Cao jin , x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Subject: Re: [PATCH] x86/cpufeature: drop *_MASK_CEHCK Message-ID: <20190827172015.GH29752@zn.tnic> References: <20190827070550.15988-1-caoj.fnst@cn.fujitsu.com> <20190827074151.GA29752@zn.tnic> <57ef4cd4-dfb8-256b-dc88-3f57c43dfe89@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <57ef4cd4-dfb8-256b-dc88-3f57c43dfe89@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.