Message ID | 20231011083132.2428720-1-songshuaishuai@tinylab.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp384710vqb; Wed, 11 Oct 2023 01:33:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHZ0VzTM3U1Pg1o8pp95yoZ8Y/wW5a5VYZaggg5R0F2waMK2iYxC/HkwRX5MZgmGSyW7+U X-Received: by 2002:a92:dacc:0:b0:34f:b824:5844 with SMTP id o12-20020a92dacc000000b0034fb8245844mr20055197ilq.3.1697013208859; Wed, 11 Oct 2023 01:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697013208; cv=none; d=google.com; s=arc-20160816; b=Gdgp+VlYiXQdoQGNTtLzipWsOWw0fKd6/EoCspuj64AjJ+4Ps8W6DqKV3MAWOPWPtz 9pdCVO5sUdjLPsQihqyunSM7ewQNXX27lr8GP4mscG5RMk6FBDGXG8XcuumvKfZ630UA IcFfdzi4B/9IhkhcIJjlBXbKFyvo4BUPr0M1nMWYHoXfYspcT46Iiv2c9ofn9xoU0mss JoY6i8eCcnuG3Chdw7dscIXzCmVTW47JCES4DD/M+ebuttEgw+Xtq5KanI+8vjf0+7V1 BzdCDRYoUTSdiBy8M12Oq5Yqws7t7vxpRPalUZ35dKUdpGHcf/saOU3Umw7aVDb/xua/ R00w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=6sgoJ21PNrjl6oZmwFd94ckplkAaJTaQt5UHbdL1LJ8=; fh=DlYutkg/6Wkat5B72kLfp99kToTYZ2djuWDJ1GjZ1/g=; b=XkAxDumWDnDzJ1aOeCQpNzeLR/ML7odje0w9a96mzD7aVxqE5/gY0j6Y3aQJnBsXNj t39mbnP7QjHOOxC4srggNeoWCg5X//AtpySnFb+/UO4PEX/63Cwvw++H8kTZ4+JODbCm AC0yuLD3jzgwkvqCIar63opwaIh8gLOhf+eDsus66676noluZ2V681ro9Rdf2Esb+ugB YPpK1yZVxEtTPiO5Fb/bT8c+E48t3j8xOpzR8RMegJiVnq50IBfYOzkBYX/6aABl2kAp lUNBVJqScAglDwwqzWS9Yfu9xF1urCmpXHE4HtJc/asgnzin0s0qHlOwDcrZdCOfMxT0 ilJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f24-20020a656298000000b00578aa7b0e03si13599651pgv.695.2023.10.11.01.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:33:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2922381B6A8A; Wed, 11 Oct 2023 01:33:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345456AbjJKIdV (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Wed, 11 Oct 2023 04:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbjJKIdS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Oct 2023 04:33:18 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4EB694 for <linux-kernel@vger.kernel.org>; Wed, 11 Oct 2023 01:33:15 -0700 (PDT) X-QQ-mid: bizesmtp79t1697013121tlm25yi8 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 11 Oct 2023 16:31:58 +0800 (CST) X-QQ-SSF: 01200000000000B0B000000A0000000 X-QQ-FEAT: C46Rb8GPIEdRSjq04tLpVIm4rBqIg5ZDlkNPqFv6Y1o3yJcnC8ZRmxn2xUPbG 5aqHDTFlNXyfj9EkRqGPEVLCeEME8D4N5AzoJUCDAT3UjzV5Z0ci7+03OQwZkTZLsqT64MD T3ppIzbnyfGx1e8sgzAkoZrig0RpTYyQD70vxYnOf7jHBi+18d9R9W2t1SXwMwkehA42LUA epsjv/QxJYlIW/iExD63iNaVCDclscyD3+WHo4bG0As7W+VaJPI7hyDtJ8Oa8EPnaD3XSoS KixdppXwX0rrquohicpmRPgk0rYlV8M8UJVN2n6X81C8Q48pgjLEM90fTs3637yXkF2X+5w rwxmvRrV2vPyRNqALNrym8K18haX46uW0fzwoZlSB7pU00ib60YvCmV0srlyg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 15077306528228941013 From: Song Shuai <songshuaishuai@tinylab.org> To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, conor.dooley@microchip.com, lihuafei1@huawei.com, songshuaishuai@tinylab.org, petr.tesarik.ext@huawei.com, duwe@suse.de, ribalda@chromium.org, akpm@linux-foundation.org, keescook@chromium.org, hi@alyssa.is, heiko@sntech.de, alexghiti@rivosinc.com, schwab@suse.de Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org Subject: [PATCH V2 0/2] riscv: kexec: cleanup and fixups Date: Wed, 11 Oct 2023 16:31:30 +0800 Message-Id: <20231011083132.2428720-1-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz4a-0 X-Spam-Status: Yes, score=6.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_PBL,RCVD_IN_SBL_CSS, RCVD_IN_VALIDITY_RPBL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Report: * 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to * DNSWL was blocked. See * http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block * for more information. * [43.155.65.254 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 3.3 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS * [43.155.65.254 listed in zen.spamhaus.org] * 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL * 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, * https://senderscore.org/blocklistlookup/ * [43.155.65.254 listed in bl.score.senderscore.com] * -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) * [43.155.65.254 listed in wl.mailspike.net] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record X-Spam-Level: ****** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 01:33:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779447322238977038 X-GMAIL-MSGID: 1779447322238977038 |
Series |
riscv: kexec: cleanup and fixups
|
|
Message
Song Shuai
Oct. 11, 2023, 8:31 a.m. UTC
Changes since V1: https://lore.kernel.org/linux-riscv/20230907103304.590739-1-songshuaishuai@tinylab.org/ - the old Patch2 in V1 had been merged to riscv/fixes, so take it out of this series - Patch1 : replace `.align 2` with `.balign 4` as Andreas suggested - Patch2 : fix the conflict caused by commit a72ab0361110 ("riscv/purgatory: Disable CFI") riscv: kexec: Cleanup riscv_kexec_relocate (Patch1) ================================================== For readability and simplicity, cleanup the riscv_kexec_relocate code: - Re-sort the first 4 `mv` instructions against `riscv_kexec_method()` - Eliminate registers for debugging (s9,s10,s11) and storing const-value (s5,s6) - Replace `jalr` with `jr` for no-link jump riscv: kexec: Remove -fPIE for PURGATORY_CFLAGS (Patch2 : the Patch3 in V1) ========================================================================== With CONFIG_RELOCATABLE enabled, KBUILD_CFLAGS had a -fPIE option and then the purgatory/string.o was built to reference _ctype symbol via R_RISCV_GOT_HI20 relocations which can't be handled by purgatory. As a consequence, the kernel failed kexec_load_file() with: [ 880.386562] kexec_image: The entry point of kernel at 0x80200000 [ 880.388650] kexec_image: Unknown rela relocation: 20 [ 880.389173] kexec_image: Error loading purgatory ret=-8 So remove the -fPIE option for PURGATORY_CFLAGS to generate R_RISCV_PCREL_HI20 relocations type making puragtory work as it was. Song Shuai (2): riscv: kexec: Cleanup riscv_kexec_relocate riscv: kexec: Remove -fPIE for PURGATORY_CFLAGS arch/riscv/kernel/kexec_relocate.S | 54 +++++++++++++----------------- arch/riscv/purgatory/Makefile | 4 +++ 2 files changed, 28 insertions(+), 30 deletions(-)