Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1290747ybe; Thu, 5 Sep 2019 13:12:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpZLV4KTcBtpufwGtqwsMR2CU+kUN2hmMMbFJpbxI+NuOtZJjzkk1m8vczQRXCsCOPZfjj X-Received: by 2002:a62:e516:: with SMTP id n22mr6199626pff.105.1567714349335; Thu, 05 Sep 2019 13:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567714349; cv=none; d=google.com; s=arc-20160816; b=Vfn8hiVTqKtZk2kElIezzPz2F/EVo3axFPG6TGGseuOztLVPlGNf32ul5Ky/11umWg av5nWsNlE4O8zr9Sqm+lS/ykrgo0fNgBO3QhC2wxRVTKLJJ3+6wB32wy1M7HGHB/PdKM 1Jm3U0I0cf5G1LNH3ThfCHtVBgCDX/YOv6p9bdLn+cISlHODF8khvsZBpOX2L8su8DI5 UXwh4P5jqiUDiSdHWFw5EaPalrXhiCKpK+bqw1ZPfFC4Z32wTfultJGBl3UXE/wLA3kY gAAQleTVKTrEoFvJpGT89qHNbwL1Qegb1/s51nuixxAQmXtXuB45MMXY8NsHY7Z3vBof jiZg== 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=cHu6QE74CNs1FkmhZ8Lols7/VAMPd2toM7CcVZKn6Vg=; b=CW9xyA3UO2F4htc86J6RghATGIj5BhC7OEEcbQDI27e6QllO5Bhnq1pQHh0kxNJYx3 Sp8Rl5ucB47HEKWxWmUYSXfc3FrA40xLdp5kAmVZUz58tsAqPAfIPg1iwUjNzOO/Jz7n 2WeGVY5TknHFvD81QSISaYUxWl0s2isHi6pN68tZZD7sY1HB5KREu76XLJuuRFolLyur itvLQe2IBxY72z0nJqfzBb7MVazA1eqJL00oQciLSSsZwGBBrzoQK77NtHfTD1h3NZN+ oQivwP5oHBY9UvzejwCdIbKiIidOVEv4hRtPu4/1vHou5/XbWpDoUB1fMMPOzALafRS0 z8Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ak74pS4L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3si3049541plp.182.2019.09.05.13.12.12; Thu, 05 Sep 2019 13:12:29 -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=@alien8.de header.s=dkim header.b=ak74pS4L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389812AbfIEQqq (ORCPT + 99 others); Thu, 5 Sep 2019 12:46:46 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39672 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387586AbfIEQqq (ORCPT ); Thu, 5 Sep 2019 12:46:46 -0400 Received: from zn.tnic (p200300EC2F0A5F00ED1F85EF3FFCFB3D.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:5f00:ed1f:85ef:3ffc:fb3d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3B2811EC026F; Thu, 5 Sep 2019 18:46:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1567702005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=cHu6QE74CNs1FkmhZ8Lols7/VAMPd2toM7CcVZKn6Vg=; b=ak74pS4L5p6sB45XG4CnsYfZqLntkV7jNgbOMe3CfvjQxe/hnY2OF+kqNLgh+yz1oW6dxX KwSanSC7zkIOS6+Alpct64rE+WcUTFhLBNuDID9HeMjR1mzJZng8m7lk2adOZ26pfdLGB/ N1zvxUKSauOxrJUZDyQ/KuVB9akSyAc= Date: Thu, 5 Sep 2019 18:46:39 +0200 From: Borislav Petkov To: Steve Wahl Cc: LKML , Nick Desaulniers , clang-built-linux@googlegroups.com, vaibhavrustagi@google.com, russ.anderson@hpe.com, dimitri.sivanich@hpe.com, mike.travis@hpe.com Subject: Re: [PATCH 1/1] x86/purgatory: Change compiler flags to avoid relocation errors. Message-ID: <20190905164639.GG19246@zn.tnic> References: <20190904214505.GA15093@swahl-linux> <20190905091514.GA21479@zn.tnic> <20190905150738.GD14263@swahl-linux> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190905150738.GD14263@swahl-linux> 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, Sep 05, 2019 at 10:07:38AM -0500, Steve Wahl wrote: > kexec: Overflow in relocation type 11 value 0x11fffd000 That looks like R_X86_64_32S which is: "The linker must verify that the generated value for the R_X86_64_32 (R_X86_64_32S) relocation zero-extends (sign-extends) to the original 64-bit value." Please add that to the commit message. > ... when loading the crash kernel. > > > What exactly caused those errors, the flags removal from > > kexec-purgatory.o? > > No, it's the flags for compiling the other objects (purgatory.o, > sha256.o, and string.o) that cause the problem. You may have missed > the added initial values for PURGATORY_CFLAGS_REMOVE and > PURGATORY_CFLAGS. This changes -mcmodel=kernel back to > -mcmodel=large, That I missed... > and adds back -ffreestanding and > -fno-zero-initialized-in-bss, to match the previous flags. ... and that I saw. :) > -mcmodel=kernel is the major cause of the relocation errors, as the > code generated contained only 32 bit references to things that can be > anywhere in 64 bit address space. Needs to go into the commit message. > The remaining flag changes are appropriate for compiling a standalone > module, which applies to 3 of the objects compiled from C files in > this directory -- they contribute to a standalone piece of code that > is not (technically) linked with the rest of the kernel. > > (Fine line here: the standalone binary does not get any symbols > resolved against the rest of the kernel; which is why I say it's not > *linked* with it. The binary image of this standalone binary does get > put into a character array that is pulled into the kernel object code, > so it does become part of the kernel, but just as an array of bytes > that kexec copies somewhere and eventually jumps to as a standalone > program.) Yes, a shorter version of that should be part of the commit message too. > kexec-purgatory.o, on the other hand, does get linked with the rest of > the kernel and should be compiled with the usual flags, not standalone > flags. That is why changes for it are a bit different, which you > noticed. Ok, thanks for explaining. Now please add that more detailed explanation to your commit message so that people doing git archeology in the future can gather from it what the problem was and what the solution became and why. Also, add the reviewed- and tested-by flags you got from people. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette