From patchwork Sat Oct 16 16:04:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12563721 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFA68C433EF for ; Sat, 16 Oct 2021 16:12:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3546160F02 for ; Sat, 16 Oct 2021 16:12:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3546160F02 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=mail.ustc.edu.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wkHMy66SN36arBQ7LU7p6yEbwEcCQ3mYsZjpP7IsxFM=; b=ruI4b0JM43aPvo r18GWQKo97dRR6VuCuWa7CLUD/cFMTkkdgdG7WwC6PNAbO0UR9dx212KnZy6RNH4+oz9X0OB1k2SV La2guykxus8yUvel68yxigEYOBZ0pHjJtm+jjU5c7OIfYldZyzm12k82yhKNItzudTWWaRpJ8pgqg hN3UMZHdP6JU9ORAmhVnzBHB5dafo5ooix8dvwQ7XHTG62B25p5V4WtQNf+fX0/QNpHuQV54zMas0 FuaXpQkaiOHtPtz0qZdej/xCxjyfMfglJiqwlWCHGa0ek2FErJ+WgoTM9nfNRc7n/b7lpxb9fB0Jm XmJyMAg/lyF0pZpUnw9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbmIJ-00Ax9Y-HU; Sat, 16 Oct 2021 16:12:23 +0000 Received: from email6.ustc.edu.cn ([2001:da8:d800::8] helo=ustc.edu.cn) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbmIF-00Ax7u-CN for linux-riscv@lists.infradead.org; Sat, 16 Oct 2021 16:12:21 +0000 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=kyrOcKIg6B5/9qJCrvjXWaFpBj53LVwaF/IXPCce9YQ=; b=hFl9QJ02BYmTG /OHR/TBruy9lDRGBpoQJTh7vVUKWqixQU1fhbMrkoAs9oyVVH7eszz4SZ2vzOQDu zIPdmoYLxaaN9zFCJP72b19dtKuJnvMIvAFAIfBs56KcZKyvltFuR4UIJMTkzdHV yz0kOwE0OOcNX5weeU1bgHGnLnZ5j0= Received: from xhacker (unknown [101.86.20.138]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygAXHwfT+WphY6c8AA--.23589S2; Sun, 17 Oct 2021 00:12:04 +0800 (CST) Date: Sun, 17 Oct 2021 00:04:08 +0800 From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Masahiro Yamada , Michal Marek , Nick Desaulniers Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 0/2] riscv: switch to relative extable Message-ID: <20211017000408.4ae9ecd6@xhacker> M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SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211016_091220_121955_94157CB5 X-CRM114-Status: UNSURE ( 7.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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. 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 | 27 +++++++++++++++++++++ scripts/sorttable.c | 2 +- 8 files changed, 73 insertions(+), 40 deletions(-) create mode 100644 arch/riscv/include/asm/extable.h