Hi Eric, On 15/04/2020 21:33, Eric W. Biederman wrote: > James Morse <james.morse@xxxxxxx> writes: > >> An image loaded for kexec is not stored in place, instead its segments >> are scattered through memory, and are re-assembled when needed. In the >> meantime, the target memory may have been removed. >> >> Because mm is not aware that this memory is still in use, it allows it >> to be removed. >> >> Add a memory notifier to prevent the removal of memory regions that >> overlap with a loaded kexec image segment. e.g., when triggered from the >> Qemu console: >> | kexec_core: memory region in use >> | memory memory32: Offline failed. >> >> Signed-off-by: James Morse <james.morse@xxxxxxx> > > Given that we are talking about the destination pages for kexec > not where the loaded kernel is currently stored the description is > confusing. I think David has some better wording to cover this. I thought I had it with 'scattered and re-assembled'. > Beyond that I think it would be better to simply unload the loaded > kernel at memory hotunplug time. Unconditionally, or if it aliases the removed region? I don't particular like it. User-space has asked for two impossible things, we are changing the answer to the first when we see the second. Its a bit spooky. (maybe no one will notice) > Usually somewhere in the loaded image > is a copy of the memory map at the time the kexec kernel was loaded. > That will invalidate the memory map as well. Ah, unconditionally. Sure, x86 needs this. (arm64 re-discovers the memory map from firmware tables after kexec) If that's an acceptable change in behaviour, sure, lets do that. > All of this should be for a very brief window of a few seconds, as > the loaded kexec image is quite short. It seems I'm the outlier anticipating anything could happen between those syscalls. Thanks, James _______________________________________________ kexec mailing list kexec@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/kexec