Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp516569ybv; Wed, 19 Feb 2020 04:11:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzRRAM9wC4FfUwc5+FR5lXFv5xOwe1rsK7koGlyo1irH9dHF5/QCbmtR6gIaoDRNAtTRGq7 X-Received: by 2002:aca:1101:: with SMTP id 1mr4394889oir.30.1582114311479; Wed, 19 Feb 2020 04:11:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582114311; cv=none; d=google.com; s=arc-20160816; b=t43n1omueHFUkjDr45Cld00ZByQ0oge6PXvVHQi3mv4nLpT/LajbJRRgf05bby4bDH WSNfWaHpLrNUgYXStD/58/3I8J41WqMs1xjXdTAa+gbWmTWsGCs3HDhviBSDhpvsh6a4 Buycae6LNp53pL/mLyKh7HvkAOhwcEV/MvryfTI4zuNr8t6ys/Gt5Cn/xIEckYPO9pg5 icDk3prB6n4TEtWVtsGPTU5lX6bpfo/En7y6WWhKTfJVqCiLaRCSGwHAS+sF3H1AhBy+ 1UNtFDB+IZfqx5feyJ0CiyMdx3LtsuwVXHB0AGQnkVclltaOg2siOMoUQXlz4K5sXjw0 VkgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tuqPEu/tbXFvguWL1KtLykJwGQRo1OKr9KYZRZEmfcI=; b=LnOcgrOqZSOai8XgjXzi1hyS/R80sYJ3iKqbLcticHmzBlGCgIOSw1/DtyadzBW+KH x6LXPR2mQQamvPJxgKE8MzjpAMdyvd1RSI3tYggGy7/iiB0dC9VGXXWKy370PWYRGjml 4EOZl8SgbbHMwCCoMQL/WTR9DdXEAQ/Tcr5v1dIfM0LXu+5y8+e0ZUx7QEzhBxqFRDF3 VcZcYcEDWGKp1WLZ5j0/7KWa7nllCL55vClL8m06dODvF3VptSjzFtnd6aZWDcRlikP1 21uxKXwZwsG88vdsKEKJ3/UItqhfmdleUwD9ZfMf8MnDOMGzmj8OgUd8DC1fiskzgXD/ 0phw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=FAs1em3y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26si970672otc.6.2020.02.19.04.11.38; Wed, 19 Feb 2020 04:11:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=FAs1em3y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgBSMJp (ORCPT + 99 others); Wed, 19 Feb 2020 07:09:45 -0500 Received: from mail.skyhub.de ([5.9.137.197]:42532 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbgBSMJp (ORCPT ); Wed, 19 Feb 2020 07:09:45 -0500 Received: from zn.tnic (p200300EC2F095500D4116BB2785F22F7.dip0.t-ipconnect.de [IPv6:2003:ec:2f09:5500:d411:6bb2:785f:22f7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E9EDC1EC026F; Wed, 19 Feb 2020 13:09:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1582114183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=tuqPEu/tbXFvguWL1KtLykJwGQRo1OKr9KYZRZEmfcI=; b=FAs1em3yPn+Jl66driUC8qgDm3SC9ltDWfBGeQuO7e2BxK6yOWuggYw7CoB0pGtut6lYHn N0OU4q3YSRQuQdGSYFXRYwh3AeoaZksJv42D8wAvuEcQsVHN8bjVxAaUSHy/o4xxGY8mvO 58oJaR8x7BWBu5wTYTAepJjNBuaCZa0= Date: Wed, 19 Feb 2020 13:09:38 +0100 From: Borislav Petkov To: Arvind Sankar Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] x86/boot/compressed/64: Remove .bss/.pgtable from bzImage Message-ID: <20200219120938.GB30966@zn.tnic> References: <20200109150218.16544-1-nivedita@alum.mit.edu> <20200205162921.GA318609@rani.riverdale.lan> <20200218180353.GA930230@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200218180353.GA930230@rani.riverdale.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 01:03:54PM -0500, Arvind Sankar wrote: > On Wed, Feb 05, 2020 at 11:29:21AM -0500, Arvind Sankar wrote: > > On Thu, Jan 09, 2020 at 10:02:17AM -0500, Arvind Sankar wrote: > > > Commit 5b11f1cee579 ("x86, boot: straighten out ranges to copy/zero in > > > compressed/head*.S") introduced a separate .pgtable section, splitting > > > it out from the rest of .bss. This section was added without the > > > writeable flag, marking it as read-only. This results in the linker > > > putting the .rela.dyn section (containing bogus dynamic relocations from > > > head_64.o) after the .bss and .pgtable sections. > > > > > > When we use objcopy to convert compressed/vmlinux into a binary for the > > > bzImage, the .bss and .pgtable sections get materialized as ~176KiB of > > > zero bytes in the binary in order to place .rela.dyn at the correct > > > location. > > > > > > Fix this by marking .pgtable as writeable. This moves the .rela.dyn > > > section earlier so that .bss and .pgtable are the last allocated > > > sections and so don't appear in bzImage. > > > > > > Signed-off-by: Arvind Sankar > > > --- > > > arch/x86/boot/compressed/head_64.S | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S > > > index 58a512e33d8d..6eb30f8a3ce7 100644 > > > --- a/arch/x86/boot/compressed/head_64.S > > > +++ b/arch/x86/boot/compressed/head_64.S > > > @@ -709,7 +709,7 @@ SYM_DATA_END_LABEL(boot_stack, SYM_L_LOCAL, boot_stack_end) > > > /* > > > * Space for page tables (not in .bss so not zeroed) > > > */ > > > - .section ".pgtable","a",@nobits > > > + .section ".pgtable","aw",@nobits > > > .balign 4096 > > > SYM_DATA_LOCAL(pgtable, .fill BOOT_PGT_SIZE, 1, 0) > > > > > > -- > > > 2.24.1 > > > > > > > Gentle reminder. > > > > https://lore.kernel.org/lkml/20200109150218.16544-1-nivedita@alum.mit.edu > > Ping. You keep pinging. Why? Is it a showstopper or what is the urgency here? This is shaving off some 100 - 200 KiB from the final bzImage, AFAICT. Or is there something more broken this is fixing? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette