Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9016850imu; Tue, 4 Dec 2018 19:23:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/UCVqjhz5rj9RAgNCRL8itdoN2bVWLkcQ6aWYD/7FQLv2El3nKv7t6Gw1Nl2MsnO0siigN2 X-Received: by 2002:a65:40c5:: with SMTP id u5mr18307313pgp.46.1543980216492; Tue, 04 Dec 2018 19:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543980216; cv=none; d=google.com; s=arc-20160816; b=Tn9HEusGPUesZIz0Zzw4hsJgLmO5dwwvC3o0gwQIH7hXND8dB3/WekIza2zMWJZtep ZPEYOm+6ivy52gBRdKrrgO9MHCWSraaE4r544Sr7XVpVHcgcylFLdDYcLsLj5Kqi6hjZ RnnGsPtqcdNF4ue3kiPP2WXKxRECJdA4hdtsaseoV2uQClWL85x6v59Ia815RJ4AGf7k wm7VN/nZSIoqGb/0U7J4MxxJ/J0ZCuFu2mlONwtR7FgQnRaT5UwIeWxEqjBjbqhrw1lE QectPuPMUlUtl/wwS0IR7ib2y465D4FTTJGKOEdzPHxoFZOHl4m76kLqYtpABiCiqYWU mGkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=xqsssdBJaamGymmETkekr5hsqf+KnFdASo7anoTu9yA=; b=h/PaNkJoNtVsVD1/1MoaAYBJF7xVqxuS6HyB7GaliOy0MGseiE6/9eBTSB9TZaSflr QK2MOXdLMTYUOYZfI9n87VEwmZKGG7bWwM9S64ODPYQjH+kYTBrr3ITXv+owYDWvqAws 3BRjoPAIYalpODbEexAsbBX771IGufti5PDK0238ACqC1u1GUfuUSKjdFNAfIO8ELW4m TRxXwremF5v5WUoF3vkSXfhTSszLvvvPnKStlnbCF+Md/7P8vWJcmP5KO0d0UAR1gdXL 3Z/h/YSsMUoPGL0OvDKrz/s3tdM/0bGYem5rfU/JToiEiPjHSGYRcW3chI3NfJFWMWsH D93g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=uvPvNegF; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si18535068pll.10.2018.12.04.19.23.20; Tue, 04 Dec 2018 19:23:36 -0800 (PST) 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=@oracle.com header.s=corp-2018-07-02 header.b=uvPvNegF; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726092AbeLEDWp (ORCPT + 99 others); Tue, 4 Dec 2018 22:22:45 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:51382 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbeLEDWo (ORCPT ); Tue, 4 Dec 2018 22:22:44 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB53EvLT175001; Wed, 5 Dec 2018 03:22:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=xqsssdBJaamGymmETkekr5hsqf+KnFdASo7anoTu9yA=; b=uvPvNegFCcuKS3Cz/tVUfpw3aoEwfXqvz8D8hFADwjVjQRJIblLS3rtKDxFm2MfwQHaY NglBY3ft38bIQeGkfGjbsjWbC3yc/fMFiPfSrRFmxNKcULMEFNO3+jErppGM9amgcUJK aWtt5GR4AKnWurvSmp9iXMVl62LOfLZCMOn3LXNr59XWccAuoohUZuk4GMqQFFHZRprE XSKU4ywwsi81BJEfnMzahZqmOrM9T173tw9wzpcMXayk1K+hMyF30DnDGOuZ6OXp4Na8 ABBj6tp3/Sh+3wW01P3KWLCkq7HkFHUMaU9TOgzebx+IkrtCmJbLDbW3tSeo6WDGiyuY cQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2p3hqu017p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Dec 2018 03:22:20 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB53MKPC017963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Dec 2018 03:22:20 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wB53MJ39011938; Wed, 5 Dec 2018 03:22:19 GMT Received: from [10.191.22.183] (/10.191.22.183) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Dec 2018 19:22:18 -0800 Subject: Re: [PATCH] x86/build: fix compiler support check for CONFIG_RETPOLINE To: Masahiro Yamada , Ingo Molnar , Thomas Gleixner , x86@kernel.org Cc: Meelis Roos , "H. Peter Anvin" , Borislav Petkov , linux-kernel@vger.kernel.org References: <1543978802-24196-1-git-send-email-yamada.masahiro@socionext.com> From: Zhenzhong Duan Organization: Oracle Corporation Message-ID: <39eae552-38cb-d6af-4717-e8a1cb1931cd@oracle.com> Date: Wed, 5 Dec 2018 11:22:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: <1543978802-24196-1-git-send-email-yamada.masahiro@socionext.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9097 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812050028 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, Thanks for fixing. There is a question still confusing me. There are many CONFIG_* used in arch/x86/Makefile. Will they also be impacted or not? # grep CONFIG_ arch/x86/Makefile ifeq ($(CONFIG_X86_32),y)         cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)         cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)  ...... drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/ drivers-$(CONFIG_PCI)      += arch/x86/pci/ drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/ drivers-$(CONFIG_PM) += arch/x86/power/ drivers-$(CONFIG_FB) += arch/x86/video/ ifeq ($(CONFIG_X86_DECODER_SELFTEST),y) Thanks Zhenzhong On 2018/12/5 11:00, Masahiro Yamada wrote: > It is wrong to add CONFIG option diagnostic to the Makefile parse > stage. > > Once you are hit by the error about non-retpoline compiler, the > compilation still breaks even after disabling CONFIG_RETPOLINE. > > The easiest fix is to move this check to the "archprepare" like commit > 829fe4aa9ac1 ("x86: Allow generating user-space headers without a > compiler") did. > > Link: https://lkml.org/lkml/2018/12/4/206 > Reported-by: Meelis Roos > Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") > Signed-off-by: Masahiro Yamada > --- > > arch/x86/Makefile | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index f5d7f41..ae0148b 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -219,12 +219,7 @@ KBUILD_CFLAGS += -Wno-sign-compare > KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > > # Avoid indirect branches in kernel to deal with Spectre > -ifdef CONFIG_RETPOLINE > -ifeq ($(RETPOLINE_CFLAGS),) > - $(error You are building kernel with non-retpoline compiler, please update your compiler.) > -endif > - KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) > -endif > +KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) > > archscripts: scripts_basic > $(Q)$(MAKE) $(build)=arch/x86/tools relocs > @@ -307,6 +302,13 @@ ifndef CC_HAVE_ASM_GOTO > @echo Compiler lacks asm-goto support. > @exit 1 > endif > +ifdef CONFIG_RETPOLINE > +ifeq ($(RETPOLINE_CFLAGS),) > + @echo "You are building kernel with non-retpoline compiler." >&2 > + @echo "Please update your compiler." >&2 > + @false > +endif > +endif > > archclean: > $(Q)rm -rf $(objtree)/arch/i386