mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
s390x/kvm: enable guarded storage
Introduce guarded storage support for KVM guests on s390. We need to enable the capability, extend machine check validity, sigp store-additional-status-at-address, and migration. The feature is fenced for older machine type versions. Signed-off-by: Fan Zhang <zhangfan@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
parent
c0a9cd940e
commit
62deb62d99
5 changed files with 106 additions and 10 deletions
|
@ -211,6 +211,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
|
|||
s390mc->ri_allowed = true;
|
||||
s390mc->cpu_model_allowed = true;
|
||||
s390mc->css_migration_enabled = true;
|
||||
s390mc->gs_allowed = true;
|
||||
mc->init = ccw_init;
|
||||
mc->reset = s390_machine_reset;
|
||||
mc->hot_add_cpu = s390_hot_add_cpu;
|
||||
|
@ -288,6 +289,22 @@ bool cpu_model_allowed(void)
|
|||
return get_machine_class()->cpu_model_allowed;
|
||||
}
|
||||
|
||||
bool gs_allowed(void)
|
||||
{
|
||||
if (kvm_enabled()) {
|
||||
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
if (object_class_dynamic_cast(OBJECT_CLASS(mc),
|
||||
TYPE_S390_CCW_MACHINE)) {
|
||||
S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
|
||||
|
||||
return s390mc->gs_allowed;
|
||||
}
|
||||
/* Make sure the "none" machine can have gs */
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static char *machine_get_loadparm(Object *obj, Error **errp)
|
||||
{
|
||||
S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
|
||||
|
@ -515,6 +532,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc)
|
|||
{
|
||||
S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
|
||||
|
||||
s390mc->gs_allowed = false;
|
||||
ccw_machine_2_10_class_options(mc);
|
||||
SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9);
|
||||
s390mc->css_migration_enabled = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue