Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9157443imu; Tue, 4 Dec 2018 23:12:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WsKm1HChAKmrGbmG4+5tLbIfPXHkSGTZou59e1/uN5w9B1JaBee1zAMJ0JIjZEWIzLlSAU X-Received: by 2002:a62:444b:: with SMTP id r72mr23657425pfa.184.1543993930600; Tue, 04 Dec 2018 23:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543993930; cv=none; d=google.com; s=arc-20160816; b=vogB+8xYDgND1Tw3lXzY8rrgGXXDiLQ8Ya+BhRlFKHEyn2VOt+P1xzONZdS/Ve4W8w fkAkGZIVNPm44pdnzZ1JN6afzWe47E71fP2rDlm5q4u/B6v1xZto/fzucRJiTqaHNkFM nqoKNUIyDP1IFUNqoYHC3ydJI2Z56H+C0fWauX3dxsR5y/fc0saNNaRfSAP5JqysgICk oxrHzeRZiNckSxxXn7Gy7JgvAc3K2aEXdr0R8gJY3OPhMXYJUnC2lhXLca0l+H8Ww7GB RvuBrA+YexZQYNHhD875hUa838LP+aU7T0pQ6KrDjsFBHtCcRh6T0Auo2UPlTPn32zgL l/6g== 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=zEx7FYUQNfSZuw7S5NHtoUJ5AraOFeU23ry2T2pRsZ8=; b=ocsmXjE+K6ms0pcZr5ujyCQo39a2Q17Y+yqG0HWpJIVto815kX8zzVbCqlCOM0nlB1 /gMFW5vUZnkcV1oW3srfQ7XbJT5XGY9JECbGLqZiD/soRzt67jXgPbxSgaHpNQRiMqNT QC98DRz/4GtVeiYZs0n63Mbd5fdzoZ2bLBAe1zqXhj8se6GrfVQ1FR5U5lRw4A49rYF8 FnX9ertag30mpEu2QEmUX2MIsdiYRSGrfjF/n3hjp4VFhHed0wiP2ak0N8zjGYms7pC6 GsJ2ffDYPfkb/6mI6cE48eSdbtNWTDh+BOEDREz+d05NJkYLBUcguRWk8EQOFSOly9ua W56Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=FmUk7gYV; 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 m11si9950907pla.436.2018.12.04.23.11.55; Tue, 04 Dec 2018 23:12:10 -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=FmUk7gYV; 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 S1726909AbeLEHLV (ORCPT + 99 others); Wed, 5 Dec 2018 02:11:21 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:46908 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbeLEHLU (ORCPT ); Wed, 5 Dec 2018 02:11:20 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB574Ska101593; Wed, 5 Dec 2018 07:10:59 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=zEx7FYUQNfSZuw7S5NHtoUJ5AraOFeU23ry2T2pRsZ8=; b=FmUk7gYVbMhR1rCBQaXStiNhMErvwuvO54f8HCZ1DoWBK5ma27WfaxauRTG8gkezdBB4 w2bQ8iahwGH9IPMaHpmqgZn6k6qrGWp8MAPbdEnUVhMYOH4PSyfiAm43AOGyA14TmAZF j+GZ9nCidWKQm+ezm+1+inf+1MDgB5Xa5a7tiCEFn3mNk8U3a++D+kes5peA+Q7nC5OV MQYOeI8uooQXBOVCHhVyn1L5J/cQ786jH6kfeEBB0LjOLLIVaDToFvGt51Djopc6759S 1QHSzSfuqZaau5xU9Y88zWuAXY9GWm4YT0Iu4M9EnYqeBjCC+DPvHejljCLJa27bqPyV 2w== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2p3jxrgk8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Dec 2018 07:10:59 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB57ArA3001088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Dec 2018 07:10:53 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB57AqVt005660; Wed, 5 Dec 2018 07:10:52 GMT Received: from [10.191.30.150] (/10.191.30.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Dec 2018 23:10:51 -0800 Subject: Re: [PATCH v2] 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: <1543991239-18476-1-git-send-email-yamada.masahiro@socionext.com> From: Zhenzhong Duan Organization: Oracle Corporation Message-ID: <34aa8fad-ee7f-6833-41a2-00a92b4ad369@oracle.com> Date: Wed, 5 Dec 2018 15:10:49 +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: <1543991239-18476-1-git-send-email-yamada.masahiro@socionext.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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-1812050066 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/12/5 14:27, Masahiro Yamada wrote: > It is troublesome to add a diagnostic like this to the Makefile > parse stage because the top-level Makefile could be parsed with > a stale include/config/auto.conf. > > 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 > Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") > Reported-by: Meelis Roos > Signed-off-by: Masahiro Yamada > --- > > Changes in v2: > - Revive ifdef CONFIG_RETPOLINE surrounding the KBUILD_CFLAGS addition > - Rephase the commit log a bit, hoping the cause of the issue will be clearer > > arch/x86/Makefile | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index f5d7f41..75ef499 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -220,9 +220,6 @@ 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 > > @@ -307,6 +304,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 Acked-by: Zhenzhong Duan -- Regards Zhenzhong