Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbdLGXhH (ORCPT ); Thu, 7 Dec 2017 18:37:07 -0500 Received: from terminus.zytor.com ([65.50.211.136]:35441 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbdLGXhG (ORCPT ); Thu, 7 Dec 2017 18:37:06 -0500 Subject: Re: [PATCH v0 1/5] x86_64: march=native support To: Alexey Dobriyan , linux-kernel@vger.kernel.org Cc: x86@kernel.org, tglx@linutronix.de, mingo@redhat.com References: <20171207224154.4687-1-adobriyan@gmail.com> From: "H. Peter Anvin" Message-ID: <5edaedc3-17e4-2aff-2cda-f00351e1498c@zytor.com> Date: Thu, 7 Dec 2017 15:32:38 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171207224154.4687-1-adobriyan@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 733 Lines: 20 One more thing: you HAVE to make arch/x86/include/asm/required-features.h aware of any features that the kernel unconditionally depend on. Again, using the gcc cpp macros that reflect what bits gcc itself broadcast. However, this is perhaps where CONFIG flags become important, since required-features.h has to be able to be compiled in the bootcode environment, which is different from the normal kernel compiler environment. We could, however, automagically generate a reflection of these as a header file: echo '#ifndef __LINUX_CC_DEFINES__' echo '#define __LINUX_CC_DEFINES__' $(CC) $(c_flags) -x c -E -Wp,-dM /dev/null | sort | \ sed -nr -e 's/^#define __([^[:space]]+)__$/#define __KERNEL_CC_\1/p' echo '#endif -hpa