Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592AbdFOWg0 (ORCPT ); Thu, 15 Jun 2017 18:36:26 -0400 Received: from mail-co1nam03on0076.outbound.protection.outlook.com ([104.47.40.76]:5608 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751546AbdFOWfx (ORCPT ); Thu, 15 Jun 2017 18:35:53 -0400 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=cavium.com; From: David Daney To: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, ralf@linux-mips.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Cc: David Daney Subject: [PATCH RFC 3/3] MIPS: Include file changes to enable building BPF code with llvm Date: Thu, 15 Jun 2017 15:35:43 -0700 Message-Id: <20170615223543.22867-4-david.daney@cavium.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170615223543.22867-1-david.daney@cavium.com> References: <20170615223543.22867-1-david.daney@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR07CA0070.namprd07.prod.outlook.com (10.174.192.38) To MWHPR07MB3501.namprd07.prod.outlook.com (10.164.192.28) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR07MB3501: X-MS-Office365-Filtering-Correlation-Id: 1f4ea946-53a7-4003-5c02-08d4b43edf67 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:MWHPR07MB3501; X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB3501;3:1dMIW9B4zfQt9yeduZWjHq5LD6NmcOuhsYonm+SM9g3bJ6dlQybygJ2KVyybc0pDETXsVff9m0m9T4PoSQjuQdJZfbjMSEnJRcjnH0CiUCYTY8Q/xwFEl4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/zhkbHB/n4LQuQiL08U+qJAiFFx3BDdwcubNgIwujpQj1yYhjP9/RXHcxA9eSGBtBcjVy3OmLDF1XBoqOJPLlfEeRY4tknZCQpi3e5SgrLfqu95GOjJEaE0dyu1HJinXKoDzbPu8n4JRv5Y4XCil2hKUBYaKpe/dBnVNAgXNbmeb6KOI+Rm0ET2qj37QUxneaqPa9NWYM9RqYMoLbFM/JGN2qZOFFf69ZHYBcaox9xfaUuBkqx0FUwzgq1yBmU2YFiP6EXfnHiO5HMb1Jft27QQuCqywd0yDUnfVoxKWbScYA3RNlwTy3oKcoD4Ta+zUwsRf0EczgiqPf7eCdjPp1GGGXfDRUZ4OaqcIq6BZsGJo92MUhPlYIEkP0Zl8toIRQV5uGydVFW78dNhiOKhIyu6V0f8kPBUERRA7mojTH4l6CfbKYYspcmZcz7tCMSlT9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR07MB3501;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR07MB3501; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR07MB3501;4:T55vB+HWCVuTJB6lpZmFu9cQoBY1XtY/9K8zNa0O4u?= =?us-ascii?Q?M5gmDeQ47MwHZlHFt8OeAb65PvqPewBfApRAnqn1g4DjVs8SZ59E7SrwjxT7?= =?us-ascii?Q?HG0c40lHs3FEhmQYe7gpJY+NUrBv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ascii?Q?/u+FnNM920uLUvxz6P0InmfnE2PGX/JqsqISHTifYVVzgtrktQz5Uany4Cbw?= =?us-ascii?Q?/0+Yyp/R90kjJeltILL7uwymzlgskFebS3N1l/IDvGPR36Q013hg25aBXuJS?= =?us-ascii?Q?UclRRkGNxFizghkT1GepJFvD7Yih3C?= X-Forefront-PRVS: 0339F89554 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39400400002)(39850400002)(39410400002)(39450400003)(39860400002)(39840400002)(81166006)(72206003)(8676002)(47776003)(1076002)(7736002)(305945005)(76176999)(6116002)(50986999)(86362001)(5660300001)(2906002)(36756003)(3846002)(38730400002)(66066001)(2950100002)(53416004)(6506006)(189998001)(478600001)(107886003)(4326008)(6512007)(5003940100001)(42186005)(33646002)(6486002)(50466002)(53936002)(48376002)(25786009)(50226002)(6666003)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB3501;H:ddl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR07MB3501;23:4a6oLjuT9v+y+T6qbZ1igTOHVXgmbXRj1zMqkeD6b?= =?us-ascii?Q?s4Nwkzu6/pAMXqzFECiOG0D3PhKIg9oRBL0FMrsP1/oF8/623c6pwTLF3ocF?= =?us-ascii?Q?I/71Sa234hALrb/5QtKsahmnFB6zWfJQa3A9+wxFN2oLZhUwnSM5+fkNRCL2?= =?us-ascii?Q?dwNZ43o/SwcVPDYSDlXoGrX2kbiJdSW1VmK3vvBo6TOJ553kPrNwRRj7ORFh?= =?us-ascii?Q?kfkG0FEpDxRxLFLmGNjpyIBv3DCwML7sqj7VD0A1vhC2nkhZXyjugGL0ZQXx?= =?us-ascii?Q?RFs6tdveQHQoJFqCo4K39EDjEp4R5QoBljXsee4wTInzm6jJ8PLrC4U9AQLf?= =?us-ascii?Q?SgUwCCnyAOCL5SbhJocSkRT+tbWC48ZCsKWyTzfs1SSP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myFwyLrbADPJhzVXzlP5eRT5A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR07MB3501;7:S0LrbzlZGwSOylrkQaYxBD7SQJIVj8vZIYgPFpS6VR9BiwQlm1m+ad1eFeO5AkG8SlBC4kuFSTGmIEkBI2LTfAxdoxXwgkjZKfmm0mXwI59e+Iwbz8oXbKiojDxk73osVcHUHRZfP38JNB1vgG1bAIjKrBYGID1DcwLWnc/tQKK5tIDJ41BcU0IMqXnXgbTTQ35KvSowdhjpRtB5ssF4oVIE+kuptbxe6L/+jL9Egw+CAh2r9YXO0dAzgwMlflHDF78yBbetIo9JezGMin5f5NuWUFwY1udOMgiwS/rnIdgnJ8O45uuc8qn2OkrnKqoAd2YzClVAZwVC5bumJdVrmQ== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 22:35:49.1241 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3501 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2549 Lines: 70 When building for the eBPF target archecture. Inline asm cannot be used as MIPS instructions are fundamentally incompatible with eBPF bytecode. The preprocessor symbol __EMITTING_BPF__ is used to gate the inclusion of inline asm in constructs used the by the BPF programs. Also make the Makefile symbol LINUXINCLUDE contain the asm/mach-MACHINE directory so that the BPF compilation process can pull in the necessary include files. Signed-off-by: David Daney --- arch/mips/Makefile | 1 + arch/mips/cavium-octeon/Platform | 3 +++ arch/mips/include/asm/checksum.h | 2 +- arch/mips/include/uapi/asm/swab.h | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 02a1787c888c..ca968415597f 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -247,6 +247,7 @@ entry-y = 0x$(shell $(NM) vmlinux 2>/dev/null \ | grep "\bkernel_entry\b" | cut -f1 -d \ ) cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic +LINUXINCLUDE += -I$(srctree)/arch/mips/include/asm/mach-generic drivers-$(CONFIG_PCI) += arch/mips/pci/ # diff --git a/arch/mips/cavium-octeon/Platform b/arch/mips/cavium-octeon/Platform index 45be853700e6..9ef3e4074099 100644 --- a/arch/mips/cavium-octeon/Platform +++ b/arch/mips/cavium-octeon/Platform @@ -4,4 +4,7 @@ platform-$(CONFIG_CAVIUM_OCTEON_SOC) += cavium-octeon/ cflags-$(CONFIG_CAVIUM_OCTEON_SOC) += \ -I$(srctree)/arch/mips/include/asm/mach-cavium-octeon +ifdef CONFIG_CAVIUM_OCTEON_SOC +LINUXINCLUDE += -I$(srctree)/arch/mips/include/asm/mach-cavium-octeon +endif load-$(CONFIG_CAVIUM_OCTEON_SOC) += 0xffffffff81100000 diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h index 77cad232a1c6..f8fff2ced216 100644 --- a/arch/mips/include/asm/checksum.h +++ b/arch/mips/include/asm/checksum.h @@ -12,7 +12,7 @@ #ifndef _ASM_CHECKSUM_H #define _ASM_CHECKSUM_H -#ifdef CONFIG_GENERIC_CSUM +#if defined(CONFIG_GENERIC_CSUM) || defined(__EMITTING_BPF__) #include #else diff --git a/arch/mips/include/uapi/asm/swab.h b/arch/mips/include/uapi/asm/swab.h index 23cd9b118c9e..42ed70015c70 100644 --- a/arch/mips/include/uapi/asm/swab.h +++ b/arch/mips/include/uapi/asm/swab.h @@ -13,7 +13,7 @@ #define __SWAB_64_THRU_32__ -#if !defined(__mips16) && \ +#if !defined(__mips16) && !defined(__EMITTING_BPF__) && \ ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ defined(_MIPS_ARCH_LOONGSON3A)) -- 2.11.0