On Mon, 16 Aug 2021 15:26:22 +0300, Mike Rapoport wrote:
> From: Mike Rapoport <[email protected]>
> 
> There are a lot of uses of memblock_find_in_range() along with
> memblock_reserve() from the times memblock allocation APIs did not exist.
> 
> memblock_find_in_range() is the very core of memblock allocations, so any
> future changes to its internal behaviour would mandate updates of all the
> users outside memblock.
> 
> Replace the calls to memblock_find_in_range() with an equivalent calls to
> memblock_phys_alloc() and memblock_phys_alloc_range() and make
> memblock_find_in_range() private method of memblock.
> 
> This simplifies the callers, ensures that (unlikely) errors in
> memblock_reserve() are handled and improves maintainability of
> memblock_find_in_range().
> 
> Signed-off-by: Mike Rapoport <[email protected]>
> Acked-by: Kirill A. Shutemov <[email protected]>
> Acked-by: Rafael J. Wysocki <[email protected]>      # ACPI
> Acked-by: Russell King (Oracle) <[email protected]>
> Acked-by: Nick Kossifidis <[email protected]>                 # riscv
> Reviewed-by: Catalin Marinas <[email protected]>                # arm64
> ---
> v5:
> * restore the original behaviour on x86 with addition of more elaborate
>   comment; I will address the issue in memory_map_top_down() in a separate
>   series.
> 
> v4: https://lore.kernel.org/lkml/[email protected]
> * Add patch that prevents the crashes reported by Guenter Roeck on x86/i386
>   on QEMU with 256M or 512M of memory and EFI boot enabled.
> * Add Acked-by and Reviewed-by, thanks everybidy!
> 
> v3: https://lore.kernel.org/lkml/[email protected]
> * simplify check for exact crash kerenl allocation on arm, per Rob
> * make crash_max unsigned long long on arm64, per Rob
> 
> v2: https://lore.kernel.org/lkml/[email protected]
> * don't change error message in arm::reserve_crashkernel(), per Russell
> 
> v1: https://lore.kernel.org/lkml/[email protected]
> 
> 
>  arch/arm/kernel/setup.c           | 20 +++++---------
>  arch/arm64/kvm/hyp/reserved_mem.c |  9 +++----
>  arch/arm64/mm/init.c              | 36 ++++++++-----------------
>  arch/mips/kernel/setup.c          | 14 +++++-----
>  arch/riscv/mm/init.c              | 44 ++++++++++---------------------
>  arch/s390/kernel/setup.c          | 10 ++++---
>  arch/x86/kernel/aperture_64.c     |  5 ++--
>  arch/x86/mm/init.c                | 23 ++++++++++------
>  arch/x86/mm/numa.c                |  5 ++--
>  arch/x86/mm/numa_emulation.c      |  5 ++--
>  arch/x86/realmode/init.c          |  2 +-
>  drivers/acpi/tables.c             |  5 ++--
>  drivers/base/arch_numa.c          |  5 +---
>  drivers/of/of_reserved_mem.c      | 12 ++++++---
>  include/linux/memblock.h          |  2 --
>  mm/memblock.c                     |  2 +-
>  16 files changed, 81 insertions(+), 118 deletions(-)
> 

Acked-by: Rob Herring <[email protected]>
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to