From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) (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 B32E023FC49 for ; Thu, 27 Nov 2025 02:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.206.16.166 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764209139; cv=none; b=ddYB2MUCGBO5bFmwv54SI83zEiZ6sv4JmL2uMcC0X7FkwpvgnWY0/G7Lbo5y6rngobIsSPxaazzWH42RSLB0ufMFlNs7X2qTk7//qwIKumc03BHWv2Ag7RIw7BQpEq0NRKFT54WBcTo3klRrWr9dx51zRzx56FCHQUbNfuBZnG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764209139; c=relaxed/simple; bh=6AsNPfhscUQ90tIcLbE/CeQ4gPEGEYCittbJxZhI0Aw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lIdRkLtEo25gMLyMyvZDrmaAR13ZWksyEHgFBUSsQgjr8ynzASPwmWDlKBtaNYJStICHIUjHXHKjPh2Y1u3v7JTCPEeK5ASUqPgdbQC+R7z8rW2GMfsIL2kWD7mVN/e3yVWuVh8wbnLySJurjl+VjdKARuXd7ICFw1Ym9/3569w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=TL02DivB; arc=none smtp.client-ip=54.206.16.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="TL02DivB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1764209085; bh=7TMgDKcDuO+a8FfAIh1HPsiWfN4auU+j7X84cJy2PqI=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=TL02DivB5EG91RciylFvYaz8VARrKC2kDwcxw1viJMld8VBpzx9sJfOmCZYfTtss/ abeuQ0OBewrjfC7cXvq8h8XRO4Jw+tpPqXDBmsnvqrtplCdDeMZZflO+IlkNY0VNl7 DNlGg3WDJQqFZezyGIbfN/wUY6PcEaiwi4m1PqCM= X-QQ-mid: zesmtpsz3t1764209082t75e6d365 X-QQ-Originating-IP: R1W27mN1EIMknNwOxEf8GO3kaReNAsp7u29qKwy7uE4= Received: from [10.10.74.117] ( [123.114.60.34]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 27 Nov 2025 10:04:40 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 18002369747829108487 Message-ID: <63BA9935197ADF34+2a3faf95-36da-46f1-b9b5-4e438e75d1be@uniontech.com> Date: Thu, 27 Nov 2025 10:04:40 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/3] kexec: print out debugging message if required for kexec_load To: Baoquan He Cc: akpm@linux-foundation.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org References: <20251126084427.3222212-1-maqianga@uniontech.com> Content-Language: en-US From: Qiang Ma In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpsz:uniontech.com:qybglogicsvrsz:qybglogicsvrsz3b-0 X-QQ-XMAILINFO: OBUGnm9pFasAsKetXCa/DoGk7sp8vSZ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3NWYXaVvKA/UQgVU8bmBWCcoU o6OSjgOmcRa X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= X-QQ-RECHKSPAM: 0 在 2025/11/27 09:47, Baoquan He 写道: > Hi, > > On 11/26/25 at 04:44pm, Qiang Ma wrote: >> Overview: >> ========= >> The commit a85ee18c7900 ("kexec_file: print out debugging message >> if required") has added general code printing in kexec_file_load(), >> but not in kexec_load(). >> >> Since kexec_load and kexec_file_load are not triggered simultaneously, >> we can unify the debug flag of kexec and kexec_file as kexec_dbg_print. > As I said in your last post, this is not needed at all, you just add a > not needed thing to kernel. > > So NACK this patchset, unless you have reason to justify it. Sorry about > it. The segment prints discussed in the last post, this patchset has been removed, leaving only type/start/head of kimage and flags. I think the current patchset is still necessary. For example, renaming kexec_file_dbg_print is still necessary, but not for kexec_file. > Thanks > Baoquan > >> >> Next, we need to do some things in this patchset: >> >> 1. rename kexec_file_dbg_print to kexec_dbg_print >> 2. Add KEXEC_DEBUG >> 3. Initialize kexec_dbg_print for kexec >> 4. Fix uninitialized struct kimage *image pointer >> 5. Set the reset of kexec_dbg_print to kimage_free >> >> Testing: >> ========= >> I did testing on x86_64, arm64 and loongarch. On x86_64, the printed messages >> look like below: >> >> unset CONFIG_KEXEC_FILE: >> [ 81.502374] kexec: kexec_load: type:0, start:0x23fff7700 head:0x10a4b9002 flags:0x3e0010 >> >> set CONFIG_KEXEC_FILE >> [ 36.774228] kexec_file: kernel: 0000000066c386c8 kernel_size: 0xd78400 >> [ 36.821814] kexec-bzImage64: Loaded purgatory at 0x23fffb000 >> [ 36.821826] kexec-bzImage64: Loaded boot_param, command line and misc at 0x23fff9000 bufsz=0x12d0 memsz=0x2000 >> [ 36.821829] kexec-bzImage64: Loaded 64bit kernel at 0x23d400000 bufsz=0xd73400 memsz=0x2ab7000 >> [ 36.821918] kexec-bzImage64: Loaded initrd at 0x23bd0b000 bufsz=0x16f40a8 memsz=0x16f40a8 >> [ 36.821920] kexec-bzImage64: Final command line is: root=/dev/mapper/test-root crashkernel=auto rd.lvm.lv=test/root >> [ 36.821925] kexec-bzImage64: E820 memmap: >> [ 36.821926] kexec-bzImage64: 0000000000000000-000000000009ffff (1) >> [ 36.821928] kexec-bzImage64: 0000000000100000-0000000000811fff (1) >> [ 36.821930] kexec-bzImage64: 0000000000812000-0000000000812fff (2) >> [ 36.821931] kexec-bzImage64: 0000000000813000-00000000bee38fff (1) >> [ 36.821933] kexec-bzImage64: 00000000bee39000-00000000beec2fff (2) >> [ 36.821934] kexec-bzImage64: 00000000beec3000-00000000bf8ecfff (1) >> [ 36.821935] kexec-bzImage64: 00000000bf8ed000-00000000bfb6cfff (2) >> [ 36.821936] kexec-bzImage64: 00000000bfb6d000-00000000bfb7efff (3) >> [ 36.821937] kexec-bzImage64: 00000000bfb7f000-00000000bfbfefff (4) >> [ 36.821938] kexec-bzImage64: 00000000bfbff000-00000000bff7bfff (1) >> [ 36.821939] kexec-bzImage64: 00000000bff7c000-00000000bfffffff (2) >> [ 36.821940] kexec-bzImage64: 00000000feffc000-00000000feffffff (2) >> [ 36.821941] kexec-bzImage64: 00000000ffc00000-00000000ffffffff (2) >> [ 36.821942] kexec-bzImage64: 0000000100000000-000000023fffffff (1) >> [ 36.872348] kexec_file: nr_segments = 4 >> [ 36.872356] kexec_file: segment[0]: buf=0x000000005314ece7 bufsz=0x4000 mem=0x23fffb000 memsz=0x5000 >> [ 36.872370] kexec_file: segment[1]: buf=0x000000006e59b143 bufsz=0x12d0 mem=0x23fff9000 memsz=0x2000 >> [ 36.872374] kexec_file: segment[2]: buf=0x00000000eb7b1fc3 bufsz=0xd73400 mem=0x23d400000 memsz=0x2ab7000 >> [ 36.882172] kexec_file: segment[3]: buf=0x000000006af76441 bufsz=0x16f40a8 mem=0x23bd0b000 memsz=0x16f5000 >> [ 36.889113] kexec_file: kexec_file_load: type:0, start:0x23fffb150 head:0x101a2e002 flags:0x8 >> >> Changes in v3: >> ========== >> - Rename kexec_core_dbg_print to kexec_dbg_print >> - Remove unnecessary segments prints >> - Remove patch "kexec_file: Fix the issue of mismatch between loop variable types" >> >> Qiang Ma (3): >> kexec: Fix uninitialized struct kimage *image pointer >> kexec: add kexec flag to control debug printing >> kexec: print out debugging message if required for kexec_load >> >> include/linux/kexec.h | 9 +++++---- >> include/uapi/linux/kexec.h | 1 + >> kernel/kexec.c | 8 +++++++- >> kernel/kexec_core.c | 4 +++- >> kernel/kexec_file.c | 4 +--- >> 5 files changed, 17 insertions(+), 9 deletions(-) >> >> -- >> 2.20.1 >> >