Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1681594ybz; Thu, 16 Apr 2020 13:35:06 -0700 (PDT) X-Google-Smtp-Source: APiQypKJvWm0wQH+SiVUo0TEiIBmK8V2sR74racufmUTq+aBvvc7RmeQlJZk2cWOrX/4yvjINhnI X-Received: by 2002:a17:907:b11:: with SMTP id h17mr11989867ejl.371.1587069305880; Thu, 16 Apr 2020 13:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587069305; cv=none; d=google.com; s=arc-20160816; b=fY2xkVjy2Jh0NfqQh8ANZ6hBrJPlLFpPz740GOPQEfGPMRXBmQu3U4PpB7H0+YVink ysahAgFBwV4dhdSTLj47HwNUI45NjRSSyT/gymSS1dlfhNFGT4SWs/wKK2fsrTOIuyUQ 5CyEB1M31Jtx4JnItFNDRTbsf8RBOrVPHTPE1QOuU3ThDlke8uvyXzVWNDHdBcE6jlsq YlqIuttCK4LdnsIxN0ggyzTLKygf4fNAg6XgSbt8JSTQNA2BcRaERxMnwNBggyO4FLSR t/j0V4k2B2qliITnpKbioBw7iCDBNo3oZQ1LuRwyiyzAMln49X80pBj5YQIxRComB8vP aTYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=imM7gqSOmjnj0wLJRzezT2h41SI88XC5LjGCQYHrvNA=; b=hrk8qRo3eLHbJLw2WY9Vctf1rQPDO8lqKzm87F0Yt5O09pbTY4jwqqqf29edeoHGCG +juE7TFHG3VHqi+7bSVnxEkHKh/8dwNjmCMVd2XPLaH+zKT7f9GAgSugTwdGC2P4xbbA mXedse1eEngpBmwIRbgXamGdR3bYvigb1tvQEQz89IPl9STkvZ3HrQmzyrNrs3BFILpj RZ1sjfaaFIxUXxYIV5nNbPwCFEnVgbtvo2+rGcpBgrK4ngfDKUstHwPslO3S8WNLZ9pT ZHsNXl4cFVyMBdxbvTz0a0qa64w2kFY1F/d54jO6tMQkk36qi0MF4wj6D0FV0RHPtXUQ +DQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw21si12426208ejb.158.2020.04.16.13.34.42; Thu, 16 Apr 2020 13:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439406AbgDPPNw (ORCPT + 99 others); Thu, 16 Apr 2020 11:13:52 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:43544 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395067AbgDPPMc (ORCPT ); Thu, 16 Apr 2020 11:12:32 -0400 Received: by mail-qt1-f193.google.com with SMTP id z90so16606157qtd.10; Thu, 16 Apr 2020 08:12:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=imM7gqSOmjnj0wLJRzezT2h41SI88XC5LjGCQYHrvNA=; b=AYjrBysu632X4CYN38xkeaCnbPj1dQEo0rNA+77p95vZQHenGv1jEfzaIyAGZNzGFc +akHzWEmHU8ZXwq4FwHFmfF+bYn4j2XJOZi+3JblObHPw5wib0kPReEHWu8JxpuSfCOI FxhHIhal8f54LasOYnRBYOZskYHuC+ggd+xQ/e0+rOoTtxl5hsbRU+AiZIrZWeJeb0ap 2Au7IDoyfz20JLUvhVRO9GH3OzLwWpS3t4L5/nC847W2DB/bx1UFGWM2G8TTI0atMNKE STIw+HMd739MHkQrijslIwDa2ovj3SP3uYQUNRbQ8d/OnMknsrLCXSVUeZRP65ZBOCtc 3aJQ== X-Gm-Message-State: AGi0PuZdyb6FoBawFSND/j4dBI0dBio6spHCuv/qle57XCDHFZ6O+1Vh u0LWAZLYi5TJFlJgRLz9w24= X-Received: by 2002:ac8:45cf:: with SMTP id e15mr27114418qto.21.1587049950302; Thu, 16 Apr 2020 08:12:30 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id c207sm15252197qkb.7.2020.04.16.08.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 08:12:29 -0700 (PDT) From: Arvind Sankar To: Arvind Sankar Cc: Ard Biesheuvel , linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] efi/arm: Remove __efistub_global annotation Date: Thu, 16 Apr 2020 11:12:25 -0400 Message-Id: <20200416151227.3360778-2-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200415221520.2692512-1-nivedita@alum.mit.edu> References: <20200415221520.2692512-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of using __efistub_global to force variables into the .data section, leave them in the .bss but pull the EFI stub's .bss section into .data in the linker script for the compressed kernel. Signed-off-by: Arvind Sankar Reviewed-by: Ard Biesheuvel --- arch/arm/boot/compressed/vmlinux.lds.S | 2 +- drivers/firmware/efi/libstub/Makefile | 7 ++++--- drivers/firmware/efi/libstub/efistub.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index b247f399de71..b6793c7932a9 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -78,7 +78,7 @@ SECTIONS * The EFI stub always executes from RAM, and runs strictly before the * decompressor, so we can make an exception for its r/w data, and keep it */ - *(.data.efistub) + *(.data.efistub .bss.efistub) __pecoff_data_end = .; /* diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 094eabdecfe6..45ffe0822df1 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -100,8 +100,9 @@ quiet_cmd_stubcopy = STUBCPY $@ # # ARM discards the .data section because it disallows r/w data in the -# decompressor. So move our .data to .data.efistub, which is preserved -# explicitly by the decompressor linker script. +# decompressor. So move our .data to .data.efistub and .bss to .bss.efistub, +# which are preserved explicitly by the decompressor linker script. # -STUBCOPY_FLAGS-$(CONFIG_ARM) += --rename-section .data=.data.efistub +STUBCOPY_FLAGS-$(CONFIG_ARM) += --rename-section .data=.data.efistub \ + --rename-section .bss=.bss.efistub,load,alloc STUBCOPY_RELOC-$(CONFIG_ARM) := R_ARM_ABS diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index bd0b86b63936..a92d42ffd9f7 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -25,7 +25,7 @@ #define EFI_ALLOC_ALIGN EFI_PAGE_SIZE #endif -#if defined(CONFIG_ARM) || defined(CONFIG_X86) +#if defined(CONFIG_X86) #define __efistub_global __section(.data) #else #define __efistub_global -- 2.25.3