diff mbox series

[RFC,v4,12/16] hw/arm/virt-acpi-build: Add PC-DIMM in SRAT

Message ID 20181018143042.29588-13-eric.auger@redhat.com
State New
Headers show
Series [RFC,v4,01/16] hw/arm/boot: introduce fdt_add_memory_node helper | expand

Commit Message

Eric Auger Oct. 18, 2018, 2:30 p.m. UTC
From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>


Generate Memory Affinity Structures for PC-DIMM ranges.

Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

Signed-off-by: Eric Auger <eric.auger@redhat.com>


---
v3 -> v4:
- do not use vms->bootinfo.device_memory_start/device_memory_size anymore

v1 -> v2:
- build_srat_hotpluggable_memory movedc to aml-build
---
 hw/arm/virt-acpi-build.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.17.1

Comments

Igor Mammedov Oct. 22, 2018, 1:40 p.m. UTC | #1
On Thu, 18 Oct 2018 16:30:38 +0200
Eric Auger <eric.auger@redhat.com> wrote:

> From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

> 

> Generate Memory Affinity Structures for PC-DIMM ranges.

> 

> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

> Signed-off-by: Eric Auger <eric.auger@redhat.com>

> 

> ---

> v3 -> v4:

> - do not use vms->bootinfo.device_memory_start/device_memory_size anymore

> 

> v1 -> v2:

> - build_srat_hotpluggable_memory movedc to aml-build

> ---

>  hw/arm/virt-acpi-build.c | 4 ++++

>  1 file changed, 4 insertions(+)

> 

> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c

> index 5785fb697c..8818bbf5ec 100644

> --- a/hw/arm/virt-acpi-build.c

> +++ b/hw/arm/virt-acpi-build.c

> @@ -545,6 +545,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)

>      int i, srat_start;

>      uint64_t mem_base;

>      MachineClass *mc = MACHINE_GET_CLASS(vms);

> +    MachineState *ms = MACHINE(vms);

>      const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(MACHINE(vms));

>  

>      srat_start = table_data->len;

> @@ -570,6 +571,9 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)

>          }

>      }

>  

> +    build_srat_hotpluggable_memory(table_data, ms->device_memory->base,

> +                                   ms->device_memory->mr.size, 0);

on x86, we use the last node here to make windows happy. I'd use the same value here.

> +

>      build_header(linker, table_data, (void *)(table_data->data + srat_start),

>                   "SRAT", table_data->len - srat_start, 3, NULL, NULL);

>  }
Eric Auger Nov. 5, 2018, 1:27 p.m. UTC | #2
Hi Igor,

On 10/22/18 3:40 PM, Igor Mammedov wrote:
> On Thu, 18 Oct 2018 16:30:38 +0200

> Eric Auger <eric.auger@redhat.com> wrote:

> 

>> From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

>>

>> Generate Memory Affinity Structures for PC-DIMM ranges.

>>

>> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

>> Signed-off-by: Eric Auger <eric.auger@redhat.com>

>>

>> ---

>> v3 -> v4:

>> - do not use vms->bootinfo.device_memory_start/device_memory_size anymore

>>

>> v1 -> v2:

>> - build_srat_hotpluggable_memory movedc to aml-build

>> ---

>>  hw/arm/virt-acpi-build.c | 4 ++++

>>  1 file changed, 4 insertions(+)

>>

>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c

>> index 5785fb697c..8818bbf5ec 100644

>> --- a/hw/arm/virt-acpi-build.c

>> +++ b/hw/arm/virt-acpi-build.c

>> @@ -545,6 +545,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)

>>      int i, srat_start;

>>      uint64_t mem_base;

>>      MachineClass *mc = MACHINE_GET_CLASS(vms);

>> +    MachineState *ms = MACHINE(vms);

>>      const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(MACHINE(vms));

>>  

>>      srat_start = table_data->len;

>> @@ -570,6 +571,9 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)

>>          }

>>      }

>>  

>> +    build_srat_hotpluggable_memory(table_data, ms->device_memory->base,

>> +                                   ms->device_memory->mr.size, 0);

> on x86, we use the last node here to make windows happy. I'd use the same value here.

OK thank you for the information.

Regards

Eric
> 

>> +

>>      build_header(linker, table_data, (void *)(table_data->data + srat_start),

>>                   "SRAT", table_data->len - srat_start, 3, NULL, NULL);

>>  }

> 

>
diff mbox series

Patch

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 5785fb697c..8818bbf5ec 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -545,6 +545,7 @@  build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
     int i, srat_start;
     uint64_t mem_base;
     MachineClass *mc = MACHINE_GET_CLASS(vms);
+    MachineState *ms = MACHINE(vms);
     const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(MACHINE(vms));
 
     srat_start = table_data->len;
@@ -570,6 +571,9 @@  build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
         }
     }
 
+    build_srat_hotpluggable_memory(table_data, ms->device_memory->base,
+                                   ms->device_memory->mr.size, 0);
+
     build_header(linker, table_data, (void *)(table_data->data + srat_start),
                  "SRAT", table_data->len - srat_start, 3, NULL, NULL);
 }