mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
nvdimm, acpi: support NFIT platform capabilities
Add a machine command line option to allow the user to control the Platform Capabilities Structure in the virtualized NFIT. This Platform Capabilities Structure was added in ACPI 6.2 Errata A. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
2e0c56cdde
commit
9ab3aad281
5 changed files with 105 additions and 4 deletions
31
hw/i386/pc.c
31
hw/i386/pc.c
|
@ -2182,6 +2182,33 @@ static void pc_machine_set_nvdimm(Object *obj, bool value, Error **errp)
|
|||
pcms->acpi_nvdimm_state.is_enabled = value;
|
||||
}
|
||||
|
||||
static void pc_machine_get_nvdimm_capabilities(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
uint32_t value = pcms->acpi_nvdimm_state.capabilities;
|
||||
|
||||
visit_type_uint32(v, name, &value, errp);
|
||||
}
|
||||
|
||||
static void pc_machine_set_nvdimm_capabilities(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
Error *error = NULL;
|
||||
uint32_t value;
|
||||
|
||||
visit_type_uint32(v, name, &value, &error);
|
||||
if (error) {
|
||||
error_propagate(errp, error);
|
||||
return;
|
||||
}
|
||||
|
||||
pcms->acpi_nvdimm_state.capabilities = value;
|
||||
}
|
||||
|
||||
static bool pc_machine_get_smbus(Object *obj, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
|
@ -2395,6 +2422,10 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
|||
object_class_property_add_bool(oc, PC_MACHINE_NVDIMM,
|
||||
pc_machine_get_nvdimm, pc_machine_set_nvdimm, &error_abort);
|
||||
|
||||
object_class_property_add(oc, PC_MACHINE_NVDIMM_CAP, "uint32",
|
||||
pc_machine_get_nvdimm_capabilities,
|
||||
pc_machine_set_nvdimm_capabilities, NULL, NULL, &error_abort);
|
||||
|
||||
object_class_property_add_bool(oc, PC_MACHINE_SMBUS,
|
||||
pc_machine_get_smbus, pc_machine_set_smbus, &error_abort);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue