From patchwork Wed Mar 6 08:56:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yunhui cui X-Patchwork-Id: 13583627 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6D526C54E49 for ; Wed, 6 Mar 2024 08:56:53 +0000 (UTC) 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:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3eyJyFrhwortC83dT4OTVgCbAdZoAFv5Zzuetpf4M3Q=; b=YsaNWJ42eBSiKd MvRHvY3Mpgfdy1IBU3gZiED0IRlrjTyMdHJfg6WvIhUNxICnIkFkUvknSRkEjq6p4MOsmXhxLQF8t M5UzVug4EhynbVSS8OOFDyw7jD9ChG/uDL0X/xqOgFQ2pDVjiHw4YOTwJjc7aTXhdwas8Ovfpln1M NZaFSCjHDMifJEdutoHcKYWPj+9K6jAOdPlQCL9Y2MprEpTglxKYdFfMLjqE44m0fTojyYizAzbr/ 0Xqc2U6rF0U4i+a0tYrjCuVyaNGy6r7vNRm/1MZhu+QEBSKayWN+ct4ffn8BiIXXpgVopbsY9YOul /y4JDxWCa1SN1U6qE6Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhn4w-0000000H15z-45Ju; Wed, 06 Mar 2024 08:56:46 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhn4s-0000000H126-4Bss for linux-riscv@lists.infradead.org; Wed, 06 Mar 2024 08:56:45 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6e5dddd3b95so484601b3a.1 for ; Wed, 06 Mar 2024 00:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709715398; x=1710320198; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=miJgmmft5IPBYmaXSyen84BtDBnhdyu7bBvtRv7/vGE=; b=cZ+ZvLRsLseO50N5i54xSlMSA69dKDYEavSXY5HQHmFcNm/UvafbhNBxAISaT1KEnZ M70TuLYotnxBOZRxn5LH9MuIrjxtyjynnZO8mnNh0ah67CDsTTBK3noK2OSe811Rb/Zj 8jYl0qXF4E+JXirEgxP4LO2b3spftX1TalueRkEKFL8RulcX6POOY2EQ5ipJJdhhi3Ln tdJxVVADIV6oLJ6FKMuMw+2DNPeI1H08K+Os7MlaCswAhrIVq+G/ouNHpBP6lr1KBf2i +Yj1LHBNu794hu6EXkLF5SOf/oyxN96ExYTASN83jfKrJsWJ5BDE1Sf/icwXxEw25IqM ezhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709715398; x=1710320198; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=miJgmmft5IPBYmaXSyen84BtDBnhdyu7bBvtRv7/vGE=; b=ThV8sEgDrjL9cQFhtAnzfw4V8tMvGyqk0t5yyhGWpXhI8JTtWlk4AaFo4npZOLVDiO UtrMHcpaJUoyXTm6mW3Ua39mV0S5s8XBIhp45uioau2ELB4yDDz6SZ84ESRZKbOnvHE7 WQs7BxLFwYzseXRO87yIcaZRrbo3p9k5GHhSqrBFKJ2F4eiLeP/tF+ztEPOhOOkyzAq4 deASZ+NVImSR+dO3be8WxeOZaPQWykklKsi7zc35ugsAilEsjG49LBKjW7cJvwPfAEbm x/6b4T5fuNPRduZQGERjFHz5+1vE3Gozq0A8021ugNsEk4xpl/uhiPqHygXO5419ClVl fCvw== X-Forwarded-Encrypted: i=1; AJvYcCXj68K8dUOKu7Uh11AU/Ryzpw/ZH+Q6QAlxO2ZupW8dmGvwu91TJhQV1J+eDRDVYgJpl4Ba/L2+1avG2Hnxje9Hb4auctaamkCxgzrDnqei X-Gm-Message-State: AOJu0YwegQFBp8+LGzHgq0Lga/uocxSZZUnT/nfXzhL4gVJmHh3S3JJB FSXUJkaPBw+YewUsewX7nV/auqiv2zM9D9MzrUAkCaCdgpFlZxodtAcLD2ooeEk= X-Google-Smtp-Source: AGHT+IHSPWMWnSqJ94igWDFx0dxlS6jl64WPFzIgP3y43hLTZHJR/pVyi5tFhE8JE9eK2c3TtONwHQ== X-Received: by 2002:a05:6a20:1442:b0:1a0:eb43:421b with SMTP id a2-20020a056a20144200b001a0eb43421bmr5447236pzi.28.1709715397698; Wed, 06 Mar 2024 00:56:37 -0800 (PST) Received: from L6YN4KR4K9.bytedance.net ([61.213.176.7]) by smtp.gmail.com with ESMTPSA id o74-20020a62cd4d000000b006e58663dd0asm10740071pfg.110.2024.03.06.00.56.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Mar 2024 00:56:37 -0800 (PST) From: Yunhui Cui To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, ardb@kernel.org, cuiyunhui@bytedance.com, xuzhipeng.1973@bytedance.com, alexghiti@rivosinc.com, samitolvanen@google.com, bp@alien8.de, xiao.w.wang@intel.com, jan.kiszka@siemens.com, kirill.shutemov@linux.intel.com, nathan@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH 1/3] Revert "riscv/efistub: Ensure GP-relative addressing is not used" Date: Wed, 6 Mar 2024 16:56:20 +0800 Message-Id: <20240306085622.87248-1-cuiyunhui@bytedance.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_005643_322420_70AC309F X-CRM114-Status: UNSURE ( 7.21 ) 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 This reverts commit afb2a4fb84555ef9e61061f6ea63ed7087b295d5. Signed-off-by: Yunhui Cui --- drivers/firmware/efi/libstub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 31eb1e287ce1..475f37796779 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -28,7 +28,7 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \ -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \ -DEFI_HAVE_STRCMP -fno-builtin -fpic \ $(call cc-option,-mno-single-pic-base) -cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax +cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE cflags-$(CONFIG_LOONGARCH) += -fpie cflags-$(CONFIG_EFI_PARAMS_FROM_FDT) += -I$(srctree)/scripts/dtc/libfdt From patchwork Wed Mar 6 08:56:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yunhui cui X-Patchwork-Id: 13583628 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 62679C5475B for ; Wed, 6 Mar 2024 08:56:53 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YFeGAo3uFJgRCAYhwZIC5lhJ3AuQxflEQDjEueqkrfk=; b=25L+yOBkwuVdXz ZflPeHQgMAKWOVxOstXJjTsX3NdliBBOgbUC49zRtacJCglm7bOthjiD7WgTuZGXXgU82OSffBaA4 HyH+kCi/176SrnJSR2H8wn++1kMw3EmG8CHLXS9YEXhd/ldCG6DqgujhQrxJHE02Qb3FGsFaC7bjs C9JF74Xlq0HVzLwkzC+91FN9yunIQuiXaR9Y9jjohB6koPQo1H85hvchQYjngnMAdV5gKE1seLNDy 3R8SuqtJpajxrNN3EmZCIr0CA7RaKkuq365Nuu+YW5DRqHT+59GGu2+pbrAcjouyxOOnVGmsKNZZT gWG5pJ75ObGSHHSGn1cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhn4x-0000000H16I-2n1f; Wed, 06 Mar 2024 08:56:47 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhn4t-0000000H13m-33pH for linux-riscv@lists.infradead.org; Wed, 06 Mar 2024 08:56:45 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6e6082eab17so3118349b3a.1 for ; Wed, 06 Mar 2024 00:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709715403; x=1710320203; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vRr7LxSbEFR3x5uzGtBz3X+EqjDvEmVPS57p5cg+Ap0=; b=FdsdE2V93mwENFmfuV08gQWnGff5Q6QnIYSlnCFJDVPXSgDyV9701oAIuwtot1ysu+ SHQGoKczPzM5C2UATmyskjzu2yYYPBzL1jvQQdhHgF53TlZo4rdh13jOMq+qdIVkuaMC Zyh45rSYBDhs78kyiMUefuTBwg07yYAly34Qk7FTdy0dadx5m+dPpYx4COuTCF+9xQAg u3VO9tsWN5SgYILEIRFgtOQ5fz0GvI9D3AUGkm+/wFIVrCetjNNtFFEXenipex/Vt7Fl a88dq1WXPult/bDp14ib5FyoL9SLZJpXKyBtyX5qCLoCSys070VOKb/Eficx197Lh0CL SBTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709715403; x=1710320203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vRr7LxSbEFR3x5uzGtBz3X+EqjDvEmVPS57p5cg+Ap0=; b=LNtSDWfcS2vP6/A/wbY0ksRjv/g8+c/TR7S9MRCK4kzRtpd4szvJdp2xGEiiZLxJSd lG0BseLsKMTUCxchQZe6ajL+XeKj2hDdBaNb08/StjjFUXsCh+SzY4AyXU3dgNLucQC5 lfU4DPa9n59t8GUeK3jYBtnvTOOehnWB5YvhbUrU/leER9Q3P5nicEm8nolYGbnhwbA3 M2r1nE2+aHPSM9C9/hxMAOYXwhzE93imfsQnQ6mFOx1UcJu0wBRL9SY2XiUFcB/RbE+U fRXlWeewmHp3CnT2aS2FVdvlS1Gc2xgzlfecAyLdK3Y+Gzs/Nwy31644W+9EiF4FZFKl uHog== X-Forwarded-Encrypted: i=1; AJvYcCX/1qRoMBBrwACq4uG0IV7DlKlMd9FzOd0mjL99GmDRQOtThcXiX3VLuw5oj49lgdhUHRzwq8b4dJpASSwzWhT8exsDDgFymezdVvPeKkVn X-Gm-Message-State: AOJu0Yz51WMLaVYlhd76mQeAPVIX3ZlnQaXZO37NkuZzZlne6qfu0VTR thm2QlHVifdBMETRhEfkI3Gua1fdYWSD2QzNnLxIA3TCh3W5a3zFxZv49vfzT2E= X-Google-Smtp-Source: AGHT+IEzhVmTzXyIgnGWoxvhwL9j1MSvK9SInEe+8cuDZjgq6TdrkmluNqbtPfM9F2D3l0tBwG18Eg== X-Received: by 2002:a05:6a00:2354:b0:6e5:80a4:2ff2 with SMTP id j20-20020a056a00235400b006e580a42ff2mr15831466pfj.30.1709715402744; Wed, 06 Mar 2024 00:56:42 -0800 (PST) Received: from L6YN4KR4K9.bytedance.net ([61.213.176.7]) by smtp.gmail.com with ESMTPSA id o74-20020a62cd4d000000b006e58663dd0asm10740071pfg.110.2024.03.06.00.56.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Mar 2024 00:56:42 -0800 (PST) From: Yunhui Cui To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, ardb@kernel.org, cuiyunhui@bytedance.com, xuzhipeng.1973@bytedance.com, alexghiti@rivosinc.com, samitolvanen@google.com, bp@alien8.de, xiao.w.wang@intel.com, jan.kiszka@siemens.com, kirill.shutemov@linux.intel.com, nathan@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH 2/3] Revert "riscv/efistub: Tighten ELF relocation check" Date: Wed, 6 Mar 2024 16:56:21 +0800 Message-Id: <20240306085622.87248-2-cuiyunhui@bytedance.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240306085622.87248-1-cuiyunhui@bytedance.com> References: <20240306085622.87248-1-cuiyunhui@bytedance.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_005643_787456_77CF5D76 X-CRM114-Status: UNSURE ( 7.55 ) 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 This reverts commit d2baf8cc82c17459fca019a12348efcf86bfec29. Signed-off-by: Yunhui Cui --- drivers/firmware/efi/libstub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 475f37796779..a223bd10564b 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -143,7 +143,7 @@ STUBCOPY_RELOC-$(CONFIG_ARM64) := R_AARCH64_ABS # exist. STUBCOPY_FLAGS-$(CONFIG_RISCV) += --prefix-alloc-sections=.init \ --prefix-symbols=__efistub_ -STUBCOPY_RELOC-$(CONFIG_RISCV) := -E R_RISCV_HI20\|R_RISCV_$(BITS)\|R_RISCV_RELAX +STUBCOPY_RELOC-$(CONFIG_RISCV) := R_RISCV_HI20 # For LoongArch, keep all the symbols in .init section and make sure that no # absolute symbols references exist. From patchwork Wed Mar 6 08:56:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yunhui cui X-Patchwork-Id: 13583629 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A64C8C54E49 for ; Wed, 6 Mar 2024 08:56:55 +0000 (UTC) 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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z/tl8lYR5WdacnSp5F8yabhZvZewvRXoKRqA5IYLhdE=; b=cNVelw2Nxi8WZd fjSv8YbRmNFBMxVqzcCB4yVrYiYB4RjYdXytm9DHAsPszcb5FD9q+10GQZN1LKFadiWBLdoFdJWfy /TSK/deorkJRSxu5zcXRYN0MTVN0dl0mgYOfZo8dFUaJ2zDg18Ega0ySUxO9KRvz/0HcS+inaNoo0 fH4hXXQbcJFuIr9Cy3DTMaNueL+gayyN+Pqt/4nubSAHdnMLt3/F92704Ek2B+gc8Hw5U1fLxyt8r tFhxcUfNNq0Em4/V4ps6cxzxi0Oelv2uLO/OXCf1qVgQJcV7cmWINXsUfTN8KV4nFkMMk7flFMhNr rTZidjq98fBY7AM8735A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhn52-0000000H17t-2BYS; Wed, 06 Mar 2024 08:56:52 +0000 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhn4y-0000000H16b-46mj for linux-riscv@lists.infradead.org; Wed, 06 Mar 2024 08:56:50 +0000 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-21fd5eb7161so2808498fac.0 for ; Wed, 06 Mar 2024 00:56:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1709715408; x=1710320208; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1CABJMt4hSO244iW5Glz3DNnS14exaADs5c0BJOhPvw=; b=VQvzmRkVNc4kJOiwHJXZa3MMePfuE+SArdQ4nasneiwKsoIPYi61BL0qyg++E86xdG fT2Nz7+EqFiQm6TXq/up+mxtUGS/7wpF94EvlWl1pMsJ6dlHO3yN5ZoQuC4RplXa3/x/ nSMhThFkJM3feAqv8LzrC6BIUvlbU4R9iHGe4BO8mjd3rlKgdsiKIRNCTMnf8iSv5cFH wTmBje/DKTZp+if2CCcIlPi9sJPg5H9c0+JxVzL2YSBA6V9nJP2LL8+mCDpYMYzv1AqP 7B7MeO43sV4H91ON/hgliDOxVrO3/Fv16Jld9F9d76yYDDq6L4T1zM7YWPyLv/bVZ+v8 SM5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709715408; x=1710320208; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1CABJMt4hSO244iW5Glz3DNnS14exaADs5c0BJOhPvw=; b=wwQF8ZqXF61TDEnVtwmrBaSu57fEBd3LP9F+uFsDZEyk2DHMb9Faq7W/YJjyShRkRp +4kFlwLydkhFBYM2biikdFANyiwRPj8W4JVpEUeAZsTwA99DuR58SOgwHc3pSRsrxROv 32HGvgJ668oPl8XRH/rCKsYFRdYOfugR83hid3YTb86KucvHj2tP+ZoxcJ6ZFlDmAWIf 5AX1LELKQuB+n3bYQfxripOZeoYVFNKIHsqM0h/dhMC2rmO/J84JP32jTxiEh6vJBSn4 +lVQP9eXhXjjCRM0kBIheHtXB2Ez3BwmlhbMqpQ11P1SBGl6y1Ca1S5sZHK/LIQqQcSL +A6g== X-Forwarded-Encrypted: i=1; AJvYcCW5HcRjiX+AlPVUJnmzTVp3TCCSkXm8MwSBE23/Qz7FaFkFlxZDByRiAWoyOt9VunNPAK6at2al8kuNzKua893qcTYnmpGZAVuCKYGHLNlE X-Gm-Message-State: AOJu0YxkbxxAd2I1w9i7Ug74G2z8V4eg2P7M6ezRvUJsxEQV91oR2eyH QeMFk1FQdAkhpTRhvLwUG3H73Cv6ttU3jIY/ce3tn5ZdFJDZOwXHtjyPQZfF6gA= X-Google-Smtp-Source: AGHT+IE2BdBcL6wdxX3LfFe6ila1xwesEmOhKWIXEUQRU2u85mQlRvRPcTSduuuATxjh6RtMEQbedw== X-Received: by 2002:a05:6870:819e:b0:21d:e28a:fb14 with SMTP id k30-20020a056870819e00b0021de28afb14mr4580959oae.47.1709715407767; Wed, 06 Mar 2024 00:56:47 -0800 (PST) Received: from L6YN4KR4K9.bytedance.net ([61.213.176.7]) by smtp.gmail.com with ESMTPSA id o74-20020a62cd4d000000b006e58663dd0asm10740071pfg.110.2024.03.06.00.56.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Mar 2024 00:56:47 -0800 (PST) From: Yunhui Cui To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, ardb@kernel.org, cuiyunhui@bytedance.com, xuzhipeng.1973@bytedance.com, alexghiti@rivosinc.com, samitolvanen@google.com, bp@alien8.de, xiao.w.wang@intel.com, jan.kiszka@siemens.com, kirill.shutemov@linux.intel.com, nathan@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH 3/3] efistub: fix missed the initialization of gp Date: Wed, 6 Mar 2024 16:56:22 +0800 Message-Id: <20240306085622.87248-3-cuiyunhui@bytedance.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240306085622.87248-1-cuiyunhui@bytedance.com> References: <20240306085622.87248-1-cuiyunhui@bytedance.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_005649_039190_AEDFE3F2 X-CRM114-Status: UNSURE ( 7.69 ) 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 Compared with gcc version 12, gcc version 13 uses the gp register for compilation optimization, but the efistub module does not initialize gp. Signed-off-by: Yunhui Cui Co-Developed-by: Zhipeng Xu --- arch/riscv/kernel/efi-header.S | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/efi-header.S b/arch/riscv/kernel/efi-header.S index 515b2dfbca75..fa17c08c092a 100644 --- a/arch/riscv/kernel/efi-header.S +++ b/arch/riscv/kernel/efi-header.S @@ -40,7 +40,7 @@ optional_header: .long __pecoff_data_virt_end - __pecoff_text_end // SizeOfInitializedData #endif .long 0 // SizeOfUninitializedData - .long __efistub_efi_pe_entry - _start // AddressOfEntryPoint + .long _efistub_entry - _start // AddressOfEntryPoint .long efi_header_end - _start // BaseOfCode #ifdef CONFIG_32BIT .long __pecoff_text_end - _start // BaseOfData @@ -121,4 +121,13 @@ section_table: .balign 0x1000 efi_header_end: + + .global _efistub_entry +_efistub_entry: + /* Reload the global pointer */ + load_global_pointer + + call __efistub_efi_pe_entry + ret + .endm