Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp788915pxb; Thu, 21 Oct 2021 09:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMxGFHI5MEktLzFY856b2vw/xPb39u6E4F6Em7ovEbJX7ethfkbQmswGxy7SaB7JS9pGEk X-Received: by 2002:a62:7cd8:0:b0:44d:4574:ea8a with SMTP id x207-20020a627cd8000000b0044d4574ea8amr6628572pfc.80.1634833767765; Thu, 21 Oct 2021 09:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634833767; cv=none; d=google.com; s=arc-20160816; b=mmrTg0GVQn/xJ/+3y0HkELOkjczg5SeQmq3NIeTNTV9eUWsKA578DNIMuNcxJsNX53 VybNOCuqjpmask0WU9oHVzeF7Y7bAcFJ8loiddmDH/7IEKVPsYebSASCnSn6ygvV9sQR sVXWEHxvQb4r/6JQLqWrKaDGwNPc4wbcyagBZ/4I13SPBlfY0a+qhtB7eu8UMJOHPwxs fqY4QNZY2hKgVWu6Msrcg7xhl1/m0YZ5XTlzut11sfK7sm6AcJDU6D3adt1T0i3sUK9O xQOPs86HCcYoVawlhOY0DAxj6QkUnNj+INktaNG7leANt7oBaHysxBtD9esleHzdV3Hk BJ9w== 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:cc:to:from:date:dkim-signature; bh=ojZuQOBSTgADKJiIRttyzJLSM9l35UDA4fraSzIPeEo=; b=by+noeN5sAAgT3grgjgz+u1ABYx9fqiomCwvZu5cCoHGt9FqmTIWkt9t2LFHfzAXxs iL2QW95iNx5mmqrY/29wID7RDw88AaOsuX+d7BxRTAy43fVOkJ6LRzZfPhDCyDBi7Fcm V1igBR6NJ2KfPnPUj59HhVaTNsTRjh1FzkRumPT/Rhi3I1+0LtfwmIJynOWilF1CgK+e YG55GAITiR/Vym3H2KJgnBPFHRei6dYsSOD3yDd7bRzC3iA1mV6moBlQn6ilTS0Sgp63 EdoWMUo/JeFJ7y/bZ7zIYCvqeCkRvSxri8sGUP46XC1VBB6odSqAc0pUi+PDysJyLNFF k8mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=ID4N2MvH; 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=mail.ustc.edu.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si8731151pgu.168.2021.10.21.09.29.13; Thu, 21 Oct 2021 09:29:27 -0700 (PDT) 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=@mail.ustc.edu.cn header.s=dkim header.b=ID4N2MvH; 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=mail.ustc.edu.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231853AbhJUQ3P (ORCPT + 99 others); Thu, 21 Oct 2021 12:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbhJUQ3O (ORCPT ); Thu, 21 Oct 2021 12:29:14 -0400 Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A8F2BC061764; Thu, 21 Oct 2021 09:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=ojZuQOBSTgADKJiIRttyzJLSM9l35UDA4fraSzIPeEo=; b=ID4N2MvHUW+Sd Qlu29nygSg1aLzjOJyPFbL0KGD5cgSz1NGmMSLQpV4usZPgrHJZjUWFl//TAUW96 fEdSToR/89rUYIRDaTy9VZjWsnyt+SyXTuzkHnKAVCyOskZhGRYRsXqNLwKIitlw xI8/Hf6WaYgY/RMaRZ7uFNmeNa6bVk= Received: from xhacker (unknown [101.86.20.138]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygBXXzvDlHFh_KZcAA--.17034S2; Fri, 22 Oct 2021 00:26:44 +0800 (CST) Date: Fri, 22 Oct 2021 00:19:57 +0800 From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Michal Marek , Nick Desaulniers Cc: Kefeng Wang , , , Subject: [PATCH v3 0/2] riscv: switch to relative extable Message-ID: <20211022001957.1eba8f04@xhacker> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID: LkAmygBXXzvDlHFh_KZcAA--.17034S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GFyDXryDGry7Cr18urW8tFb_yoWkAFc_ua 4IqF97W3yxXa1SkF9rJrs5ArW0krW8tryDXFWrtr47KrZrCr4UKayqqF4xZw18ZF45ZF4f GrWvqrW8tr17tjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcxYjsxI4VW3JwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z2 80aVCY1x0267AKxVW8JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwACI402YVCY1x02628vn2kIc2xKxwCF 04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r 18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vI r41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr 1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8fwIDUUUUU== X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jisheng Zhang Similar as other architectures such as arm64, x86 and so on, use offsets relative to the exception table entry values rather than absolute addresses for both the exception locationand the fixup. patch1 consolidates the __ex_table construction, it's a great code clean up even w/o the 2nd patch. patch2 does the real job. Since v2: - directly check R_RISCV_SUB32 in __ex_table instead of adding addend_riscv_rela() Since v1: - fix build error for NOMMU case, thank lkp@intel.com Jisheng Zhang (2): riscv: consolidate __ex_table construction riscv: switch to relative exception tables arch/riscv/include/asm/Kbuild | 1 - arch/riscv/include/asm/extable.h | 25 ++++++++++++++++++++ arch/riscv/include/asm/futex.h | 12 +++------- arch/riscv/include/asm/uaccess.h | 40 +++++++++++--------------------- arch/riscv/lib/uaccess.S | 4 ++-- arch/riscv/mm/extable.c | 2 +- scripts/mod/modpost.c | 15 ++++++++++++ scripts/sorttable.c | 2 +- 8 files changed, 61 insertions(+), 40 deletions(-) create mode 100644 arch/riscv/include/asm/extable.h -- 2.33.0