Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1015156ybz; Thu, 16 Apr 2020 00:54:24 -0700 (PDT) X-Google-Smtp-Source: APiQypIMRbNNfjsmUtJM+3/xnRHEH40gaglyHCTkHEFeUZEcE/9zSBhfsv5jEY9Rbfrrj1aT8UIp X-Received: by 2002:a05:6402:290:: with SMTP id l16mr27276306edv.207.1587023664683; Thu, 16 Apr 2020 00:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587023664; cv=none; d=google.com; s=arc-20160816; b=YMeh7CHdmat64qwUdooYgWjQSCGCb8AQ7/b08++htRNhSjxM6t3CcS3hRTnTW/+k9i nH886QFw3AhoGx34r0kZStvgy5KUV4C8WD527dGKP/vGrLC/SzNq4oDu9xkCQ2oxDLU+ VfxUR58aAkejw+4BAlZMd6qa/qJSis7/S1JkM+wb+JFTxk2pFkCULZqJbdYYObwNL3w8 R9wD7Owv/tP8/5viyVWGFe15dUyYTimDKu4vg1rWmfitRq0hLS62Ol42JQnGcbsF6+Fz ast1sV6fh8wMIjvaSAz76o2NkXpj3A/3vm/hJcpZU4RfX8fFeLFdu0kV/JzIqLBTY14S CxwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zyriOISZUIDUeRIEs68jEVaT+XTSff8XZUHnb7W38jQ=; b=CXrylvK3m3SRggm3f/QkSKACEOyvUmkikC9oGvpV4+bCffP9c9DEv9xCfAyaeIfwdp JOZdSDjJBtkkrT+vLbJhx9WJSIZNR2nLPb3kUQl8a4z70Powb9pslhjGX3ZC0unbWxcR Xh0PcSv5QoOkQvdsqSJbhCUkvk5XIfEB0ye1v8JWr3oT8mlPROBgnvqzWAfvt2dCYezw cgDVaYyRWXVAvLbuVeWw9nkOcAkOFiKHUCHf+H2x2Wg/ZXUVaeZ6gXA6iOsIarJ9XhEc LOy4ORatGZ3mIUTU/JoS9Bl9ppuPFiGVw9ODIbfiNFI7WRVYB272D4OSDxyWVeH84agh UgJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KZcD59NI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si9815523eja.496.2020.04.16.00.54.01; Thu, 16 Apr 2020 00:54:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=KZcD59NI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439691AbgDPHuy (ORCPT + 99 others); Thu, 16 Apr 2020 03:50:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:56510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439438AbgDPHut (ORCPT ); Thu, 16 Apr 2020 03:50:49 -0400 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 134A52076A; Thu, 16 Apr 2020 07:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587023449; bh=OFHqz9GYYZNwc+I9swBEm5dzUhRk5QACD1V1CxcDFlo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KZcD59NIBi3fSTJa9R3dm9SUE41lbsKpYBdDP7DYKp2lCFhz+WVORehUZFIWPY6cj 0vgcsAVA8xIEXgiwx8uUO3ae0nXXWMHi0nDPOF8S5JPQCg391UW8ZSfOp4iYiysmLv Xl/X7Mvexhs6KXq+jLXS8bmun/3zNDOV3gU6qZec= Received: by mail-il1-f177.google.com with SMTP id e4so6031637ils.4; Thu, 16 Apr 2020 00:50:49 -0700 (PDT) X-Gm-Message-State: AGi0PuZzqNK4DwGc65TDZeUaD8FldjrbRkB0xvDH0lS/QEleM/koTiyL cIOiFGHBL+4NKfMUFLL83jfZJ0nlcVQUH3vVzSo= X-Received: by 2002:a92:aa0f:: with SMTP id j15mr9438871ili.211.1587023448452; Thu, 16 Apr 2020 00:50:48 -0700 (PDT) MIME-Version: 1.0 References: <20200415221520.2692512-1-nivedita@alum.mit.edu> <20200415221520.2692512-2-nivedita@alum.mit.edu> In-Reply-To: <20200415221520.2692512-2-nivedita@alum.mit.edu> From: Ard Biesheuvel Date: Thu, 16 Apr 2020 09:50:36 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] efi/arm: Remove __efistub_global annotation To: Arvind Sankar Cc: linux-efi , Linux ARM , X86 ML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Apr 2020 at 00:15, Arvind Sankar wrote: > > 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.24.1 >