Re: [PATCH] makedumpfile add dmesg PRINTK_CALLER id support

2024-01-23 Thread 萩尾 一仁
On 2024/01/11 15:55, HAGIO KAZUHITO(萩尾 一仁) wrote: > On 2023/12/29 5:33, Edward Chron wrote: >> Submission to Project: makedumpfile >> Component: dmesg >> Files: printk.c makedumpfile.c makedumpfile.h >> Code level patch applied against: 1.7.4++ - latest code pulled from >> https://github.com/

[PATCH linux-next v3 11/14] mips, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on mips with some adjustments. Here use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compiling in the crashkernel reservation code. Signed-off-by: Baoqu

[PATCH linux-next v3 12/14] riscv, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on risc-v with some adjustments. Here wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery, and use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if

[PATCH linux-next v3 09/14] s390, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on s390 with some adjustments. Here wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery. Signed-off-by: Baoquan He --- arch/s390/kernel/kexec_elf.c

[PATCH linux-next v3 10/14] sh, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on SuperH with some adjustments. wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery, and use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compi

[PATCH linux-next v3 07/14] arm64, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on arm64 with some adjustments. Here wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery. Signed-off-by: Baoquan He --- arch/arm64/include/asm/kexec

[PATCH linux-next v3 14/14] loongarch, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on loongarch with some adjustments. Here use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compiling in the crashkernel reservation code. Signed-off-by:

[PATCH linux-next v3 13/14] arm, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on arm with some adjustments. Here use CONFIG_CRASH_RESERVE ifdef to replace CONFIG_KEXEC ifdef. Signed-off-by: Baoquan He --- v2->v3: - Fix the lkp reported

[PATCH linux-next v3 08/14] ppc, crash: enforce KEXEC and KEXEC_FILE to select CRASH_DUMP

2024-01-23 Thread Baoquan He
In PowerPC, the crash dumping and kexec reboot share code in arch_kexec_locate_mem_hole(), in which struct crash_mem is used. Here enfoce enforce KEXEC and KEXEC_FILE to select CRASH_DUMP for now. Signed-off-by: Baoquan He --- arch/powerpc/Kconfig | 5 + 1 file changed, 5 insertions(+) dif

[PATCH linux-next v3 06/14] x86, crash: wrap crash dumping code into crash related ifdefs

2024-01-23 Thread Baoquan He
Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on x86 with some adjustments. Here, also change some ifdefs or IS_ENABLED() check to more appropriate ones, e,g - #ifdef CONFIG_KEXEC_CORE -> #ifdef CONFIG_CRA

[PATCH linux-next v3 04/14] crash: split crash dumping code out from kexec_core.c

2024-01-23 Thread Baoquan He
Currently, KEXEC_CORE select CRASH_CORE automatically because crash codes need be built in to avoid compiling error when building kexec code even though the crash dumping functionality is not enabled. E.g CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_KEXEC=y CONFIG_KEXEC_FILE=

[PATCH linux-next v3 05/14] crash: clean up kdump related config items

2024-01-23 Thread Baoquan He
By splitting CRASH_RESERVE and VMCORE_INFO out from CRASH_CORE, cleaning up the dependency of FA_DMUMP on CRASH_DUMP, and moving crash codes from kexec_core.c to crash_core.c, now we can rearrange CRASH_DUMP to depend on KEXEC_CORE, and make CRASH_DUMP select CRASH_RESERVE and VMCORE_INFO. KEXEC_C

[PATCH linux-next v3 03/14] crash: remove dependency of FA_DUMP on CRASH_DUMP

2024-01-23 Thread Baoquan He
In kdump kernel, /proc/vmcore is an elf file mapping the crashed kernel's old memory content. Its elf header is constructed in 1st kernel and passed to kdump kernel via elfcorehdr_addr. Config CRASH_DUMP enables the code of 1st kernel's old memory accessing in different architectures. Currently, c

[PATCH linux-next v3 02/14] crash: split vmcoreinfo exporting code out from crash_core.c

2024-01-23 Thread Baoquan He
Now move the relevant codes into separate files: kernel/crash_reserve.c, include/linux/crash_reserve.h. And add config item CRASH_RESERVE to control its enabling. And also update the old ifdeffery of CONFIG_CRASH_CORE, including of and config item dependency on CRASH_CORE accordingly. And also

[PATCH linux-next v3 01/14] kexec: split crashkernel reservation code out from crash_core.c

2024-01-23 Thread Baoquan He
Both kdump and fa_dump of ppc rely on crashkernel reservation. Move the relevant codes into separate files: crash_reserve.c, include/linux/crash_reserve.h. And also add config item CRASH_RESERVE to control its enabling of the codes. And update config items which has relationship with crashkernel r

[PATCH linux-next v3 00/14] Split crash out from kexec and clean up related config items

2024-01-23 Thread Baoquan He
Motivation: = Previously, LKP reported a building error. When investigating, it can't be resolved reasonablly with the present messy kdump config items. https://lore.kernel.org/oe-kbuild-all/202312182200.ka7mzifq-...@intel.com/ The kdump (crash dumping) related config items could cau

Re: [PATCH v4 1/7] ima: define and call ima_alloc_kexec_file_buf

2024-01-23 Thread Stefan Berger
On 1/23/24 21:54, Stefan Berger wrote: On 1/22/24 13:37, Tushar Sugandhi wrote: Refactor ima_dump_measurement_list() to move the memory allocation part to a separate function ima_alloc_kexec_file_buf() which allocates buffer of size 'kexec_segment_size' at kexec 'load'.  Make the local vari

Re: [PATCH v4 1/7] ima: define and call ima_alloc_kexec_file_buf

2024-01-23 Thread Stefan Berger
On 1/22/24 13:37, Tushar Sugandhi wrote: Refactor ima_dump_measurement_list() to move the memory allocation part to a separate function ima_alloc_kexec_file_buf() which allocates buffer of size 'kexec_segment_size' at kexec 'load'. Make the local variable ima_kexec_file in function ima_dump_m

Re: [PATCH v4 6/7] ima: make the kexec extra memory configurable

2024-01-23 Thread Stefan Berger
On 1/23/24 16:19, Tushar Sugandhi wrote: Thanks again Stefan for taking a look. On 1/23/24 11:02, Stefan Berger wrote: On 1/22/24 13:38, Tushar Sugandhi wrote: The extra memory allocated for carrying the IMA measurement list across kexec is hardcoded as half a PAGE.  Make it configurable.

Re: [PATCH v4 6/7] ima: make the kexec extra memory configurable

2024-01-23 Thread Tushar Sugandhi
Thanks again Stefan for taking a look. On 1/23/24 11:02, Stefan Berger wrote: On 1/22/24 13:38, Tushar Sugandhi wrote: The extra memory allocated for carrying the IMA measurement list across kexec is hardcoded as half a PAGE.  Make it configurable. Define a Kconfig option, IMA_KEXEC_EXTRA_ME

Re: [PATCH v4 5/7] ima: suspend measurements during buffer copy at kexec execute

2024-01-23 Thread Tushar Sugandhi
On 1/23/24 10:18, Stefan Berger wrote: On 1/22/24 13:38, Tushar Sugandhi wrote: New measurements added to the IMA log while the log is being copied during the kexec 'execute' may not get copied over.  This can cause the measurement log to be out of sync with the IMA TPM PCR, which could I

Re: [PATCH v4 2/7] kexec: define functions to map and unmap segments

2024-01-23 Thread Tushar Sugandhi
Thanks Stefan for taking a look. On 1/23/24 09:03, Stefan Berger wrote: On 1/22/24 13:37, Tushar Sugandhi wrote: Implement kimage_map_segment() to enable mapping of IMA buffer source pages to the kimage structure post kexec 'load'.  This function, accepting a kimage pointer, an address, and a

Re: [PATCH v4 6/7] ima: make the kexec extra memory configurable

2024-01-23 Thread Stefan Berger
On 1/22/24 13:38, Tushar Sugandhi wrote: The extra memory allocated for carrying the IMA measurement list across kexec is hardcoded as half a PAGE. Make it configurable. Define a Kconfig option, IMA_KEXEC_EXTRA_MEMORY_KB, to configure the extra memory (in kb) to be allocated for IMA measurem

Re: [PATCH v4 5/7] ima: suspend measurements during buffer copy at kexec execute

2024-01-23 Thread Stefan Berger
On 1/22/24 13:38, Tushar Sugandhi wrote: New measurements added to the IMA log while the log is being copied during the kexec 'execute' may not get copied over. This can cause the measurement log to be out of sync with the IMA TPM PCR, which could It could be out of sync with any PCR that I

Re: [PATCH v4 2/7] kexec: define functions to map and unmap segments

2024-01-23 Thread Stefan Berger
On 1/22/24 13:37, Tushar Sugandhi wrote: Implement kimage_map_segment() to enable mapping of IMA buffer source pages to the kimage structure post kexec 'load'. This function, accepting a kimage pointer, an address, and a size, will gather the source pages within the specified address range, c

Re: [PATCH v15 5/5] powerpc: add crash memory hotplug support

2024-01-23 Thread Hari Bathini
On 11/01/24 4:21 pm, Sourabh Jain wrote: Extend the arch crash hotplug handler, as introduced by the patch title ("powerpc: add crash CPU hotplug support"), to also support memory add/remove events. Elfcorehdr describes the memory of the crash kernel to capture the kernel; hence, it needs to

Re: [PATCH v15 4/5] powerpc: add crash CPU hotplug support

2024-01-23 Thread Hari Bathini
On 11/01/24 4:21 pm, Sourabh Jain wrote: Due to CPU/Memory hotplug or online/offline events, the elfcorehdr (which describes the CPUs and memory of the crashed kernel) and FDT (Flattened Device Tree) of kdump image becomes outdated. Consequently, attempting dump collection with an outdated elf