Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp754502ybz; Wed, 15 Apr 2020 18:14:05 -0700 (PDT) X-Google-Smtp-Source: APiQypKAXQlY+T/JCYrVuMmKN9mDimfWD3snKaZXfeQVl5meHAjer3MKdxkDAhzIcX7LnZ6/LHxu X-Received: by 2002:a17:906:9494:: with SMTP id t20mr7216805ejx.51.1586999645527; Wed, 15 Apr 2020 18:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999645; cv=none; d=google.com; s=arc-20160816; b=U5HCbTg2eFNvBBnwcHUtHku/xHHcCxclGo+sT3ijFPGx7dH0SxYIOUdXciMUravbIZ DM8VITyQl20vM/gCYqL6wSmZxQeZSLtC23EXA+ijyCEwwQ7QghD6Vgs4sIz0EtQ0dKVu yYFOwttsI0Qc7+80IXk0hI0HZHZqE+FSBrAcLt0C17tLACwhvkmA6WmxNj7ry0ftmTo5 A1gK9zlng6lEBolF8rWX6XZcmtgLUuOrF1SU4/CJZ6GTtBLH02qFwuCLpxKF1w+PE1bz QRPHGwZUSdRB0v25ghF9iWb85Be1ESdWaR/VRPS6zgQOTmKUZM+h91htS+jCRqm/UxnI pdpA== 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=Q+WCTPxC8MtmwIEzjkAHtcw6Iyj7SzDEM2KrEeYU91g=; b=lkDJfDk4Oj+LEyepNUm+YV0OGomtmwGL295hYDd9DaEa5G41DDUT+n+R5GYC71y57l cSiho03JZSBS0Hpi/NiMPJr7DTdKpj1PED9F/DtJ5JU1Wc1fJHfosMXt4mNHKTULfpkS 6lnGWJRkjyZxXakSnyPecTc2Gg/wqCoirH6h2C2P6BUXvreyh1Ob4OX68KDdb4KnLVaB oMQP8Zc+jXRNpyaGDP1XnPZwJqWzaFbB5kkuJTm+qk4PwfJGJpCF4LV66Dh3uwI5eCoF Ght25FMuNgFN4bCeNDJNkhJQXSj/lAc0uDvrP1CiIu4HN1e+zfUtuiheMy6tDQMM0akO H+Rw== 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 dn24si11929762edb.602.2020.04.15.18.13.43; Wed, 15 Apr 2020 18:14: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 S1731413AbgDOWPn (ORCPT + 99 others); Wed, 15 Apr 2020 18:15:43 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:44186 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729157AbgDOWPY (ORCPT ); Wed, 15 Apr 2020 18:15:24 -0400 Received: by mail-qt1-f196.google.com with SMTP id w24so14815942qts.11; Wed, 15 Apr 2020 15:15:23 -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=Q+WCTPxC8MtmwIEzjkAHtcw6Iyj7SzDEM2KrEeYU91g=; b=Cql9riM97qXFYt7vFVW6ugy0QOPzMXGYTsVFCXrDFWG29bbjF79bXbLGC2prPTjIuN QKWPDnAttsSWmaRRFLAu6IttBCoY+KCdCye26cmt2j1xlqsUh6hXKXCtsD577doYTLHG tWD/OvAebCWLRz7nLOlDdh5OO0OlWJHLaYQpbkjBkkr1l2pxNuXA4WPJLvU0KFQDGN9b FgQXrQlCapiJN8cI0Vl8CRIWuLhwz8Kn1yPhYd1kanxalyg3cs6HSW7tzfNgqJDRQYTf VkW6ehdJfZJ9YnV4Pha7XwlF56qoKXAVb80PeeAwFkz7K9gEvvpH+mux/kNfS0G/vb35 tdUg== X-Gm-Message-State: AGi0Pubn/SNU/wJupidCEKUY0/yMWTR8H6hKv5sLHFJqdANM9U2zh4k0 1OE5V+2xjRZ8KdJPojyXefI= X-Received: by 2002:ac8:2272:: with SMTP id p47mr18126911qtp.297.1586988922280; Wed, 15 Apr 2020 15:15:22 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id i20sm13264340qkl.135.2020.04.15.15.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 15:15:21 -0700 (PDT) From: Arvind Sankar To: Ard Biesheuvel Cc: 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 1/5] efi/arm: Remove __efistub_global annotation Date: Wed, 15 Apr 2020 18:15:16 -0400 Message-Id: <20200415221520.2692512-2-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 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 --- 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