qemu-kvm/kvm-virtio-net-disable-USO-for-virt-rhel9.6.patch
Jon Maloy 609fe233e6 * Tue May 13 2025 Jon Maloy <jmaloy@redhat.com> - 9.1.0-20
- kvm-virtio-net-disable-USO-for-virt-rhel9.6.patch [RHEL-80313]
- kvm-arm-Use-arm_virt_compat_set-to-apply-the-compat.patch [RHEL-80313]
- kvm-file-posix-probe-discard-alignment-on-Linux-block-de.patch [RHEL-86032]
- kvm-block-io-skip-head-tail-requests-on-EINVAL.patch [RHEL-86032]
- kvm-file-posix-Fix-crash-on-discard_granularity-0.patch [RHEL-86032]
- Resolves: RHEL-80313
  (Unable to migrate VM from RHEL10.0/qemu-kvm-9.6 to RHEL9.6/qemu-kvm-9.6)
- Resolves: RHEL-86032
  (QEMU sends unaligned discards on 4K devices [RHEL-9.7])
2025-05-13 21:10:08 -04:00

136 lines
5.1 KiB
Diff

From a7cd7f5b3bd6df30e75532fb19b645c5349f6183 Mon Sep 17 00:00:00 2001
From: Shaoqin Huang <shahuang@redhat.com>
Date: Thu, 24 Apr 2025 04:48:29 -0400
Subject: [PATCH 1/5] virtio-net: disable USO for virt-rhel9.6
RH-Author: Shaoqin Huang <shahuang@redhat.com>
RH-MergeRequest: 353: virtio-net: disable USO for virt-rhel9.6
RH-Jira: RHEL-80313
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
RH-Commit: [1/2] c7099480e656106219040d45ce7b76b19376227a (shahuang/qemu-kvm)
JIRA: https://issues.redhat.com/browse/RHEL-80313
Upstream Status: RHEL only
RHEL9 kernels have USO* disabled while RHEL10 has it enabled, this can
cause the migration to fail when running a RHEL9 qemu on a RHEL10 kernel
and then migrate to a RHEL9 kernel.
Make sure the virt-rhel9.6 machine type in RHEL9 stay the same
independent of the kernel.
Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
---
hw/arm/virt.c | 3 +++
hw/core/machine.c | 15 +++++++++------
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 3 +++
hw/s390x/s390-virtio-ccw.c | 2 ++
include/hw/boards.h | 3 +++
6 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c5270a5abc..896deaa025 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3600,6 +3600,9 @@ DEFINE_VIRT_MACHINE(2, 6)
static void virt_rhel_machine_9_6_0_options(MachineClass *mc)
{
compat_props_add(mc->compat_props, arm_rhel9_compat, arm_rhel9_compat_len);
+
+ /* NB: remember to move this line to the *latest* RHEL 9 machine */
+ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len);
}
DEFINE_VIRT_MACHINE_AS_LATEST(9, 6, 0)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index add42660f8..37751f6b9b 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -305,6 +305,15 @@ GlobalProperty hw_compat_2_1[] = {
};
const size_t hw_compat_2_1_len = G_N_ELEMENTS(hw_compat_2_1);
+/* Apply this to all RHEL9 boards going backward and forward */
+GlobalProperty hw_compat_rhel_9[] = {
+ /* supported by userspace, but RHEL 9 *kernels* do not support USO. */
+ { TYPE_VIRTIO_NET, "host_uso", "off"},
+ { TYPE_VIRTIO_NET, "guest_uso4", "off"},
+ { TYPE_VIRTIO_NET, "guest_uso6", "off"},
+};
+const size_t hw_compat_rhel_9_len = G_N_ELEMENTS(hw_compat_rhel_9);
+
/*
* RHEL only: machine types for previous major releases are deprecated
*/
@@ -341,12 +350,6 @@ GlobalProperty hw_compat_rhel_9_5[] = {
const size_t hw_compat_rhel_9_5_len = G_N_ELEMENTS(hw_compat_rhel_9_5);
GlobalProperty hw_compat_rhel_9_4[] = {
- /* hw_compat_rhel_9_4 from hw_compat_8_0 */
- { TYPE_VIRTIO_NET, "host_uso", "off"},
- /* hw_compat_rhel_9_4 from hw_compat_8_0 */
- { TYPE_VIRTIO_NET, "guest_uso4", "off"},
- /* hw_compat_rhel_9_4 from hw_compat_8_0 */
- { TYPE_VIRTIO_NET, "guest_uso6", "off"},
/* hw_compat_rhel_9_4 from hw_compat_8_1 */
{ TYPE_PCI_BRIDGE, "x-pci-express-writeable-slt-bug", "true" },
/* hw_compat_rhel_9_4 from hw_compat_8_1 */
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 656abb5d39..10764bf596 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -929,6 +929,7 @@ static void pc_i440fx_rhel_machine_7_6_0_options(MachineClass *m)
compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len);
compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len);
+ compat_props_add(m->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len);
}
DEFINE_I440FX_MACHINE(7, 6, 0);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 578f63524f..5bf08be0fb 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -679,6 +679,9 @@ static void pc_q35_rhel_machine_9_6_0_options(MachineClass *m)
m->desc = "RHEL-9.6.0 PC (Q35 + ICH9, 2009)";
pcmc->smbios_stream_product = "RHEL";
pcmc->smbios_stream_version = "9.6.0";
+
+ /* NB: remember to move this line to the *latest* RHEL 9 machine */
+ compat_props_add(m->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len);
}
DEFINE_Q35_MACHINE_BUGFIX(9, 6, 0);
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 9f4ad01789..312e8f18aa 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1348,6 +1348,8 @@ static void ccw_rhel_machine_9_6_0_instance_options(MachineState *machine)
static void ccw_rhel_machine_9_6_0_class_options(MachineClass *mc)
{
+ /* NB: remember to move this line to the *latest* RHEL 9 machine */
+ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len);
}
DEFINE_CCW_MACHINE_AS_LATEST(9, 6, 0);
diff --git a/include/hw/boards.h b/include/hw/boards.h
index fe011b1e86..8f3fa40cf9 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -803,6 +803,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[];
+extern const size_t hw_compat_rhel_9_len;
+
extern GlobalProperty hw_compat_rhel_9_6[];
extern const size_t hw_compat_rhel_9_6_len;
--
2.48.1