diff options
Diffstat (limited to 'qemu/include/hw/mem')
-rw-r--r-- | qemu/include/hw/mem/nvdimm.h | 62 | ||||
-rw-r--r-- | qemu/include/hw/mem/pc-dimm.h | 97 |
2 files changed, 0 insertions, 159 deletions
diff --git a/qemu/include/hw/mem/nvdimm.h b/qemu/include/hw/mem/nvdimm.h deleted file mode 100644 index 517de9c36..000000000 --- a/qemu/include/hw/mem/nvdimm.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Non-Volatile Dual In-line Memory Module Virtualization Implementation - * - * Copyright(C) 2015 Intel Corporation. - * - * Author: - * Xiao Guangrong <guangrong.xiao@linux.intel.com> - * - * NVDIMM specifications and some documents can be found at: - * NVDIMM ACPI device and NFIT are introduced in ACPI 6: - * http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf - * NVDIMM Namespace specification: - * http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf - * DSM Interface Example: - * http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf - * Driver Writer's Guide: - * http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef QEMU_NVDIMM_H -#define QEMU_NVDIMM_H - -#include "hw/mem/pc-dimm.h" - -#define NVDIMM_DEBUG 0 -#define nvdimm_debug(fmt, ...) \ - do { \ - if (NVDIMM_DEBUG) { \ - fprintf(stderr, "nvdimm: " fmt, ## __VA_ARGS__); \ - } \ - } while (0) - -#define TYPE_NVDIMM "nvdimm" - -#define NVDIMM_DSM_MEM_FILE "etc/acpi/nvdimm-mem" - -/* - * 32 bits IO port starting from 0x0a18 in guest is reserved for - * NVDIMM ACPI emulation. - */ -#define NVDIMM_ACPI_IO_BASE 0x0a18 -#define NVDIMM_ACPI_IO_LEN 4 - -struct AcpiNVDIMMState { - /* detect if NVDIMM support is enabled. */ - bool is_enabled; - - /* the data of the fw_cfg file NVDIMM_DSM_MEM_FILE. */ - GArray *dsm_mem; - /* the IO region used by OSPM to transfer control to QEMU. */ - MemoryRegion io_mr; -}; -typedef struct AcpiNVDIMMState AcpiNVDIMMState; - -void nvdimm_init_acpi_state(AcpiNVDIMMState *state, MemoryRegion *io, - FWCfgState *fw_cfg, Object *owner); -void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, - GArray *linker); -#endif diff --git a/qemu/include/hw/mem/pc-dimm.h b/qemu/include/hw/mem/pc-dimm.h deleted file mode 100644 index 218dfb0ed..000000000 --- a/qemu/include/hw/mem/pc-dimm.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * PC DIMM device - * - * Copyright ProfitBricks GmbH 2012 - * Copyright (C) 2013-2014 Red Hat Inc - * - * Authors: - * Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com> - * Igor Mammedov <imammedo@redhat.com> - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - * - */ - -#ifndef QEMU_PC_DIMM_H -#define QEMU_PC_DIMM_H - -#include "exec/memory.h" -#include "sysemu/hostmem.h" -#include "hw/qdev.h" - -#define DEFAULT_PC_DIMMSIZE (1024*1024*1024) - -#define TYPE_PC_DIMM "pc-dimm" -#define PC_DIMM(obj) \ - OBJECT_CHECK(PCDIMMDevice, (obj), TYPE_PC_DIMM) -#define PC_DIMM_CLASS(oc) \ - OBJECT_CLASS_CHECK(PCDIMMDeviceClass, (oc), TYPE_PC_DIMM) -#define PC_DIMM_GET_CLASS(obj) \ - OBJECT_GET_CLASS(PCDIMMDeviceClass, (obj), TYPE_PC_DIMM) - -#define PC_DIMM_ADDR_PROP "addr" -#define PC_DIMM_SLOT_PROP "slot" -#define PC_DIMM_NODE_PROP "node" -#define PC_DIMM_SIZE_PROP "size" -#define PC_DIMM_MEMDEV_PROP "memdev" - -#define PC_DIMM_UNASSIGNED_SLOT -1 - -/** - * PCDIMMDevice: - * @addr: starting guest physical address, where @PCDIMMDevice is mapped. - * Default value: 0, means that address is auto-allocated. - * @node: numa node to which @PCDIMMDevice is attached. - * @slot: slot number into which @PCDIMMDevice is plugged in. - * Default value: -1, means that slot is auto-allocated. - * @hostmem: host memory backend providing memory for @PCDIMMDevice - */ -typedef struct PCDIMMDevice { - /* private */ - DeviceState parent_obj; - - /* public */ - uint64_t addr; - uint32_t node; - int32_t slot; - HostMemoryBackend *hostmem; -} PCDIMMDevice; - -/** - * PCDIMMDeviceClass: - * @get_memory_region: returns #MemoryRegion associated with @dimm - */ -typedef struct PCDIMMDeviceClass { - /* private */ - DeviceClass parent_class; - - /* public */ - MemoryRegion *(*get_memory_region)(PCDIMMDevice *dimm); -} PCDIMMDeviceClass; - -/** - * MemoryHotplugState: - * @base: address in guest RAM address space where hotplug memory - * address space begins. - * @mr: hotplug memory address space container - */ -typedef struct MemoryHotplugState { - hwaddr base; - MemoryRegion mr; -} MemoryHotplugState; - -uint64_t pc_dimm_get_free_addr(uint64_t address_space_start, - uint64_t address_space_size, - uint64_t *hint, uint64_t align, uint64_t size, - Error **errp); - -int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp); - -int qmp_pc_dimm_device_list(Object *obj, void *opaque); -uint64_t pc_existing_dimms_capacity(Error **errp); -void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms, - MemoryRegion *mr, uint64_t align, Error **errp); -void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms, - MemoryRegion *mr); -#endif |