From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C759AC7EE22 for ; Fri, 5 May 2023 12:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232093AbjEEMEk (ORCPT ); Fri, 5 May 2023 08:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232069AbjEEMEh (ORCPT ); Fri, 5 May 2023 08:04:37 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D0C39EDF; Fri, 5 May 2023 05:04:32 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E468D5C02C1; Fri, 5 May 2023 08:04:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 05 May 2023 08:04:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1683288268; x=1683374668; bh=LAgUMsID5w2avzf9PFHv2O+viyYgaFw1o+N MLyWqG60=; b=H/bh1YSV4eq+4ZpRFAv55gNbJuhPtakE72182LsFotC8j2DgTIu oXRjQ3r1ylDPH9UnBsOZZUYBJmGYmQXCLMb6viGJomasYQWeHOwZ7dDuiEThl3F4 CyrqrwejtER3OgqzazlYNnLJhDNIoHOb6Mfqd7GOpfW9CUMA/t43ruOSI/KrvBse pb800EY/VOQmwZufAWJ/nOZoIJtk1yB1d32srLnvHxD+Tu4pp7JYVsL1sMwg9VHl jgmplK0vxqzEjENNnL3IGOgAT4r0JewN+T+3OMNhOPq+Z+TiD9QkcQ2Wws/0LxwM fSi/CQ8wBV7wpYIKsNQsKVmOEn6gs86yfnQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1683288268; x=1683374668; bh=LAgUMsID5w2avzf9PFHv2O+viyYgaFw1o+N MLyWqG60=; b=XylrgE/FzpOkXP/38f7IkiLZCII9CBUuA/C0RjqY0nZtqr0hqGf Er7A6zovX6ZSrGHXF06ocW3kOCRuzgOv/xGTpJulhNQTKVfxt29zjaa/G5iJ0lqt KjSvcMrONnO05OBuI0KS1as3b1P1THDQtH+bFBQ1TSitaRCdy1iLQZuoZ6uZcCsU 3fs1C2g2OqupuruP9j2k+QzxXlssNm28Wvpje/URAZ16jYRL1vR/naHswlqJhY+r /hSL662sDvMg09gEMJKGchvUNrJO9Iba3QU4HIxjJK13TJGD+HT2B1hke8LID+l2 Qy3IG/BJhm0l+wH8ALOK1YVSFRQvxAiaVBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefvddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepkeevieelveeiueekveejgeekfffhffekkeeikeejffdvkedt geevfeejuefggeegnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 May 2023 08:04:26 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: [PATCH AUTOSEL 6.3 08/59] bpf, mips: Implement DADDI workarounds for JIT From: Jiaxun Yang In-Reply-To: <20230504194142.3805425-8-sashal@kernel.org> Date: Fri, 5 May 2023 13:04:14 +0100 Cc: linux-kernel@vger.kernel.org, "stable@vger.kernel.org" , Daniel Borkmann , =?utf-8?Q?Philippe_Mathieu-Daud=C3=A9?= , Johan Almbladh , Thomas Bogendoerfer , Alexei Starovoitov , Andrii Nakryiko , "paulburton@kernel.org" , "linux-mips@vger.kernel.org" , bpf@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <50FCC591-D86A-46A3-AF4A-DD68D2FACC78@flygoat.com> References: <20230504194142.3805425-1-sashal@kernel.org> <20230504194142.3805425-8-sashal@kernel.org> To: Sasha Levin X-Mailer: Apple Mail (2.3731.500.231) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 2023=E5=B9=B45=E6=9C=884=E6=97=A5 20:40=EF=BC=8CSasha Levin = =E5=86=99=E9=81=93=EF=BC=9A >=20 > From: Jiaxun Yang >=20 > [ Upstream commit bbefef2f07080cd502a93cb1c529e1c8a6c4ac8e ] >=20 > For DADDI errata we just workaround by disable immediate operation > for BPF_ADD / BPF_SUB to avoid generation of DADDIU. >=20 > All other use cases in JIT won't cause overflow thus they are all = safe. >=20 > Signed-off-by: Jiaxun Yang > Signed-off-by: Daniel Borkmann > Reviewed-by: Philippe Mathieu-Daud=C3=A9 > Acked-by: Johan Almbladh > Link: = https://lore.kernel.org/bpf/20230228113305.83751-2-jiaxun.yang@flygoat.com= > Signed-off-by: Sasha Levin Hi Sasha, I think this patch should count as a functional improvement instead of = regression fix. Please drop it from stable queue. Thanks Jiaxun > --- > arch/mips/Kconfig | 1 - > arch/mips/net/bpf_jit_comp.c | 4 ++++ > 2 files changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig > index e2f3ca73f40d6..edc7d8790f1e8 100644 > --- a/arch/mips/Kconfig > +++ b/arch/mips/Kconfig > @@ -64,7 +64,6 @@ config MIPS > select HAVE_DMA_CONTIGUOUS > select HAVE_DYNAMIC_FTRACE > select HAVE_EBPF_JIT if !CPU_MICROMIPS && \ > - !CPU_DADDI_WORKAROUNDS && \ > !CPU_R4000_WORKAROUNDS && \ > !CPU_R4400_WORKAROUNDS > select HAVE_EXIT_THREAD > diff --git a/arch/mips/net/bpf_jit_comp.c = b/arch/mips/net/bpf_jit_comp.c > index b17130d510d49..a40d926b65139 100644 > --- a/arch/mips/net/bpf_jit_comp.c > +++ b/arch/mips/net/bpf_jit_comp.c > @@ -218,9 +218,13 @@ bool valid_alu_i(u8 op, s32 imm) > /* All legal eBPF values are valid */ > return true; > case BPF_ADD: > + if (IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS)) > + return false; > /* imm must be 16 bits */ > return imm >=3D -0x8000 && imm <=3D 0x7fff; > case BPF_SUB: > + if (IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS)) > + return false; > /* -imm must be 16 bits */ > return imm >=3D -0x7fff && imm <=3D 0x8000; > case BPF_AND: > --=20 > 2.39.2 >=20