Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8858646ybi; Tue, 23 Jul 2019 16:53:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7SYDZb5FWjtfRa65lmQXwbj7htDoYD2AGCQct0L9PpJUKVNUAmAnEXNVYlNIY7HUBi+1k X-Received: by 2002:a17:902:ba8b:: with SMTP id k11mr82728547pls.107.1563926008877; Tue, 23 Jul 2019 16:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563926008; cv=none; d=google.com; s=arc-20160816; b=A8iXByKsZ9e5AzpdQZDio9e9OJhH7FqAI24A1aBkF46Z2ro87XPFujYQxsG1BZPXHb UjRsWlCsU4GiB7/9tAIiMJ42Rm5wz2Lk36FDOB9U03ztnZRmbfB5T/bac8Uma4xMMvqY 54VSQObEN7oYUy8d2glTpG5WG79tBAykB14bpNCOz1BeQqUqC2xmmotESe2ey8rz57+1 ITqt75XxNwNnGoIcf/ruOZiFhOZ932dtKZmBbs1iHY5denGSQQas+Q+ZofmPGAwILfz5 5Oo6LtSLr11NWmFXiPkajR71R8sWJ74ng9XCgf7UJ5J068SBI1poJqpOBIW0bl9+u22l bG4A== 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=wTkY6dlZvHnMQHzMWsIucJKjIdmkzKoevp4XVYdjnkE=; b=FeOnqIQT31txuzpQFPUvut1RvB6p3v3CsBHZqjumuv4fAjRPYZdzCVHUtszeYzXdGk eKE1G3VInMuAC4S0mWx6tUT1blJXd6PHihKSttWRH0bE2aVfbMrPTl2Tq4YClLug34fm dqemHpAseFpOev6WLfsMOqOZvVyNM0bjKcKSJJXMb5cQpOxnP8QBnx5J3WPa3595AVMC +M1F3qk6+rvyvMPE2QAcozvreGbmAa1pNEK8DeEZY5aM/STNsHtB0C9IQgMCPP0Did2V mYDH/05CCwP2nY2PIbzwmQDtuJuWjAitmDHxQIC5kmSHu9A2gaGaE+G0POKV43X/Xfgq MkIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Fpcz3JME; 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 m68si17444587pfb.75.2019.07.23.16.53.11; Tue, 23 Jul 2019 16:53:28 -0700 (PDT) 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=@kernel.org header.s=default header.b=Fpcz3JME; 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 S1732848AbfGWNnF (ORCPT + 99 others); Tue, 23 Jul 2019 09:43:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:54598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbfGWNnF (ORCPT ); Tue, 23 Jul 2019 09:43:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37E5E21738; Tue, 23 Jul 2019 13:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563889384; bh=lpuL+EZ8Wd2LNNDofJ1Vmkit+yVhNieoW2WZW6wxTbc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fpcz3JMEYktpZ1GlQru9DtoSrnMnRtqV3ChygsiiUFmQHUNjPPs9jDEDNbBHloUIE 47EURATsT6Q2suaifGJ4beIGIT4pE2p+6gEh5BuYK5invipIKdderJYrukVowyC+t1 ab680OX84BuQ1n7t7NP+EeXLcOFCpz0kMimqkECY= Date: Tue, 23 Jul 2019 15:43:02 +0200 From: Greg KH To: "H.J. Lu" Cc: Thomas Gleixner , Mike Lothian , Tom Lendacky , bhe@redhat.com, Borislav Petkov , Dave Hansen , lijiang@redhat.com, Linux Kernel Mailing List , Andy Lutomirski , Ingo Molnar , Peter Zijlstra , the arch/x86 maintainers Subject: Re: [PATCH v3 1/2] x86/mm: Identify the end of the kernel area to be reserved Message-ID: <20190723134302.GA7144@kroah.com> References: <7db7da45b435f8477f25e66f292631ff766a844c.1560969363.git.thomas.lendacky@amd.com> <20190713145909.30749-1-mike@fireburn.co.uk> <20190723130513.GA25290@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190723130513.GA25290@kroah.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 03:05:14PM +0200, Greg KH wrote: > On Mon, Jul 15, 2019 at 01:16:48PM -0700, H.J. Lu wrote: > > On Mon, Jul 15, 2019 at 3:35 AM Thomas Gleixner wrote: > > > > > > On Mon, 15 Jul 2019, Thomas Gleixner wrote: > > > > On Mon, 15 Jul 2019, Mike Lothian wrote: > > > > > That build failure is from the current tip of Linus's tree > > > > > If the fix is in, then it hasn't fixed the issue > > > > > > > > The reverted commit caused a build fail with gold as well. Let me stare at > > > > your issue. > > > > > > So with gold the build fails in the reloc tool complaining about that > > > relocation: > > > > > > Invalid absolute R_X86_64_32S relocation: __end_of_kernel_reserve > > > > > > The commit does: > > > > > > +extern char __end_of_kernel_reserve[]; > > > + > > > > > > void __init setup_arch(char **cmdline_p) > > > { > > > + /* > > > + * Reserve the memory occupied by the kernel between _text and > > > + * __end_of_kernel_reserve symbols. Any kernel sections after the > > > + * __end_of_kernel_reserve symbol must be explicitly reserved with a > > > + * separate memblock_reserve() or they will be discarded. > > > + */ > > > memblock_reserve(__pa_symbol(_text), > > > - (unsigned long)__bss_stop - (unsigned long)_text); > > > + (unsigned long)__end_of_kernel_reserve - (unsigned long)_text); > > > > > > So it replaces __bss_stop with __end_of_kernel_reserve here. > > > > > > --- a/arch/x86/kernel/vmlinux.lds.S > > > +++ b/arch/x86/kernel/vmlinux.lds.S > > > @@ -368,6 +368,14 @@ SECTIONS > > > __bss_stop = .; > > > } > > > > > > + /* > > > + * The memory occupied from _text to here, __end_of_kernel_reserve, is > > > + * automatically reserved in setup_arch(). Anything after here must be > > > + * explicitly reserved using memblock_reserve() or it will be discarded > > > + * and treated as available memory. > > > + */ > > > + __end_of_kernel_reserve = .; > > > > > > And from the linker script __bss_stop and __end_of_kernel_reserve are > > > exactly the same. From System.map (of a successful ld build): > > > > > > ffffffff82c00000 B __brk_base > > > ffffffff82c00000 B __bss_stop > > > ffffffff82c00000 B __end_bss_decrypted > > > ffffffff82c00000 B __end_of_kernel_reserve > > > ffffffff82c00000 B __start_bss_decrypted > > > ffffffff82c00000 B __start_bss_decrypted_unused > > > > > > So how on earth can gold fail with that __end_of_kernel_reserve change? > > > > > > For some unknown reason it turns that relocation into an absolute > > > one. That's clearly a gold bug^Wfeature and TBH, I'm more than concerned > > > about that kind of behaviour. > > > > > > If we just revert that commit, then what do we achieve? We paper over the > > > underlying problem, which is not really helping anything. > > > > > > Aside of that gold still fails to build the X32 VDSO and it does so for a > > > very long time.... > > > > > > Until we really understand what the problem is, this stays as is. > > > > > > @H.J.: Any insight on that? > > > > > > > Since building a workable kernel for different kernel configurations isn't a > > requirement for gold, I don't recommend gold for kernel. > > Um, it worked before this commit, and now it doesn't. "Some" companies > are using gold for linking the kernel today... Oh nevermind, I see the rest of the thread where it's now not being allowed, sorry for the noise. greg k-h