lkml.org 
[lkml]   [2019]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/5] x86/boot: Wrap up the SRAT traversing code into subtable_parse()
On 08/30/19 at 05:47pm, Masayoshi Mizuma wrote:
> From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
>
> Wrap up the SRAT traversing code into subtable_parse().
>
> Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> ---
> arch/x86/boot/compressed/acpi.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
> index 149795c36..908a1bfab 100644
> --- a/arch/x86/boot/compressed/acpi.c
> +++ b/arch/x86/boot/compressed/acpi.c
> @@ -362,6 +362,19 @@ static unsigned long get_acpi_srat_table(void)
> return 0;
> }

Reviewed-by: Baoquan He <bhe@redhat.com>

Thanks
Baoquan
>
> +static void subtable_parse(struct acpi_subtable_header *sub_table, int *num)
> +{
> + struct acpi_srat_mem_affinity *ma;
> +
> + ma = (struct acpi_srat_mem_affinity *)sub_table;
> +
> + if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && ma->length) {
> + immovable_mem[*num].start = ma->base_address;
> + immovable_mem[*num].size = ma->length;
> + (*num)++;
> + }
> +}
> +
> /**
> * count_immovable_mem_regions - Parse SRAT and cache the immovable
> * memory regions into the immovable_mem array.
> @@ -395,14 +408,8 @@ int count_immovable_mem_regions(void)
> while (table + sizeof(struct acpi_subtable_header) < table_end) {
> sub_table = (struct acpi_subtable_header *)table;
> if (sub_table->type == ACPI_SRAT_TYPE_MEMORY_AFFINITY) {
> - struct acpi_srat_mem_affinity *ma;
>
> - ma = (struct acpi_srat_mem_affinity *)sub_table;
> - if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && ma->length) {
> - immovable_mem[num].start = ma->base_address;
> - immovable_mem[num].size = ma->length;
> - num++;
> - }
> + subtable_parse(sub_table, &num);
>
> if (num >= MAX_NUMNODES*2) {
> debug_putstr("Too many immovable memory regions, aborting.\n");
> --
> 2.18.1
>

\
 
 \ /
  Last update: 2019-09-05 15:43    [W:0.068 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site