[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 1/1] nvdimm: let qemu requiring section alig
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH 1/1] nvdimm: let qemu requiring section alignment of pmem resource. |
Date: |
Mon, 11 Jun 2018 17:26:30 +0100 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
On Mon, Jun 11, 2018 at 06:54:25PM +0800, Zhang Yi wrote:
> Nvdimm driver use Memory hot-plug APIs to map it's pmem resource,
> which at a section granularity.
>
> When QEMU emulated the vNVDIMM device, decrease the label-storage,
> QEMU will put the vNVDIMMs directly next to one another in physical
> address space, which means that the boundary between them won't
> align to the 128 MB memory section size.
I'm having a hard time parsing this.
Where does the "128 MB memory section size" come from? ACPI?
A chipset-specific value?
> Signed-off-by: Zhang Yi <address@hidden>
> ---
> hw/mem/nvdimm.c | 2 +-
> include/hw/mem/nvdimm.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
> index 4087aca..ff6e171 100644
> --- a/hw/mem/nvdimm.c
> +++ b/hw/mem/nvdimm.c
> @@ -109,7 +109,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error
> **errp)
> NVDIMMDevice *nvdimm = NVDIMM(dimm);
> uint64_t align, pmem_size, size = memory_region_size(mr);
>
> - align = memory_region_get_alignment(mr);
> + align = MAX(memory_region_get_alignment(mr), NVDIMM_ALIGN_SIZE);
>
> pmem_size = size - nvdimm->label_size;
> nvdimm->label_data = memory_region_get_ram_ptr(mr) + pmem_size;
> diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h
> index 3c82751..1d384e4 100644
> --- a/include/hw/mem/nvdimm.h
> +++ b/include/hw/mem/nvdimm.h
> @@ -41,6 +41,7 @@
> * at least 128KB in size, which holds around 1000 labels."
> */
> #define MIN_NAMESPACE_LABEL_SIZE (128UL << 10)
> +#define NVDIMM_ALIGN_SIZE (128UL << 20)
>
> #define TYPE_NVDIMM "nvdimm"
> #define NVDIMM(obj) OBJECT_CHECK(NVDIMMDevice, (obj), TYPE_NVDIMM)
> --
> 2.7.4
>
signature.asc
Description: PGP signature