Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp431719ybe; Wed, 4 Sep 2019 23:33:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGaRkLDNRf7mc3qmmjxPLIqczv5NB1ZNqexkXNFKPWiml5n+O1ONzfYrCCPIzAw6bfjeDK X-Received: by 2002:aa7:8251:: with SMTP id e17mr1888511pfn.189.1567665212848; Wed, 04 Sep 2019 23:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567665212; cv=none; d=google.com; s=arc-20160816; b=z18F71JkRlDVDo/kiDzD5YrjwWGVhHsvDhh2t8WstYpiqx1wis6wVX1tOwVaTR88RP BoZP2VOPIegsIfQM+2H59o6INfFSiYa3yxQXVsX5WXHxBkfX5/7RWBy8Mit7cKlUNyl3 vnhQ3OMazIPo2iuoinML6E3HCz+SZyysw2wL0PAXCx993WUSFciyLMHfTnODGBXxiVd7 IfWrMuANtWsb2msAP0uQ5SZW5NK6ZniMzCGLBAnqqBXxtVLmW6tYXhV1UbBtdS6XEckI D2wb2F9sDAwuKVMbLcR0y+rh3smf+RKAHF2V1KnDTiWFQHowQ2CEn/q+pQdaLra00203 w0AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eDeL1H8rDxfUHOLv70GUO77M1psIvXCkWkx60/Nsrkc=; b=U9veTLP+m4dmyX1w6NdwIfe7fDnF2H4dw/Ut+cWGmeOJRc8uwL0mSktVwIoJvtpqtR Z+JslryEw+sP+v1Y10nLkzs2sm28lcbpqgE+Aguxat665ERobi8IvQt2Knvrwwtodpbh eqwRNDoc2WzGsg0+7dmCftPbei6ooAhU44YeqZeWSzr24QWZ/7KkXWiXM16zXL19n0AU f6riF5MubGO6AzFA7Vnajit5wDlrABmvjmB2whLY5nFpxPdXeFQkzmwFNoBHsWHcNLHJ GsJl3Tc0phvPOgmTTIJYSAd4eRICKYgWQPvJjeK5DmclEd+BvIN2Eehq4iU7HDt0L8qP j2Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lonelycoder.com header.s=google header.b=iU4GU7M+; 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 61si1227670pjo.46.2019.09.04.23.33.15; Wed, 04 Sep 2019 23:33:32 -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=@lonelycoder.com header.s=google header.b=iU4GU7M+; 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 S1731147AbfIEFeZ (ORCPT + 99 others); Thu, 5 Sep 2019 01:34:25 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36955 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725209AbfIEFeZ (ORCPT ); Thu, 5 Sep 2019 01:34:25 -0400 Received: by mail-oi1-f193.google.com with SMTP id v7so781336oib.4 for ; Wed, 04 Sep 2019 22:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lonelycoder.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eDeL1H8rDxfUHOLv70GUO77M1psIvXCkWkx60/Nsrkc=; b=iU4GU7M+14QxcU0lK5lK/o/Ss6KqjXSdFosvRlvOe2pX9s2IaiAhVQwOWKIkRGK6Wo e6V6TI+A3vRzT9iCDrn0av1tGCJnVdGPX3ryovJ8aW7K/c3smGptIUOgjLI9pdXAYuTS WekNyAv7QolsvCPnks95C+ytwEYrnbMrIsdi/lR4q8C+9Dz16pLgCw3F4OL8HALABLrg mk6YpJPGmRdlh/CQ3mvMnkoSJrKKDLYekARHuwFN1a0qsXrlVbUMK+m0XCHngrq2fZEm Enu0IJ4jO1XKClQDcvjquj/CcX+EZxybLRcU39jLh10btv3gmmSPE3OU+nIl00P8MCL8 L2NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eDeL1H8rDxfUHOLv70GUO77M1psIvXCkWkx60/Nsrkc=; b=dKpDYyMCZWJt3+4fROi5hZiRrmVsRhN/UixaiHTb8i4i+2vor7Kv5NzqTUR4Hg9XQ9 GV9ODh472KYzTg7cKwi892S1e5RkGrZrLWWMakhOI+GS+eCYRIfRdb74WCQ7EEV0FAC5 k1du1uB/0iob2feBkBQWBnqETOhqKUq0/Dr1Bs19gwpIipP9YkmXKVHhIeNJYvxKp8qz B0GUYTIx66IMZYgQ52KDZ1cNcBqblM1B0ATDv8mo2/Kvd5pla/OP0IAS7XsnsvvejRAj qMoBIB5MAdl78RU8kd87KyLahNbzrFnAAiYdzdH7Brjfi+NqQEV2S7z4u0V1hYKMMrPe YOzQ== X-Gm-Message-State: APjAAAVPIgYwweiOs4GYLg5jHmEq9leThbCVM+eUfiaSnJ03d+sM8DlC XzAwu0WIXE0Wt8J7ALXFFYU1or74sL8lfPcgH5xYqA== X-Received: by 2002:aca:fc91:: with SMTP id a139mr1143435oii.173.1567661663983; Wed, 04 Sep 2019 22:34:23 -0700 (PDT) MIME-Version: 1.0 References: <20190904214505.GA15093@swahl-linux> In-Reply-To: From: Andreas Smas Date: Wed, 4 Sep 2019 22:34:13 -0700 Message-ID: Subject: Re: [PATCH 1/1] x86/purgatory: Change compiler flags to avoid relocation errors. To: Nick Desaulniers Cc: Steve Wahl , Thomas Gleixner , LKML , clang-built-linux , Vaibhav Rustagi , russ.anderson@hpe.com, dimitri.sivanich@hpe.com, mike.travis@hpe.com, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 4, 2019 at 3:19 PM Nick Desaulniers wrote: > > + (folks recommended by ./scripts/get_maintainer.pl ) > (See also, step 7: > https://nickdesaulniers.github.io/blog/2017/05/16/submitting-your-first-patch-to-the-linux-kernel-and-responding-to-feedback/) > > On Wed, Sep 4, 2019 at 2:45 PM Steve Wahl wrote: > > > > The last change to this Makefile caused relocation errors when loading > > It's good to add a fixes tag like below when a patch fixes a > regression, so that stable backports the fix as far back as the > regression: > Fixes: b059f801a937 ("x86/purgatory: Use CFLAGS_REMOVE rather than > reset KBUILD_CFLAGS") > > > a kdump kernel. This change restores the appropriate flags, without > > reverting to the former practice of resetting KBUILD_CFLAGS. > > > > Signed-off-by: Steve Wahl > > --- > > arch/x86/purgatory/Makefile | 35 +++++++++++++++++++---------------- > > 1 file changed, 19 insertions(+), 16 deletions(-) > > > > diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile > > index 8901a1f89cf5..9f0bfef1f5db 100644 > > --- a/arch/x86/purgatory/Makefile > > +++ b/arch/x86/purgatory/Makefile > > @@ -18,37 +18,40 @@ targets += purgatory.ro > > KASAN_SANITIZE := n > > KCOV_INSTRUMENT := n > > > > +# These are adjustments to the compiler flags used for objects that > > +# make up the standalone porgatory.ro > > + > > +PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel > > +PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss > > Thanks for confirming the fix. While it sounds like -mcmodel=large is > the only necessary change, I don't object to -ffreestanding of > -fno-zero-initialized-in-bss being readded, especially since I think > what you've done with PURGATORY_CFLAGS_REMOVE is more concise. Without -ffreestanding this results in undefined symbols (as before this patch) $ readelf -a arch/x86/purgatory/purgatory.ro|grep UND 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 51: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __stack_chk_fail I just bumped into this issue as I discovered that kexec() no longer works after the x86/purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS -commit was merged.