Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6108886ybv; Tue, 18 Feb 2020 10:04:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwfe5DqXeehbBAeOT+YU+HvNbmoB/ECdpKIMXARoX1RvtCffMj5JmA2HDBnS51XtuC8gxs4 X-Received: by 2002:a9d:62ca:: with SMTP id z10mr416430otk.263.1582049073723; Tue, 18 Feb 2020 10:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582049073; cv=none; d=google.com; s=arc-20160816; b=m0v24KyMT4fvMBUzwTLftuMaTifXmbmfygIgLk7ufizNBK5OSDkAcoivX5EHOSIilc 6fAmp8GIosyMtFw3O0E6ohM0zhPGwLa1BjalNPW6Xt6cCBSb5g4GXldSl8PXicGonrn3 NeKW4u2slV+MnEV51us4zw6326Ki/yMWX3DHHJyi1tMelc38vHiE/SXklnyr/WyC0d3n hBWVPbQKB1ioaim/82LxYodJ0Lzyo//uKbaySp6Wy1KWpNQBG/rYnrSUe5Wky+vXR9Qb QzWy4GOvlnq9ZhAzgjJTaqVy5nDXjtyBwp49SJ024nnO1DO5HAv5GWqjc0O1qS72IyIi L6ag== 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:date:from:dkim-signature; bh=aJ1BGIDBYGzcyK8G8MxbNsnhVp8YW/urTc9MDE4QmZk=; b=B25qe6Gbf1ZQkVB47auBWOQDpaurbNEoU5GONutmaosbo/mN7jZ+KpqJQ26YgMf4PB lR9KJiOAs6icn7v1FPnOiJ030M/+ybKnZLtr/833kz96XPLo8QiNPwiuC3Bgc4RBbQTN nwweWTKncfEnPmNi+7kpxPlmeYgqEQPMk5k06gmm9K0Tr1YuiAr3UHLqQaIKBCMvFsgJ leEE/kcatZ6EOiNbDbBO4oIi0BtXdUuQpDgxPfVWTrNUx5sijAtrVCJ+67yLN3F2e/WC Pij+kSOSPZ/pJs8bCJ22Gs31AtTAkCfjiZRNiqNF6o8eWGQcnGsDWVULjjN2GKS3x1zj XW1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="l0XaU/ue"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si2025835otk.251.2020.02.18.10.04.21; Tue, 18 Feb 2020 10:04:33 -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=fail header.i=@gmail.com header.s=20161025 header.b="l0XaU/ue"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgBRSD5 (ORCPT + 99 others); Tue, 18 Feb 2020 13:03:57 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44623 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726403AbgBRSD5 (ORCPT ); Tue, 18 Feb 2020 13:03:57 -0500 Received: by mail-qk1-f194.google.com with SMTP id j8so4065094qka.11 for ; Tue, 18 Feb 2020 10:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aJ1BGIDBYGzcyK8G8MxbNsnhVp8YW/urTc9MDE4QmZk=; b=l0XaU/uefp36+SJJxTAxnIaHsK0+EPAmXcFPMsLURbl3BQD9ZfmArypV0e3vQyWpt5 Ky0yJzLK4yKBbpcH4pa8ECMGG62FFKlhBP58jHZtjupGfjOX/0PO+/tus06p05upcmWP /xUds2PjQMAPxfdc6RziMTg9cfZixdc5L5vFWd/JnCmsew9zFU9jLMuhvBNAbOkLKwlD xHPVNHsMCkRGyQC7gNFhu/J/bDkgu2PwT6Zrl3ZblPFMlGfTJ9OnizJyV/xyPhPEXNp1 6OjyBxtjL06osCjx/N8bbpeUcIgStdxRn9+9bcm0VVICwHEPXMDNSLzg0Lmu15mtfA3G CzZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=aJ1BGIDBYGzcyK8G8MxbNsnhVp8YW/urTc9MDE4QmZk=; b=P3loOgRV4xfpFptn5Z0BTBAP188D+RxuUDH/MjpsmupnVfSSwoQd60nkueoETm9wb/ 6TdGpj9vcGs5HdjWQkdh5oTz82jWQS4En4p/dJUs2xsV6dnlxZ50aeb8hik2bsTVx2Qr ZM2csAHjAYfl2qLcwmvwWm+Iv35RNG6g5ZGaVrgyRTjkyntVN9ZYlApg+U9lgjSQJvkN xkFWAg9nSI9PXE0yU8yKta0HyhqmEhNSCjp0ifDaXU2DFUcoBONRT1j9iq5EuGBu8ZZS D4duElmoFr1vnKsBSoS4LC6ReMsnp8uQ9GIrYw6wxeruwlqExSr2ar+rD4HewmuXSx3q E4Rg== X-Gm-Message-State: APjAAAUPExXeVR7CwjsCwfJxEUIJjSJE1De8rnshsY6RdY6Oqr203pyr USva9pOtrfDB1+MEddHx/F0= X-Received: by 2002:a37:b103:: with SMTP id a3mr20208424qkf.204.1582049036041; Tue, 18 Feb 2020 10:03:56 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id k50sm2217315qtc.90.2020.02.18.10.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 10:03:55 -0800 (PST) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 18 Feb 2020 13:03:54 -0500 To: Arvind Sankar Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "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: <20200218180353.GA930230@rani.riverdale.lan> References: <20200109150218.16544-1-nivedita@alum.mit.edu> <20200205162921.GA318609@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200205162921.GA318609@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 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.