Skip to content

Commit 29b0aab

Browse files
RichardWeiYangIngo Molnar
authored and
Ingo Molnar
committed
x86/boot: Replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9b67ce2 commit 29b0aab

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

arch/x86/include/asm/boot.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
#include <asm/pgtable_types.h>
77
#include <uapi/asm/boot.h>
88

9-
/* Physical address where kernel should be loaded. */
10-
#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
11-
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
12-
& ~(CONFIG_PHYSICAL_ALIGN - 1))
13-
149
/* Minimum kernel alignment, as a power of two */
1510
#ifdef CONFIG_X86_64
1611
# define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT

arch/x86/include/asm/page_types.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131

3232
#define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC
3333

34-
#define __PHYSICAL_START ALIGN(CONFIG_PHYSICAL_START, \
35-
CONFIG_PHYSICAL_ALIGN)
34+
/* Physical address where kernel should be loaded. */
35+
#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
36+
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
37+
& ~(CONFIG_PHYSICAL_ALIGN - 1))
3638

37-
#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
39+
#define __START_KERNEL (__START_KERNEL_map + LOAD_PHYSICAL_ADDR)
3840

3941
#ifdef CONFIG_X86_64
4042
#include <asm/page_64_types.h>

0 commit comments

Comments
 (0)