From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Maxim Levitsky <mlevitsk@redhat.com>,
Vadim Rozenfeld <vrozenfe@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH v2 1/8] i386: Add 6.2 machine types
Date: Thu, 2 Sep 2021 11:35:23 +0200 [thread overview]
Message-ID: <20210902093530.345756-2-vkuznets@redhat.com> (raw)
In-Reply-To: <20210902093530.345756-1-vkuznets@redhat.com>
Introduce 6.2 machine types and the required infrastructure for adding
compat properties to pre-6.2 machine types.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
hw/core/machine.c | 3 +++
hw/i386/pc.c | 3 +++
hw/i386/pc_piix.c | 14 +++++++++++++-
hw/i386/pc_q35.c | 13 ++++++++++++-
include/hw/boards.h | 3 +++
include/hw/i386/pc.h | 3 +++
6 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 54e040587dd3..9d0d1194e1ef 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -46,6 +46,9 @@ GlobalProperty hw_compat_6_0[] = {
};
const size_t hw_compat_6_0_len = G_N_ELEMENTS(hw_compat_6_0);
+GlobalProperty hw_compat_6_1[] = {};
+const size_t hw_compat_6_1_len = G_N_ELEMENTS(hw_compat_6_1);
+
GlobalProperty hw_compat_5_2[] = {
{ "ICH9-LPC", "smm-compat", "on"},
{ "PIIX4_PM", "smm-compat", "on"},
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 102b22394689..1276bfeee456 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -93,6 +93,9 @@
#include "trace.h"
#include CONFIG_DEVICES
+GlobalProperty pc_compat_6_1[] = {};
+const size_t pc_compat_6_1_len = G_N_ELEMENTS(pc_compat_6_1);
+
GlobalProperty pc_compat_6_0[] = {
{ "qemu64" "-" TYPE_X86_CPU, "family", "6" },
{ "qemu64" "-" TYPE_X86_CPU, "model", "6" },
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1bc30167acc0..c5da7739cef7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -412,7 +412,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
}
-static void pc_i440fx_6_1_machine_options(MachineClass *m)
+static void pc_i440fx_6_2_machine_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pc_i440fx_machine_options(m);
@@ -421,6 +421,18 @@ static void pc_i440fx_6_1_machine_options(MachineClass *m)
pcmc->default_cpu_version = 1;
}
+DEFINE_I440FX_MACHINE(v6_2, "pc-i440fx-6.2", NULL,
+ pc_i440fx_6_2_machine_options);
+
+static void pc_i440fx_6_1_machine_options(MachineClass *m)
+{
+ pc_i440fx_6_2_machine_options(m);
+ m->alias = NULL;
+ m->is_default = false;
+ compat_props_add(m->compat_props, hw_compat_6_1, hw_compat_6_1_len);
+ compat_props_add(m->compat_props, pc_compat_6_1, pc_compat_6_1_len);
+}
+
DEFINE_I440FX_MACHINE(v6_1, "pc-i440fx-6.1", NULL,
pc_i440fx_6_1_machine_options);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index eeb0b185b118..565fadce540c 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -354,7 +354,7 @@ static void pc_q35_machine_options(MachineClass *m)
m->max_cpus = 288;
}
-static void pc_q35_6_1_machine_options(MachineClass *m)
+static void pc_q35_6_2_machine_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pc_q35_machine_options(m);
@@ -362,6 +362,17 @@ static void pc_q35_6_1_machine_options(MachineClass *m)
pcmc->default_cpu_version = 1;
}
+DEFINE_Q35_MACHINE(v6_2, "pc-q35-6.2", NULL,
+ pc_q35_6_2_machine_options);
+
+static void pc_q35_6_1_machine_options(MachineClass *m)
+{
+ pc_q35_6_2_machine_options(m);
+ m->alias = NULL;
+ compat_props_add(m->compat_props, hw_compat_6_1, hw_compat_6_1_len);
+ compat_props_add(m->compat_props, pc_compat_6_1, pc_compat_6_1_len);
+}
+
DEFINE_Q35_MACHINE(v6_1, "pc-q35-6.1", NULL,
pc_q35_6_1_machine_options);
diff --git a/include/hw/boards.h b/include/hw/boards.h
index accd6eff35ab..463a5514f97d 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -353,6 +353,9 @@ struct MachineState {
} \
type_init(machine_initfn##_register_types)
+extern GlobalProperty hw_compat_6_1[];
+extern const size_t hw_compat_6_1_len;
+
extern GlobalProperty hw_compat_6_0[];
extern const size_t hw_compat_6_0_len;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 88dffe751724..97b4ab79b534 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -196,6 +196,9 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);
void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
const CPUArchIdList *apic_ids, GArray *entry);
+extern GlobalProperty pc_compat_6_1[];
+extern const size_t pc_compat_6_1_len;
+
extern GlobalProperty pc_compat_6_0[];
extern const size_t pc_compat_6_0_len;
--
2.31.1
next prev parent reply other threads:[~2021-09-02 9:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 9:35 [PATCH v2 0/8] i386: Assorted KVM PV and Hyper-V feature improvements Vitaly Kuznetsov
2021-09-02 9:35 ` Vitaly Kuznetsov [this message]
2021-09-02 9:35 ` [PATCH v2 2/8] i386: docs: Briefly describe KVM PV features Vitaly Kuznetsov
2021-09-29 15:26 ` Paolo Bonzini
2021-09-02 9:35 ` [PATCH v2 3/8] i386: Support KVM_CAP_ENFORCE_PV_FEATURE_CPUID Vitaly Kuznetsov
2021-09-02 9:35 ` [PATCH v2 4/8] i386: Support KVM_CAP_HYPERV_ENFORCE_CPUID Vitaly Kuznetsov
2021-09-02 9:35 ` [PATCH v2 5/8] i386: Move HV_APIC_ACCESS_RECOMMENDED bit setting to hyperv_fill_cpuids() Vitaly Kuznetsov
2021-09-02 9:35 ` [PATCH v2 6/8] i386: Implement pseudo 'hv-avic' ('hv-apicv') enlightenment Vitaly Kuznetsov
2021-09-02 9:35 ` [PATCH v2 7/8] i386: Make Hyper-V version id configurable Vitaly Kuznetsov
2021-09-02 9:35 ` [PATCH v2 8/8] i386: Change the default Hyper-V version to match WS2016 Vitaly Kuznetsov
2021-09-17 8:17 ` [PATCH v2 0/8] i386: Assorted KVM PV and Hyper-V feature improvements Vitaly Kuznetsov
2021-09-29 15:29 ` Paolo Bonzini
2021-09-30 8:09 ` Vitaly Kuznetsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210902093530.345756-2-vkuznets@redhat.com \
--to=vkuznets@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vrozenfe@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).