From 87252e1b61cb6e651da6cd3e9996ade8bd59a388 Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Wed, 2 Dec 2015 15:20:58 +0800 Subject: nvdimm acpi: build ACPI NFIT table NFIT is defined in ACPI 6.0: 5.2.25 NVDIMM Firmware Interface Table (NFIT) Currently, we only support PMEM mode. Each device has 3 structures: - SPA structure, defines the PMEM region info - MEM DEV structure, it has the @handle which is used to associate specified ACPI NVDIMM device we will introduce in later patch. Also we can happily ignored the memory device's interleave, the real nvdimm hardware access is hidden behind host - DCR structure, it defines vendor ID used to associate specified vendor nvdimm driver. Since we only implement PMEM mode this time, Command window and Data window are not needed The NVDIMM functionality is controlled by the parameter, 'nvdimm', which is introduced for the machine, there is a example to enable it: -machine pc,nvdimm -m 8G,maxmem=100G,slots=100 -object \ memory-backend-file,id=mem1,share,mem-path=/tmp/nvdimm1,size=10G -device \ nvdimm,memdev=mem1,id=nv1 It is disabled on default Reviewed-by: Stefan Hajnoczi Signed-off-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 2 ++ include/hw/mem/nvdimm.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index c6a777546a..b0d6283b25 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -55,6 +55,7 @@ struct PCMachineState { uint64_t max_ram_below_4g; OnOffAuto vmport; OnOffAuto smm; + bool nvdimm; /* RAM information (sizes, addresses, configuration): */ ram_addr_t below_4g_mem_size, above_4g_mem_size; @@ -65,6 +66,7 @@ struct PCMachineState { #define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g" #define PC_MACHINE_VMPORT "vmport" #define PC_MACHINE_SMM "smm" +#define PC_MACHINE_NVDIMM "nvdimm" /** * PCMachineClass: diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index dbfa8d6bd4..49183c126b 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -26,4 +26,7 @@ #include "hw/mem/pc-dimm.h" #define TYPE_NVDIMM "nvdimm" + +void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, + GArray *linker); #endif -- cgit v1.2.3-55-g7522