[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 03/10] i386: add properoty, x-smm-compat-5, to keep compatibil
From: |
Isaku Yamahata |
Subject: |
[PATCH v3 03/10] i386: add properoty, x-smm-compat-5, to keep compatibility of SMM |
Date: |
Wed, 10 Feb 2021 22:46:39 -0800 |
The following patch will introduce incompatible behavior of SMM.
Introduce a property to keep the old behavior for compatibility.
To enable smm compat, use "-machine x-smm-compat-5=on"
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
hw/i386/pc_piix.c | 10 ++++++----
hw/i386/pc_q35.c | 1 +
hw/i386/x86.c | 18 ++++++++++++++++++
include/hw/i386/x86.h | 2 ++
4 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6188c3e97e..87269e170e 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -441,6 +441,7 @@ DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL,
static void pc_i440fx_5_2_machine_options(MachineClass *m)
{
pc_i440fx_6_0_machine_options(m);
+ m->default_machine_opts = "firmware=bios-256k.bin,x-smm-compat-5=on";
m->alias = NULL;
m->is_default = false;
compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len);
@@ -664,7 +665,8 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m)
pc_i440fx_2_3_machine_options(m);
m->hw_version = "2.2.0";
- m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on";
+ m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on"
+ ",x-smm-compat-5=on";
compat_props_add(m->compat_props, hw_compat_2_2, hw_compat_2_2_len);
compat_props_add(m->compat_props, pc_compat_2_2, pc_compat_2_2_len);
pcmc->rsdp_in_ram = false;
@@ -727,7 +729,7 @@ static void pc_i440fx_1_7_machine_options(MachineClass *m)
pc_i440fx_2_0_machine_options(m);
m->hw_version = "1.7.0";
- m->default_machine_opts = NULL;
+ m->default_machine_opts = "x-smm-compat-5=on";
m->option_rom_has_mr = true;
compat_props_add(m->compat_props, pc_compat_1_7, pc_compat_1_7_len);
pcmc->smbios_defaults = false;
@@ -999,7 +1001,7 @@ static void xenfv_4_2_machine_options(MachineClass *m)
pc_i440fx_4_2_machine_options(m);
m->desc = "Xen Fully-virtualized PC";
m->max_cpus = HVM_MAX_VCPUS;
- m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
+ m->default_machine_opts = "accel=xen,suppress-vmdesc=on,x-smm-compat-5=on";
}
DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
@@ -1011,7 +1013,7 @@ static void xenfv_3_1_machine_options(MachineClass *m)
m->desc = "Xen Fully-virtualized PC";
m->alias = "xenfv";
m->max_cpus = HVM_MAX_VCPUS;
- m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
+ m->default_machine_opts = "accel=xen,suppress-vmdesc=on,x-smm-compat-5=on";
}
DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 0a212443aa..14974b7255 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -358,6 +358,7 @@ DEFINE_Q35_MACHINE(v6_0, "pc-q35-6.0", NULL,
static void pc_q35_5_2_machine_options(MachineClass *m)
{
pc_q35_6_0_machine_options(m);
+ m->default_machine_opts = "firmware=bios-256k.bin,x-smm-compat-5=on";
m->alias = NULL;
compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len);
compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len);
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 6329f90ef9..00eb2253d3 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -1174,6 +1174,18 @@ static void x86_machine_set_smm(Object *obj, Visitor *v,
const char *name,
visit_type_OnOffAuto(v, name, &x86ms->smm, errp);
}
+static bool x86_machine_get_smm_compat_5(Object *obj, Error **errp)
+{
+ X86MachineState *x86ms = X86_MACHINE(obj);
+ return x86ms->smm_compat_5;
+}
+
+static void x86_machine_set_smm_compat_5(Object *obj, bool value, Error **errp)
+{
+ X86MachineState *x86ms = X86_MACHINE(obj);
+ x86ms->smm_compat_5 = value;
+}
+
bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms)
{
if (x86ms->acpi == ON_OFF_AUTO_OFF) {
@@ -1204,6 +1216,7 @@ static void x86_machine_initfn(Object *obj)
X86MachineState *x86ms = X86_MACHINE(obj);
x86ms->smm = ON_OFF_AUTO_AUTO;
+ x86ms->smm_compat_5 = false;
x86ms->acpi = ON_OFF_AUTO_AUTO;
x86ms->smp_dies = 1;
x86ms->pci_irq_mask = ACPI_BUILD_PCI_IRQS;
@@ -1228,6 +1241,11 @@ static void x86_machine_class_init(ObjectClass *oc, void
*data)
object_class_property_set_description(oc, X86_MACHINE_SMM,
"Enable SMM");
+ object_class_property_add_bool(oc, X86_MACHINE_SMM_COMPAT_5,
+ x86_machine_get_smm_compat_5, x86_machine_set_smm_compat_5);
+ object_class_property_set_description(oc, X86_MACHINE_SMM_COMPAT_5,
+ "Enable SMM compatible behavior");
+
object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto",
x86_machine_get_acpi, x86_machine_set_acpi,
NULL, NULL);
diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index 56080bd1fb..3dbe19a335 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -65,6 +65,7 @@ struct X86MachineState {
unsigned smp_dies;
OnOffAuto smm;
+ bool smm_compat_5;
OnOffAuto acpi;
/*
@@ -75,6 +76,7 @@ struct X86MachineState {
};
#define X86_MACHINE_SMM "smm"
+#define X86_MACHINE_SMM_COMPAT_5 "x-smm-compat-5"
#define X86_MACHINE_ACPI "acpi"
#define TYPE_X86_MACHINE MACHINE_TYPE_NAME("x86")
--
2.17.1
- [PATCH v3 00/10] ACPI related fixes to comform the spec better, Isaku Yamahata, 2021/02/11
- [PATCH v3 01/10] checkpatch: don't emit warning on newly created acpi data files, Isaku Yamahata, 2021/02/11
- [PATCH v3 02/10] qtest: update tests/qtest/bios-tables-test-allowed-diff.h, Isaku Yamahata, 2021/02/11
- [PATCH v3 03/10] i386: add properoty, x-smm-compat-5, to keep compatibility of SMM,
Isaku Yamahata <=
- [PATCH v3 04/10] acpi/core: always set SCI_EN when SMM isn't supported, Isaku Yamahata, 2021/02/11
- [PATCH v3 05/10] acpi: set fadt.smi_cmd to zero when SMM is not supported, Isaku Yamahata, 2021/02/11
- [PATCH v3 06/10] acpi: add test case for smm unsupported -machine smm=off, Isaku Yamahata, 2021/02/11
- [PATCH v3 09/10] acpi: add test case for -no-hpet, Isaku Yamahata, 2021/02/11
- [PATCH v3 08/10] i386: acpi: Don't build HPET ACPI entry if HPET is disabled, Isaku Yamahata, 2021/02/11
- [PATCH v3 07/10] hw/i386: declare ACPI mother board resource for MMCONFIG region, Isaku Yamahata, 2021/02/11