Blob Blame History Raw
From 4ee284aca9a6fb151f85f266b375a8c1d9213a28 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 28 Jun 2023 01:40:03 -0400
Subject: Add machine types compat bits.

Adding upstream compat changes to rhel machine types.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/arm/virt.c              | 1 +
 hw/core/machine.c          | 8 ++++++++
 hw/i386/pc.c               | 6 ++++++
 hw/i386/pc_piix.c          | 4 ++++
 hw/i386/pc_q35.c           | 4 ++++
 hw/s390x/s390-virtio-ccw.c | 1 +
 include/hw/boards.h        | 3 +++
 include/hw/i386/pc.h       | 3 +++
 8 files changed, 30 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 3c36106eb5..c2283275b5 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3616,6 +3616,7 @@ type_init(rhel_machine_init);
 static void rhel920_virt_options(MachineClass *mc)
 {
     compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+    compat_props_add(mc->compat_props, hw_compat_rhel_9_3, hw_compat_rhel_9_3_len);
     compat_props_add(mc->compat_props, hw_compat_rhel_9_2, hw_compat_rhel_9_2_len);
 }
 DEFINE_RHEL_MACHINE_AS_LATEST(9, 2, 0)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2e54c7ae7c..8e23b9263d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -59,6 +59,14 @@ const size_t hw_compat_7_2_len = G_N_ELEMENTS(hw_compat_7_2);
 const char *rhel_old_machine_deprecation =
     "machine types for previous major releases are deprecated";
 
+GlobalProperty hw_compat_rhel_9_3[] = {
+  /* hw_compat_rhel_9_3 from hw_compat_8_0 */
+  { "migration", "multifd-flush-after-each-section", "on"},
+  /* hw_compat_rhel_9_3 from hw_compat_8_0 */
+  { TYPE_PCI_DEVICE, "x-pcie-ari-nextfn-1", "on" },
+};
+const size_t hw_compat_rhel_9_3_len = G_N_ELEMENTS(hw_compat_rhel_9_3);
+
 GlobalProperty hw_compat_rhel_9_2[] = {
   /* hw_compat_rhel_9_2 from hw_compat_7_2 */
   { "e1000e", "migrate-timadj", "off" },
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 4be9a7db82..173815cc7e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -432,6 +432,12 @@ GlobalProperty pc_rhel_compat[] = {
 };
 const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat);
 
+GlobalProperty pc_rhel_9_3_compat[] = {
+    /* pc_rhel_9_3_compat from pc_compat_8_0 */
+    { "virtio-mem", "unplugged-inaccessible", "auto" },
+};
+const size_t pc_rhel_9_3_compat_len = G_N_ELEMENTS(pc_rhel_9_3_compat);
+
 GlobalProperty pc_rhel_9_2_compat[] = {
     /* pc_rhel_9_2_compat from pc_compat_7_2 */
     { "ICH9-LPC", "noreboot", "true" },
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index db7d8e26e1..014c017344 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1015,6 +1015,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
     /* From pc_i440fx_5_1_machine_options() */
     pcmc->pci_root_uid = 1;
     pcmc->enforce_amd_1tb_hole = false;
+    compat_props_add(m->compat_props, hw_compat_rhel_9_3,
+		     hw_compat_rhel_9_3_len);
+    compat_props_add(m->compat_props, pc_rhel_9_3_compat,
+                     pc_rhel_9_3_compat_len);
     compat_props_add(m->compat_props, hw_compat_rhel_9_2,
                      hw_compat_rhel_9_2_len);
     compat_props_add(m->compat_props, pc_rhel_9_2_compat,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index e878bf4626..0b8adb0adb 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -722,6 +722,10 @@ static void pc_q35_machine_rhel920_options(MachineClass *m)
     pcmc->smbios_stream_product = "RHEL";
     pcmc->smbios_stream_version = "9.2.0";
 
+    compat_props_add(m->compat_props, hw_compat_rhel_9_3,
+                     hw_compat_rhel_9_3_len);
+     compat_props_add(m->compat_props, pc_rhel_9_3_compat,
+                     pc_rhel_9_3_compat_len);
     compat_props_add(m->compat_props, hw_compat_rhel_9_2,
                      hw_compat_rhel_9_2_len);
     compat_props_add(m->compat_props, pc_rhel_9_2_compat,
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 2a5dbd2728..4892db6d04 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1225,6 +1225,7 @@ static void ccw_machine_rhel920_instance_options(MachineState *machine)
 
 static void ccw_machine_rhel920_class_options(MachineClass *mc)
 {
+    compat_props_add(mc->compat_props, hw_compat_rhel_9_3, hw_compat_rhel_9_3_len);
     compat_props_add(mc->compat_props, hw_compat_rhel_9_2, hw_compat_rhel_9_2_len);
 }
 DEFINE_CCW_MACHINE(rhel920, "rhel9.2.0", true);
diff --git a/include/hw/boards.h b/include/hw/boards.h
index d9d1ae6dd1..60cc08865c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -473,6 +473,9 @@ extern const size_t hw_compat_2_2_len;
 extern GlobalProperty hw_compat_2_1[];
 extern const size_t hw_compat_2_1_len;
 
+extern GlobalProperty hw_compat_rhel_9_3[];
+extern const size_t hw_compat_rhel_9_3_len;
+
 extern GlobalProperty hw_compat_rhel_9_2[];
 extern const size_t hw_compat_rhel_9_2_len;
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 7b569fa254..eb6ff6b099 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -304,6 +304,9 @@ int pc_machine_kvm_type(MachineState *machine, const char *vm_type);
 extern GlobalProperty pc_rhel_compat[];
 extern const size_t pc_rhel_compat_len;
 
+extern GlobalProperty pc_rhel_9_3_compat[];
+extern const size_t pc_rhel_9_3_compat_len;
+
 extern GlobalProperty pc_rhel_9_2_compat[];
 extern const size_t pc_rhel_9_2_compat_len;
 
-- 
2.39.3