From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EE0830DD1A for ; Fri, 23 Jan 2026 00:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769127600; cv=none; b=gFgpS21EvLtyJalCURo47EC7DJWupHozonYa9scxy/2xsi3F1zSIlSCvKecC+DU4uaEDW1OHwhE6uQ+ih3//OabsoKzgNR94hjSeFLJWnQuIK9yYlb/nHxSz9RlzyjjX59yMoOZUXj+2qgbTZ4Ja01cm2xFayn/z4sIKkch2OlA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769127600; c=relaxed/simple; bh=7ozZUNN6n50Iyls+Ras6tjIXrAObT1k8VQj+LbRxMnc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Jrvz8gbWZuGNBYRBXjGS8W4F4zSeusI4duO7Bq5EX2s+OOrtin638m68OV3Dg+NmSM1SwxJtNnED9bNKRU1A4CG0ewQz3pTwcrvxuUlck7XknQDc6pKa3wDOTbH1te52ph1BsXnTWZ4Je/2XkB0uXwjqc/X/i73JNavmCt7L1u0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=V0wdry3h; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="V0wdry3h" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769127590; 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=bwUWq+5Go0qRUFEN+zaOFDSCRCtJUy4aBgzMdXDwS3w=; b=V0wdry3hZZMf5n6iT7VSL1fuJT8q5q/BnP6Ay8OQSBpeIzUE/49Fw/OIHJK2o5LDt+PP5a psDjsYIQlqFoo4rQU0RhDG6ndX8Fu/ileRkXYY9558bTk+snxYKQ6aZaQUBnpbWaEMp2y8 oQD8TIAEm+nBvz5OtL/zu10VzgMTFX4= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-75-pjrXPuAaPCaFt-xOqS-C2A-1; Thu, 22 Jan 2026 19:19:47 -0500 X-MC-Unique: pjrXPuAaPCaFt-xOqS-C2A-1 X-Mimecast-MFC-AGG-ID: pjrXPuAaPCaFt-xOqS-C2A_1769127586 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C11681944F12; Fri, 23 Jan 2026 00:19:45 +0000 (UTC) Received: from localhost (unknown [10.72.112.31]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 45E421956095; Fri, 23 Jan 2026 00:19:43 +0000 (UTC) Date: Fri, 23 Jan 2026 08:19:40 +0800 From: Baoquan He To: Breno Leitao Cc: akpm@linux-foundation.org, vgoyal@redhat.com, dyoung@redhat.com, xueshuai@linux.alibaba.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, osandov@osandov.com, kernel-team@meta.com Subject: Re: [PATCH v2] vmcoreinfo: make hwerr_data visible for debugging Message-ID: References: <20260122-fix_vmcoreinfo-v2-1-2d6311f9e36c@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260122-fix_vmcoreinfo-v2-1-2d6311f9e36c@debian.org> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 01/22/26 at 02:39am, Breno Leitao wrote: > If the kernel is compiled with LTO, hwerr_data symbol might be lost, and > vmcoreinfo doesn't have it dumped. This is currently seen in some > production kernels with LTO enabled. > > Remove the static qualifier from hwerr_data so that the information is > still preserved when the kernel is built with LTO. Making hwerr_data > a global symbol ensures its debug info survives the LTO link process and > appears in kallsyms. Also document it, so, it doesn't get removed in the > future as suggested by akpm. > > Signed-off-by: Breno Leitao > --- > Changes in v2: > - Add a comment to explain why the array is global (akpm) > - Link to v1: https://patch.msgid.link/20260121-fix_vmcoreinfo-v1-1-39e96fab670e@debian.org > --- > kernel/vmcore_info.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) LGTM, Acked-by: Baoquan He BTW, is it worth a 'Fixes' tag? > > diff --git a/kernel/vmcore_info.c b/kernel/vmcore_info.c > index 22b3205dd4dc5..46198580373a4 100644 > --- a/kernel/vmcore_info.c > +++ b/kernel/vmcore_info.c > @@ -36,7 +36,11 @@ struct hwerr_info { > time64_t timestamp; > }; > > -static struct hwerr_info hwerr_data[HWERR_RECOV_MAX]; > +/* > + * The hwerr_data[] array is declared with global scope so that it remains > + * accessible to vmcoreinfo even when Link Time Optimization (LTO) is enabled. > + */ > +struct hwerr_info hwerr_data[HWERR_RECOV_MAX]; > > Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type, > void *data, size_t data_len) > > --- > base-commit: 053966c344dbd346e71305f530e91ea77916189f > change-id: 20260121-fix_vmcoreinfo-01592f705a77 > > Best regards, > -- > Breno Leitao >