Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2217234pxa; Mon, 3 Aug 2020 10:16:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvXm8GEzZ8dnZc08TX4clKt45rYVHI90F5YxmnxIPUXoZP5XrY4CX71o8QUOjX83eTGxSG X-Received: by 2002:aa7:df8a:: with SMTP id b10mr16081015edy.62.1596475014723; Mon, 03 Aug 2020 10:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596475014; cv=none; d=google.com; s=arc-20160816; b=w9LxuquVVuI46u4rFLMR9vtR4QkYtmrAyKD+3rrhHdLacG70pNGkq0tKHh9UurVQdP 3stIwrrZ0kqMvsGFDC9vjdbrwGNjHSUPM0vMbzwT4EZcj+GNGGJRYp9XN+oVKhVW5g6A GyQ8ECcsQdHzqlcgVEZiyuAAC96tI0bm2ne+J4d1kU37g32UJ8cRN2JDNyajtLwZPwE7 r3ik8/l97eAFojd1dOOyQXiVzsZDlSyMFGG4ch6uF/tDVCi4xF/ODc3wYfT3WqQ+umUV bpp6CJFulFajh5FqAFuSLbAjG01mKMiKf8+H+kisAncj2+a4Xyqq4zbMpRW/qHEnRmHy /Gog== 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; bh=9YfQtQwETamahw2CDQQqt03G4khh0WloFU6Yg+SzgsY=; b=iQIo/KSI9ylW41YoRWLXl/6FPSJfWgjrSFSLFDTADeneOpjsURWEDSbEEdSqhecwiV OCkQRZicfNvP2jTuP/0qaVOqllAB6c7xzF33ODmL7qmBswfEJzzZh3J81fBct3+7F1+v Q5QIWjS8hQP2HbdTNfnT3ixq1pMgzCnI1M8YdQTlwVg1/RambC5MEbFXwRWwSsm9Sh4H +wWuQ3N3ECOtzTqBZY5/Dc/C5tz6bnZqqIiyt40m+xEZVZqQE5HWB17jh8yGmb2Rzkh3 jaXIlEy4O3tMv8QAQtro8m1cNz9UZxQSkFEpqv6Ov2z4Wv6+OyltMMpG8RlaXx51UXZb 6BuA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si10386316ejb.303.2020.08.03.10.16.31; Mon, 03 Aug 2020 10:16:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbgHCROQ (ORCPT + 99 others); Mon, 3 Aug 2020 13:14:16 -0400 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]:29756 "EHLO mx0b-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbgHCROP (ORCPT ); Mon, 3 Aug 2020 13:14:15 -0400 Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 073H3jqF010632; Mon, 3 Aug 2020 17:13:42 GMT Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 32pf6tkhg4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Aug 2020 17:13:42 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 6F96162; Mon, 3 Aug 2020 17:13:41 +0000 (UTC) Received: from localhost.localdomain (unknown [16.214.163.7]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 1482137; Mon, 3 Aug 2020 17:13:40 +0000 (UTC) Date: Mon, 3 Aug 2020 12:13:39 -0500 From: Steve Wahl To: Pingfan Liu Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Hans de Goede , Nick Desaulniers , Arvind Sankar , Steve Wahl , linux-kernel@vger.kernel.org, kexec@lists.infradead.org Subject: Re: [PATCHv2] x86/purgatory: don't generate debug info for purgatory.ro Message-ID: <20200803171338.GX12531@localhost.localdomain> 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> User-Agent: Mutt/1.11.3 (2019-02-01) X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-03_15:2020-08-03,2020-08-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 clxscore=1011 phishscore=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008030123 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Steve Wahl On Mon, Aug 03, 2020 at 01:49:48PM +0800, 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 >