Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1657178ybl; Thu, 5 Dec 2019 05:06:22 -0800 (PST) X-Google-Smtp-Source: APXvYqy/SoC/xEmbLBzSLEb/tU71bXENs5u5bfKA5I32mKvaXcMsGBuaSzukgPUeeXsnKcyXx6pC X-Received: by 2002:aca:111a:: with SMTP id 26mr6618613oir.145.1575551182068; Thu, 05 Dec 2019 05:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575551182; cv=none; d=google.com; s=arc-20160816; b=y18SZ0TezqHv/eFw2EvfQq5exCUnOUY+W5k4awFHb5XjQjMRsQWoz94T9pVOOQuoUb +ms9HwQFzpaMlYDLcXEuwk9IVzDc2qbUJWt5R1s1t12owqHrwhqe0fV9cu8MOLAgy3P0 Y7Hkt84P67eL3sb8FbyJGiZ1zzrpO8kw1grV4+tjEcxjyqxG5vapbr6A/g75/+Tlai/3 Ko9lN6/jdeYKZUMwpkd7+C3mWz7ooGMm+h1TtgNQ9tTsUNdmPx8QOnA9RuiKSZIktbtj 6QjpjSKZoY4bK2ktzJk04WjWhUmAtUjMt7/Mc0rskoNLg6o/JbNDeMA3QvE/qj7/Q7AS q6Lg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=gtVuFr80RE9vKYlDQHjBebTWHzHKVnfzkxa0FcUYx8E=; b=YO8/9UnoxDc4dunggvjLh01zHindnhGWvVD+iWh6kdKMoipHAH5uZxqlbtr/YmAhI6 YmGpteqsmglXwUDQHt7RFGvFlOvY+M/A9+7hEBL7npjpa8zqX2En4Dnovzg/cP5I9EI6 dW2zlzSFfa33byGeD6rEdLz0JjOQuf/QQOzhYBGeEq8u9YBz9ljCtcv9/zVLukIYLHU4 1muvUBOhBg1YHZwd5gvkYXxuEIxcBE0bGXrHjW4fo5LeRcu9qpaApRVPNlX1QhBMCv7d s1LpqOdxkFgLZdkuMQQc5eOVlHeXYbA701g1KvCchGpzzwmcrJiY+AB5c0vcjYGevoOF 4JkQ== 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 c12si4328620otp.310.2019.12.05.05.06.01; Thu, 05 Dec 2019 05:06:22 -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; 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 S1729438AbfLENEP (ORCPT + 99 others); Thu, 5 Dec 2019 08:04:15 -0500 Received: from www62.your-server.de ([213.133.104.62]:59854 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729146AbfLENEO (ORCPT ); Thu, 5 Dec 2019 08:04:14 -0500 Received: from 29.249.197.178.dynamic.dsl-lte-bonding.lssmb00p-msn.res.cust.swisscom.ch ([178.197.249.29] helo=localhost) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1icqni-0007Pf-Bq; Thu, 05 Dec 2019 14:04:11 +0100 Date: Thu, 5 Dec 2019 14:04:09 +0100 From: Daniel Borkmann To: Alexander Lobakin Cc: Paul Burton , Hassan Naveed , Ralf Baechle , James Hogan , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: MIPS eBPF JIT support on pre-32R2 Message-ID: <20191205130409.GC29780@localhost.localdomain> References: <09d713a59665d745e21d021deeaebe0a@dlink.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <09d713a59665d745e21d021deeaebe0a@dlink.ru> User-Agent: Mutt/1.12.1 (2019-06-15) X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.101.4/25654/Thu Dec 5 10:46:25 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 05, 2019 at 03:45:27PM +0300, Alexander Lobakin wrote: > Hey all, > > I'm writing about lines arch/mips/net/ebpf_jit.c:1806-1807: > > if (!prog->jit_requested || MIPS_ISA_REV < 2) > return prog; > > Do pre-32R2 architectures (32R1, maybe even R3000-like) actually support > this eBPF JIT code? If they do, then the condition 'MIPS_ISA_REV < 2' > should be removed as it is always true for them and tells CC to remove > JIT completely. > > If they don't support instructions from this JIT, then the line > arch/mips/Kconfig:50: > > select HAVE_EBPF_JIT if (!CPU_MICROMIPS) > > should be changed to something like: > > select HAVE_EBPF_JIT if !CPU_MICROMIPS && TARGET_ISA_REV >= 2 > > (and then the mentioned 'if' condition would become redundant) > > At the moment it is possible to build a kernel without both JIT and > interpreter, but with CONFIG_BPF_SYSCALL=y (what should not be allowed > I suppose?) within the following configuration: Cannot comment on the MIPS ISA question above, but it would definiely be a bug to build a kernel with neither JIT nor interpreter. If a JIT is not available, then there /must/ be the interpreter as fallback to be able to run BPF programs. > - select any pre-32R2 CPU (e.g. CONFIG_CPU_MIPS32_R1); > - enable CONFIG_BPF_JIT (CONFIG_MIPS_EBPF_JIT will be autoselected); > - enable CONFIG_BPF_JIT_ALWAYS_ON (this removes BPF interpreter from > the system). > > I may prepare a proper patch by myself if needed (after clarification). > Thanks. > > Regards, > ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ