Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1019207rdb; Sun, 20 Aug 2023 13:14:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECO3alTu8dmIbcAmnJD2PxhQcpIxxaueZWc09omYFBUNXdKV9x8k8p6klH7rpZx45bimSi X-Received: by 2002:a05:6a00:a04:b0:689:f586:4add with SMTP id p4-20020a056a000a0400b00689f5864addmr6648029pfh.31.1692562478533; Sun, 20 Aug 2023 13:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692562478; cv=none; d=google.com; s=arc-20160816; b=rjTzV404UYCwjNmuTBU4qfM3qHS5ixl+KcbfjHOgr6ZFKnf97ZiROO+O18HZ7DUV1n rwTY9BKMCl0fSSLN7hqiQjqljiZl2zKkaL7uh26mMgEpdxw+Cph7MEa/4gRd4XDIDqPr r9g2a6ippaZQec/crlRGZVt1yyGEC0m6ezzVWtWe4s4KEfq3a/qSX/5d2DdKjZ21J9pz vvVYgnGyk603wJfY24cZJ/MqnK3LAaENmPok2Mq3xAuOTDq3I+6M2qvgbQ9UXzEzOH1I xjESwIuKBBf5lFDlaOS9UFRl6T+tgw5nUvpb1Z8lWIcJzUjEwOVTY+JbO8+KvIJN8V7u aWZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=05AQ92MSagK5TzWvq0gZCGJQvtjJFwtTDAgyWyisdBk=; fh=2K0cnVWNN/lSoXOQ2Jt2UifFp/1e7O4elwn57wGf9gU=; b=eAODxHEfsoN4TCdC5xF4irkQKvDzYyiSs3/0jNRq4U2x65aAzGL7MlrOXOO1r4Cpjn Xkfju3sxl3EhIY0AiOsEP69wMmITH4VvaquzQWXVt4dY2S4Ofd7N+jA4lpNj+arxLQml jksHeXNLJUOVeBmi5OdEBktJgKWau9QXcvXWW9XLk5jDF4E/AziRWz4Q6B2LRwIJ5k2W tH/SINUCrsnfvy/KflZKZxAqQV4Red+eOxjp0dzH7IkkX0B3PTYW94Q/U1ERVpQ+Ftbu 1/jBW0a9WQQ1kEvWfDH6p/JPfjtg5s+RU3P8BUJmLEhNoVDLsY8JRG5DbLQmekOXUT21 EH5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jxQCnCm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id by7-20020a056a00400700b006872ef079c9si5768471pfb.295.2023.08.20.13.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 13:14:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jxQCnCm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA989255C30; Sat, 19 Aug 2023 11:37:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377269AbjHRNoy (ORCPT + 99 others); Fri, 18 Aug 2023 09:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348157AbjHRNor (ORCPT ); Fri, 18 Aug 2023 09:44:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 018BE3589; Fri, 18 Aug 2023 06:44:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90AC5668D0; Fri, 18 Aug 2023 13:44:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 269E3C433C7; Fri, 18 Aug 2023 13:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692366285; bh=Bdt3dnT3PkezZZXx7wU43uaGt0Ad+1xDJCxtNTUmhhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxQCnCm35VHvjJdE7inNoatr+9zM6kr5y/tyhEqHGTkpXig54SOHXPWcTv3H08vz9 mJb7JEljiE63xypdH5gJ2t3LuUOPF/WGjLMwCJMazwpFsot9ml21BYOyMaZ1t9sYMn YnEyyrhBuGBD4BThYV50hSYLz0hHYMoMG535iRNHFFbuanSFkRmdI601RBVUBilK6f p5B8ghF5x5uc6mYSyliO4NAbwz+O3wbluHnqL1f4UKqL5+RMAmAmDO4cJAznoGvQfS EO8QZOVOVXKzKivNzf6+/ALlARo0I6sog1mPeF4SdTbf3CAR8TNOJvzrCAJFS6aZfn K4Yl6DfvxHG+w== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Evgeniy Baskov , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Peter Jones , Matthew Garrett , Gerd Hoffmann , Kees Cook , "H. Peter Anvin" , =?UTF-8?q?Marvin=20H=C3=A4user?= Subject: [PATCH 01/17] x86/efi: Drop EFI stub .bss from .data section Date: Fri, 18 Aug 2023 15:44:06 +0200 Message-Id: <20230818134422.380032-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230818134422.380032-1-ardb@kernel.org> References: <20230818134422.380032-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1658; i=ardb@kernel.org; h=from:subject; bh=Bdt3dnT3PkezZZXx7wU43uaGt0Ad+1xDJCxtNTUmhhs=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIeV+6bSi3LqslkvT5PemxwrP0Mq4wlqurPd5zelui7dlN 9re8bB3lLIwiHEwyIopsgjM/vtu5+mJUrXOs2Rh5rAygQxh4OIUgIlsYGNk+DR/QYbLjYv9QtLb rWr/rPPkShKoENbqmH/sBvfbgiiNDwz//eJO68vqaSuVc7Y//vdXbGFy9MFNVj8vS86tE5629v0 2dgA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the EFI stub always zero inits its BSS section upon entry, there is no longer a need to place the BSS symbols carried by the stub into the .data section. Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/vmlinux.lds.S | 1 - drivers/firmware/efi/libstub/Makefile | 7 ------- 2 files changed, 8 deletions(-) diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S index b22f34b8684a725b..4ff6ab1b67d9b336 100644 --- a/arch/x86/boot/compressed/vmlinux.lds.S +++ b/arch/x86/boot/compressed/vmlinux.lds.S @@ -47,7 +47,6 @@ SECTIONS _data = . ; *(.data) *(.data.*) - *(.bss.efistub) _edata = . ; } . = ALIGN(L1_CACHE_BYTES); diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index ae8874401a9f1490..8302ba66ef0b3d45 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -108,13 +108,6 @@ lib-y := $(patsubst %.o,%.stub.o,$(lib-y)) # https://bugs.llvm.org/show_bug.cgi?id=46480 STUBCOPY_FLAGS-y += --remove-section=.note.gnu.property -# -# For x86, bootloaders like systemd-boot or grub-efi do not zero-initialize the -# .bss section, so the .bss section of the EFI stub needs to be included in the -# .data section of the compressed kernel to ensure initialization. Rename the -# .bss section here so it's easy to pick out in the linker script. -# -STUBCOPY_FLAGS-$(CONFIG_X86) += --rename-section .bss=.bss.efistub,load,alloc STUBCOPY_RELOC-$(CONFIG_X86_32) := R_386_32 STUBCOPY_RELOC-$(CONFIG_X86_64) := R_X86_64_64 -- 2.39.2