Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp863760pxb; Sat, 16 Jan 2021 09:33:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrLrTmNnRIRRWzJQzIWp560rm57tcFCsOvgvppsvZb7mIhonIfV1DV2M1Xrw0N7ktbLLWs X-Received: by 2002:a05:6402:37b:: with SMTP id s27mr13658439edw.266.1610818386449; Sat, 16 Jan 2021 09:33:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610818386; cv=none; d=google.com; s=arc-20160816; b=g6W8QMtGXdkBY46Wco2FvCBahNCvrOLZrIhjawCVi2F591v0MmxddMRmVs3xd3l8AZ BZScueUuTnJx8EYAAhyheKBqjVrTSqHr12xuSpj+KQxgataxT5ZdCY1kduYpZZ8Rs4M7 J+idy7pmYfXQEvkZR8yiR6Y1j5DmsMX0BYQET3Kr+h9YgWmoqugnmArKqU+zxUi++ZEU SARP659hzLR+p7cLPoCXzTyu3ZB1b0DMk52MM0P5DquiTCxTY0d69ojpfDq6aoJDhKhE bf7XGATpXSjrR+wZZ0w0a+JVlumZaOiQt5o45paIkTLpGw1pcyflbjgjH9iMTf3uhq7x T9hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=EZcb4JPboRMaIJED6qHefe7v5f3cTWgIwS+L2+WZgls=; b=AM1RTD2PvCnWxfRtNvY4YwVvmUzcBDl3gSGYSwj9WMgmtLEDx1jEy/TyOGsDTeV1Ng sK2eZyy7h6yaJ+KvsTE8NkoKa+q80zJRhlb0HE9AeTFP91X1ZbvtrwfWekfOEa06qK1P WhBmw2S/2HkXll0TpFza+darlt8HXOKz+q1InA1XjP1r7dgVV+1mPfCz2Zg1x3PhHoXS iL46mQIahcfAZg/b6nqQ6txScdIsEPvtNoZyDLArLRAnjkUHovuPkpwiNvkZhPZ7jjIP ZBjOOJ/lCYDpLRoRI6s6RfvPd4+Exc3G8TtX5zYXguc6w9B/7jYJFiNxjTOJKB7GiGb/ uL8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=LSNpXC3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si4094205eju.191.2021.01.16.09.32.42; Sat, 16 Jan 2021 09:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=LSNpXC3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbhAPRav (ORCPT + 99 others); Sat, 16 Jan 2021 12:30:51 -0500 Received: from mail-41103.protonmail.ch ([185.70.41.103]:57994 "EHLO mail-41103.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726957AbhAPRav (ORCPT ); Sat, 16 Jan 2021 12:30:51 -0500 Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 150E52000A65 for ; Sat, 16 Jan 2021 15:03:33 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="LSNpXC3d" Date: Sat, 16 Jan 2021 15:01:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610809327; bh=EZcb4JPboRMaIJED6qHefe7v5f3cTWgIwS+L2+WZgls=; h=Date:To:From:Cc:Reply-To:Subject:From; b=LSNpXC3dm6RptrTUPwvFgxXyRviBwprpEyfyXbpJ/SB1HEwiG+8pj5VWQztrLQT1k O5Ac0LtvC2waSTef8PpY12pNjTmyW3ZDMU7WLGbhn+QzmJiE9scuOy6NWcSubrygsg OMHAANZDAgeYRbThwrjb3I4AXgYTn2rWmeYQs6jYTzy9ASUnWGiGgyFxHtj0TxlQLe 4omepypPI+WeJHviQNXjTQwlpansq1CRghc2fse3zblGnpkJJ1HrB/5ptQT3y/VWGh 8hBRQuot4X8SJydRCnIqKgogwF/mHRZu+siUqHnKFOtxvHLpdNYsBhq/JpPwxiYHp8 bnkQ7j0lcJX9g== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Nathan Chancellor , Nick Desaulniers , Kees Cook , Andrew Morton , Mike Rapoport , Alexander Lobakin , Jinyang He , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH mips-next 0/2] MIPS: optimize relocations processing Message-ID: <20210116150126.20693-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series converts the logics of two main relocation functions, one for relocatable kernel and one for modules, from the arrays of handlers (callbacks) to plain switch-case functions, which allows the compiler to greatly optimize the code, so the relocations will be applied faster with lesser code size. Tested on MIPS32 R2 with GCC 10.2 and LLVM 11.0 with -O2. Alexander Lobakin (2): MIPS: module: optimize module relocations processing MIPS: relocatable: optimize the relocation process arch/mips/kernel/module.c | 109 +++++++++++++++++------------------- arch/mips/kernel/relocate.c | 54 ++++++++++-------- 2 files changed, 82 insertions(+), 81 deletions(-) --=20 2.30.0