Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8836294ybi; Tue, 23 Jul 2019 16:22:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAb9ZTgwhciSKltD0D/PqJJrq895dEG/P/s7ShiLnBV/kdN7BaWfbcbEELcjFtoZQ7UkQF X-Received: by 2002:a65:5687:: with SMTP id v7mr80072576pgs.263.1563924151163; Tue, 23 Jul 2019 16:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563924151; cv=none; d=google.com; s=arc-20160816; b=od7jllcWmGtkRi+MQhmQyJQTaQX5+2CGdyS+tMyaOYrjHEecnKqGeFgB259gpu8gxX P9+MonpcfikxoVZADe0K66smgNZFNsATUBRkndXM534t2G1yRwarIVcSA+IY7I3Rt9Ij /or7rFdWlBnOxBhl2EpK2BIWSYd3wo1q5AoQakX/mcD8nGoa7a3glxcCBp/NyKjtsAq2 6o1pRJhNkCA6G+WGs2FdzC38DJjbSRZJUhyJSDs0XYuEdS5wqv3LVuR2akMkRyG+66sz iig3udJ+rNrfexQeLcusGvCqj/gBLlE2NCXVonXna8cBXvFaPbf+xi7DfQUSAeQJF5K/ kuXA== 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=JuZ7/LFPsrZs1omNJhtfxmCSxFSBgPQah49rZYccpz8=; b=r0WH6e6k72VwZSAZTbU1kiPmU9AaDTdJAtr5EhZug0K4gn/42mTJo+CmlqkmyESqwk 0Umg03N9LSzlJoL2A9nF2BVzwpQR2zhRa0BKbJ4FJN521eeCPHsQ1Cgn6j8uo6qHH65c kv4tz90wIx0YpLuSpRHCwg3DEiWYqidC5XrhG0VNUY1naZ/vLqbq5klMdy/vvxdfYuc3 BqPsO6mjPSNl61buxm++ICHeGqug0c6CNE7UMKUuS71iJvMzyvKqQWoqSIJpN1ARPryS jFsjpOnzytNVTNoqw8O9QfrzR/aGWr3Efq0tDj/2IAvAadmkK6cNE5Djt9fk0IgIh6kI hkww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w5GCQXa6; 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 u190si13625969pgd.547.2019.07.23.16.22.15; Tue, 23 Jul 2019 16:22:31 -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=w5GCQXa6; 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 S1732415AbfGWNFS (ORCPT + 99 others); Tue, 23 Jul 2019 09:05:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730059AbfGWNFS (ORCPT ); Tue, 23 Jul 2019 09:05:18 -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 6F59B218BE; Tue, 23 Jul 2019 13:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563887116; bh=Q8D4t7cJn1/TNwgDJMoznl3qalYmQpoD/w0gjwZCvU0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w5GCQXa6wPQfKGCsNtCBbWrn4TYdL5NoayvSI2QnniwHn3vH2QOt7WLbf7WL82SVR BKFnVsZ1ldKA5RYw5M/ZRshEpBxmzUIsQ3/8JfEHqWc4KOqRi8PnrxaRcCVlA1Pw0e WggY/vRi3aa6VHGbt4OQjVv6nStWqCIo/o1bCskk= Date: Tue, 23 Jul 2019 15:05:13 +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: <20190723130513.GA25290@kroah.com> References: <7db7da45b435f8477f25e66f292631ff766a844c.1560969363.git.thomas.lendacky@amd.com> <20190713145909.30749-1-mike@fireburn.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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... thanks, greg k-h