From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 982B8C3F2D1 for ; Tue, 3 Mar 2020 19:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D3C82073B for ; Tue, 3 Mar 2020 19:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583262708; bh=Gm97G7ePTvTA/2qImrmMfXs4ah+ywyggwz9iheWgI34=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=RjTwPahbVpcfH0LQ+5lsAAjFakBEoLnuvg7c5S6gAf8TIdjARQjzfona7ds3CjLqq XeLPiBKuLToBAGKXdRL0J9OfSXAl7xtd8YpEZDckKBFIirzA3cS8QHivsT45I124vt 3GpLcDlOXN6Qxs+nOsZZf1Y9JEnHEz7Q1gfnrKyg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728467AbgCCTLs (ORCPT ); Tue, 3 Mar 2020 14:11:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:47206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729586AbgCCTLr (ORCPT ); Tue, 3 Mar 2020 14:11:47 -0500 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 9610F208C3 for ; Tue, 3 Mar 2020 19:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583262706; bh=Gm97G7ePTvTA/2qImrmMfXs4ah+ywyggwz9iheWgI34=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=zFNEdwSvQ65AQQj+EjXhFKyKnE4i/lJyYwLSS+ADHBpVaPtUkoLFAiyvHSC1cKiJh EYfrrxQmOXeBXtbvN9MopG2vxijGaxFQ4mmfFvLPzqxTudAwxoAj2HOPArIUTQ/Xaf L5pahdot351ChS+RD22FpHcjnYJhEpnrtZ3tQ/J0= Received: by mail-wr1-f41.google.com with SMTP id v4so5833528wrs.8 for ; Tue, 03 Mar 2020 11:11:46 -0800 (PST) X-Gm-Message-State: ANhLgQ18+daACKm1LWd+5zcdDGyHP8j6blVzYXUfCs53JivEi3TfQvlG +5VnIXIwVtoiZ5LL8mNVznob9uW1Sh8BGJVRZrY3EA== X-Google-Smtp-Source: ADFU+vvZpcv2G95Un+H8kNu0mF7hau3OQ+mlltuZfwIGzpAzdyWYqEdm4ZULNNH/bCnKgBNOLgwTiI9R4qt0HDehXj4= X-Received: by 2002:adf:a411:: with SMTP id d17mr6691415wra.126.1583262705029; Tue, 03 Mar 2020 11:11:45 -0800 (PST) MIME-Version: 1.0 References: <20200301230537.2247550-1-nivedita@alum.mit.edu> <20200301230537.2247550-4-nivedita@alum.mit.edu> In-Reply-To: <20200301230537.2247550-4-nivedita@alum.mit.edu> From: Ard Biesheuvel Date: Tue, 3 Mar 2020 20:11:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/5] efi/x86: Add kernel preferred address to PE header To: Arvind Sankar Cc: linux-efi , "the arch/x86 maintainers" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Mon, 2 Mar 2020 at 00:05, Arvind Sankar wrote: > > Store the kernel's link address as ImageBase in the PE header. Note that > the PE specification requires the ImageBase to be 64k aligned. The > preferred address should almost always satisfy that, except for 32-bit > kernel if the configuration has been customized. > > Signed-off-by: Arvind Sankar > --- > arch/x86/boot/header.S | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S > index 4ee25e28996f..0d8d2cb28fd9 100644 > --- a/arch/x86/boot/header.S > +++ b/arch/x86/boot/header.S > @@ -138,10 +138,12 @@ optional_header: > #endif > > extra_header_fields: > + # PE specification requires ImageBase to be 64k-aligned > + .set ImageBase, (LOAD_PHYSICAL_ADDR+0xffff) & ~0xffff Could you call this image_base please, and put some spaces around the + > #ifdef CONFIG_X86_32 > - .long 0 # ImageBase > + .long ImageBase # ImageBase > #else > - .quad 0 # ImageBase > + .quad ImageBase # ImageBase > #endif > .long 0x20 # SectionAlignment > .long 0x20 # FileAlignment > -- > 2.24.1 >