Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp950670lqs; Wed, 6 Mar 2024 01:33:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUF5BhAatQgBQIEekstXcczr8JbbpqhHvR6C1kdH+w41xWpttTccyuxNmtK3pRcFZdhdqtcccoDBKZJ8kTrf3hTLG7+DemLcE2FbRP5Sw== X-Google-Smtp-Source: AGHT+IHpkKLCT4fAl0qyR1WmtLwcEeXBHnYSLDVMKaCa8DuT2kjsSTQDuDmLkH/PVl0jpDQTBqWD X-Received: by 2002:a05:6a00:23c4:b0:6e6:217e:b336 with SMTP id g4-20020a056a0023c400b006e6217eb336mr9254934pfc.13.1709717585014; Wed, 06 Mar 2024 01:33:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709717585; cv=pass; d=google.com; s=arc-20160816; b=fWHJVZhqlZhMiHLNGpqkmglS4lFU/32Cxs9jNtIEJrGx36Zre6P4noh1HCnRfdx+3X AD+EbyALUdXv+i13/r9EYupB/TGPvNyx1cCPdMSjNsSR53VGzWQR+eKkHUiYLEDEjYYL MPsU1QU4/oZhM0MhQVzHDfL+eGXYg/xTVIC9gLpTLbyACbwacQHcwJvZCisDFXQ/LkGU nKfELW/5BxyEkoQrrOyYosaz5vijSOaxXM7aDyMktBOy7kcnUQXCFZrsSEpzLOurzy4c 4Lp2Q2HxlDLKZ2pXZLbXtmrERGa+lS150cQtkNVu6SE05R06XFz7TBA9iExiX92YsGdZ 5lVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=1CABJMt4hSO244iW5Glz3DNnS14exaADs5c0BJOhPvw=; fh=u0wR5zzWYmBq2iuzYWK6ApJaOkucXRVOamWDSiv31DY=; b=NXq/jjGopw8H/ybVn6chJ58m3GD0IQtCOC18zzjDvECYEEiH85LyhZ7svLr0bAThEe pUQcNgkrxF7ds1POVHk+kMvEujuLR+TMWZwlKiyl9WswP0QGq3XFPyk/Jb5GPYNE5fPj y69vygpLcksiY4tpuXQ74AXV0Chu5GijI9cvhi/niJ0fiPXSJX44HfC+VSk0edBTEFsx oH7LQXXD2KPz5nwewlN6uEyi/Ps36E8rh8Rz6HXvDpG+NT/Zp+XpNF+r1BhacQ8do/3g gui9v88/WpywuSHajd7Ix0W8CJsxcIoc8T9qDagYqmUaUNtC9xEUlLqVgihkLxXvSx+E Vc3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=ULFJY8yl; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-93586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q123-20020a632a81000000b005dc98dad591si11458799pgq.707.2024.03.06.01.33.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 01:33:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=ULFJY8yl; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-93586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6E8F628E257 for ; Wed, 6 Mar 2024 09:09:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00D1074E17; Wed, 6 Mar 2024 08:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="ULFJY8yl" Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 BA1A260B8D for ; Wed, 6 Mar 2024 08:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715410; cv=none; b=Ytq8ws4BXHCfmiyGeEBbLmk7kIspjM55iamB3ne48EGBtlASSGtbmW+bMVFNmKnbCpVIPnwF9gdGRa0VKOJuMVVGrsKtnqm75xUupnaoLD1KBF4Y30Wy+7HQYUWSPdUz560R5fUQbFir8LUBugMzJ40VqwEyx16G8YYlDsARFHU= 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.210.52 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 Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6e125818649so3462738a34.1 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=Y+a3q0EQFGD+jzGxILB6WO41ItwFN4fXYMAA2eICbnS84L0NTSaZkqkwq2uroNsLFm zYDWGu3GlSRnAjBH8pq9rkuaCa2fVQucLDblbm64uUHI7Dc5HmJlY/54reHD0x499OkE uYK8K6JJvjzqEUpbUQzg+dJy+cX92BZyTOQW1+JUkOU+IMslXz9nUAB3pNk2uDDivgiR tQpntQuJ4gjVr38T+DH/MowvPq/idBgbYfi9Id0cYnNlnP5bwrwxL3STUgf0BZXz/3gI 1/bQn5GQIHLJHQsZpee3NP9NJh51dG+TCF09SUwpZnRUTGXLwIhd+syldoZZoCuwju6n 2Cug== X-Forwarded-Encrypted: i=1; AJvYcCUiJRef0DcWERMRKPtgBpOn0sVvmUQIiR7j6Zxzl72ejhCFWgZtPgupIPd2fDv+weIk7Om3/HmKQiSBN0zUR5x1Utnmh/tLg8xLYHfe X-Gm-Message-State: AOJu0YyOgk5TPZIVPhkDdIosWydUXQds9GdKbQEuEkE9IsiLPSzF7DfO YGV6ISbd4UKgPu+rCZAMYH2sjN1l3CmnwJpN77E5Skv2H6QBRRkTCzmpi6ooDs4= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 -- 2.20.1