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: 778406 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 563895FB81 for ; Wed, 6 Mar 2024 08:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715399; cv=none; b=AO0CFQ7GyLQ3z8hfyRv3GPB9LWfnyGugItyi5/tsbyIam7Dc9Sy7zh6F9+mnjOJrDaI4bKagT1U3UkXZb//yQygaUo30Y1eyDoDue+fFzxX+dIxmuFqiHpCQG89WYk/ZyJb9vq8S+v8fB4w1L5uu984X1XFman94Z+ASRdv9SBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715399; c=relaxed/simple; bh=ALSPsCpVA0CNK2wGtP8VKCF7ZyFy6s/GtdM0fjyQOjM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=gSH6jH5wpUDsUgLm1ZV/sXafDBdCOZAj9Z30t6V7yr4Yb1QjBPShnJyFArWe0a/H7BGr4X7OfgmXp9RW7JEL/oXWNvpxj0hNe23gIfMWsqb3+c3PGXeIW+qeW8W8AoLutK3VK++78k+/MXT4N84/mALQHdzprxYvwL+X4/qe++c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=SO7DT2+X; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="SO7DT2+X" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6e5e4b1d1f1so434913b3a.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=vger.kernel.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=SO7DT2+XR1Z4OLsN6CO25OwBa9XsaFkp7GP2lSemHoJuYgPyp4JLPBLuXky1AEsR6G qPFkCZlsPtANynBTpWZbfM2S3FHfS0KFlU0TdY0POs907lM4gizQeIA3+Mmo+0/c9NJj 3xq+aS03liXzgMe+rEOUuufNOvGmOtqvkASbUaTm+GQ66S2GjQ4QhKN7oOCkZX0ddi/v 7tZU5tC0Q384JKC22tsiCy8OVg8s74Pt9ZyVd81BR+rnO+ORAUWasnxqkeylKFaGZmvq pUlrPAdHIt9b/vzIlzftBqwPF/RmOmN1E0n3Sa7Eq4JHI6PlnSVkMU0WJyfLxNkSqAhq uwwQ== 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=akx8BVUqr7U0vcyKIQ5mG3hzIOASja0GYy6JDzOujwZTdfyKCgLpnJGtebMu71wwvj hli6hzkvLPu7jAVS1yifpBvhjeUtI+i/bfT6vsKdsoC6oX6SfgUpV8nAokKcmfmgazAv kX+pHLES+7dYBM7rALvhGRhLEzxFSS8gXeaMiQzcJ1NOdUfeK8Wh4yjMqqyEOvvXOwW/ iWBHPBQYXt6RG2RAdbBdev2t2E2QZ/fgEVhCixYi5CkoFWPX1jLhv2AwF1Og0MLASM0q tLWJaLBGDHF/4Io8Pa9KSxe3RFC3chTjx/NKUyP1KZi8ZI1vlGOHt0W7aRK8vikZmFPl eHdw== X-Forwarded-Encrypted: i=1; AJvYcCW9TQiP2e4mUp0jsYUC4fjKUYyzdQ7r+11sE5yqRmhWEVPDRhQg/8XcQycwi6waCHoNmFKE1+uJQdWNiCiyq7sw85cWImdwcJX3 X-Gm-Message-State: AOJu0Ywowa40MgK+denzHZvOupen0SA19R30zl7wsd1uK24WBy/bRwHR qAYEOMOXGzI+zXVFsrB3x4X8gALPZCHddk/DbJRrEdnfzu6uD3ZORWHCSVLat3o= 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) Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 778943 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6386660B80 for ; Wed, 6 Mar 2024 08:56:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715404; cv=none; b=dSw6vdD8Uv8X7bN0DwOJ0ptSibMBj0ofUhr7TB3BywxIPEGKc1mBdyLywLCUHyb3ygO5xjJFQ5QerbmHH9aNGYAkadOH4U7gRvV8WrhRwSnzE+N/FB5FTQBcSYy14Zrw9FRDnJyXAN9WYwa9iUunRIper9sdeHpgNpXM62ZFGTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715404; c=relaxed/simple; bh=a6eeGsVPbJ4geGSegwTUJJlLAqhxpUbQgapuYeVQNSk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rUSmWrz2v6STP8nIQ049VukY0PEwYVSjJrt2WOrq1SEgSGwFulKnZc5yLsrQ1Q2K4irX+PPtcJx3EX8wWiuMm1A+ynTW54ReNL1Hl4EgYRHtl9rzKDQNaYaFairYaAyi/VhoadN2GmDRu8kk+8/7rSYh2yjHQMSr/XsYrkxidKI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=JXucF6vb; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="JXucF6vb" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6e64997a934so575712b3a.0 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=vger.kernel.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=JXucF6vbVt404QQBuRHWHlD/HxH9/eQ5hH2OSoVPOjV5fZUzaCt17Fre8E3xn3rha8 FNr3iCD330095bPlqG0Y4kUcSQJFCQnXugkhG3LK3lc+0cneJ4xiA/MIcVhWQDpQTYkM OnZigoRTHFv9NNMrcPwDoWUCvlS/UYfbMBA9D/ODVTCVOc9DSS2lkjKZnfXjYImhn7H9 XdTy1/n9TbHYzmxSvp7xuW7DvFYUxxSx5Q4Rqa+d0yJjKawb5NrS86uKOjyAvuYxErJ6 nLyNiwjXHVrvhkZ6ApFQYCPatz4Jdz+o+gPRnLaOAeGLTDuxi1xHQ9H668TpUF7/gbeM 2IlA== 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=DSvGM2rEJXuVFLy8QF2iJlHXLYPgg1A9xIFbZ8QfAznD9tqA8pTgtf+TgpRZ1yRYEB ZzXqbLhS6s+n/wTiWfBiKbx4SBv+oRtHPmmGcOH3GucxJZ5zPjDwG2U62d7xkMHEtFxJ IFOvxIa7iMZhkqjbCIksrvnP5mgbYCpJuJfAlvBPyO8JBy76300ymIlq4ZkGpNZbI2PW XYJvQ7pd6p5kfArrkrp4y9g3V37uFC9JEVb9x+xTXRCPtl9qWo/k5oYWLPef3akBsUz3 cBZ/Re7JyICoGEkEdumsfMtyp+BlkA8LDw+eClxe7RQaCE0t9Gnzr0760QjY3BN1ieW8 hn3A== X-Forwarded-Encrypted: i=1; AJvYcCU061lgFeZoMPLemReRtxkNBc8yDdhpAssV01k869XHcRVIwiPrKZjQbKj76YYs3gttzxh6I2XFO9cE6Pe3+NlvN+2djvlpL3Uv X-Gm-Message-State: AOJu0YwTLwAgwYk3PXN6pRpffs8yBpcFlFRwolcZxbgiLYIm4q8os2J4 T7TJptLQetKWskivNWpl63oL5+WPysVlhsTSsmINB2Ht3N2PzrGP6dcaLpvYVhY= 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> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 778405 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB07960912 for ; Wed, 6 Mar 2024 08:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715410; cv=none; b=WiqyIGgkVQRMsp25VqbCxmPyW9FyiXUWEt7J4jVChvJiAjIEbqZ8Jlt5E17HHU0LeeKsm9//tyEhayfW6mlj0w0uM5k/yoj57JfmNxzrCohDuGM4s5r+vlglpxtlqhKclFSbkLIznqSsC0ZLKdXYU9jxFWCQeMijS0FJhPhIrc0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715410; c=relaxed/simple; bh=5PaOQohqxvp2+MT7niO+peIr/2hmdAFE5UfHwQ4Ukws=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Mvm7IUpMmKitHUg3RwVbxv+7KPwy6obncsZ7OEdc0uIBVVhcNAlzGaz0GDk6P3oPer8XNP3oLMjykKJSjB0GxDmLwIL+0Kzfw/vIJSFXzhgpEzLIzWYLXRkd4tlH/VEcoBSwOovErKAUouUq3K0MT/kMlipFAqfFMQHrAV9R7Ic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=ULFJY8yl; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="ULFJY8yl" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-21f0c82e97fso4191043fac.2 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=vger.kernel.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=ULFJY8ylDjBgKKt/Wg0/xtbkvfomi2pAmc3fbrLuQPCkAqtDQwGzAm7Q0mUHzQOsdj DMPwBWObGn0POhIJlb6liPmoePrS6j2CZiCtmLiaSKGrCSI/0PxdVasK9BF0qly8m+HE //ONfWOQAXSfz9Jj4tLyQF6knxEsiPbAtiz9+BZU2Tab9xqev0KHcmdgxj6ShQ9Xpdxj a5bCyhUl0m2Zb8tz4f2Cs5KVv+6iV5aToGjXpa7XajXah6PTMvzvEL8kieh5SSjHRg8j vZrZF9v9E67NrC36fhjMYB8A+AYNsb5he05z4KKTam6MuGhPUoYro73NL8hKbEz81Jx6 RmkA== 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=Eb4WCzyRrto92JCj4D/BaZ7Htk/v6Gx0+RXczCPw4SC9dVi8GN81CZ8yKx7DRLi03a odfHum9sqKy5CzTZOIpbVMfFYSpZVD6imWGRGiy2ZxT5AqDXLbG50H8Xf6lz+zUUywwE Dn/aLSjFvIqmAnkV3G+cyLeHXflFeOMnkDQHYzBJR7CQtrUaMnVD7nsmtAQQ22oWHftl JfYdhskoeQaIcxdOIqpS3j79vz3ka1D0OQH75p+zCgwMMP1QrCdSfQQSIKuRqW/RmOQ7 IW5KCSwKGmvMa3F87VXssuFa8h7yC9xkerorV+Lb0PEVMJTgaomHCpBBZv8YybOL5plv lmOA== X-Forwarded-Encrypted: i=1; AJvYcCXx0pUC8Ji4Ocu+r9cgcdzXK3o2i8MelaPZAf7bg8nE/ESjq+/wTMF6bDlTPz1fZ0aq1VvJ7cvg+F4B62+Jz51n19PKb5w65A5V X-Gm-Message-State: AOJu0YzWpV0e2loPfxSe/Al1F1s0S8yC/Urqf7fVzY0gTh6NM5t95FIT R7eieM7rIuqMD98gnVvMJiVbB+Ln2I+fDyzm4fXk3c3HEPkHaXCq/LPUAr4ur68= 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> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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