Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp786303rwr; Fri, 5 May 2023 05:10:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Rdi0HpeUigLWBOLpOOkbmGvXWOjoYIKTQdnJ1B1fmaslIGfj9HWuj1wZATFXYb68CiDp9 X-Received: by 2002:a05:6a20:2452:b0:f5:7035:99fa with SMTP id t18-20020a056a20245200b000f5703599famr1605679pzc.57.1683288631049; Fri, 05 May 2023 05:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683288631; cv=none; d=google.com; s=arc-20160816; b=EHxKboXF7Ke7YL54v9+IdqudIofeyQ8z8w6GlsOZ475Q+s8GjTqfCixE+a/Hzyh0rh UlRS2OBCSdiAEEPouz6cjq0JfhOQpQ5kKPhhDzqZg0FC1AwghYg61443DskYW/Z4H8cp UDtXkaeIHIc6zeejDGFLn6ntA8rMl0Kd4u51YNOf7H5zRKel13W6lfxcadje0+WypnJv 5TSmg7M1Z2vdoh1JAWqG6tMFFwqLTxTxugqk0lEE5QbHDlSr3oCkCk+yz9oVjepowLWE 0stGuQJx1cdlpJnmqhZHiKeEMzpZRARAKXnziOvwRYgprp+ZYkJB80bd7pUL0XzCQott x8MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:feedback-id:dkim-signature:dkim-signature; bh=LAgUMsID5w2avzf9PFHv2O+viyYgaFw1o+NMLyWqG60=; b=N4LA5jI4u2LOUjMbsDoexbV8dUFxnbCOBIrOanRqF/TYSu5afcfCVHvysFnsxsNeUN 6WTFZGclVG2Np2iUgU5gNdRPR0WA9o4KCg/gdrmaI0stzNgKJuXEJGwUTPjUyLWZQLPS dbLwMRdZVlN9Pf5VvB0G4l/P9X/sZjuZ2NofNXJR0yrGxh/lFJ+UrZhp84uQgwyITd3R oj5nt6Pq+gBWJkpN3THdalECTqdrn5CuzpFUfzg8M9FrPQA9H228DPBvaY4mBcaROvvE i+pD7dRMxh2S1jHAgC/lGftFl44wwGAEDt6+8/L3DcQvPBJ6svTM6WZYF3viFjkytQg6 FIxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="H/bh1YSV"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="XylrgE/F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a63b20e000000b005131739af72si1760417pge.755.2023.05.05.05.10.16; Fri, 05 May 2023 05:10:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="H/bh1YSV"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="XylrgE/F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232083AbjEEMEk (ORCPT + 99 others); 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) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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