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 0886AC7EE2E for ; Mon, 27 Feb 2023 15:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbjB0PRc (ORCPT ); Mon, 27 Feb 2023 10:17:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbjB0PRa (ORCPT ); Mon, 27 Feb 2023 10:17:30 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F92B227A8; Mon, 27 Feb 2023 07:17:29 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 3E8BB92009C; Mon, 27 Feb 2023 16:17:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 3BB0192009B; Mon, 27 Feb 2023 15:17:27 +0000 (GMT) Date: Mon, 27 Feb 2023 15:17:27 +0000 (GMT) From: "Maciej W. Rozycki" To: Johan Almbladh cc: Jiaxun Yang , "linux-mips@vger.kernel.org" , linux-kernel@vger.kernel.org, Thomas Bogendoerfer , "paulburton@kernel.org" , bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Subject: Re: [PATCH 1/2] MIPS: ebpf jit: Implement DADDI workarounds In-Reply-To: Message-ID: References: <20230222161222.11879-1-jiaxun.yang@flygoat.com> <20230222161222.11879-2-jiaxun.yang@flygoat.com> <7CAF04EF-FC1D-4BE1-A639-92D677525C63@flygoat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Feb 2023, Johan Almbladh wrote: > > > DADDI/DADDIU are only available on 64-bit CPUs, so the errata would > > > only be applicable to that. No need for the CONFIG_64BIT conditional. > > > > It’s possible to compile a 32bit kernel for R4000 with CONFIG_CPU_DADDI_WORKAROUNDS > > enabled. > > Yes, but DADDI/DADDIU are 64-bit instructions so they would not be > available when compiling the kernel in 32-bit mode for R4000, and > hence the workaround would not be applicable, right? If this is > correct, I would imagine CONFIG_CPU_DADDI_WORKAROUNDS itself to be > conditional on CONFIG_64BIT. That way the this relationship is > expressed once in the Kconfig file, instead of being spread out over > multiple places in the code. It is: select CPU_DADDI_WORKAROUNDS if 64BIT It only applies to 64-bit operations which are not used in 32-bit code. Maciej