qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v4 11/16] acpi: move build_srat_hotpluggable_memor


From: Shameerali Kolothum Thodi
Subject: Re: [Qemu-devel] [RFC v4 11/16] acpi: move build_srat_hotpluggable_memory to generic ACPI source
Date: Mon, 21 Jan 2019 17:09:02 +0000

Hi Eric,

> -----Original Message-----
> From: Auger Eric [mailto:address@hidden
> Sent: 21 January 2019 13:59
> To: Shameerali Kolothum Thodi <address@hidden>;
> address@hidden; address@hidden; address@hidden;
> address@hidden; address@hidden; address@hidden;
> address@hidden
> Cc: address@hidden; Linuxarm <address@hidden>;
> address@hidden; address@hidden
> Subject: Re: [Qemu-devel] [RFC v4 11/16] acpi: move
> build_srat_hotpluggable_memory to generic ACPI source

[...]

> >> +void build_srat_hotpluggable_memory(GArray *table_data, uint64_t base,
> >> +                                    uint64_t len, int default_node)
> >> +{
> >> +    MemoryDeviceInfoList *info_list = qmp_memory_device_list();
> >> +    MemoryDeviceInfoList *info;
> >> +    MemoryDeviceInfo *mi;
> >> +    PCDIMMDeviceInfo *di;
> >> +    uint64_t end = base + len, cur, size;
> >> +    bool is_nvdimm;
> >> +    AcpiSratMemoryAffinity *numamem;
> >> +    MemoryAffinityFlags flags;
> >> +
> >> +    for (cur = base, info = info_list;
> >> +         cur < end;
> >> +         cur += size, info = info->next) {
> >> +        numamem = acpi_data_push(table_data, sizeof *numamem);
> >> +
> >> +        if (!info) {
> >> +            build_srat_memory(numamem, cur, end - cur, default_node,
> >> +                              MEM_AFFINITY_HOTPLUGGABLE |
> >> MEM_AFFINITY_ENABLED);
> >> +            break;
> >> +        }
> >> +
> >> +        mi = info->value;
> >> +        is_nvdimm = (mi->type ==
> >> MEMORY_DEVICE_INFO_KIND_NVDIMM);
> >> +        di = !is_nvdimm ? mi->u.dimm.data : mi->u.nvdimm.data;
> >> +
> >> +        if (cur < di->addr) {
> >> +            build_srat_memory(numamem, cur, di->addr - cur,
> >> default_node,
> >> +                              MEM_AFFINITY_HOTPLUGGABLE |
> >> MEM_AFFINITY_ENABLED);
> >> +            numamem = acpi_data_push(table_data, sizeof
> *numamem);
> >> +        }
> >> +
> >> +        size = di->size;
> >> +
> >> +        flags = MEM_AFFINITY_ENABLED;
> >> +        if (di->hotpluggable) {
> >> +            flags |= MEM_AFFINITY_HOTPLUGGABLE;
> >> +        }
> >> +        if (is_nvdimm) {
> >> +            flags |= MEM_AFFINITY_NON_VOLATILE;
> >> +        }
> >> +
> >> +        build_srat_memory(numamem, di->addr, size, di->node, flags);
> >> +    }
> >> +
> >> +    qapi_free_MemoryDeviceInfoList(info_list);
> >> +}
> >
> > The above logic changes the SRAT entries if dimm is hot-added and a reboot 
> > is
> > performed and as mentioned above, EDK2 seems to be not happy with this.
> >
> > I had a look at the pc code and it looks like it only has one SRAT entry 
> > for the
> > whole hot-pluggable address space[2] which probable means SRAT remains
> same
> > across reboot even after mem is hot added. Not sure why we are doing this
> differently
> > for ARM.
> 
> Initially this code was inpired from x86 code. Then Igor fixed it on x86
>  with:
> dbb6da8ba7e02105bdbb33b527e088249c9843c8  pc: acpi: revert back to 1
> SRAT entry for hotpluggable area

Ok. That explains it. Thanks for the info.

> So it looks the same change must be done on ARM.

Ok. 
 
> I am currently busy with this respin. As suggested by David and Igor I
> implemented the initial RAM as device memory. I am now looking at NUMA
> impacts of that change.

Sure. Mean time I will continue with my testing and will sent out the RFC for 
hot-add feature on top of v5 of this series then.

Thanks,
Shameer.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]