Received: by 10.192.165.156 with SMTP id m28csp943033imm; Thu, 19 Apr 2018 10:02:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+YFn+VkcmiTo4YHkqOvgs+k/RdOMiTPTmjYHpfllXveLn1x2YsqapEUEwpBBaFcVFnWm4d X-Received: by 2002:a17:902:43a4:: with SMTP id j33-v6mr6958766pld.260.1524157369276; Thu, 19 Apr 2018 10:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524157369; cv=none; d=google.com; s=arc-20160816; b=FJUBemCNnxm7cYmsFg+CgsdjwJ+3ARmhO/xHdpx566YdCYxLfLkVs6uPLkutyfg9s+ py2Emfn4VOmcMyv5eu/ef3Edi/qkSMmRgsot9skLMFE2Afyphlc90V5ckW7llj1IFwPq HvIfJqLQWn69fcRdli8z9qFtXipKfaEJ2U44Ereerx70yTUY5xQ9elF2PI8pRG0CgXgy qcRc9Udl4pixI84cEt4cNhCz82NmmE5rpwpAxABi2JiPNOaHE+7nQvVQc/Sp+t2U2a+K hafCbmB0UggVqMyxbqeWg/6wwCiXJTeU8zrDhS2EwHUMxn0E0bAeRNOEcqev4GacZgSt pcow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature:dkim-signature :arc-authentication-results; bh=zqCzSZt1BhCR/ONEWwD17wE/LTZUm7Bf4OHY0FVjZoc=; b=wcgbTwy0Bm5XN5CMM7zILu9V9ezkAquCoaqZRv0bBBUbWgJOq4AiakiykwdV583dze MmjEpkaAlMrx3Y+a61wt/T1p7bDwf2QULo4YI1Z4Kts558SsIjTKMMtDwlE580tRkNFm AzD6Cl1Hs9fdKy3IHYmylH9DDXFRIOFfz0LbGl5AgfBU9GVtNjDWeFppLroOnqNTCyu7 2RxBKOqndRuwBBhKIYc4FaNtd/1Q5uigsmn7HvW0uhQcfEm0XC9IiiFLhbokFkxenvFQ peCqDyKxyniyA1on49AFYjYa/pojTnbnNEUw3/irwAEenEJiDz6j3tk/EUR/dxj77zWX VZZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=CCA2CxmM; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Sdlyvqcm; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20-v6si3842314plp.7.2018.04.19.10.02.21; Thu, 19 Apr 2018 10:02:49 -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=@fb.com header.s=facebook header.b=CCA2CxmM; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Sdlyvqcm; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754035AbeDSQhR (ORCPT + 99 others); Thu, 19 Apr 2018 12:37:17 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:52102 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753497AbeDSQhO (ORCPT ); Thu, 19 Apr 2018 12:37:14 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3JGZjrw016689; Thu, 19 Apr 2018 09:36:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : from : to : cc : references : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=zqCzSZt1BhCR/ONEWwD17wE/LTZUm7Bf4OHY0FVjZoc=; b=CCA2CxmMu9kcgEuwJYbnuJ3nHVah+dpoDhgJ+e8VAajmW/dCzxWF+FI3OsC0V9VK+vER q3GlnphQfvbGNgG7zBCR3uHWn/OfI7yPOPH35GoqcNy5MVm6eLVUBmR1folVh1Hj29tG k50TFbBxyCim+JD8QyTAwD4cdB4DRckh6bs= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 2heh5dhn68-15 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 19 Apr 2018 09:36:34 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.13) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 19 Apr 2018 09:36:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zqCzSZt1BhCR/ONEWwD17wE/LTZUm7Bf4OHY0FVjZoc=; b=SdlyvqcmmjMGDXh3C7tRPs+++B45HQmYG/2iXohKB3W3+/a4erM1g4AuRS+cX83Mm4+HCqJ+NpCSeH2Rp/y1rS2g11s6VmXLS66uJel8XV7v4ae/vcPE1GCfXPbaSeqqSMB7kTZXfEkfIv90/fgISmka12r2HTTxDbO7rOEMnco= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=fb.com; Received: from macbook-pro-52.dhcp.thefacebook.com (2620:10d:c090:200::4:6dc) by CY1PR15MB0078.namprd15.prod.outlook.com (2a01:111:e400:5849::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Thu, 19 Apr 2018 16:36:05 +0000 Subject: Re: [PATCH v2] x86/cpufeature: guard asm_volatile_goto usage with NO_BPF_WORKAROUND From: Yonghong Song To: , , , , , CC: , netdev References: <20180415042738.1788215-1-yhs@fb.com> Message-ID: <41651b53-7e99-4394-7edc-13c17b3bc9dd@fb.com> Date: Thu, 19 Apr 2018 09:36:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180415042738.1788215-1-yhs@fb.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::4:6dc] X-ClientProxiedBy: MWHPR0201CA0024.namprd02.prod.outlook.com (2603:10b6:301:74::37) To CY1PR15MB0078.namprd15.prod.outlook.com (2a01:111:e400:5849::28) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0078; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0078;3:/X9O3lz/G6xSxYDAXae9mLHxBIqub4RqOF7q8NAVnlJwDEHc3b/vpLWfWqkW7ifVYMRPLjJIsYVawe8Nurpl3yXhi7PJ5YEYgq4g//PhkAXGsRX6AEPDUAkDxyNXEhtbq5tSgH8aT0LdhNXiM5MviDlaK+TigiKJpoc4uXOVbzBtjhDra5qpf+0SlbRJjfJpdIKO73svPSyLdWb2Xl1dyhac03XWIiovCgVq1okHaY8JggF+2Xorf0NYzQjeWQ0e;25:rRULN8NO6/5oX3KjNZcBnn8UvQ2boD2WWHpAyQIdnKxvRlLP5BbkzjhV72nwOtFEVTO3q+NcfdZ8wl2uJGtmdCv9rLLb0K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d84jgDCQ0RKSHhiMmx+WPXBnnaOKvHbIWuT1OxBldUtsCde3qwE3+f0zbcE4VCcY0gWq5tfu7zGChEDMglXFcMp9CSt/I/ZC95gTLneaQDCIq0O7LxeChB13J5mciym/u7X0w2WyeliS8llpPlFdV1yk8ID6Uxa0h86H4qBcXv5TbpRI+uIQj4rPlt6Vu+UNSuBOkT26xhv8EjOO2+rEoUCwrS+DauI2JOPAMNDDtT34FOiJpzaKE+r8toS4P6wDmLF2oYv08bdeRlNCfXV1yWmlUxPbvVXywLgrZ5/4PmfEJ17UUPtN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231232)(11241501184)(944501327)(52105095)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:CY1PR15MB0078;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0078; X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(376002)(396003)(39860400002)(39380400002)(346002)(6506007)(76176011)(47776003)(53936002)(6486002)(6512007)(31696002)(7736002)(305945005)(5660300001)(36756003)(86362001)(23676004)(65826007)(478600001)(316002)(6246003)(6666003)(230700001)(8936002)(186003)(16526019)(67846002)(229853002)(476003)(31686004)(8676002)(2486003)(386003)(53546011)(50466002)(11346002)(446003)(52116002)(25786009)(6116002)(46003)(4326008)(59450400001)(52396003)(81166006)(2906002)(52146003)(2616005)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0078;H:macbook-pro-52.dhcp.thefacebook.com;FPR:;SPF:None;LANG:en;MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjE1TUIwMDc4OzIzOktGRl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XE+4VoflNhOYQurO/sDRiEMtc5ZRhzalVnp54n4vQ1MbiXzzkpffkqSPgqSeWBkT2CtKQNSBQVXJFA7FNRsuQHhWSnnwQdtEyXVZiImqsq8klTac9Resx1CddJwGIE/YBK/OJ4g8VptRMrOAs8eJYLwrM6f2h/ahUUZws= X-MS-Office365-Filtering-Correlation-Id: 3d75fc98-9088-408f-3a62-08d5a613a637 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2018 16:36:05.9613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d75fc98-9088-408f-3a62-08d5a613a637 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0078 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-19_05:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Peter, Just pinging. Did you get chances to look at this? [ cc netdev as well so folks are aware of the issue. ] Thanks! Yonghong On 4/14/18 9:27 PM, Yonghong Song wrote: > Commit d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") > removed X86_FAST_FEATURE_TESTS and make macro static_cpu_has() always > use __always_inline function _static_cpu_has() funciton. > The static_cpu_has() uses gcc feature asm_volatile_goto construct, > which is not supported by clang. > > Currently, for BPF programs written in C, the only widely-supported > compiler is clang. Because of clang lacking support > of asm_volatile_goto construct, if you try to compile > bpf programs under samples/bpf/, > $ make -j20 && make headers_install && make samples/bpf/ > you will see a lot of failures like below: > > ========================= > clang -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/7/include \ > -I/home/yhs/work/bpf-next/arch/x86/include \ > -I./arch/x86/include/generated -I/home/yhs/work/bpf-next/include \ > -I./include -I/home/yhs/work/bpf-next/arch/x86/include/uapi \ > -I./arch/x86/include/generated/uapi \ > -I/home/yhs/work/bpf-next/include/uapi -I./include/generated/uapi \ > -include /home/yhs/work/bpf-next/include/linux/kconfig.h > -Isamples/bpf \ > -I/home/yhs/work/bpf-next/tools/testing/selftests/bpf/ \ > -D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \ > -D__TARGET_ARCH_x86 -Wno-compare-distinct-pointer-types \ > -Wno-gnu-variable-sized-type-not-at-end \ > -Wno-address-of-packed-member -Wno-tautological-compare \ > -Wno-unknown-warning-option \ > -O2 -emit-llvm -c /home/yhs/work/bpf-next/samples/bpf/xdp_redirect_cpu_kern.c \ > -o -| llc -march=bpf -filetype=obj -o samples/bpf/xdp_redirect_cpu_kern.o > In file included from /home/yhs/work/bpf-next/samples/bpf/xdp_redirect_cpu_kern.c:10: > In file included from /home/yhs/work/bpf-next/include/uapi/linux/in.h:24: > In file included from /home/yhs/work/bpf-next/include/linux/socket.h:8: > In file included from /home/yhs/work/bpf-next/include/linux/uio.h:13: > In file included from /home/yhs/work/bpf-next/include/linux/thread_info.h:38: > In file included from /home/yhs/work/bpf-next/arch/x86/include/asm/thread_info.h:53: > /home/yhs/work/bpf-next/arch/x86/include/asm/cpufeature.h:150:2: error: 'asm goto' constructs are not supported yet > asm_volatile_goto("1: jmp 6f\n" > ^ > /home/yhs/work/bpf-next/include/linux/compiler-gcc.h:296:42: note: expanded from macro 'asm_volatile_goto' > #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) > ^ > 1 error generated. > ========================= > ... > In file included from /home/yhs/work/bpf-next/samples/bpf/tracex4_kern.c:7: > In file included from /home/yhs/work/bpf-next/include/linux/ptrace.h:6: > In file included from /home/yhs/work/bpf-next/include/linux/sched.h:14: > In file included from /home/yhs/work/bpf-next/include/linux/pid.h:5: > In file included from /home/yhs/work/bpf-next/include/linux/rculist.h:11: > In file included from /home/yhs/work/bpf-next/include/linux/rcupdate.h:40: > In file included from /home/yhs/work/bpf-next/include/linux/preempt.h:81: > In file included from /home/yhs/work/bpf-next/arch/x86/include/asm/preempt.h:7: > In file included from /home/yhs/work/bpf-next/include/linux/thread_info.h:38: > In file included from /home/yhs/work/bpf-next/arch/x86/include/asm/thread_info.h:53: > /home/yhs/work/bpf-next/arch/x86/include/asm/cpufeature.h:150:2: error: 'asm goto' constructs are not supported yet > ... > ========================= > > This patch adds a preprocessor guard NO_BPF_WORKAROUND around the > asm_volatile_goto based static_cpu_has(). NO_BPF_WORKAROUND is set > at toplevel Makefile when compiler supports asm-goto. That is, > if the compiler supports asm-goto, the kernel build will use > asm-goto version of static_cpu_has(). > > For clang compilation for bpf programs where only header files > are accessed, NO_BPF_WORKAROUND is not defined and asm-goto version > of static_cpu_has() will not be accessed, hence the above compilation > error will disappear. > > If later clang compiler starts to support asm_volatile_goto, > the change in this patch can be reverted. > > Fixes: d0266046ad54 ("x86: Remove FAST_FEATURE_TESTS") > Suggested-by: Alexei Starovoitov > Signed-off-by: Yonghong Song > --- > Makefile | 1 + > arch/x86/include/asm/cpufeature.h | 5 +++++ > 2 files changed, 6 insertions(+) > > Changelog: > v1 -> v2: > Use NO_BPF_WORKAROUND macro instead of CC_HAVE_ASM_GOTO > to make it explicit that this is a workaround. > > diff --git a/Makefile b/Makefile > index c1a608a..7b81f1f 100644 > --- a/Makefile > +++ b/Makefile > @@ -504,6 +504,7 @@ export RETPOLINE_CFLAGS > ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) > CC_HAVE_ASM_GOTO := 1 > KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO > + KBUILD_CFLAGS += -DNO_BPF_WORKAROUND > KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO > endif > > diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h > index b27da96..638417b 100644 > --- a/arch/x86/include/asm/cpufeature.h > +++ b/arch/x86/include/asm/cpufeature.h > @@ -140,6 +140,8 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit); > > #define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit) > > +/* this macro is a temporary hack for bpf until clang gains asm-goto support */ > +#ifdef NO_BPF_WORKAROUND > /* > * Static testing of CPU features. Used the same as boot_cpu_has(). > * These will statically patch the target code for additional > @@ -195,6 +197,9 @@ static __always_inline __pure bool _static_cpu_has(u16 bit) > boot_cpu_has(bit) : \ > _static_cpu_has(bit) \ > ) > +#else > +#define static_cpu_has(bit) boot_cpu_has(bit) > +#endif > > #define cpu_has_bug(c, bit) cpu_has(c, (bit)) > #define set_cpu_bug(c, bit) set_cpu_cap(c, (bit)) >