]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/boot: Replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR
authorWei Yang <richard.weiyang@gmail.com>
Wed, 13 Mar 2024 07:58:37 +0000 (07:58 +0000)
committerIngo Molnar <mingo@kernel.org>
Fri, 22 Mar 2024 10:36:45 +0000 (11:36 +0100)
Both __PHYSICAL_START and LOAD_PHYSICAL_ADDR are defined to get aligned
CONFIG_PHYSICAL_START, so we can replace __PHYSICAL_START with
LOAD_PHYSICAL_ADDR. And then remove the definition of __PHYSICAL_START,
which is only used to define __START_KERNEL.

Since <asm/boot.h> includes <asm/pgtable_types.h>, which includes
<asm/page_types.h>, it is fine to move definition from <asm/boot.h> to
<asm/page_types.h>.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240313075839.8321-3-richard.weiyang@gmail.com
arch/x86/include/asm/boot.h
arch/x86/include/asm/page_types.h

index a38cc0afc90a0b90a65340bed48c7db243614b35..12cbc57d0128d01544f58864b9ccdbead493b764 100644 (file)
@@ -6,11 +6,6 @@
 #include <asm/pgtable_types.h>
 #include <uapi/asm/boot.h>
 
-/* Physical address where kernel should be loaded. */
-#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
-                               + (CONFIG_PHYSICAL_ALIGN - 1)) \
-                               & ~(CONFIG_PHYSICAL_ALIGN - 1))
-
 /* Minimum kernel alignment, as a power of two */
 #ifdef CONFIG_X86_64
 # define MIN_KERNEL_ALIGN_LG2  PMD_SHIFT
index 86bd4311daf8a5046e5fa4cb71979535667a2e3d..acc1620fd121f1751c45095e7e3cca61d759b7bb 100644 (file)
 
 #define VM_DATA_DEFAULT_FLAGS  VM_DATA_FLAGS_TSK_EXEC
 
-#define __PHYSICAL_START       ALIGN(CONFIG_PHYSICAL_START, \
-                                     CONFIG_PHYSICAL_ALIGN)
+/* Physical address where kernel should be loaded. */
+#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
+                               + (CONFIG_PHYSICAL_ALIGN - 1)) \
+                               & ~(CONFIG_PHYSICAL_ALIGN - 1))
 
-#define __START_KERNEL         (__START_KERNEL_map + __PHYSICAL_START)
+#define __START_KERNEL         (__START_KERNEL_map + LOAD_PHYSICAL_ADDR)
 
 #ifdef CONFIG_X86_64
 #include <asm/page_64_types.h>