Received: by 10.192.165.148 with SMTP id m20csp978154imm; Thu, 10 May 2018 03:50:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZom8wJAo1jlfU4LSetXC8cRdpQ4mw09IeJ+Ld8DkQcQMVP8si5pXy8DSWCSVaZUanRCTEdm X-Received: by 2002:a62:883:: with SMTP id 3-v6mr908649pfi.154.1525949432847; Thu, 10 May 2018 03:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525949432; cv=none; d=google.com; s=arc-20160816; b=cEQGCVwngyAeYaAlGZqeyvS0VV8MXLhDwj27Ov5nTXydwuEh/NOCcyq9MShIavv9/V VxPn4wHBY69z+8tVFDumiAhYYdvq3Ac+PqC1pbvMLaALm47NfYzQNSEc++cu6XYSmT/8 kIP6n+nC6+nDgcxpr4M33PYH/94HliJJEZAjorYbf4OBcIlPq/TR7BDv25ml1T6u0e6t XfVESxod1i7eDYJLK98pWksB7ohk6uujFMvSc7zUgMMz/quNOJiIsxYX/B+CyVMCUwwU GQvG0EOtoyiW56BUqv8QbjZVMlSonDn/64EP0ZwjI9XwMN4TJs9dBYW59wbf0Sy62Shm 16cw== 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:arc-authentication-results; bh=7VAWUm0yYwwf1q8mM86OCMWy0EEWzXovGdIEtHV97po=; b=1K5pnGBgs5fl3vnSIISoYALG3aWpFzhD1OzY2oXuiKZXDCITETrbxW1GzH3BkkaxQm OI6ZEuMf0IRGv7YGM8MPVQviLAtGkXX+APhxGmX6h8mltyDiKYPkK0HpQeqt3REyTa94 j6CWaeAvcYVRT0ymJs8ArvcKt3pUcEKb7QFH4GfP19jphysu3UVmfws1TxPEelvingRR uOqzFSLFjxFOWaS+/EcG9ZtBR6dqVlYakzJPUU3K7O0adrSD9FV2mCRcIl6zFLaYHkCg JTP/0LUOv/rGGpq+emuJFIC3+uUI1XcfBGdjL51OXrNHX2jza607C8ZZmcqfN8xfaod/ wpDQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9-v6si518887pff.270.2018.05.10.03.50.16; Thu, 10 May 2018 03:50:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935371AbeEJKte (ORCPT + 99 others); Thu, 10 May 2018 06:49:34 -0400 Received: from mail.skyhub.de ([5.9.137.197]:51054 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935279AbeEJKtb (ORCPT ); Thu, 10 May 2018 06:49:31 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AykBubIjsWyt; Thu, 10 May 2018 12:49:14 +0200 (CEST) Received: from pd.tnic (p200300EC2BC8BE00CCA7BC9076439171.dip0.t-ipconnect.de [IPv6:2003:ec:2bc8:be00:cca7:bc90:7643:9171]) (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 CB9AB1EC0077; Thu, 10 May 2018 12:49:13 +0200 (CEST) Date: Thu, 10 May 2018 12:49:08 +0200 From: Borislav Petkov To: Yonghong Song Cc: peterz@infradead.org, mingo@kernel.org, torvalds@linux-foundation.org, ast@fb.com, daniel@iogearbox.net, linux-kernel@vger.kernel.org, x86@kernel.org, netdev@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH bpf v3] x86/cpufeature: bpf hack for clang not supporting asm goto Message-ID: <20180510104908.GA16130@pd.tnic> References: <20180504033119.2130788-1-yhs@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180504033119.2130788-1-yhs@fb.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 03, 2018 at 08:31:19PM -0700, 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 goto construct, > which is not supported by clang. > > Issues > ====== > > Currently, for BPF programs written in C, the only widely-supported > compiler is clang. Because of clang lacking support > of asm 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: This is not the kernel's problem. Fix the samples to build successfully like the rest of the things in tools/ use kernel machinery and undefine/redefine stuff so that it builds. For example, tools/include/asm/alternative-asm.h redefines two macros. So do something along those lines. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.