Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp460413ybv; Wed, 5 Feb 2020 08:30:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzS0bO7RlJl+SVzt+HhZA+/+HrK5tD4fVAqI87fEZ7S0ty3V1DwI7rp+jetuCUW73EZYnCl X-Received: by 2002:aca:3114:: with SMTP id x20mr3587111oix.121.1580920245292; Wed, 05 Feb 2020 08:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580920245; cv=none; d=google.com; s=arc-20160816; b=Lk5XkcvZG7up4VQrtI71HWbia9WeUgiVhUXv++SoOAckJJk4kc0nRxjiZkMfjMLENZ b0Db/L8qYxA40hJe7t5qbDUzk7TIXvZgFUwQydPhjDVbREZzKEFZZCh+9GHZMT8Q/DsG UTmsTHxtKEzu0wntnycJ49LtaTJ7CNU2d9wl8eIpH9qVWcF+f0aM3inRt6kC9nV84sGx yfJBZ8T3vECj3W4LhSM2mZtij7N5JauzkUio7lmHJXT5ufqQKUvefDBFJ4UawCCnbCyg WFFTKDi6P4lHMt+Eu01eGBmF1FSh79Pt49fv4yHq+eSLLdD3UdTdoee8sLwam4i5WSMn dDXw== 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=MsrrVulbZqmpS62WjvEb6sitgf3QvwZDf40VZAyVo28=; b=BztTOA8qfCq34lmajy4XP3EDKtaP+2JUKSAqF/Zzwk/Yc0o/6rVIqJuSc++h8cwApZ 587eniTIHvQrOdgQWfFbdWYjEHnHHLbJcuVjuwHfceQjLwXjoXt9nt5CvAGQRE5gk7Fy hhp2mSzQmucFNRIjjdFbAJHfz9NMQsEDi0DTStokP29TcT43O7SXib98CgCavgjqeYyL 19x4JHerx4lqn54mPJ5J4ilA+CXD1GoygSChnRFMXt4kA0Mpvex7JQPm+JAt3eVQmp0l nK4aK7gqblLgYbuN7DJ+HnQhHbsbhpoSWfAb93ldkW0w92ppoXeP9gqX5S530HR6Fsu0 zl+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=O1RKE5N1; 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 n14si13625570otk.179.2020.02.05.08.30.31; Wed, 05 Feb 2020 08:30:45 -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=O1RKE5N1; 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 S1727083AbgBEQ32 (ORCPT + 99 others); Wed, 5 Feb 2020 11:29:28 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35077 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbgBEQ32 (ORCPT ); Wed, 5 Feb 2020 11:29:28 -0500 Received: by mail-qk1-f194.google.com with SMTP id q15so2433065qki.2 for ; Wed, 05 Feb 2020 08:29:25 -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=MsrrVulbZqmpS62WjvEb6sitgf3QvwZDf40VZAyVo28=; b=O1RKE5N1nT3P3pfqLAn8sWSvxxpXrQISBApODx6VkyRFs0gkEoYGr3H/7DZ+IVDNnu avIbf8wDt4p3lfawFSvf7WYGOyW4JfhT2Hhu7xSem7+DfUdJfIoQws+LuGCQUI/2dHUc u6KIYzPmMbuG/jAqd7TOdYtoseKkqEKhR2LRPUwp554zGWk+39sAwt88ggfvnzTlVs2v e0cp8HXHb3zolfMd704U/xtEJ/0V0POy7y+9HCItSgdhb9UxCoNyS+vDWc60FSQ4RSqD 7f6PfvFa7fIyidLLvatITFI2JGY3Wlan2UOLMQ5rQr1wKYRk5kTmTKE8Q+PCAy5TQEbp sC+w== 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=MsrrVulbZqmpS62WjvEb6sitgf3QvwZDf40VZAyVo28=; b=ViMyBdlcZwybIvJUlKr+sr9LJ7RWj21efNJz7x8Dv9ZorwG4WwjjyUlfRkOxDkUDMW ZiOoRFsFClrXKVErF/SgqUx65ckLehbN/da5wvUzgDRCUg+yMkZakUt4FDCUt/3ZNe5g aa9Y/6JACtT/emujxRUzXLmqz536syRn9Dl8gv2kXkLNZE4A/J4XfX+HkA1/k0XlMUWQ K3DFsSO9U8nSwQUAHKnJwrioOxf6ie+4U40q/aUtO1IrjbYoKSSIPqXkvHIsRu5NZ94k 0t7IwI26arOgCEx9/YINeBG0dPMCtFncvAqJq53SaNFD8ykgAHUMIVuKBnTCkrpeuVr7 tthQ== X-Gm-Message-State: APjAAAVvJexcHqJEgz0ldTB2QxqhaezOy0NwAo86ILkconG75FmqEpr1 AQuzMqJTRmpqJDpMyN0b8/M= X-Received: by 2002:a37:e20a:: with SMTP id g10mr2744394qki.423.1580920165354; Wed, 05 Feb 2020 08:29:25 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id d25sm53738qkk.77.2020.02.05.08.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 08:29:24 -0800 (PST) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Wed, 5 Feb 2020 11:29:22 -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: <20200205162921.GA318609@rani.riverdale.lan> References: <20200109150218.16544-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200109150218.16544-1-nivedita@alum.mit.edu> 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 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