Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1557202pxa; Thu, 6 Aug 2020 10:12:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys+jbaur2zPjyvPyjFCkbj+f0ujLeS5ZSgpj4StFmfpZTg2BOrKid7GLf38DXYhuvyrblb X-Received: by 2002:a05:6402:12c4:: with SMTP id k4mr4954749edx.358.1596733953368; Thu, 06 Aug 2020 10:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596733953; cv=none; d=google.com; s=arc-20160816; b=c8+z1nDdRfptTUgsWt3Fb55KniDYnRw+weNFQkxNbiEH0fBUndoLFzZIptIcjiM+5u 7Z3K3Ejr2bAotWWWALzT6do95mX0iYwBK+4hBO2BeWw3hf514J/BVAHFTRcAfCNjM/25 TYU/vO5GDj25Zt865vZ1Cu8w2hrts4QmXUojoHslu4vFUuBXdBINkqapd+eFJi3jlZM1 dw4W7MRL9GkAzvBs8gz99nAqFgATjiRJWvuc7IzvoTgVOffUh1viLxDIWj88rs8ECRMD 3kpnGNN/porlFbYQFnapjQf/hMiQQw0qYloRGBex/hwXZyL9WIJ7Hoxy3K32lmD2bBq8 zbTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=f88Fq/eenv8sNNn9Tg1gLIIHq9PFrGBC4IOs6PirgI4=; b=zD95I42fMX040rSnYh1liV4OfD410yGCExsyUoPRE5iTxOsF5DaqqUR7Z/fXbou9Ft mMAn0qDmvAy1vgrzKDlsDex/EIGC10IQfjclqQ8O2Ug80TbOSJ+MJiU6BAaURtHPDCZA UGCokHbGYArNk0Io4Dr+7yUA+xEvMfHijNePAU61YslEp+yCTd4DF0tC8vzU/WIrcwsu EEfhXeaP7YQAVZqyDyOsHcXl5GFX+KuTsGgX7GXc1V6IKlbRdarH2rINWFHEtj7MCFuU EcY5OpoO2920Q9g/0fDvLzUXWV8XOrBMr291S/palB/vNRZMCu6XB+FV80z1C628YkaN 6Q7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ennrXqcX; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id be25si3566871edb.124.2020.08.06.10.12.10; Thu, 06 Aug 2020 10:12:33 -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=@redhat.com header.s=mimecast20190719 header.b=ennrXqcX; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730114AbgHFRLP (ORCPT + 99 others); Thu, 6 Aug 2020 13:11:15 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40650 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729421AbgHFRLL (ORCPT ); Thu, 6 Aug 2020 13:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596733870; 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: in-reply-to:in-reply-to:references:references; bh=f88Fq/eenv8sNNn9Tg1gLIIHq9PFrGBC4IOs6PirgI4=; b=ennrXqcXuYpV4nyMvoPHkjnQHiiaIohNCCgR4fskJmB9LQBmguX1z8sZlj2LwMq/d/l4z7 Zdrkj1+XzUtfVGSY63Q1EaOimADWGXZVHw2xS5xjE9UNbLPgYQmSusLN9RynDCnVSI8nS8 QGLJb0pNXJwc3lLwbxo8biCJnep1t2g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-GuX-fLXpNoCnwWHH3KsG0Q-1; Thu, 06 Aug 2020 07:33:26 -0400 X-MC-Unique: GuX-fLXpNoCnwWHH3KsG0Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8BAE0106B243; Thu, 6 Aug 2020 11:33:24 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-96.pek2.redhat.com [10.72.12.96]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 766A15D9DC; Thu, 6 Aug 2020 11:33:19 +0000 (UTC) Date: Thu, 6 Aug 2020 19:33:15 +0800 From: Dave Young To: Pingfan Liu Cc: x86@kernel.org, Steve Wahl , kexec@lists.infradead.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Hans de Goede , Arvind Sankar , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner Subject: Re: [PATCHv2] x86/purgatory: don't generate debug info for purgatory.ro Message-ID: <20200806113315.GA2492@dhcp-128-65.nay.redhat.com> References: <1596433788-3784-1-git-send-email-kernelfans@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596433788-3784-1-git-send-email-kernelfans@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/03/20 at 01:49pm, 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 > --- > 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 > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec > Hi Pingfan, Looks good, thanks for the patch. Acked-by: Dave Young Thanks Dave