From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AA8FA8827 for ; Sun, 4 Feb 2024 07:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707031235; cv=none; b=fjT381/4Deu2mfMz+LdCEJ64RLZOt/yJBReY3dqdO1tbQ5hBatuKmiLc0ZD5fxhBJr5iYEO/iuf7MXTnMBVCwOWnaMXaMnM9adU8NCV2aJdiFGtLlcEjAkonT947JljFx4G0kTnsUsGkmvQ7gf3QKEpdxVPlgcBPaSV5agzasT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707031235; c=relaxed/simple; bh=UEywF//4EW+FW+MnMVOj13AW6T4w3zY6JP1xUHczGZM=; h=Date:To:From:Subject:Message-Id; b=jQM8uD1q05Moz/d3JO6y2dtvbli8FMPSamp8GDUFpPv2XjIeo5Gur6SBS8gEFJXAw3csdK66xo7h/YwjHKQABuOAhD4cbuOBIhyb38lfUwYF9BUhwd6HBk0CvVhWM0Mg9XU8zALlpM+/1Ko0SlGQIW/Akc0mRHrQGBnFPTgreoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=HT22tuB3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="HT22tuB3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 226CEC43399; Sun, 4 Feb 2024 07:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1707031235; bh=UEywF//4EW+FW+MnMVOj13AW6T4w3zY6JP1xUHczGZM=; h=Date:To:From:Subject:From; b=HT22tuB3rLed7Ca9+Wmf3BmbnwWtGgJwmGRgbWx8doGbg4FPlU6e+SXPvKkJiPAfX y5QGkYeUpJ8uYteKM4Scr/nq/oPVek7sXJ39Ps2QEo9OA1L621MrIYVjHGDU+UBn2R yK3UjBu5zELDEi3aFNIalnbUxeacBlPcPGSicN24= Date: Sat, 03 Feb 2024 23:20:34 -0800 To: mm-commits@vger.kernel.org,yang.lee@linux.alibaba.com,viro@zeniv.linux.org.uk,sfr@canb.auug.org.au,piliu@redhat.com,nathan@kernel.org,mhklinux@outlook.com,klarasmodin@gmail.com,hbathini@linux.ibm.com,ebiederm@xmission.com,bhe@redhat.com,akpm@linux-foundation.org From: Andrew Morton Subject: + x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix.patch added to mm-unstable branch Message-Id: <20240204072035.226CEC43399@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: x86, crash: don't nest CONFIG_CRASH_DUMP ifdef inside CONFIG_KEXEC_CODE ifdef scope has been added to the -mm mm-unstable branch. Its filename is x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Baoquan He Subject: x86, crash: don't nest CONFIG_CRASH_DUMP ifdef inside CONFIG_KEXEC_CODE ifdef scope Date: Tue, 30 Jan 2024 10:59:59 +0800 Michael pointed out that the CONFIG_CRASH_DUMP ifdef is nested inside CONFIG_KEXEC_CODE ifdef scope in some XEN, Hyper-V codes. Although the nesting works well too since CONFIG_CRASH_DUMP has dependency on CONFIG_KEXEC_CORE, it may cause confusion because there are places where it's not nested, and people may think it needs to be nested even though it doesn't have to. Fix that by moving CONFIG_CRASH_DUMP ifdeffery of codes out of CONFIG_KEXEC_CODE ifdeffery scope. And also put function machine_crash_shutdown() definition inside CONFIG_CRASH_DUMP ifdef scope instead of CONFIG_KEXEC_CORE ifdef. And also fix a building error Nathan reported as below by replacing CONFIG_KEXEC_CORE ifdef with CONFIG_VMCORE_INFO ifdef. ==== $ curl -LSso .config https://git.alpinelinux.org/aports/plain/community/linux-edge/config-edge.x86_64 $ make -skj"$(nproc)" ARCH=x86_64 CROSS_COMPILE=x86_64-linux- olddefconfig all .. x86_64-linux-ld: arch/x86/xen/mmu_pv.o: in function `paddr_vmcoreinfo_note': mmu_pv.c:(.text+0x3af3): undefined reference to `vmcoreinfo_note' ==== Link: https://lore.kernel.org/all/SN6PR02MB4157931105FA68D72E3D3DB8D47B2@SN6PR02MB4157.namprd02.prod.outlook.com/T/#u Link: https://lore.kernel.org/all/20240126045551.GA126645@dev-arch.thelio-3990X/T/#u Link: https://lkml.kernel.org/r/ZbhmL/jQtZ7TFZqV@MiWiFi-R3L-srv Signed-off-by: Baoquan He Reviewed-by: Michael Kelley Cc: Al Viro Cc: Eric W. Biederman Cc: Hari Bathini Cc: Klara Modin Cc: Nathan Chancellor Cc: Pingfan Liu Cc: Stephen Rothwell Cc: Yang Li Signed-off-by: Andrew Morton --- arch/x86/kernel/cpu/mshyperv.c | 10 ++++++---- arch/x86/kernel/reboot.c | 2 +- arch/x86/xen/enlighten_hvm.c | 4 ++-- arch/x86/xen/mmu_pv.c | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) --- a/arch/x86/kernel/cpu/mshyperv.c~x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix +++ a/arch/x86/kernel/cpu/mshyperv.c @@ -209,6 +209,7 @@ static void hv_machine_shutdown(void) if (kexec_in_progress) hyperv_cleanup(); } +#endif /* CONFIG_KEXEC_CORE */ #ifdef CONFIG_CRASH_DUMP static void hv_machine_crash_shutdown(struct pt_regs *regs) @@ -222,8 +223,7 @@ static void hv_machine_crash_shutdown(st /* Disable the hypercall page when there is only 1 active CPU. */ hyperv_cleanup(); } -#endif -#endif /* CONFIG_KEXEC_CORE */ +#endif /* CONFIG_CRASH_DUMP */ #endif /* CONFIG_HYPERV */ static uint32_t __init ms_hyperv_platform(void) @@ -497,9 +497,11 @@ static void __init ms_hyperv_init_platfo no_timer_check = 1; #endif -#if IS_ENABLED(CONFIG_HYPERV) && defined(CONFIG_KEXEC_CORE) +#if IS_ENABLED(CONFIG_HYPERV) +#if defined(CONFIG_KEXEC_CORE) machine_ops.shutdown = hv_machine_shutdown; -#ifdef CONFIG_CRASH_DUMP +#endif +#if defined(CONFIG_CRASH_DUMP) machine_ops.crash_shutdown = hv_machine_crash_shutdown; #endif #endif --- a/arch/x86/kernel/reboot.c~x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix +++ a/arch/x86/kernel/reboot.c @@ -826,7 +826,7 @@ void machine_halt(void) machine_ops.halt(); } -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_CRASH_DUMP void machine_crash_shutdown(struct pt_regs *regs) { machine_ops.crash_shutdown(regs); --- a/arch/x86/xen/enlighten_hvm.c~x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix +++ a/arch/x86/xen/enlighten_hvm.c @@ -148,6 +148,7 @@ static void xen_hvm_shutdown(void) if (kexec_in_progress) xen_reboot(SHUTDOWN_soft_reset); } +#endif #ifdef CONFIG_CRASH_DUMP static void xen_hvm_crash_shutdown(struct pt_regs *regs) @@ -156,7 +157,6 @@ static void xen_hvm_crash_shutdown(struc xen_reboot(SHUTDOWN_soft_reset); } #endif -#endif static int xen_cpu_up_prepare_hvm(unsigned int cpu) { @@ -238,10 +238,10 @@ static void __init xen_hvm_guest_init(vo #ifdef CONFIG_KEXEC_CORE machine_ops.shutdown = xen_hvm_shutdown; +#endif #ifdef CONFIG_CRASH_DUMP machine_ops.crash_shutdown = xen_hvm_crash_shutdown; #endif -#endif } static __init int xen_parse_nopv(char *arg) --- a/arch/x86/xen/mmu_pv.c~x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix +++ a/arch/x86/xen/mmu_pv.c @@ -2520,7 +2520,7 @@ out: } EXPORT_SYMBOL_GPL(xen_remap_pfn); -#ifdef CONFIG_KEXEC_CORE +#ifdef CONFIG_VMCORE_INFO phys_addr_t paddr_vmcoreinfo_note(void) { if (xen_pv_domain()) _ Patches currently in -mm which might be from bhe@redhat.com are mm-vmalloc-remove-vmap_area_list.patch kexec-split-crashkernel-reservation-code-out-from-crash_corec.patch crash-split-vmcoreinfo-exporting-code-out-from-crash_corec.patch crash-remove-dependency-of-fa_dump-on-crash_dump.patch crash-split-crash-dumping-code-out-from-kexec_corec.patch crash-clean-up-kdump-related-config-items.patch x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix.patch arm64-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch arm64-crash-wrap-crash-dumping-code-into-crash-related-ifdefs-fix.patch ppc-crash-enforce-kexec-and-kexec_file-to-select-crash_dump.patch ppc-crash-enforce-kexec-and-kexec_file-to-select-crash_dump-fix.patch s390-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch sh-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch mips-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch riscv-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch arm-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch loongarch-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch arch-crash-move-arch_crash_save_vmcoreinfo-out-to-file-vmcore_infoc.patch panic-suppress-gnu_printf-warning.patch