Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4084478ybi; Mon, 15 Jul 2019 03:37:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+jKo2f4dZgD9kt5MhdnMGdaRTe0gbjVeAqYzaXC5vrMaanAg01b34X/akGT5kgLuqu1Yy X-Received: by 2002:a17:902:8f81:: with SMTP id z1mr26992336plo.290.1563187042134; Mon, 15 Jul 2019 03:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563187042; cv=none; d=google.com; s=arc-20160816; b=VcxFlsZbup5wmgq257O+J+tclCK9FAgyFjsZh2ODH56Ix3WDtTxaB9cN2gP4OjSnSs eWm6Nsxi+5xj9NDs7hzkQCEvrB79KC0YlSZbMTtTqrCtnJ8alZ2qzTvycLRa6VOHtH8V SuRukTJcjaCcApZv9XK4jyX4MEjPRxaW74UTqLKDfZGOkp92MhWLm8LBIiSiVisaXT2x xC7nlswsSLN2tFmbBtBaqZUpcLijdpa5OLT5rKaoVpoHy3BeQFl1nuuJT3N57lhIISPw QPB7PN4sd6IvCoPs4zM1fOeWhbaved37cxag/peZ865G9k0digsv/H0JxwZEX/hhfc0g PUdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=sG8L5v8n8B9PEh8NYJTnox7a2BVlo1zPA75NaKGlO5Y=; b=TPWU1O0UygaaaX+IfPLf4ITzJ2kns/1eL4RDTKRk4JIEQhgsxUdpiWDC4tKsyA/rzO nOvt3yfC1aaJQe3Vd4P6vY/Wqofr5+0L4gko7IyksSjGs6w5YKQ2pdNY8uSadUPNocvh itPr2tTEUmtHWsXEoNgNKD0VokaR+vz2zTrzwP9QWfDU2/4i9VgyuuSzaPS7X5KK6PA1 j/WP2EdyWtyq+TQkoNjerO1kes+Fwfc1m2+ll2PvHnIKrCvYxNdAJ0RNn7P2HfXw2yTT ESvYD85c88HKC3CKrN3FYDpzOo+NF8+VjO2EPl1nSDWI2uDo6rPfLdeTiKPcMXRwWSnm V9Jw== ARC-Authentication-Results: i=1; mx.google.com; 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 z25si14946307pgv.418.2019.07.15.03.37.05; Mon, 15 Jul 2019 03:37:22 -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; 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 S1729776AbfGOKfq (ORCPT + 99 others); Mon, 15 Jul 2019 06:35:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47279 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729428AbfGOKfp (ORCPT ); Mon, 15 Jul 2019 06:35:45 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hmyKU-0001Va-Vz; Mon, 15 Jul 2019 12:35:35 +0200 Date: Mon, 15 Jul 2019 12:35:33 +0200 (CEST) From: Thomas Gleixner To: Mike Lothian cc: thomas.lendacky@amd.com, bhe@redhat.com, Borislav Petkov , dave.hansen@linux.intel.com, lijiang@redhat.com, Linux Kernel Mailing List , Andy Lutomirski , mingo@redhat.com, Peter Zijlstra , x86@kernel.org, "H.J. Lu" Subject: Re: [PATCH v3 1/2] x86/mm: Identify the end of the kernel area to be reserved In-Reply-To: Message-ID: References: <7db7da45b435f8477f25e66f292631ff766a844c.1560969363.git.thomas.lendacky@amd.com> <20190713145909.30749-1-mike@fireburn.co.uk> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, tglx