Skip to content

Commit

Permalink
hw/arm/virt: Introduce a RAS machine option
Browse files Browse the repository at this point in the history
RAS Virtualization feature is not supported now, so
add a RAS machine option and disable it by default.

Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Dongjiu Geng <[email protected]>
Signed-off-by: Xiang Zheng <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
gengdongjiu1 authored and pm215 committed May 14, 2020
1 parent 1439f21 commit 2afa8c8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions hw/arm/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,20 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
visit_type_OnOffAuto(v, name, &vms->acpi, errp);
}

static bool virt_get_ras(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);

return vms->ras;
}

static void virt_set_ras(Object *obj, bool value, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);

vms->ras = value;
}

static char *virt_get_gic_version(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
Expand Down Expand Up @@ -2327,6 +2341,15 @@ static void virt_instance_init(Object *obj)
"Valid values are none and smmuv3",
NULL);

/* Default disallows RAS instantiation */
vms->ras = false;
object_property_add_bool(obj, "ras", virt_get_ras,
virt_set_ras, NULL);
object_property_set_description(obj, "ras",
"Set on/off to enable/disable reporting host memory errors "
"to a KVM guest using ACPI and guest external abort exceptions",
NULL);

vms->irqmap = a15irqmap;

virt_flash_create(vms);
Expand Down
1 change: 1 addition & 0 deletions include/hw/arm/virt.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ typedef struct {
bool highmem_ecam;
bool its;
bool virt;
bool ras;
OnOffAuto acpi;
VirtGICType gic_version;
VirtIOMMUType iommu;
Expand Down

0 comments on commit 2afa8c8

Please sign in to comment.