Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/boot: Use __ALIGN_KERNEL_MASK() instead of open coded analogue

LOAD_PHYSICAL_ADDR is calculated as an aligned (up) CONFIG_PHYSICAL_START
with the respective alignment value CONFIG_PHYSICAL_ALIGN. However,
the code is written openly while we have __ALIGN_KERNEL_MASK() macro
that does the same. This macro has nothing special, that's why
it may be used in assembler code or linker scripts (on the contrary
__ALIGN_KERNEL() may not). Do it so.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250404165303.3657139-1-andriy.shevchenko@linux.intel.com

authored by

Andy Shevchenko and committed by
Ingo Molnar
0ee07a07 dda88878

+1 -3
+1 -3
arch/x86/include/asm/page_types.h
··· 29 29 #define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC 30 30 31 31 /* Physical address where kernel should be loaded. */ 32 - #define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ 33 - + (CONFIG_PHYSICAL_ALIGN - 1)) \ 34 - & ~(CONFIG_PHYSICAL_ALIGN - 1)) 32 + #define LOAD_PHYSICAL_ADDR __ALIGN_KERNEL_MASK(CONFIG_PHYSICAL_START, CONFIG_PHYSICAL_ALIGN - 1) 35 33 36 34 #define __START_KERNEL (__START_KERNEL_map + LOAD_PHYSICAL_ADDR) 37 35