• David Hildenbrand's avatar
    memblock: add MEMBLOCK_DRIVER_MANAGED to mimic IORESOURCE_SYSRAM_DRIVER_MANAGED · f7892d8e
    David Hildenbrand authored
    Let's add a flag that corresponds to IORESOURCE_SYSRAM_DRIVER_MANAGED,
    indicating that we're dealing with a memory region that is never
    indicated in the firmware-provided memory map, but always detected and
    added by a driver.
    
    Similar to MEMBLOCK_HOTPLUG, most infrastructure has to treat such
    memory regions like ordinary MEMBLOCK_NONE memory regions -- for
    example, when selecting memory regions to add to the vmcore for dumping
    in the crashkernel via for_each_mem_range().
    
    However, especially kexec_file is not supposed to select such memblocks
    via for_each_free_mem_range() / for_each_free_mem_range_reverse() to
    place kexec images, similar to how we handle
    IORESOURCE_SYSRAM_DRIVER_MANAGED without CONFIG_ARCH_KEEP_MEMBLOCK.
    
    We'll make sure that memory hotplug code sets the flag where applicable
    (IORESOURCE_SYSRAM_DRIVER_MANAGED) next.  This prepares architectures
    that need CONFIG_ARCH_KEEP_MEMBLOCK, such as arm64, for virtio-mem...
    f7892d8e
kexec_file.c 33.6 KB