Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2214584pxa; Mon, 3 Aug 2020 10:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+NWvNV8wcPKixVRW15SGcUmnuhIM/vsCuvjguc5y5mDLA4rV/TfFBt+S8q/4GKdb3eo9T X-Received: by 2002:a17:906:1414:: with SMTP id p20mr17003380ejc.247.1596474796740; Mon, 03 Aug 2020 10:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596474796; cv=none; d=google.com; s=arc-20160816; b=RcKFaqlf434caLIWSepM/z2InH5xir8ha8S0nHyEX08zYNX1jhutrSb44Ofq9mPre+ zovP0pLBZMdGceydLAImqLYK3Lu6POezgyc1dkQAhG5xbI5KJB50gT3K+6NwUjIk5ONW KXr9djFNEsQkGPXQ8gt1cHsHhBIKRulG+1WBoleKo4a68Gi9SQIOUxLw9x1APJOIp40b uD5tSree3BdrfVGHVMeLnLJNMqz1Gr0ukOLstP3AKIOK9CsxmnFMwDFrrjMl01LxPgY7 3WT9AAbV5QaEREuVBQJFL1CYDIFLgukTqpXFjhs32Srgo1bCerFY1k0DpVP4g/pUgmIs ttFQ== 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=EdcsAD52151YFyK9GV+0dTJh1rWdO1ZkWpKqDyiylxA=; b=A8ousXWtOViCQgLDl5XNThpVH9jhWc8iI0QhZWsSj7TOuIsPdqxRkMpqfALdD+AvKe udVvPpeKt4p+gLAtqpMOzOFnWSc5uWwn4Ezla2dkTo+uvjtB64xQxLpe1CZek6hYle1Y cbuXuu3ApCSkjgkhf1UR+RumHU4C9KL+iKAqIdQi83rHYj3+kY2yLk7SDLd7eRhAqrCX YLyGXnMmWF+EweXhV9jUn8s56j8u0vtDLOdCsydRLG57gLpu8dqv/tnxXapQaFsP7JUw OcwuqN5D9xdit07dXAMEvVZw9lVV2oa0BegqGr3c+oHEnr2AGW1pWwafrxknEgY5xUhU Cz3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PFGpIjGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du22si3795262ejc.24.2020.08.03.10.12.54; Mon, 03 Aug 2020 10:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PFGpIjGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728309AbgHCRM3 (ORCPT + 99 others); Mon, 3 Aug 2020 13:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbgHCRM3 (ORCPT ); Mon, 3 Aug 2020 13:12:29 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF133C06174A for ; Mon, 3 Aug 2020 10:12:28 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id w17so21069802ply.11 for ; Mon, 03 Aug 2020 10:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EdcsAD52151YFyK9GV+0dTJh1rWdO1ZkWpKqDyiylxA=; b=PFGpIjGn1339koZitvzVbBMuGGtmca3kJSr1WQrEN+phD/GnE9e0iYibDk906j3c3m O59emUPBY55iyJ/cbZJ4Za0UuDvLGr0ObmEgp3KRW3HHQWBu1oeu9hWmgsWVtVBfA6ct kMeGFen2EDnaZY2cPVQJXhM3RzqdF+22zmrJbhQuzbZwmUtsB9QCnVRAVwvWHZtRKafS I0P3VVu2OzGC2fQ8qIu7Fdu3NBKdztPegrTtcydKXmVp9mQB+TBFNiruBufTlzMCNwbC PeelPejcygyXnSYWML3bQjP/9dFtK4j7ljNSDe8q8J49DRBILha4+C1ShQwxFFFuCFz5 9Dgg== 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=EdcsAD52151YFyK9GV+0dTJh1rWdO1ZkWpKqDyiylxA=; b=VWU9W+NfM292zO9rFDEbUZQeUbQ1/nuG9W7dGIS6HudAvbt6MOKQAjN8eXi3RAU0md CX2Ih/AaZS3ike+/fNbMpNMasq8wf2vgJF+E2Gi5PpkNdqs2Jh+rvkvhKI0nJWboMNz+ Ebs4x1tqjuI8HOT8jOxJRNEO0dbSKJFnYbyJLdXEGWRaqbbfnOIOY4zIVLu7aadTGY8A 3gcuxP8Bzdsv0Mv6mc+PulNjjdycf45aHqTmZ1hUoyHSLl4bvz5w+vViYpS8Cei682mC WKncVXsjej37KSeFLD7/pJq+CSrqCD5Dut5vZ3g5Kr5Dd3iF7cf++a9l61yWmY8o6maj mZxw== X-Gm-Message-State: AOAM530a+aEz7aUHgcp1tbR1V9IbgqIjEfrWQWILl/tY7kZmYisObuDV +FBiRdrSquy495zfVA4MwVeSyqqz3T3HsHgq5DPT6Q== X-Received: by 2002:a17:90b:1103:: with SMTP id gi3mr333409pjb.32.1596474747635; Mon, 03 Aug 2020 10:12:27 -0700 (PDT) MIME-Version: 1.0 References: <1596433788-3784-1-git-send-email-kernelfans@gmail.com> In-Reply-To: <1596433788-3784-1-git-send-email-kernelfans@gmail.com> From: Nick Desaulniers Date: Mon, 3 Aug 2020 10:12:16 -0700 Message-ID: Subject: Re: [PATCHv2] x86/purgatory: don't generate debug info for purgatory.ro To: Pingfan Liu Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Hans de Goede , Arvind Sankar , Steve Wahl , LKML , kexec@lists.infradead.org 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 Sun, Aug 2, 2020 at 10:50 PM Pingfan Liu wrote: > > Purgatory.ro is a standalone binary that is not linked against the rest of > the kernel. Its image is copied into an array that is linked to the > kernel, and from there kexec relocates it wherever it desires. > > Unlike the debug info for vmlinux, which can be used for analyzing crash > such info is useless in purgatory.ro. And discarding them can save about > 200K space. > > Original: > 259080 kexec-purgatory.o > Stripped debug info: > 29152 kexec-purgatory.o > > Signed-off-by: Pingfan Liu > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: Hans de Goede > Cc: Nick Desaulniers > Cc: Arvind Sankar > Cc: Steve Wahl > Cc: linux-kernel@vger.kernel.org > Cc: kexec@lists.infradead.org > To: x86@kernel.org Reviewed-by: Nick Desaulniers > --- Thanks for the patch! One thing that can be handy for reviewers (but isn't strictly necessary) is to put a comment about what changed since the previous version below the above^ `---` line. By putting comments "below the fold" you can pass along information to the reviewers that won't wind up in `git log` when committed. Not strictly necessary, and less so for smaller patches, but hope this helps. (No need for a v3 over that). > arch/x86/purgatory/Makefile | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile > index 088bd76..d24b43a 100644 > --- a/arch/x86/purgatory/Makefile > +++ b/arch/x86/purgatory/Makefile > @@ -32,7 +32,7 @@ KCOV_INSTRUMENT := n > # make up the standalone purgatory.ro > > PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel > -PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss > +PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -g0 > PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING > PURGATORY_CFLAGS += $(call cc-option,-fno-stack-protector) > > @@ -64,6 +64,9 @@ CFLAGS_sha256.o += $(PURGATORY_CFLAGS) > CFLAGS_REMOVE_string.o += $(PURGATORY_CFLAGS_REMOVE) > CFLAGS_string.o += $(PURGATORY_CFLAGS) > > +AFLAGS_REMOVE_setup-x86_$(BITS).o += -Wa,-gdwarf-2 > +AFLAGS_REMOVE_entry64.o += -Wa,-gdwarf-2 > + > $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE > $(call if_changed,ld) > > -- > 2.7.5 > -- Thanks, ~Nick Desaulniers