[lkml]   [2019]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v16 5/7] x86/boot: Early parse RSDP and fill in boot_params
On Wed, Jan 23, 2019 at 07:08:48PM +0800, Chao Fan wrote:
> #endif /* CONFIG_ACPI */
>diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
>index 8dd1d5ccae58..86fa8bf56d68 100644
>--- a/arch/x86/boot/compressed/misc.c
>+++ b/arch/x86/boot/compressed/misc.c
>@@ -382,6 +382,13 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
> debug_putaddr(trampoline_32bit);
> #endif
>+ /*
>+ * Very early parse RSDP and fill in boot_params.
>+ * Early parsing is only executed once, and later anyone who
>+ * needs RSDP can gain RSDP address by boot_params but not parse again.
>+ */
>+ boot_params->acpi_rsdp_addr = get_rsdp_addr();

Hi Boris and Kairui,

I splite my v15 PATCH 5/6 to two patches, this v16 5/7 is new added.
Since as Boris said much code such as Kairui's need RSDP where is not
related to KASLR, but in my v15 version, the function entry is only
in kaslr.c. So I expose get_rsdp_addr() as not static, and fill in
boot_params without #ifdef KASLR issue ot MEMORY_HOTREMOVE and so on.
More code can gain the RSDP by boot_params.

Since in KALSR, we need RSDP to parse SRAT and gain memroy information,
so I put boot_params->acpi_rsdp_addr = get_rsdp_addr(); just before
choose_random_location(), in which KASLR works. Then in this version
v16 PATCH 6/7, only try to gain RSDP by boot_params and not parse again.

So I think this method can cover other people's usage, such as Kairui
Song, how do you think this change.

Chao Fan

> /*
> * The memory hole needed for the kernel is the larger of either
> * the entire decompressed kernel plus relocation table, or the
>diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
>index 764ad50c0119..e1dd15769cf3 100644
>--- a/arch/x86/boot/compressed/misc.h
>+++ b/arch/x86/boot/compressed/misc.h
>@@ -119,3 +119,10 @@ static inline void console_init(void)
> void set_sev_encryption_mask(void);
> #endif
>+/* acpi.c */
>+#ifdef CONFIG_ACPI
>+acpi_physical_address get_rsdp_addr(void);
>+static inline acpi_physical_address get_rsdp_addr(void) { return 0; }

 \ /
  Last update: 2019-01-23 12:19    [W:0.202 / U:3.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site