Re: [PATCH v2 1/2] KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown

2023-12-11 Thread Eric W. Biederman
"Gowans, James" writes: > On Mon, 2023-12-11 at 09:54 +0200, James Gowans wrote: >> > >> > What problem are you running into with your rebase that worked with >> > reboot notifiers that is not working with syscore_shutdown? >> >> Prior to this commit [1] which changed KVM from reboot notifiers

Re: [PATCHv4 05/14] x86/kvm: Do not try to disable kvmclock if it was not enabled

2023-12-11 Thread Kirill A. Shutemov
On Tue, Dec 05, 2023 at 03:45:01AM +0300, Kirill A. Shutemov wrote: > kvm_guest_cpu_offline() tries to disable kvmclock regardless if it is > present in the VM. It leads to write to a MSR that doesn't exist on some > configurations, namely in TDX guest: > > unchecked MSR access error: WRMSR

Re: [PATCH v2 1/2] KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown

2023-12-11 Thread Gowans, James
On Mon, 2023-12-11 at 09:34 -0800, Sean Christopherson wrote: > On Sat, Dec 09, 2023, James Gowans wrote: > > Thoughts on possible ways to fix this: > > a) go back to reboot notifiers > > b) get kexec to call syscore_shutdown() to invoke all of these callbacks > > c) Add a KVM-specific callback to

Re: [PATCH v2 1/2] KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown

2023-12-11 Thread Sean Christopherson
On Mon, Dec 11, 2023, Sean Christopherson wrote: > On Sat, Dec 09, 2023, James Gowans wrote: > > Hi Sean, > > > > Blast from the past but I've just been bitten by this patch when > > rebasing across v6.4. > > > > On Fri, 2023-05-12 at 16:31 -0700, Sean Christopherson wrote: > > > Use

Re: [PATCH v2 1/2] KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown

2023-12-11 Thread Sean Christopherson
On Sat, Dec 09, 2023, James Gowans wrote: > Hi Sean, > > Blast from the past but I've just been bitten by this patch when > rebasing across v6.4. > > On Fri, 2023-05-12 at 16:31 -0700, Sean Christopherson wrote: > > Use syscore_ops.shutdown to disable hardware virtualization during a > > reboot

Re: [PATCH v2 1/2] KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown

2023-12-11 Thread Gowans, James
On Mon, 2023-12-11 at 09:54 +0200, James Gowans wrote: > > > > What problem are you running into with your rebase that worked with > > reboot notifiers that is not working with syscore_shutdown? > > Prior to this commit [1] which changed KVM from reboot notifiers to > syscore_ops, KVM's reboot

Re: [PATCH 0/5] kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC

2023-12-11 Thread Baoquan He
On 12/11/23 at 09:25am, Geert Uytterhoeven wrote: > Hi Baoquan, > > On Fri, Dec 8, 2023 at 8:43 AM Baoquan He wrote: > > Forgot adding kexec to CC, add it now. > > > > On 12/08/23 at 03:30pm, Baoquan He wrote: > > > The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be > > >

[PATCH v14 6/6] powerpc: add crash memory hotplug support

2023-12-11 Thread Sourabh Jain
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 be updated if memory resources change due to

[PATCH v14 5/6] powerpc: add crash CPU hotplug support

2023-12-11 Thread Sourabh Jain
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 elfcorehdr or FDT can lead to failed or

[PATCH v14 3/6] crash: add a new kexec flag for FDT update

2023-12-11 Thread Sourabh Jain
The commit a72bbec70da2 ("crash: hotplug support for kexec_load()") introduced a new kexec flag, `KEXEC_UPDATE_ELFCOREHDR`. Kexec tool uses this flag to indicate kernel that it is safe to modify the elfcorehdr of kdump image loaded using kexec_load system call. Similarly, add a new kexec flag,

[PATCH v14 1/6] crash: forward memory_notify arg to arch crash hotplug handler

2023-12-11 Thread Sourabh Jain
In the event of memory hotplug or online/offline events, the crash memory hotplug notifier `crash_memhp_notifier()` receives a `memory_notify` object but doesn't forward that object to the generic and architecture-specific crash hotplug handler. The `memory_notify` object contains the starting

[PATCH v14 0/6] powerpc/crash: Kernel handling of CPU and memory hotplug

2023-12-11 Thread Sourabh Jain
Commit 247262756121 ("crash: add generic infrastructure for crash hotplug support") added a generic infrastructure that allows architectures to selectively update the kdump image component during CPU or memory add/remove events within the kernel itself. This patch series adds crash hotplug

[PATCH v14 4/6] powerpc/kexec: turn some static helper functions public

2023-12-11 Thread Sourabh Jain
Move the functions update_cpus_node and get_crash_memory_ranges from kexec/file_load_64.c to kexec/core_64.c to make these functions usable by other kexec components. get_crash_memory_ranges uses functions defined in ranges.c, so take ranges.c out of CONFIG_KEXEC_FILE. Later in the series, these

[PATCH v14 2/6] crash: make CPU and Memory hotplug support reporting flexible

2023-12-11 Thread Sourabh Jain
Architectures' specific functions `arch_crash_hotplug_cpu_support()` and `arch_crash_hotplug_memory_support()` advertise the kernel's capability to update the kdump image on CPU and Memory hotplug events to userspace via the sysfs interface. These architecture-specific functions need to access

Re: [PATCH 0/5] kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC

2023-12-11 Thread Geert Uytterhoeven
Hi Baoquan, On Fri, Dec 8, 2023 at 8:43 AM Baoquan He wrote: > Forgot adding kexec to CC, add it now. > > On 12/08/23 at 03:30pm, Baoquan He wrote: > > The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be > > dropped, then compiling errors will be triggered if below config > >