* Fri Dec 16 2022 Miroslav Rezanina <mrezanin@redhat.com> - 7.2.0-1

- Rebase to QEMU 7.2.0 [bz#2135806]
- Resolves: bz#2135806
  (Rebase to QEMU 7.2 for RHEL 9.2.0)
This commit is contained in:
Miroslav Rezanina 2022-12-15 01:04:15 -05:00
parent 55259e29d6
commit 9f4495a7b6
59 changed files with 544 additions and 3844 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@
/qemu-7.0.0.tar.xz /qemu-7.0.0.tar.xz
/capstone.tar.gz /capstone.tar.gz
/qemu-7.1.0.tar.xz /qemu-7.1.0.tar.xz
/qemu-7.2.0.tar.xz

View File

@ -1,4 +1,4 @@
From 476f040f14a9287efb6f0bf5b3ca97844bf9fdc3 Mon Sep 17 00:00:00 2001 From ccc4a5bdc8c2f27678312364a7c12aeafd009bb6 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 26 May 2021 10:56:02 +0200 Date: Wed, 26 May 2021 10:56:02 +0200
Subject: Initial redhat build Subject: Initial redhat build
@ -13,7 +13,7 @@ several issues are fixed in QEMU tree:
We disable make check due to issues with some of the tests. We disable make check due to issues with some of the tests.
This rebase is based on qemu-kvm-7.0.0-11.el9 This rebase is based on qemu-kvm-7.1.0-7.el9
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
-- --
@ -56,6 +56,16 @@ Rebase changes (7.1.0 rc0):
- capstone submodule removed - capstone submodule removed
- Temporary include capstone build - Temporary include capstone build
Rebase changes (7.2.0 rc0):
- Switch --enable-slirp=system to --enable-slirp
Rebaes changes (7.2.0 rc2):
- Added new configure options (blkio and sndio, both disabled)
Rebase changes (7.2.0):
- Fix SRPM name generation to work on Fedora 37
- Switch back to system meson
Merged patches (6.0.0): Merged patches (6.0.0):
- 605758c902 Limit build on Power to qemu-img and qemu-ga only - 605758c902 Limit build on Power to qemu-img and qemu-ga only
@ -148,25 +158,23 @@ Merged patches (7.0.0):
- d46d2710b2 spec: Obsolete old usb redir subpackage - d46d2710b2 spec: Obsolete old usb redir subpackage
- 6f52a50b68 spec: Obsolete ssh driver - 6f52a50b68 spec: Obsolete ssh driver
Merged patches (7.2.0 rc4):
- 8c6834feb6 Remove opengl display device subpackages (C9S MR 124)
- 0ecc97f29e spec: Add requires for packages with additional virtio-gpu variants (C9S MR 124)
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
fix
--- ---
.distro/85-kvm.preset | 5 -
.distro/Makefile | 100 + .distro/Makefile | 100 +
.distro/Makefile.common | 41 + .distro/Makefile.common | 41 +
.distro/README.tests | 39 + .distro/README.tests | 39 +
.distro/ksm.service | 13 -
.distro/ksm.sysconfig | 4 -
.distro/ksmctl.c | 77 -
.distro/ksmtuned | 139 -
.distro/ksmtuned.conf | 21 -
.distro/ksmtuned.service | 12 -
.distro/kvm-setup | 49 -
.distro/kvm-setup.service | 14 -
.distro/modules-load.conf | 4 + .distro/modules-load.conf | 4 +
.distro/qemu-guest-agent.service | 1 - .distro/qemu-guest-agent.service | 1 -
.distro/qemu-kvm.spec.template | 4256 +++++++++++++++++++++++ .distro/qemu-kvm.spec.template | 4315 +++++++++++++++++++++++
.distro/rpminspect.yaml | 6 +- .distro/rpminspect.yaml | 6 +-
.distro/scripts/extract_build_cmd.py | 12 + .distro/scripts/extract_build_cmd.py | 12 +
.distro/scripts/process-patches.sh | 4 +
.gitignore | 1 + .gitignore | 1 +
README.systemtap | 43 + README.systemtap | 43 +
scripts/qemu-guest-agent/fsfreeze-hook | 2 +- scripts/qemu-guest-agent/fsfreeze-hook | 2 +-
@ -174,19 +182,10 @@ Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
scripts/systemtap/script.d/qemu_kvm.stp | 1 + scripts/systemtap/script.d/qemu_kvm.stp | 1 +
tests/check-block.sh | 2 + tests/check-block.sh | 2 +
ui/vnc-auth-sasl.c | 2 +- ui/vnc-auth-sasl.c | 2 +-
24 files changed, 4510 insertions(+), 338 deletions(-) 16 files changed, 4573 insertions(+), 4 deletions(-)
delete mode 100644 .distro/85-kvm.preset
create mode 100644 .distro/Makefile create mode 100644 .distro/Makefile
create mode 100644 .distro/Makefile.common create mode 100644 .distro/Makefile.common
create mode 100644 .distro/README.tests create mode 100644 .distro/README.tests
delete mode 100644 .distro/ksm.service
delete mode 100644 .distro/ksm.sysconfig
delete mode 100644 .distro/ksmctl.c
delete mode 100644 .distro/ksmtuned
delete mode 100644 .distro/ksmtuned.conf
delete mode 100644 .distro/ksmtuned.service
delete mode 100644 .distro/kvm-setup
delete mode 100644 .distro/kvm-setup.service
create mode 100644 .distro/modules-load.conf create mode 100644 .distro/modules-load.conf
create mode 100644 .distro/qemu-kvm.spec.template create mode 100644 .distro/qemu-kvm.spec.template
create mode 100644 README.systemtap create mode 100644 README.systemtap

View File

@ -1,6 +1,6 @@
From ae20ca5826cd237e727cff1663177f7f863fab21 Mon Sep 17 00:00:00 2001 From 90366cd2ead5a5301aaceed56477d2e6d9f1b3cd Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Thu, 15 Jul 2021 03:22:36 -0400 Date: Wed, 7 Dec 2022 03:05:48 -0500
Subject: Enable/disable devices for RHEL Subject: Enable/disable devices for RHEL
This commit adds all changes related to changes in supported devices. This commit adds all changes related to changes in supported devices.
@ -29,6 +29,9 @@ Rebase notes (7.1.0 rc0):
Rebase notes (7.1.0 rc3): Rebase notes (7.1.0 rc3):
- Added CONFIG_VHOST_USER_FS option (all archs) - Added CONFIG_VHOST_USER_FS option (all archs)
Rebase notes (7.2.0 rc20):
- Removed disabling a15mpcore.c as no longer needed
Merged patches (6.1.0): Merged patches (6.1.0):
- c51bf45304 Remove SPICE and QXL from x86_64-rh-devices.mak - c51bf45304 Remove SPICE and QXL from x86_64-rh-devices.mak
- 02fc745601 aarch64-rh-devices: add CONFIG_PVPANIC_PCI - 02fc745601 aarch64-rh-devices: add CONFIG_PVPANIC_PCI
@ -59,7 +62,7 @@ Merged patches (7.1.0 rc0):
.../x86_64-softmmu/x86_64-rh-devices.mak | 109 ++++++++++++++++++ .../x86_64-softmmu/x86_64-rh-devices.mak | 109 ++++++++++++++++++
hw/arm/meson.build | 2 +- hw/arm/meson.build | 2 +-
hw/block/fdc.c | 10 ++ hw/block/fdc.c | 10 ++
hw/cpu/meson.build | 5 +- hw/cpu/meson.build | 3 +-
hw/display/cirrus_vga.c | 5 +- hw/display/cirrus_vga.c | 5 +-
hw/ide/piix.c | 5 +- hw/ide/piix.c | 5 +-
hw/input/pckbd.c | 2 + hw/input/pckbd.c | 2 +
@ -70,7 +73,7 @@ Merged patches (7.1.0 rc0):
target/ppc/cpu-models.c | 9 ++ target/ppc/cpu-models.c | 9 ++
target/s390x/cpu_models_sysemu.c | 3 + target/s390x/cpu_models_sysemu.c | 3 +
target/s390x/kvm/kvm.c | 8 ++ target/s390x/kvm/kvm.c | 8 ++
19 files changed, 285 insertions(+), 13 deletions(-) 19 files changed, 283 insertions(+), 13 deletions(-)
create mode 100644 configs/devices/aarch64-softmmu/aarch64-rh-devices.mak create mode 100644 configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
create mode 100644 configs/devices/rh-virtio.mak create mode 100644 configs/devices/rh-virtio.mak
@ -364,24 +367,21 @@ index 64ae4a6899..9b8e782c19 100644
error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'"); error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
return; return;
diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build
index 9e52fee9e7..bb71c9f3e7 100644 index 9e52fee9e7..87c209a754 100644
--- a/hw/cpu/meson.build --- a/hw/cpu/meson.build
+++ b/hw/cpu/meson.build +++ b/hw/cpu/meson.build
@@ -1,6 +1,7 @@ @@ -1,4 +1,5 @@
-softmmu_ss.add(files('core.c', 'cluster.c')) -softmmu_ss.add(files('core.c', 'cluster.c'))
+#softmmu_ss.add(files('core.c', 'cluster.c')) +#softmmu_ss.add(files('core.c', 'cluster.c'))
+softmmu_ss.add(files('core.c')) +softmmu_ss.add(files('core.c'))
specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c')) specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c'))
specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c')) specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c'))
-specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
+#specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c'))
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 3bb6a58698..6447fdb02e 100644 index 6e8c747c46..1948ebee8e 100644
--- a/hw/display/cirrus_vga.c --- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c
@@ -2945,7 +2945,10 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp) @@ -2946,7 +2946,10 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
int16_t device_id = pc->device_id; int16_t device_id = pc->device_id;
@ -394,10 +394,10 @@ index 3bb6a58698..6447fdb02e 100644
* Also accept 8 MB/16 MB for backward compatibility. * Also accept 8 MB/16 MB for backward compatibility.
*/ */
diff --git a/hw/ide/piix.c b/hw/ide/piix.c diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 9a9b28078e..f3ce3fbcee 100644 index 267dbf37db..87fcda4062 100644
--- a/hw/ide/piix.c --- a/hw/ide/piix.c
+++ b/hw/ide/piix.c +++ b/hw/ide/piix.c
@@ -197,7 +197,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) @@ -199,7 +199,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
k->class_id = PCI_CLASS_STORAGE_IDE; k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
@ -407,7 +407,7 @@ index 9a9b28078e..f3ce3fbcee 100644
} }
static const TypeInfo piix3_ide_info = { static const TypeInfo piix3_ide_info = {
@@ -220,6 +221,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) @@ -222,6 +223,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_STORAGE_IDE; k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
dc->hotpluggable = false; dc->hotpluggable = false;
@ -480,10 +480,10 @@ index 793df42e21..cd3c305471 100644
endif endif
diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c
index 3099b38e32..10d91c4ef0 100644 index 9a2cef7d05..a528ff9a3d 100644
--- a/target/arm/cpu_tcg.c --- a/target/arm/cpu_tcg.c
+++ b/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c
@@ -147,6 +147,7 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu) @@ -151,6 +151,7 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu)
/* CPU models. These are not needed for the AArch64 linux-user build. */ /* CPU models. These are not needed for the AArch64 linux-user build. */
#if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
@ -491,7 +491,7 @@ index 3099b38e32..10d91c4ef0 100644
#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{ {
@@ -500,6 +501,7 @@ static void cortex_a9_initfn(Object *obj) @@ -504,6 +505,7 @@ static void cortex_a9_initfn(Object *obj)
cpu->isar.reset_pmcr_el0 = 0x41093000; cpu->isar.reset_pmcr_el0 = 0x41093000;
define_arm_cp_regs(cpu, cortexa9_cp_reginfo); define_arm_cp_regs(cpu, cortexa9_cp_reginfo);
} }
@ -499,7 +499,7 @@ index 3099b38e32..10d91c4ef0 100644
#ifndef CONFIG_USER_ONLY #ifndef CONFIG_USER_ONLY
static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri) static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
@@ -524,6 +526,7 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = { @@ -528,6 +530,7 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = {
.access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 }, .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
}; };
@ -507,7 +507,7 @@ index 3099b38e32..10d91c4ef0 100644
static void cortex_a7_initfn(Object *obj) static void cortex_a7_initfn(Object *obj)
{ {
ARMCPU *cpu = ARM_CPU(obj); ARMCPU *cpu = ARM_CPU(obj);
@@ -572,6 +575,7 @@ static void cortex_a7_initfn(Object *obj) @@ -576,6 +579,7 @@ static void cortex_a7_initfn(Object *obj)
cpu->isar.reset_pmcr_el0 = 0x41072000; cpu->isar.reset_pmcr_el0 = 0x41072000;
define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */ define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */
} }
@ -515,7 +515,7 @@ index 3099b38e32..10d91c4ef0 100644
static void cortex_a15_initfn(Object *obj) static void cortex_a15_initfn(Object *obj)
{ {
@@ -618,6 +622,7 @@ static void cortex_a15_initfn(Object *obj) @@ -624,6 +628,7 @@ static void cortex_a15_initfn(Object *obj)
define_arm_cp_regs(cpu, cortexa15_cp_reginfo); define_arm_cp_regs(cpu, cortexa15_cp_reginfo);
} }
@ -523,7 +523,7 @@ index 3099b38e32..10d91c4ef0 100644
static void cortex_m0_initfn(Object *obj) static void cortex_m0_initfn(Object *obj)
{ {
ARMCPU *cpu = ARM_CPU(obj); ARMCPU *cpu = ARM_CPU(obj);
@@ -1058,6 +1063,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) @@ -1065,6 +1070,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data)
cc->gdb_core_xml_file = "arm-m-profile.xml"; cc->gdb_core_xml_file = "arm-m-profile.xml";
} }
@ -531,7 +531,7 @@ index 3099b38e32..10d91c4ef0 100644
#ifndef TARGET_AARCH64 #ifndef TARGET_AARCH64
/* /*
@@ -1125,6 +1131,7 @@ static void arm_max_initfn(Object *obj) @@ -1132,6 +1138,7 @@ static void arm_max_initfn(Object *obj)
#endif /* !TARGET_AARCH64 */ #endif /* !TARGET_AARCH64 */
static const ARMCPUInfo arm_tcg_cpus[] = { static const ARMCPUInfo arm_tcg_cpus[] = {
@ -539,7 +539,7 @@ index 3099b38e32..10d91c4ef0 100644
{ .name = "arm926", .initfn = arm926_initfn }, { .name = "arm926", .initfn = arm926_initfn },
{ .name = "arm946", .initfn = arm946_initfn }, { .name = "arm946", .initfn = arm946_initfn },
{ .name = "arm1026", .initfn = arm1026_initfn }, { .name = "arm1026", .initfn = arm1026_initfn },
@@ -1140,7 +1147,9 @@ static const ARMCPUInfo arm_tcg_cpus[] = { @@ -1147,7 +1154,9 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
{ .name = "cortex-a7", .initfn = cortex_a7_initfn }, { .name = "cortex-a7", .initfn = cortex_a7_initfn },
{ .name = "cortex-a8", .initfn = cortex_a8_initfn }, { .name = "cortex-a8", .initfn = cortex_a8_initfn },
{ .name = "cortex-a9", .initfn = cortex_a9_initfn }, { .name = "cortex-a9", .initfn = cortex_a9_initfn },
@ -549,7 +549,7 @@ index 3099b38e32..10d91c4ef0 100644
{ .name = "cortex-m0", .initfn = cortex_m0_initfn, { .name = "cortex-m0", .initfn = cortex_m0_initfn,
.class_init = arm_v7m_class_init }, .class_init = arm_v7m_class_init },
{ .name = "cortex-m3", .initfn = cortex_m3_initfn, { .name = "cortex-m3", .initfn = cortex_m3_initfn,
@@ -1171,6 +1180,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = { @@ -1178,6 +1187,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
{ .name = "pxa270-b1", .initfn = pxa270b1_initfn }, { .name = "pxa270-b1", .initfn = pxa270b1_initfn },
{ .name = "pxa270-c0", .initfn = pxa270c0_initfn }, { .name = "pxa270-c0", .initfn = pxa270c0_initfn },
{ .name = "pxa270-c5", .initfn = pxa270c5_initfn }, { .name = "pxa270-c5", .initfn = pxa270c5_initfn },
@ -634,10 +634,10 @@ index d8a141a023..d086b1c39c 100644
/* detect missing features if any to properly report them */ /* detect missing features if any to properly report them */
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 7bd8db0e7b..81cb489694 100644 index 3ac7ec9acf..97da1a6424 100644
--- a/target/s390x/kvm/kvm.c --- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c
@@ -2520,6 +2520,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp) @@ -2529,6 +2529,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp)
error_setg(errp, "KVM doesn't support CPU models"); error_setg(errp, "KVM doesn't support CPU models");
return; return;
} }

View File

@ -1,251 +0,0 @@
From 963cd2a0d78f6cec0ee5203ca2d2de77094bf047 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 1 Jun 2022 05:45:58 -0400
Subject: Re-enable capstone internal build
Until capstone component is added to RHEL 9 we revert changes removing
internal capstone usage.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
.distro/Makefile.common | 3 +-
.distro/capstone.tar.gz | Bin 0 -> 5765837 bytes
.distro/qemu-kvm.spec.template | 5 +-
configure | 12 ++++
meson.build | 116 +++++++++++++++++++++++++++++++--
meson_options.txt | 3 +-
scripts/meson-buildoptions.sh | 5 +-
7 files changed, 135 insertions(+), 9 deletions(-)
create mode 100644 .distro/capstone.tar.gz
diff --git a/configure b/configure
index 72ab03f11a..448b0c82cb 100755
--- a/configure
+++ b/configure
@@ -322,8 +322,10 @@ vfio_user_server="disabled"
# 1. Track which submodules are needed
if test "$default_feature" = no ; then
+ capstone="disabled"
slirp="disabled"
else
+ capstone="auto"
slirp="auto"
fi
fdt="auto"
@@ -902,6 +904,15 @@ for opt do
--enable-uuid|--disable-uuid)
echo "$0: $opt is obsolete, UUID support is always built" >&2
;;
+ --disable-capstone) capstone="disabled"
+ ;;
+ --enable-capstone) capstone="enabled"
+ ;;
+ --enable-capstone=git) capstone="internal"
+ ;;
+ --enable-capstone=*) capstone="$optarg"
+ ;;
+
--with-git=*) git="$optarg"
;;
--with-git-submodules=*)
@@ -2742,6 +2753,7 @@ if test "$skip_meson" = no; then
test "$werror" = yes && meson_option_add -Dwerror=true
# QEMU options
+ test "$capstone" != auto && meson_option_add "-Dcapstone=$capstone"
test "$cfi" != false && meson_option_add "-Dcfi=$cfi"
test "$fdt" != auto && meson_option_add "-Dfdt=$fdt"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
diff --git a/meson.build b/meson.build
index 20fddbd707..9e6a979c13 100644
--- a/meson.build
+++ b/meson.build
@@ -2596,10 +2596,13 @@ genh += custom_target('config-poison.h',
##############
capstone = not_found
-if not get_option('capstone').auto() or have_system or have_user
+capstone_opt = get_option('capstone')
+if capstone_opt in ['enabled', 'auto', 'system']
+ have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')
capstone = dependency('capstone', version: '>=3.0.5',
kwargs: static_kwargs, method: 'pkg-config',
- required: get_option('capstone'))
+ required: capstone_opt == 'system' or
+ capstone_opt == 'enabled' and not have_internal)
# Some versions of capstone have broken pkg-config file
# that reports a wrong -I path, causing the #include to
@@ -2608,10 +2611,113 @@ if not get_option('capstone').auto() or have_system or have_user
if capstone.found() and not cc.compiles('#include <capstone.h>',
dependencies: [capstone])
capstone = not_found
- if get_option('capstone').enabled()
- error('capstone requested, but it does not appear to work')
+ if capstone_opt == 'system'
+ error('system capstone requested, it does not appear to work')
endif
endif
+
+ if capstone.found()
+ capstone_opt = 'system'
+ elif have_internal
+ capstone_opt = 'internal'
+ else
+ capstone_opt = 'disabled'
+ endif
+endif
+if capstone_opt == 'internal'
+ capstone_data = configuration_data()
+ capstone_data.set('CAPSTONE_USE_SYS_DYN_MEM', '1')
+
+ capstone_files = files(
+ 'capstone/cs.c',
+ 'capstone/MCInst.c',
+ 'capstone/MCInstrDesc.c',
+ 'capstone/MCRegisterInfo.c',
+ 'capstone/SStream.c',
+ 'capstone/utils.c'
+ )
+
+ if 'CONFIG_ARM_DIS' in config_all_disas
+ capstone_data.set('CAPSTONE_HAS_ARM', '1')
+ capstone_files += files(
+ 'capstone/arch/ARM/ARMDisassembler.c',
+ 'capstone/arch/ARM/ARMInstPrinter.c',
+ 'capstone/arch/ARM/ARMMapping.c',
+ 'capstone/arch/ARM/ARMModule.c'
+ )
+ endif
+
+ # FIXME: This config entry currently depends on a c++ compiler.
+ # Which is needed for building libvixl, but not for capstone.
+ if 'CONFIG_ARM_A64_DIS' in config_all_disas
+ capstone_data.set('CAPSTONE_HAS_ARM64', '1')
+ capstone_files += files(
+ 'capstone/arch/AArch64/AArch64BaseInfo.c',
+ 'capstone/arch/AArch64/AArch64Disassembler.c',
+ 'capstone/arch/AArch64/AArch64InstPrinter.c',
+ 'capstone/arch/AArch64/AArch64Mapping.c',
+ 'capstone/arch/AArch64/AArch64Module.c'
+ )
+ endif
+
+ if 'CONFIG_PPC_DIS' in config_all_disas
+ capstone_data.set('CAPSTONE_HAS_POWERPC', '1')
+ capstone_files += files(
+ 'capstone/arch/PowerPC/PPCDisassembler.c',
+ 'capstone/arch/PowerPC/PPCInstPrinter.c',
+ 'capstone/arch/PowerPC/PPCMapping.c',
+ 'capstone/arch/PowerPC/PPCModule.c'
+ )
+ endif
+
+ if 'CONFIG_S390_DIS' in config_all_disas
+ capstone_data.set('CAPSTONE_HAS_SYSZ', '1')
+ capstone_files += files(
+ 'capstone/arch/SystemZ/SystemZDisassembler.c',
+ 'capstone/arch/SystemZ/SystemZInstPrinter.c',
+ 'capstone/arch/SystemZ/SystemZMapping.c',
+ 'capstone/arch/SystemZ/SystemZModule.c',
+ 'capstone/arch/SystemZ/SystemZMCTargetDesc.c'
+ )
+ endif
+
+ if 'CONFIG_I386_DIS' in config_all_disas
+ capstone_data.set('CAPSTONE_HAS_X86', 1)
+ capstone_files += files(
+ 'capstone/arch/X86/X86Disassembler.c',
+ 'capstone/arch/X86/X86DisassemblerDecoder.c',
+ 'capstone/arch/X86/X86ATTInstPrinter.c',
+ 'capstone/arch/X86/X86IntelInstPrinter.c',
+ 'capstone/arch/X86/X86InstPrinterCommon.c',
+ 'capstone/arch/X86/X86Mapping.c',
+ 'capstone/arch/X86/X86Module.c'
+ )
+ endif
+
+ configure_file(output: 'capstone-defs.h', configuration: capstone_data)
+
+ capstone_cargs = [
+ # FIXME: There does not seem to be a way to completely replace the c_args
+ # that come from add_project_arguments() -- we can only add to them.
+ # So: disable all warnings with a big hammer.
+ '-Wno-error', '-w',
+
+ # Include all configuration defines via a header file, which will wind up
+ # as a dependency on the object file, and thus changes here will result
+ # in a rebuild.
+ '-include', 'capstone-defs.h',
+
+ '-Wp,-D_GLIBCXX_ASSERTIONS',
+
+ ]
+
+ libcapstone = static_library('capstone',
+ build_by_default: false,
+ sources: capstone_files,
+ c_args: capstone_cargs,
+ include_directories: 'capstone/include')
+ capstone = declare_dependency(link_with: libcapstone,
+ include_directories: 'capstone/include/capstone')
endif
slirp = not_found
@@ -3977,7 +4083,7 @@ summary_info += {'bzip2 support': libbzip2}
summary_info += {'lzfse support': liblzfse}
summary_info += {'zstd support': zstd}
summary_info += {'NUMA host support': numa}
-summary_info += {'capstone': capstone}
+summary_info += {'capstone': capstone_opt == 'internal' ? capstone_opt : capstone}
summary_info += {'libpmem support': libpmem}
summary_info += {'libdaxctl support': libdaxctl}
summary_info += {'libudev': libudev}
diff --git a/meson_options.txt b/meson_options.txt
index e58e158396..7cd920fcd6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -262,7 +262,8 @@ option('libvduse', type: 'feature', value: 'auto',
option('vduse_blk_export', type: 'feature', value: 'auto',
description: 'VDUSE block export support')
-option('capstone', type: 'feature', value: 'auto',
+option('capstone', type: 'combo', value: 'auto',
+ choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
description: 'Whether and how to find the capstone library')
option('slirp', type: 'combo', value: 'auto',
choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 359b04e0e6..b1001aa1db 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -16,6 +16,9 @@ meson_options_help() {
printf "%s\n" ' --enable-block-drv-whitelist-in-tools'
printf "%s\n" ' use block whitelist also in tools instead of only'
printf "%s\n" ' QEMU'
+ printf "%s\n" ' --enable-capstone[=CHOICE]'
+ printf "%s\n" ' Whether and how to find the capstone library'
+ printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)'
printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)'
printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation'
printf "%s\n" ' --enable-debug-mutex mutex debugging support'
@@ -75,7 +78,6 @@ meson_options_help() {
printf "%s\n" ' bzip2 bzip2 support for DMG images'
printf "%s\n" ' canokey CanoKey support'
printf "%s\n" ' cap-ng cap_ng support'
- printf "%s\n" ' capstone Whether and how to find the capstone library'
printf "%s\n" ' cloop cloop image format support'
printf "%s\n" ' cocoa Cocoa user interface (macOS only)'
printf "%s\n" ' coreaudio CoreAudio sound support'
@@ -216,6 +218,7 @@ _meson_option_parse() {
--disable-cap-ng) printf "%s" -Dcap_ng=disabled ;;
--enable-capstone) printf "%s" -Dcapstone=enabled ;;
--disable-capstone) printf "%s" -Dcapstone=disabled ;;
+ --enable-capstone=*) quote_sh "-Dcapstone=$2" ;;
--enable-cfi) printf "%s" -Dcfi=true ;;
--disable-cfi) printf "%s" -Dcfi=false ;;
--enable-cfi-debug) printf "%s" -Dcfi_debug=true ;;
--
2.31.1

View File

@ -1,4 +1,4 @@
From 8ee73de7f30f39293388932bbb0d69b6c9435ab1 Mon Sep 17 00:00:00 2001 From 0208f38671b9de4036c0d56142a7f22e5091bae0 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 11 Jan 2019 09:54:45 +0100 Date: Fri, 11 Jan 2019 09:54:45 +0100
Subject: Machine type related general changes Subject: Machine type related general changes
@ -43,10 +43,13 @@ Merged patches (7.0.0):
Merged patches (7.1.0 rc0): Merged patches (7.1.0 rc0):
- 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/acpi/piix4.c chunk) - 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/acpi/piix4.c chunk)
- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/core/machine.c and include/hw/boards.h chunk) - 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/core/machine.c and include/hw/boards.h chunk)
Merged patches (7.2.0 rc0):
- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts)
--- ---
hw/acpi/piix4.c | 2 +- hw/acpi/piix4.c | 2 +-
hw/arm/virt.c | 2 +- hw/arm/virt.c | 2 +-
hw/core/machine.c | 211 +++++++++++++++++++++++++++++++++++ hw/core/machine.c | 222 +++++++++++++++++++++++++++++++++++
hw/display/vga-isa.c | 2 +- hw/display/vga-isa.c | 2 +-
hw/i386/pc_piix.c | 2 + hw/i386/pc_piix.c | 2 +
hw/i386/pc_q35.c | 2 + hw/i386/pc_q35.c | 2 +
@ -55,10 +58,10 @@ Merged patches (7.1.0 rc0):
hw/timer/i8254_common.c | 2 +- hw/timer/i8254_common.c | 2 +-
hw/usb/hcd-xhci-pci.c | 59 +++++++--- hw/usb/hcd-xhci-pci.c | 59 +++++++---
hw/usb/hcd-xhci-pci.h | 1 + hw/usb/hcd-xhci-pci.h | 1 +
include/hw/boards.h | 28 +++++ include/hw/boards.h | 31 +++++
include/hw/firmware/smbios.h | 5 +- include/hw/firmware/smbios.h | 5 +-
include/hw/i386/pc.h | 3 + include/hw/i386/pc.h | 3 +
14 files changed, 346 insertions(+), 23 deletions(-) 14 files changed, 360 insertions(+), 23 deletions(-)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 0a81f1ad93..dbfb362a8f 100644 index 0a81f1ad93..dbfb362a8f 100644
@ -74,10 +77,10 @@ index 0a81f1ad93..dbfb362a8f 100644
.fields = (VMStateField[]) { .fields = (VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState), VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
diff --git a/hw/arm/virt.c b/hw/arm/virt.c diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9633f822f3..389d6882dd 100644 index b871350856..d633300fdc 100644
--- a/hw/arm/virt.c --- a/hw/arm/virt.c
+++ b/hw/arm/virt.c +++ b/hw/arm/virt.c
@@ -1617,7 +1617,7 @@ static void virt_build_smbios(VirtMachineState *vms) @@ -1619,7 +1619,7 @@ static void virt_build_smbios(VirtMachineState *vms)
smbios_set_defaults("QEMU", product, smbios_set_defaults("QEMU", product,
vmc->smbios_old_sys_ver ? "1.0" : mc->name, false, vmc->smbios_old_sys_ver ? "1.0" : mc->name, false,
@ -87,10 +90,10 @@ index 9633f822f3..389d6882dd 100644
smbios_get_tables(MACHINE(vms), NULL, 0, smbios_get_tables(MACHINE(vms), NULL, 0,
&smbios_tables, &smbios_tables_len, &smbios_tables, &smbios_tables_len,
diff --git a/hw/core/machine.c b/hw/core/machine.c diff --git a/hw/core/machine.c b/hw/core/machine.c
index a673302cce..909f75770b 100644 index 8d34caa31d..9edec1ca05 100644
--- a/hw/core/machine.c --- a/hw/core/machine.c
+++ b/hw/core/machine.c +++ b/hw/core/machine.c
@@ -40,6 +40,217 @@ @@ -40,6 +40,228 @@
#include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-pci.h"
#include "qom/object_interfaces.h" #include "qom/object_interfaces.h"
@ -101,6 +104,17 @@ index a673302cce..909f75770b 100644
+ "machine types for previous major releases are deprecated"; + "machine types for previous major releases are deprecated";
+ +
+/* +/*
+ * Mostly the same as hw_compat_7_0
+ */
+GlobalProperty hw_compat_rhel_9_1[] = {
+ /* hw_compat_rhel_9_1 from hw_compat_7_0 */
+ { "arm-gicv3-common", "force-8-bit-prio", "on" },
+ /* hw_compat_rhel_9_1 from hw_compat_7_0 */
+ { "nvme-ns", "eui64-default", "on"},
+};
+const size_t hw_compat_rhel_9_1_len = G_N_ELEMENTS(hw_compat_rhel_9_1);
+
+/*
+ * Mostly the same as hw_compat_6_2 + * Mostly the same as hw_compat_6_2
+ */ + */
+GlobalProperty hw_compat_rhel_9_0[] = { +GlobalProperty hw_compat_rhel_9_0[] = {
@ -305,14 +319,14 @@ index a673302cce..909f75770b 100644
+}; +};
+const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6); +const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6);
+ +
GlobalProperty hw_compat_7_0[] = { GlobalProperty hw_compat_7_1[] = {
{ "arm-gicv3-common", "force-8-bit-prio", "on" }, { "virtio-device", "queue_reset", "false" },
{ "nvme-ns", "eui64-default", "on"}, };
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
index 46abbc5653..505467059b 100644 index 2a5437d803..0db2c2b2a1 100644
--- a/hw/display/vga-isa.c --- a/hw/display/vga-isa.c
+++ b/hw/display/vga-isa.c +++ b/hw/display/vga-isa.c
@@ -88,7 +88,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp) @@ -89,7 +89,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
} }
static Property vga_isa_properties[] = { static Property vga_isa_properties[] = {
@ -322,10 +336,10 @@ index 46abbc5653..505467059b 100644
}; };
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 20962c34e7..1ec5d6a4f8 100644 index 0ad0ed1603..0985ff67d2 100644
--- a/hw/i386/pc_piix.c --- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c
@@ -185,6 +185,8 @@ static void pc_init1(MachineState *machine, @@ -187,6 +187,8 @@ static void pc_init1(MachineState *machine,
smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
mc->name, pcmc->smbios_legacy_mode, mc->name, pcmc->smbios_legacy_mode,
pcmc->smbios_uuid_encoded, pcmc->smbios_uuid_encoded,
@ -335,7 +349,7 @@ index 20962c34e7..1ec5d6a4f8 100644
} }
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 2e5dae9a89..ef471f6664 100644 index a496bd6e74..ea582254e3 100644
--- a/hw/i386/pc_q35.c --- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c
@@ -201,6 +201,8 @@ static void pc_q35_init(MachineState *machine) @@ -201,6 +201,8 @@ static void pc_q35_init(MachineState *machine)
@ -348,10 +362,10 @@ index 2e5dae9a89..ef471f6664 100644
} }
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 6b65823b4b..75dacabc43 100644 index 700b1b66b6..13693aeb4f 100644
--- a/hw/net/rtl8139.c --- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c
@@ -3179,7 +3179,7 @@ static int rtl8139_pre_save(void *opaque) @@ -3178,7 +3178,7 @@ static int rtl8139_pre_save(void *opaque)
static const VMStateDescription vmstate_rtl8139 = { static const VMStateDescription vmstate_rtl8139 = {
.name = "rtl8139", .name = "rtl8139",
@ -360,7 +374,7 @@ index 6b65823b4b..75dacabc43 100644
.minimum_version_id = 3, .minimum_version_id = 3,
.post_load = rtl8139_post_load, .post_load = rtl8139_post_load,
.pre_save = rtl8139_pre_save, .pre_save = rtl8139_pre_save,
@@ -3260,7 +3260,9 @@ static const VMStateDescription vmstate_rtl8139 = { @@ -3259,7 +3259,9 @@ static const VMStateDescription vmstate_rtl8139 = {
VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State), VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State),
VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State), VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State),
VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State), VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State),
@ -371,7 +385,7 @@ index 6b65823b4b..75dacabc43 100644
VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State), VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 60349ee402..0edcc98434 100644 index b4243de735..c5ad69237e 100644
--- a/hw/smbios/smbios.c --- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c
@@ -57,6 +57,9 @@ static bool smbios_legacy = true; @@ -57,6 +57,9 @@ static bool smbios_legacy = true;
@ -384,7 +398,7 @@ index 60349ee402..0edcc98434 100644
uint8_t *smbios_tables; uint8_t *smbios_tables;
size_t smbios_tables_len; size_t smbios_tables_len;
@@ -639,7 +642,7 @@ static void smbios_build_type_1_table(void) @@ -669,7 +672,7 @@ static void smbios_build_type_1_table(void)
static void smbios_build_type_2_table(void) static void smbios_build_type_2_table(void)
{ {
@ -393,7 +407,7 @@ index 60349ee402..0edcc98434 100644
SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer); SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer);
SMBIOS_TABLE_SET_STR(2, product_str, type2.product); SMBIOS_TABLE_SET_STR(2, product_str, type2.product);
@@ -914,7 +917,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features) @@ -977,7 +980,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features)
void smbios_set_defaults(const char *manufacturer, const char *product, void smbios_set_defaults(const char *manufacturer, const char *product,
const char *version, bool legacy_mode, const char *version, bool legacy_mode,
@ -405,7 +419,7 @@ index 60349ee402..0edcc98434 100644
{ {
smbios_have_defaults = true; smbios_have_defaults = true;
smbios_legacy = legacy_mode; smbios_legacy = legacy_mode;
@@ -935,11 +941,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product, @@ -998,11 +1004,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
g_free(smbios_entries); g_free(smbios_entries);
} }
@ -466,7 +480,7 @@ index 050875b497..32935da46c 100644
vmstate_pit_channel, PITChannelState), vmstate_pit_channel, PITChannelState),
VMSTATE_INT64(channels[0].next_transition_time, VMSTATE_INT64(channels[0].next_transition_time,
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index e934b1a5b1..e18b05e528 100644 index 643d4643e4..529bad9366 100644
--- a/hw/usb/hcd-xhci-pci.c --- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c
@@ -104,6 +104,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id) @@ -104,6 +104,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id)
@ -577,13 +591,16 @@ index c193f79443..086a1feb1e 100644
#endif #endif
diff --git a/include/hw/boards.h b/include/hw/boards.h diff --git a/include/hw/boards.h b/include/hw/boards.h
index 7b416c9787..bfd757c561 100644 index 90f1dd3aeb..2209d4e416 100644
--- a/include/hw/boards.h --- a/include/hw/boards.h
+++ b/include/hw/boards.h +++ b/include/hw/boards.h
@@ -451,4 +451,32 @@ extern const size_t hw_compat_2_2_len; @@ -454,4 +454,35 @@ extern const size_t hw_compat_2_2_len;
extern GlobalProperty hw_compat_2_1[]; extern GlobalProperty hw_compat_2_1[];
extern const size_t hw_compat_2_1_len; extern const size_t hw_compat_2_1_len;
+extern GlobalProperty hw_compat_rhel_9_1[];
+extern const size_t hw_compat_rhel_9_1_len;
+
+extern GlobalProperty hw_compat_rhel_9_0[]; +extern GlobalProperty hw_compat_rhel_9_0[];
+extern const size_t hw_compat_rhel_9_0_len; +extern const size_t hw_compat_rhel_9_0_len;
+ +
@ -614,10 +631,10 @@ index 7b416c9787..bfd757c561 100644
+extern const char *rhel_old_machine_deprecation; +extern const char *rhel_old_machine_deprecation;
#endif #endif
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
index 4b7ad77a44..9acff96a86 100644 index 7f3259a630..d24b3ccd32 100644
--- a/include/hw/firmware/smbios.h --- a/include/hw/firmware/smbios.h
+++ b/include/hw/firmware/smbios.h +++ b/include/hw/firmware/smbios.h
@@ -272,7 +272,10 @@ void smbios_entry_add(QemuOpts *opts, Error **errp); @@ -294,7 +294,10 @@ void smbios_entry_add(QemuOpts *opts, Error **errp);
void smbios_set_cpuid(uint32_t version, uint32_t features); void smbios_set_cpuid(uint32_t version, uint32_t features);
void smbios_set_defaults(const char *manufacturer, const char *product, void smbios_set_defaults(const char *manufacturer, const char *product,
const char *version, bool legacy_mode, const char *version, bool legacy_mode,
@ -630,7 +647,7 @@ index 4b7ad77a44..9acff96a86 100644
void smbios_get_tables(MachineState *ms, void smbios_get_tables(MachineState *ms,
const struct smbios_phys_mem_area *mem_array, const struct smbios_phys_mem_area *mem_array,
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 8435733bd6..4d9e95a091 100644 index c95333514e..3754eaa97d 100644
--- a/include/hw/i386/pc.h --- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h
@@ -112,6 +112,9 @@ struct PCMachineClass { @@ -112,6 +112,9 @@ struct PCMachineClass {

View File

@ -1,4 +1,4 @@
From dfe5c09a8cca1dcbff5798951fa88b7f540ea4ed Mon Sep 17 00:00:00 2001 From 8501581c99760ed8a800d0c98eeb17a4bf450366 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 12:53:31 +0200 Date: Fri, 19 Oct 2018 12:53:31 +0200
Subject: Add aarch64 machine types Subject: Add aarch64 machine types
@ -23,6 +23,9 @@ Rebase notes (7.1.0 rc0):
Rebase notes (7.1.0 rc3): Rebase notes (7.1.0 rc3):
- Updated dtb_randomness comment - Updated dtb_randomness comment
Rebase notes (7.2.0 rc0):
- Disabled cortex-a35
Merged patches (6.2.0): Merged patches (6.2.0):
- 9a3d4fde0e hw/arm/virt: Remove 9.0 machine type - 9a3d4fde0e hw/arm/virt: Remove 9.0 machine type
- f7d04d6695 hw: arm: virt: Add hw_compat_rhel_8_5 to 8.5 machine type - f7d04d6695 hw: arm: virt: Add hw_compat_rhel_8_5 to 8.5 machine type
@ -43,20 +46,23 @@ Merged patches (7.0.0):
Merged patches (7.1.0 rc0): Merged patches (7.1.0 rc0):
- ac97dd4f9f RHEL-only: AArch64: Drop unsupported CPU types - ac97dd4f9f RHEL-only: AArch64: Drop unsupported CPU types
- e9c0a70664 target/arm: deprecate named CPU models - e9c0a70664 target/arm: deprecate named CPU models
Merged patches (7.2.0 rc0):
- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts)
--- ---
hw/arm/virt.c | 236 ++++++++++++++++++++++++++++++++- hw/arm/virt.c | 237 ++++++++++++++++++++++++++++++++-
include/hw/arm/virt.h | 8 ++ include/hw/arm/virt.h | 8 ++
target/arm/cpu-qom.h | 1 + target/arm/cpu-qom.h | 1 +
target/arm/cpu.c | 5 + target/arm/cpu.c | 5 +
target/arm/cpu.h | 2 + target/arm/cpu.h | 2 +
target/arm/cpu64.c | 14 +- target/arm/cpu64.c | 16 ++-
target/arm/cpu_tcg.c | 12 +- target/arm/cpu_tcg.c | 12 +-
target/arm/helper.c | 2 + target/arm/helper.c | 2 +
tests/qtest/arm-cpu-features.c | 6 + tests/qtest/arm-cpu-features.c | 6 +
9 files changed, 274 insertions(+), 12 deletions(-) 9 files changed, 277 insertions(+), 12 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 389d6882dd..9737b77eca 100644 index d633300fdc..dfcab40a73 100644
--- a/hw/arm/virt.c --- a/hw/arm/virt.c
+++ b/hw/arm/virt.c +++ b/hw/arm/virt.c
@@ -80,6 +80,7 @@ @@ -80,6 +80,7 @@
@ -117,13 +123,14 @@ index 389d6882dd..9737b77eca 100644
/* Number of external interrupt lines to configure the GIC with */ /* Number of external interrupt lines to configure the GIC with */
#define NUM_IRQS 256 #define NUM_IRQS 256
@@ -197,14 +239,18 @@ static const int a15irqmap[] = { @@ -197,15 +239,19 @@ static const int a15irqmap[] = {
}; };
static const char *valid_cpus[] = { static const char *valid_cpus[] = {
+#if 0 /* Disabled for Red Hat Enterprise Linux */ +#if 0 /* Disabled for Red Hat Enterprise Linux */
ARM_CPU_TYPE_NAME("cortex-a7"), ARM_CPU_TYPE_NAME("cortex-a7"),
ARM_CPU_TYPE_NAME("cortex-a15"), ARM_CPU_TYPE_NAME("cortex-a15"),
ARM_CPU_TYPE_NAME("cortex-a35"),
ARM_CPU_TYPE_NAME("cortex-a53"), ARM_CPU_TYPE_NAME("cortex-a53"),
+#endif /* disabled for RHEL */ +#endif /* disabled for RHEL */
ARM_CPU_TYPE_NAME("cortex-a57"), ARM_CPU_TYPE_NAME("cortex-a57"),
@ -136,7 +143,7 @@ index 389d6882dd..9737b77eca 100644
ARM_CPU_TYPE_NAME("host"), ARM_CPU_TYPE_NAME("host"),
ARM_CPU_TYPE_NAME("max"), ARM_CPU_TYPE_NAME("max"),
}; };
@@ -2288,6 +2334,7 @@ static void machvirt_init(MachineState *machine) @@ -2290,6 +2336,7 @@ static void machvirt_init(MachineState *machine)
qemu_add_machine_init_done_notifier(&vms->machine_done); qemu_add_machine_init_done_notifier(&vms->machine_done);
} }
@ -144,7 +151,7 @@ index 389d6882dd..9737b77eca 100644
static bool virt_get_secure(Object *obj, Error **errp) static bool virt_get_secure(Object *obj, Error **errp)
{ {
VirtMachineState *vms = VIRT_MACHINE(obj); VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2315,6 +2362,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp) @@ -2317,6 +2364,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
vms->virt = value; vms->virt = value;
} }
@ -152,7 +159,7 @@ index 389d6882dd..9737b77eca 100644
static bool virt_get_highmem(Object *obj, Error **errp) static bool virt_get_highmem(Object *obj, Error **errp)
{ {
@@ -2344,6 +2392,7 @@ static void virt_set_its(Object *obj, bool value, Error **errp) @@ -2346,6 +2394,7 @@ static void virt_set_its(Object *obj, bool value, Error **errp)
vms->its = value; vms->its = value;
} }
@ -160,7 +167,7 @@ index 389d6882dd..9737b77eca 100644
static bool virt_get_dtb_randomness(Object *obj, Error **errp) static bool virt_get_dtb_randomness(Object *obj, Error **errp)
{ {
VirtMachineState *vms = VIRT_MACHINE(obj); VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2357,6 +2406,7 @@ static void virt_set_dtb_randomness(Object *obj, bool value, Error **errp) @@ -2359,6 +2408,7 @@ static void virt_set_dtb_randomness(Object *obj, bool value, Error **errp)
vms->dtb_randomness = value; vms->dtb_randomness = value;
} }
@ -168,7 +175,7 @@ index 389d6882dd..9737b77eca 100644
static char *virt_get_oem_id(Object *obj, Error **errp) static char *virt_get_oem_id(Object *obj, Error **errp)
{ {
@@ -2440,6 +2490,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp) @@ -2442,6 +2492,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp)
vms->ras = value; vms->ras = value;
} }
@ -176,7 +183,7 @@ index 389d6882dd..9737b77eca 100644
static bool virt_get_mte(Object *obj, Error **errp) static bool virt_get_mte(Object *obj, Error **errp)
{ {
VirtMachineState *vms = VIRT_MACHINE(obj); VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2453,6 +2504,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp) @@ -2455,6 +2506,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp)
vms->mte = value; vms->mte = value;
} }
@ -184,7 +191,7 @@ index 389d6882dd..9737b77eca 100644
static char *virt_get_gic_version(Object *obj, Error **errp) static char *virt_get_gic_version(Object *obj, Error **errp)
{ {
@@ -2884,6 +2936,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str) @@ -2886,6 +2938,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str)
return fixed_ipa ? 0 : requested_pa_size; return fixed_ipa ? 0 : requested_pa_size;
} }
@ -192,7 +199,7 @@ index 389d6882dd..9737b77eca 100644
static void virt_machine_class_init(ObjectClass *oc, void *data) static void virt_machine_class_init(ObjectClass *oc, void *data)
{ {
MachineClass *mc = MACHINE_CLASS(oc); MachineClass *mc = MACHINE_CLASS(oc);
@@ -3285,3 +3338,184 @@ static void virt_machine_2_6_options(MachineClass *mc) @@ -3294,3 +3347,185 @@ static void virt_machine_2_6_options(MachineClass *mc)
vmc->no_pmu = true; vmc->no_pmu = true;
} }
DEFINE_VIRT_MACHINE(2, 6) DEFINE_VIRT_MACHINE(2, 6)
@ -372,6 +379,7 @@ index 389d6882dd..9737b77eca 100644
+ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
+ +
+ compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len); + compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
+ +
+ /* Disable FEAT_LPA2 since old kernels (<= v5.12) don't boot with that feature */ + /* Disable FEAT_LPA2 since old kernels (<= v5.12) don't boot with that feature */
+ vmc->no_tcg_lpa2 = true; + vmc->no_tcg_lpa2 = true;
@ -412,10 +420,10 @@ index 64c44cef2d..82e97249bc 100644
void arm_cpu_register(const ARMCPUInfo *info); void arm_cpu_register(const ARMCPUInfo *info);
diff --git a/target/arm/cpu.c b/target/arm/cpu.c diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 7ec3281da9..86174077f1 100644 index 38d066c294..a845814bfb 100644
--- a/target/arm/cpu.c --- a/target/arm/cpu.c
+++ b/target/arm/cpu.c +++ b/target/arm/cpu.c
@@ -2200,8 +2200,13 @@ static void arm_cpu_instance_init(Object *obj) @@ -2250,8 +2250,13 @@ static void arm_cpu_instance_init(Object *obj)
static void cpu_register_class_init(ObjectClass *oc, void *data) static void cpu_register_class_init(ObjectClass *oc, void *data)
{ {
ARMCPUClass *acc = ARM_CPU_CLASS(oc); ARMCPUClass *acc = ARM_CPU_CLASS(oc);
@ -430,7 +438,7 @@ index 7ec3281da9..86174077f1 100644
void arm_cpu_register(const ARMCPUInfo *info) void arm_cpu_register(const ARMCPUInfo *info)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 5168e3d837..876ca7cebb 100644 index 9aeed3c848..f9f504d89e 100644
--- a/target/arm/cpu.h --- a/target/arm/cpu.h
+++ b/target/arm/cpu.h +++ b/target/arm/cpu.h
@@ -34,6 +34,8 @@ @@ -34,6 +34,8 @@
@ -443,10 +451,26 @@ index 5168e3d837..876ca7cebb 100644
#define EXCP_SWI 2 /* software interrupt */ #define EXCP_SWI 2 /* software interrupt */
#define EXCP_PREFETCH_ABORT 3 #define EXCP_PREFETCH_ABORT 3
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 78e27f778a..1a16c9dccc 100644 index 3d74f134f5..4b330a52b5 100644
--- a/target/arm/cpu64.c --- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c +++ b/target/arm/cpu64.c
@@ -94,6 +94,7 @@ static void aarch64_a57_initfn(Object *obj) @@ -36,6 +36,7 @@
#include "hw/qdev-properties.h"
#include "internals.h"
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void aarch64_a35_initfn(Object *obj)
{
ARMCPU *cpu = ARM_CPU(obj);
@@ -115,6 +116,7 @@ static void aarch64_a35_initfn(Object *obj)
/* These values are the same with A53/A57/A72. */
define_cortex_a72_a57_a53_cp_reginfo(cpu);
}
+#endif /* disabled for RHEL */
void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp)
{
@@ -735,6 +737,7 @@ static void aarch64_a57_initfn(Object *obj)
define_cortex_a72_a57_a53_cp_reginfo(cpu); define_cortex_a72_a57_a53_cp_reginfo(cpu);
} }
@ -454,30 +478,22 @@ index 78e27f778a..1a16c9dccc 100644
static void aarch64_a53_initfn(Object *obj) static void aarch64_a53_initfn(Object *obj)
{ {
ARMCPU *cpu = ARM_CPU(obj); ARMCPU *cpu = ARM_CPU(obj);
@@ -343,6 +344,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj) @@ -1033,6 +1036,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj)
/* From D5.1 AArch64 PMU register summary */ /* From D5.1 AArch64 PMU register summary */
cpu->isar.reset_pmcr_el0 = 0x410c3000; cpu->isar.reset_pmcr_el0 = 0x410c3000;
} }
+#endif /* disabled for RHEL */ +#endif /* disabled for RHEL */
void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) static void aarch64_host_initfn(Object *obj)
{ {
@@ -1108,6 +1110,7 @@ static void aarch64_max_initfn(Object *obj) @@ -1240,13 +1244,18 @@ static void aarch64_max_initfn(Object *obj)
qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property);
} }
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void aarch64_a64fx_initfn(Object *obj)
{
ARMCPU *cpu = ARM_CPU(obj);
@@ -1156,14 +1159,18 @@ static void aarch64_a64fx_initfn(Object *obj)
/* TODO: Add A64FX specific HPC extension registers */
}
+#endif /* disabled for RHEL */
static const ARMCPUInfo aarch64_cpus[] = { static const ARMCPUInfo aarch64_cpus[] = {
+#if 0 /* Disabled for Red Hat Enterprise Linux */
{ .name = "cortex-a35", .initfn = aarch64_a35_initfn },
- { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, - { .name = "cortex-a57", .initfn = aarch64_a57_initfn },
+#endif /* disabled for RHEL */
+ { .name = "cortex-a57", .initfn = aarch64_a57_initfn, + { .name = "cortex-a57", .initfn = aarch64_a57_initfn,
+ .deprecation_note = RHEL_CPU_DEPRECATION }, + .deprecation_note = RHEL_CPU_DEPRECATION },
+#if 0 /* Disabled for Red Hat Enterprise Linux */ +#if 0 /* Disabled for Red Hat Enterprise Linux */
@ -490,7 +506,7 @@ index 78e27f778a..1a16c9dccc 100644
{ .name = "max", .initfn = aarch64_max_initfn }, { .name = "max", .initfn = aarch64_max_initfn },
#if defined(CONFIG_KVM) || defined(CONFIG_HVF) #if defined(CONFIG_KVM) || defined(CONFIG_HVF)
{ .name = "host", .initfn = aarch64_host_initfn }, { .name = "host", .initfn = aarch64_host_initfn },
@@ -1235,8 +1242,13 @@ static void aarch64_cpu_instance_init(Object *obj) @@ -1318,8 +1327,13 @@ static void aarch64_cpu_instance_init(Object *obj)
static void cpu_register_class_init(ObjectClass *oc, void *data) static void cpu_register_class_init(ObjectClass *oc, void *data)
{ {
ARMCPUClass *acc = ARM_CPU_CLASS(oc); ARMCPUClass *acc = ARM_CPU_CLASS(oc);
@ -505,10 +521,10 @@ index 78e27f778a..1a16c9dccc 100644
void aarch64_cpu_register(const ARMCPUInfo *info) void aarch64_cpu_register(const ARMCPUInfo *info)
diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c
index 10d91c4ef0..33cbc2cfe8 100644 index a528ff9a3d..053f70e399 100644
--- a/target/arm/cpu_tcg.c --- a/target/arm/cpu_tcg.c
+++ b/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c
@@ -144,10 +144,10 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu) @@ -148,10 +148,10 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu)
} }
#endif /* !CONFIG_USER_ONLY */ #endif /* !CONFIG_USER_ONLY */
@ -520,7 +536,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{ {
@@ -501,7 +501,6 @@ static void cortex_a9_initfn(Object *obj) @@ -505,7 +505,6 @@ static void cortex_a9_initfn(Object *obj)
cpu->isar.reset_pmcr_el0 = 0x41093000; cpu->isar.reset_pmcr_el0 = 0x41093000;
define_arm_cp_regs(cpu, cortexa9_cp_reginfo); define_arm_cp_regs(cpu, cortexa9_cp_reginfo);
} }
@ -528,7 +544,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
#ifndef CONFIG_USER_ONLY #ifndef CONFIG_USER_ONLY
static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri) static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
@@ -526,7 +525,6 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = { @@ -530,7 +529,6 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = {
.access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 }, .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
}; };
@ -536,7 +552,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
static void cortex_a7_initfn(Object *obj) static void cortex_a7_initfn(Object *obj)
{ {
ARMCPU *cpu = ARM_CPU(obj); ARMCPU *cpu = ARM_CPU(obj);
@@ -575,7 +573,6 @@ static void cortex_a7_initfn(Object *obj) @@ -579,7 +577,6 @@ static void cortex_a7_initfn(Object *obj)
cpu->isar.reset_pmcr_el0 = 0x41072000; cpu->isar.reset_pmcr_el0 = 0x41072000;
define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */ define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */
} }
@ -544,7 +560,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
static void cortex_a15_initfn(Object *obj) static void cortex_a15_initfn(Object *obj)
{ {
@@ -622,7 +619,6 @@ static void cortex_a15_initfn(Object *obj) @@ -628,7 +625,6 @@ static void cortex_a15_initfn(Object *obj)
define_arm_cp_regs(cpu, cortexa15_cp_reginfo); define_arm_cp_regs(cpu, cortexa15_cp_reginfo);
} }
@ -552,7 +568,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
static void cortex_m0_initfn(Object *obj) static void cortex_m0_initfn(Object *obj)
{ {
ARMCPU *cpu = ARM_CPU(obj); ARMCPU *cpu = ARM_CPU(obj);
@@ -1063,7 +1059,6 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) @@ -1070,7 +1066,6 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data)
cc->gdb_core_xml_file = "arm-m-profile.xml"; cc->gdb_core_xml_file = "arm-m-profile.xml";
} }
@ -560,7 +576,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
#ifndef TARGET_AARCH64 #ifndef TARGET_AARCH64
/* /*
@@ -1131,7 +1126,6 @@ static void arm_max_initfn(Object *obj) @@ -1138,7 +1133,6 @@ static void arm_max_initfn(Object *obj)
#endif /* !TARGET_AARCH64 */ #endif /* !TARGET_AARCH64 */
static const ARMCPUInfo arm_tcg_cpus[] = { static const ARMCPUInfo arm_tcg_cpus[] = {
@ -568,7 +584,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
{ .name = "arm926", .initfn = arm926_initfn }, { .name = "arm926", .initfn = arm926_initfn },
{ .name = "arm946", .initfn = arm946_initfn }, { .name = "arm946", .initfn = arm946_initfn },
{ .name = "arm1026", .initfn = arm1026_initfn }, { .name = "arm1026", .initfn = arm1026_initfn },
@@ -1147,9 +1141,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = { @@ -1154,9 +1148,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
{ .name = "cortex-a7", .initfn = cortex_a7_initfn }, { .name = "cortex-a7", .initfn = cortex_a7_initfn },
{ .name = "cortex-a8", .initfn = cortex_a8_initfn }, { .name = "cortex-a8", .initfn = cortex_a8_initfn },
{ .name = "cortex-a9", .initfn = cortex_a9_initfn }, { .name = "cortex-a9", .initfn = cortex_a9_initfn },
@ -578,7 +594,7 @@ index 10d91c4ef0..33cbc2cfe8 100644
{ .name = "cortex-m0", .initfn = cortex_m0_initfn, { .name = "cortex-m0", .initfn = cortex_m0_initfn,
.class_init = arm_v7m_class_init }, .class_init = arm_v7m_class_init },
{ .name = "cortex-m3", .initfn = cortex_m3_initfn, { .name = "cortex-m3", .initfn = cortex_m3_initfn,
@@ -1180,7 +1172,6 @@ static const ARMCPUInfo arm_tcg_cpus[] = { @@ -1187,7 +1179,6 @@ static const ARMCPUInfo arm_tcg_cpus[] = {
{ .name = "pxa270-b1", .initfn = pxa270b1_initfn }, { .name = "pxa270-b1", .initfn = pxa270b1_initfn },
{ .name = "pxa270-c0", .initfn = pxa270c0_initfn }, { .name = "pxa270-c0", .initfn = pxa270c0_initfn },
{ .name = "pxa270-c5", .initfn = pxa270c5_initfn }, { .name = "pxa270-c5", .initfn = pxa270c5_initfn },
@ -586,16 +602,16 @@ index 10d91c4ef0..33cbc2cfe8 100644
#ifndef TARGET_AARCH64 #ifndef TARGET_AARCH64
{ .name = "max", .initfn = arm_max_initfn }, { .name = "max", .initfn = arm_max_initfn },
#endif #endif
@@ -1208,3 +1199,4 @@ static void arm_tcg_cpu_register_types(void) @@ -1215,3 +1206,4 @@ static void arm_tcg_cpu_register_types(void)
type_init(arm_tcg_cpu_register_types) type_init(arm_tcg_cpu_register_types)
#endif /* !CONFIG_USER_ONLY || !TARGET_AARCH64 */ #endif /* !CONFIG_USER_ONLY || !TARGET_AARCH64 */
+#endif /* disabled for RHEL */ +#endif /* disabled for RHEL */
diff --git a/target/arm/helper.c b/target/arm/helper.c diff --git a/target/arm/helper.c b/target/arm/helper.c
index d7bc467a2a..a91494b7d3 100644 index d8c8223ec3..ad9d235773 100644
--- a/target/arm/helper.c --- a/target/arm/helper.c
+++ b/target/arm/helper.c +++ b/target/arm/helper.c
@@ -8213,6 +8213,7 @@ void arm_cpu_list(void) @@ -8476,6 +8476,7 @@ void arm_cpu_list(void)
static void arm_cpu_add_definition(gpointer data, gpointer user_data) static void arm_cpu_add_definition(gpointer data, gpointer user_data)
{ {
ObjectClass *oc = data; ObjectClass *oc = data;
@ -603,7 +619,7 @@ index d7bc467a2a..a91494b7d3 100644
CpuDefinitionInfoList **cpu_list = user_data; CpuDefinitionInfoList **cpu_list = user_data;
CpuDefinitionInfo *info; CpuDefinitionInfo *info;
const char *typename; const char *typename;
@@ -8222,6 +8223,7 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data) @@ -8485,6 +8486,7 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data)
info->name = g_strndup(typename, info->name = g_strndup(typename,
strlen(typename) - strlen("-" TYPE_ARM_CPU)); strlen(typename) - strlen("-" TYPE_ARM_CPU));
info->q_typename = g_strdup(typename); info->q_typename = g_strdup(typename);

View File

@ -1,4 +1,4 @@
From 77a23381d2a445ee499c4335816f3df08d545aed Mon Sep 17 00:00:00 2001 From 2c523f1b6c9470e1cd517ba99e414cde02727e16 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:27:13 +0200 Date: Fri, 19 Oct 2018 13:27:13 +0200
Subject: Add ppc64 machine types Subject: Add ppc64 machine types
@ -34,10 +34,10 @@ Merged patches (7.1.0 rc0):
8 files changed, 314 insertions(+), 1 deletion(-) 8 files changed, 314 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bc9ba6e6dc..5d0989f87a 100644 index 66b414d2e9..499eb49253 100644
--- a/hw/ppc/spapr.c --- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c
@@ -1633,6 +1633,9 @@ static void spapr_machine_reset(MachineState *machine) @@ -1633,6 +1633,9 @@ static void spapr_machine_reset(MachineState *machine, ShutdownCause reason)
pef_kvm_reset(machine->cgs, &error_fatal); pef_kvm_reset(machine->cgs, &error_fatal);
spapr_caps_apply(spapr); spapr_caps_apply(spapr);
@ -47,7 +47,7 @@ index bc9ba6e6dc..5d0989f87a 100644
first_ppc_cpu = POWERPC_CPU(first_cpu); first_ppc_cpu = POWERPC_CPU(first_cpu);
if (kvm_enabled() && kvmppc_has_cap_mmu_radix() && if (kvm_enabled() && kvmppc_has_cap_mmu_radix() &&
@@ -3344,6 +3347,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp) @@ -3347,6 +3350,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp)
spapr->host_serial = g_strdup(value); spapr->host_serial = g_strdup(value);
} }
@ -68,7 +68,7 @@ index bc9ba6e6dc..5d0989f87a 100644
static void spapr_instance_init(Object *obj) static void spapr_instance_init(Object *obj)
{ {
SpaprMachineState *spapr = SPAPR_MACHINE(obj); SpaprMachineState *spapr = SPAPR_MACHINE(obj);
@@ -3422,6 +3439,12 @@ static void spapr_instance_init(Object *obj) @@ -3425,6 +3442,12 @@ static void spapr_instance_init(Object *obj)
spapr_get_host_serial, spapr_set_host_serial); spapr_get_host_serial, spapr_set_host_serial);
object_property_set_description(obj, "host-serial", object_property_set_description(obj, "host-serial",
"Host serial number to advertise in guest device tree"); "Host serial number to advertise in guest device tree");
@ -81,7 +81,7 @@ index bc9ba6e6dc..5d0989f87a 100644
} }
static void spapr_machine_finalizefn(Object *obj) static void spapr_machine_finalizefn(Object *obj)
@@ -4679,6 +4702,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) @@ -4682,6 +4705,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
vmc->client_architecture_support = spapr_vof_client_architecture_support; vmc->client_architecture_support = spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce; vmc->quiesce = spapr_vof_quiesce;
vmc->setprop = spapr_vof_setprop; vmc->setprop = spapr_vof_setprop;
@ -89,15 +89,15 @@ index bc9ba6e6dc..5d0989f87a 100644
} }
static const TypeInfo spapr_machine_info = { static const TypeInfo spapr_machine_info = {
@@ -4730,6 +4754,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc) @@ -4733,6 +4757,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
} \ } \
type_init(spapr_machine_register_##suffix) type_init(spapr_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */ +#if 0 /* Disabled for Red Hat Enterprise Linux */
/* /*
* pseries-7.1 * pseries-7.2
*/ */
@@ -4868,6 +4893,7 @@ static void spapr_machine_4_1_class_options(MachineClass *mc) @@ -4882,6 +4907,7 @@ static void spapr_machine_4_1_class_options(MachineClass *mc)
} }
DEFINE_SPAPR_MACHINE(4_1, "4.1", false); DEFINE_SPAPR_MACHINE(4_1, "4.1", false);
@ -105,7 +105,7 @@ index bc9ba6e6dc..5d0989f87a 100644
/* /*
* pseries-4.0 * pseries-4.0
@@ -4887,6 +4913,8 @@ static bool phb_placement_4_0(SpaprMachineState *spapr, uint32_t index, @@ -4901,6 +4927,8 @@ static bool phb_placement_4_0(SpaprMachineState *spapr, uint32_t index,
*nv2atsd = 0; *nv2atsd = 0;
return true; return true;
} }
@ -114,7 +114,7 @@ index bc9ba6e6dc..5d0989f87a 100644
static void spapr_machine_4_0_class_options(MachineClass *mc) static void spapr_machine_4_0_class_options(MachineClass *mc)
{ {
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
@@ -5214,6 +5242,221 @@ static void spapr_machine_2_1_class_options(MachineClass *mc) @@ -5228,6 +5256,221 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len); compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len);
} }
DEFINE_SPAPR_MACHINE(2_1, "2.1", false); DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
@ -375,7 +375,7 @@ index fcb5dfe792..ab8fb5bf62 100644
qdev_unrealize(DEVICE(cpu)); qdev_unrealize(DEVICE(cpu));
return false; return false;
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 530d739b1d..6f96972392 100644 index 04a95669ab..d5f4cf5e03 100644
--- a/include/hw/ppc/spapr.h --- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h
@@ -154,6 +154,7 @@ struct SpaprMachineClass { @@ -154,6 +154,7 @@ struct SpaprMachineClass {
@ -434,10 +434,10 @@ index cd3ff700ac..1cb49c8087 100644
{ "405cr", "405crc" }, { "405cr", "405crc" },
{ "405gp", "405gpd" }, { "405gp", "405gpd" },
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index a4c893cfad..c6575493b7 100644 index 81d4263a07..508fbed90b 100644
--- a/target/ppc/cpu.h --- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h +++ b/target/ppc/cpu.h
@@ -1464,6 +1464,7 @@ static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch) @@ -1467,6 +1467,7 @@ static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch)
/* Compatibility modes */ /* Compatibility modes */
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
@ -446,7 +446,7 @@ index a4c893cfad..c6575493b7 100644
uint32_t min_compat_pvr, uint32_t max_compat_pvr); uint32_t min_compat_pvr, uint32_t max_compat_pvr);
bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr, bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr,
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 466d0d2f4c..22c100e227 100644 index 7c25348b7b..83671c955f 100644
--- a/target/ppc/kvm.c --- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c +++ b/target/ppc/kvm.c
@@ -89,6 +89,7 @@ static int cap_ppc_nested_kvm_hv; @@ -89,6 +89,7 @@ static int cap_ppc_nested_kvm_hv;
@ -482,9 +482,9 @@ index 466d0d2f4c..22c100e227 100644
PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void) PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void)
{ {
uint32_t host_pvr = mfpvr(); uint32_t host_pvr = mfpvr();
@@ -2966,3 +2978,18 @@ bool kvm_arch_cpu_check_are_resettable(void) @@ -2970,3 +2982,18 @@ bool kvm_arch_cpu_check_are_resettable(void)
void kvm_arch_accel_class_init(ObjectClass *oc)
{ {
return true;
} }
+ +
+void kvmppc_svm_allow(Error **errp) +void kvmppc_svm_allow(Error **errp)

View File

@ -1,4 +1,4 @@
From 6a14fc5e35a8cec7f049c203d6dc2390fac175f1 Mon Sep 17 00:00:00 2001 From 1973257ed781a93943f27f1518933e8c09c50f88 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:47:32 +0200 Date: Fri, 19 Oct 2018 13:47:32 +0200
Subject: Add s390x machine types Subject: Add s390x machine types
@ -27,26 +27,29 @@ Merged patches (7.1.0 rc0):
- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/s390x/s390-virtio-ccw.c chunk) - 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/s390x/s390-virtio-ccw.c chunk)
- c8ad21ca31 redhat: Update s390x machine type compatibility for rebase to QEMU 7.0.0 - c8ad21ca31 redhat: Update s390x machine type compatibility for rebase to QEMU 7.0.0
- 5bcf8d874c target/s390x: deprecate CPUs older than z14 - 5bcf8d874c target/s390x: deprecate CPUs older than z14
Merged patches (7.2.0 rc0):
- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts)
--- ---
hw/s390x/s390-virtio-ccw.c | 107 +++++++++++++++++++++++++++++++ hw/s390x/s390-virtio-ccw.c | 108 +++++++++++++++++++++++++++++++
target/s390x/cpu_models.c | 11 ++++ target/s390x/cpu_models.c | 11 ++++
target/s390x/cpu_models.h | 2 + target/s390x/cpu_models.h | 2 +
target/s390x/cpu_models_sysemu.c | 2 + target/s390x/cpu_models_sysemu.c | 2 +
4 files changed, 122 insertions(+) 4 files changed, 123 insertions(+)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index cc3097bfee..4c68d72000 100644 index 2e64ffab45..8d5221fbb1 100644
--- a/hw/s390x/s390-virtio-ccw.c --- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c
@@ -792,6 +792,7 @@ bool css_migration_enabled(void) @@ -823,6 +823,7 @@ bool css_migration_enabled(void)
} \ } \
type_init(ccw_machine_register_##suffix) type_init(ccw_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */ +#if 0 /* Disabled for Red Hat Enterprise Linux */
static void ccw_machine_7_1_instance_options(MachineState *machine) static void ccw_machine_7_2_instance_options(MachineState *machine)
{ {
} }
@@ -1131,6 +1132,112 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) @@ -1186,6 +1187,113 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
} }
DEFINE_CCW_MACHINE(2_4, "2.4", false); DEFINE_CCW_MACHINE(2_4, "2.4", false);
@ -62,6 +65,7 @@ index cc3097bfee..4c68d72000 100644
+ +
+static void ccw_machine_rhel900_class_options(MachineClass *mc) +static void ccw_machine_rhel900_class_options(MachineClass *mc)
+{ +{
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len);
+} +}
+DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", true); +DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", true);
@ -205,7 +209,7 @@ index c3a4f80633..739770dc15 100644
static void s390_qemu_cpu_model_class_init(ObjectClass *oc, void *data) static void s390_qemu_cpu_model_class_init(ObjectClass *oc, void *data)
diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h
index 74d1f87e4f..372160bcd7 100644 index fb1adc8b21..d76745afa9 100644
--- a/target/s390x/cpu_models.h --- a/target/s390x/cpu_models.h
+++ b/target/s390x/cpu_models.h +++ b/target/s390x/cpu_models.h
@@ -38,6 +38,8 @@ struct S390CPUDef { @@ -38,6 +38,8 @@ struct S390CPUDef {

View File

@ -1,4 +1,4 @@
From 68c1bbec1fae27b527f85f2666c54fff3d499eaf Mon Sep 17 00:00:00 2001 From 0935624ccdddc286d6eeeb0c1b70d78983c21aa2 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:10:31 +0200 Date: Fri, 19 Oct 2018 13:10:31 +0200
Subject: Add x86_64 machine types Subject: Add x86_64 machine types
@ -36,10 +36,13 @@ Merged patches (7.1.0 rc0):
- 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/i386/pc.c chunk) - 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/i386/pc.c chunk)
- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (x86_64 specific changes) - 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (x86_64 specific changes)
- 35b5c8554f target/i386: deprecate CPUs older than x86_64-v2 ABI - 35b5c8554f target/i386: deprecate CPUs older than x86_64-v2 ABI
Merged patches (7.2.0 rc0):
- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts)
--- ---
hw/i386/pc.c | 147 ++++++++++++++++++++++- hw/i386/pc.c | 147 ++++++++++++++++++++++-
hw/i386/pc_piix.c | 83 ++++++++++++- hw/i386/pc_piix.c | 86 +++++++++++++-
hw/i386/pc_q35.c | 231 ++++++++++++++++++++++++++++++++++++- hw/i386/pc_q35.c | 234 ++++++++++++++++++++++++++++++++++++-
hw/s390x/s390-virtio-ccw.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 +
include/hw/boards.h | 2 + include/hw/boards.h | 2 +
include/hw/i386/pc.h | 27 +++++ include/hw/i386/pc.h | 27 +++++
@ -47,13 +50,13 @@ Merged patches (7.1.0 rc0):
target/i386/kvm/kvm-cpu.c | 1 + target/i386/kvm/kvm-cpu.c | 1 +
target/i386/kvm/kvm.c | 4 + target/i386/kvm/kvm.c | 4 +
tests/qtest/pvpanic-test.c | 5 +- tests/qtest/pvpanic-test.c | 5 +-
10 files changed, 515 insertions(+), 7 deletions(-) 10 files changed, 521 insertions(+), 7 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 7280c02ce3..09b62db9e9 100644 index 546b703cb4..c7b1350e64 100644
--- a/hw/i386/pc.c --- a/hw/i386/pc.c
+++ b/hw/i386/pc.c +++ b/hw/i386/pc.c
@@ -390,6 +390,149 @@ GlobalProperty pc_compat_1_4[] = { @@ -393,6 +393,149 @@ GlobalProperty pc_compat_1_4[] = {
}; };
const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4); const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
@ -203,7 +206,7 @@ index 7280c02ce3..09b62db9e9 100644
GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
{ {
GSIState *s; GSIState *s;
@@ -1910,6 +2053,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) @@ -1907,6 +2050,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->pvh_enabled = true; pcmc->pvh_enabled = true;
pcmc->kvmclock_create_always = true; pcmc->kvmclock_create_always = true;
assert(!mc->get_hotplug_handler); assert(!mc->get_hotplug_handler);
@ -211,7 +214,7 @@ index 7280c02ce3..09b62db9e9 100644
mc->get_hotplug_handler = pc_get_hotplug_handler; mc->get_hotplug_handler = pc_get_hotplug_handler;
mc->hotplug_allowed = pc_hotplug_allowed; mc->hotplug_allowed = pc_hotplug_allowed;
mc->cpu_index_to_instance_props = x86_cpu_index_to_props; mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
@@ -1920,7 +2064,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) @@ -1917,7 +2061,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->has_hotpluggable_cpus = true; mc->has_hotpluggable_cpus = true;
mc->default_boot_order = "cad"; mc->default_boot_order = "cad";
mc->block_default_type = IF_IDE; mc->block_default_type = IF_IDE;
@ -222,10 +225,10 @@ index 7280c02ce3..09b62db9e9 100644
mc->wakeup = pc_machine_wakeup; mc->wakeup = pc_machine_wakeup;
hc->pre_plug = pc_machine_device_pre_plug_cb; hc->pre_plug = pc_machine_device_pre_plug_cb;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1ec5d6a4f8..52111697cb 100644 index 0985ff67d2..173a1fd10b 100644
--- a/hw/i386/pc_piix.c --- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c
@@ -51,6 +51,7 @@ @@ -53,6 +53,7 @@
#include "qapi/error.h" #include "qapi/error.h"
#include "qemu/error-report.h" #include "qemu/error-report.h"
#include "sysemu/xen.h" #include "sysemu/xen.h"
@ -233,7 +236,7 @@ index 1ec5d6a4f8..52111697cb 100644
#ifdef CONFIG_XEN #ifdef CONFIG_XEN
#include <xen/hvm/hvm_info_table.h> #include <xen/hvm/hvm_info_table.h>
#include "hw/xen/xen_pt.h" #include "hw/xen/xen_pt.h"
@@ -182,8 +183,8 @@ static void pc_init1(MachineState *machine, @@ -184,8 +185,8 @@ static void pc_init1(MachineState *machine,
if (pcmc->smbios_defaults) { if (pcmc->smbios_defaults) {
MachineClass *mc = MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_GET_CLASS(machine);
/* These values are guest ABI, do not change */ /* These values are guest ABI, do not change */
@ -244,7 +247,7 @@ index 1ec5d6a4f8..52111697cb 100644
pcmc->smbios_uuid_encoded, pcmc->smbios_uuid_encoded,
pcmc->smbios_stream_product, pcmc->smbios_stream_product,
pcmc->smbios_stream_version, pcmc->smbios_stream_version,
@@ -331,6 +332,7 @@ static void pc_init1(MachineState *machine, @@ -334,6 +335,7 @@ static void pc_init1(MachineState *machine,
* hw_compat_*, pc_compat_*, or * pc_*_machine_options(). * hw_compat_*, pc_compat_*, or * pc_*_machine_options().
*/ */
@ -252,7 +255,7 @@ index 1ec5d6a4f8..52111697cb 100644
static void pc_compat_2_3_fn(MachineState *machine) static void pc_compat_2_3_fn(MachineState *machine)
{ {
X86MachineState *x86ms = X86_MACHINE(machine); X86MachineState *x86ms = X86_MACHINE(machine);
@@ -880,3 +882,80 @@ static void xenfv_3_1_machine_options(MachineClass *m) @@ -896,3 +898,83 @@ static void xenfv_3_1_machine_options(MachineClass *m)
DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init, DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
xenfv_3_1_machine_options); xenfv_3_1_machine_options);
#endif #endif
@ -301,6 +304,9 @@ index 1ec5d6a4f8..52111697cb 100644
+ pcmc->kvmclock_create_always = false; + pcmc->kvmclock_create_always = false;
+ /* From pc_i440fx_5_1_machine_options() */ + /* From pc_i440fx_5_1_machine_options() */
+ pcmc->pci_root_uid = 1; + pcmc->pci_root_uid = 1;
+ pcmc->legacy_no_rng_seed = true;
+ compat_props_add(m->compat_props, hw_compat_rhel_9_1,
+ hw_compat_rhel_9_1_len);
+ compat_props_add(m->compat_props, hw_compat_rhel_9_0, + compat_props_add(m->compat_props, hw_compat_rhel_9_0,
+ hw_compat_rhel_9_0_len); + hw_compat_rhel_9_0_len);
+ compat_props_add(m->compat_props, pc_rhel_9_0_compat, + compat_props_add(m->compat_props, pc_rhel_9_0_compat,
@ -334,7 +340,7 @@ index 1ec5d6a4f8..52111697cb 100644
+DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760, +DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760,
+ pc_machine_rhel760_options); + pc_machine_rhel760_options);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index ef471f6664..4e7f1a707c 100644 index ea582254e3..97c3630021 100644
--- a/hw/i386/pc_q35.c --- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c
@@ -198,8 +198,8 @@ static void pc_q35_init(MachineState *machine) @@ -198,8 +198,8 @@ static void pc_q35_init(MachineState *machine)
@ -356,7 +362,7 @@ index ef471f6664..4e7f1a707c 100644
static void pc_q35_machine_options(MachineClass *m) static void pc_q35_machine_options(MachineClass *m)
{ {
PCMachineClass *pcmc = PC_MACHINE_CLASS(m); PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
@@ -654,3 +655,229 @@ static void pc_q35_2_4_machine_options(MachineClass *m) @@ -666,3 +667,232 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
pc_q35_2_4_machine_options); pc_q35_2_4_machine_options);
@ -397,6 +403,9 @@ index ef471f6664..4e7f1a707c 100644
+ m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)"; + m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)";
+ pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_product = "RHEL";
+ pcmc->smbios_stream_version = "9.0.0"; + pcmc->smbios_stream_version = "9.0.0";
+ pcmc->legacy_no_rng_seed = true;
+ compat_props_add(m->compat_props, hw_compat_rhel_9_1,
+ hw_compat_rhel_9_1_len);
+ compat_props_add(m->compat_props, hw_compat_rhel_9_0, + compat_props_add(m->compat_props, hw_compat_rhel_9_0,
+ hw_compat_rhel_9_0_len); + hw_compat_rhel_9_0_len);
+ compat_props_add(m->compat_props, pc_rhel_9_0_compat, + compat_props_add(m->compat_props, pc_rhel_9_0_compat,
@ -587,10 +596,10 @@ index ef471f6664..4e7f1a707c 100644
+DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760, +DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760,
+ pc_q35_machine_rhel760_options); + pc_q35_machine_rhel760_options);
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 4c68d72000..e1e6b6b5a7 100644 index 8d5221fbb1..ba640e3d9e 100644
--- a/hw/s390x/s390-virtio-ccw.c --- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c
@@ -1157,6 +1157,7 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine) @@ -1213,6 +1213,7 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
static void ccw_machine_rhel860_class_options(MachineClass *mc) static void ccw_machine_rhel860_class_options(MachineClass *mc)
{ {
ccw_machine_rhel900_class_options(mc); ccw_machine_rhel900_class_options(mc);
@ -599,7 +608,7 @@ index 4c68d72000..e1e6b6b5a7 100644
/* All RHEL machines for prior major releases are deprecated */ /* All RHEL machines for prior major releases are deprecated */
mc->deprecation_reason = rhel_old_machine_deprecation; mc->deprecation_reason = rhel_old_machine_deprecation;
diff --git a/include/hw/boards.h b/include/hw/boards.h diff --git a/include/hw/boards.h b/include/hw/boards.h
index bfd757c561..0d22c19f4a 100644 index 2209d4e416..fd75f551b1 100644
--- a/include/hw/boards.h --- a/include/hw/boards.h
+++ b/include/hw/boards.h +++ b/include/hw/boards.h
@@ -266,6 +266,8 @@ struct MachineClass { @@ -266,6 +266,8 @@ struct MachineClass {
@ -612,10 +621,10 @@ index bfd757c561..0d22c19f4a 100644
bool smbus_no_migration_support; bool smbus_no_migration_support;
bool nvdimm_supported; bool nvdimm_supported;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 4d9e95a091..f96bf85df1 100644 index 3754eaa97d..4266fe2fdb 100644
--- a/include/hw/i386/pc.h --- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h
@@ -290,6 +290,33 @@ extern const size_t pc_compat_1_5_len; @@ -293,6 +293,33 @@ extern const size_t pc_compat_1_5_len;
extern GlobalProperty pc_compat_1_4[]; extern GlobalProperty pc_compat_1_4[];
extern const size_t pc_compat_1_4_len; extern const size_t pc_compat_1_4_len;
@ -650,7 +659,7 @@ index 4d9e95a091..f96bf85df1 100644
static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
{ \ { \
diff --git a/target/i386/cpu.c b/target/i386/cpu.c diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1db1278a59..db97eeb8b0 100644 index 22b681ca37..f7c526cbe6 100644
--- a/target/i386/cpu.c --- a/target/i386/cpu.c
+++ b/target/i386/cpu.c +++ b/target/i386/cpu.c
@@ -1832,9 +1832,13 @@ static const CPUCaches epyc_milan_cache_info = { @@ -1832,9 +1832,13 @@ static const CPUCaches epyc_milan_cache_info = {
@ -816,10 +825,10 @@ index 7237378a7d..7b8a3d5af0 100644
}; };
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index f148a6d52f..4e5d4bafc4 100644 index a213209379..81526a1575 100644
--- a/target/i386/kvm/kvm.c --- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c
@@ -3626,6 +3626,7 @@ static int kvm_get_msrs(X86CPU *cpu) @@ -3707,6 +3707,7 @@ static int kvm_get_msrs(X86CPU *cpu)
struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries; struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries;
int ret, i; int ret, i;
uint64_t mtrr_top_bits; uint64_t mtrr_top_bits;
@ -827,7 +836,7 @@ index f148a6d52f..4e5d4bafc4 100644
kvm_msr_buf_reset(cpu); kvm_msr_buf_reset(cpu);
@@ -3981,6 +3982,9 @@ static int kvm_get_msrs(X86CPU *cpu) @@ -4062,6 +4063,9 @@ static int kvm_get_msrs(X86CPU *cpu)
break; break;
case MSR_KVM_ASYNC_PF_EN: case MSR_KVM_ASYNC_PF_EN:
env->async_pf_en_msr = msrs[i].data; env->async_pf_en_msr = msrs[i].data;

View File

@ -1,4 +1,4 @@
From 0833b7e925c98253c90c9de18758517f2778f77d Mon Sep 17 00:00:00 2001 From badfb1290c8eea8a2e1769b2392c7899d5077698 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 2 Sep 2020 09:39:41 +0200 Date: Wed, 2 Sep 2020 09:39:41 +0200
Subject: Enable make check Subject: Enable make check
@ -48,7 +48,7 @@ Merged patches (7.1.0 rc0):
12 files changed, 18 insertions(+), 19 deletions(-) 12 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py
index 0b2b0dc692..3a7b5f0748 100644 index 00a26e4a0c..fe5ecf238a 100644
--- a/tests/avocado/replay_kernel.py --- a/tests/avocado/replay_kernel.py
+++ b/tests/avocado/replay_kernel.py +++ b/tests/avocado/replay_kernel.py
@@ -147,7 +147,7 @@ def test_aarch64_virt(self): @@ -147,7 +147,7 @@ def test_aarch64_virt(self):
@ -118,20 +118,20 @@ index 5052883fb6..b5286f4b12 100644
qtest_outl(s, 0xcf8, 0x80001010); qtest_outl(s, 0xcf8, 0x80001010);
qtest_outl(s, 0xcfc, 0xe1020000); qtest_outl(s, 0xcfc, 0xe1020000);
diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-scsi-test.c diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-scsi-test.c
index 71c91b0356..dae4139c17 100644 index e37b48b2cc..88647da054 100644
--- a/tests/qtest/fuzz-virtio-scsi-test.c --- a/tests/qtest/fuzz-virtio-scsi-test.c
+++ b/tests/qtest/fuzz-virtio-scsi-test.c +++ b/tests/qtest/fuzz-virtio-scsi-test.c
@@ -19,7 +19,7 @@ static void test_mmio_oob_from_memory_region_cache(void) @@ -19,7 +19,7 @@ static void test_mmio_oob_from_memory_region_cache(void)
{ {
QTestState *s; QTestState *s;
- s = qtest_init("-M pc-q35-5.2 -display none -m 512M " - s = qtest_init("-M pc-q35-5.2 -m 512M "
+ s = qtest_init("-M pc-q35-rhel8.4.0 -display none -m 512M " + s = qtest_init("-M pc-q35-rhel8.4.0 -m 512M "
"-device virtio-scsi,num_queues=8,addr=03.0 "); "-device virtio-scsi,num_queues=8,addr=03.0 ");
qtest_outl(s, 0xcf8, 0x80001811); qtest_outl(s, 0xcf8, 0x80001811);
diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c
index a58c98e4d1..c8387e39ce 100644 index d4a8db6fd6..1a796ec15a 100644
--- a/tests/qtest/intel-hda-test.c --- a/tests/qtest/intel-hda-test.c
+++ b/tests/qtest/intel-hda-test.c +++ b/tests/qtest/intel-hda-test.c
@@ -38,7 +38,7 @@ static void test_issue542_ich6(void) @@ -38,7 +38,7 @@ static void test_issue542_ich6(void)
@ -144,18 +144,18 @@ index a58c98e4d1..c8387e39ce 100644
qtest_outl(s, 0xcf8, 0x80000804); qtest_outl(s, 0xcf8, 0x80000804);
diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build
index fd5d6e5ae1..d9409560cd 100644 index 32f028872c..1e78a1a055 100644
--- a/tests/qtest/libqos/meson.build --- a/tests/qtest/libqos/meson.build
+++ b/tests/qtest/libqos/meson.build +++ b/tests/qtest/libqos/meson.build
@@ -44,7 +44,7 @@ libqos_srcs = files( @@ -43,7 +43,7 @@ libqos_srcs = files(
'virtio-rng.c', 'virtio-rng.c',
'virtio-scsi.c', 'virtio-scsi.c',
'virtio-serial.c', 'virtio-serial.c',
- 'virtio-iommu.c', - 'virtio-iommu.c',
+# 'virtio-iommu.c', +# 'virtio-iommu.c',
'virtio-gpio.c',
'generic-pcihost.c', 'generic-pcihost.c',
# qgraph machines:
diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c
index 8ac95b89f7..cd2102555c 100644 index 8ac95b89f7..cd2102555c 100644
--- a/tests/qtest/lpc-ich9-test.c --- a/tests/qtest/lpc-ich9-test.c
@ -170,10 +170,10 @@ index 8ac95b89f7..cd2102555c 100644
qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index be4b30dea2..2c3d62a9fe 100644 index c07a5b1a5f..9df3f9f8b9 100644
--- a/tests/qtest/meson.build --- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build +++ b/tests/qtest/meson.build
@@ -76,7 +76,6 @@ qtests_i386 = \ @@ -82,7 +82,6 @@ qtests_i386 = \
config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_Q35') and \
config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
slirp.found() ? ['virtio-net-failover'] : []) + \ slirp.found() ? ['virtio-net-failover'] : []) + \
@ -181,7 +181,7 @@ index be4b30dea2..2c3d62a9fe 100644
qtests_pci + \ qtests_pci + \
qtests_cxl + \ qtests_cxl + \
['fdc-test', ['fdc-test',
@@ -90,7 +89,6 @@ qtests_i386 = \ @@ -96,7 +95,6 @@ qtests_i386 = \
'drive_del-test', 'drive_del-test',
'tco-test', 'tco-test',
'cpu-plug-test', 'cpu-plug-test',
@ -189,7 +189,7 @@ index be4b30dea2..2c3d62a9fe 100644
'vmgenid-test', 'vmgenid-test',
'migration-test', 'migration-test',
'test-x86-cpuid-compat', 'test-x86-cpuid-compat',
@@ -212,15 +210,13 @@ qtests_arm = \ @@ -209,15 +207,13 @@ qtests_arm = \
# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
qtests_aarch64 = \ qtests_aarch64 = \
@ -206,7 +206,7 @@ index be4b30dea2..2c3d62a9fe 100644
qtests_s390x = \ qtests_s390x = \
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
@@ -228,7 +224,6 @@ qtests_s390x = \ @@ -225,7 +221,6 @@ qtests_s390x = \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \ (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
['boot-serial-test', ['boot-serial-test',
'drive_del-test', 'drive_del-test',
@ -245,7 +245,7 @@ index 10ef9d2a91..3855873050 100644
qtest_start("-device nec-usb-xhci,id=xhci" qtest_start("-device nec-usb-xhci,id=xhci"
diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 443ee56de9..1bccb3bab9 100644 index 4a809590bf..1bf3fa641c 100644
--- a/tests/qtest/virtio-net-failover.c --- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@

View File

@ -1,4 +1,4 @@
From 2092b90c5d7791bedbdb4ba067c90ae44d355e66 Mon Sep 17 00:00:00 2001 From 0804844e4755377be6d2ebad578794ad9f4f3f31 Mon Sep 17 00:00:00 2001
From: Bandan Das <bsd@redhat.com> From: Bandan Das <bsd@redhat.com>
Date: Tue, 3 Dec 2013 20:05:13 +0100 Date: Tue, 3 Dec 2013 20:05:13 +0100
Subject: vfio: cap number of devices that can be assigned Subject: vfio: cap number of devices that can be assigned

View File

@ -1,4 +1,4 @@
From 793720efdf835b13246f02191f6c07a60a726841 Mon Sep 17 00:00:00 2001 From 283a0e258dc2f3b83c58e6f948bafe430cd2c1d5 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com> From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 4 Dec 2013 18:53:17 +0100 Date: Wed, 4 Dec 2013 18:53:17 +0100
Subject: Add support statement to -help output Subject: Add support statement to -help output
@ -21,10 +21,10 @@ Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
1 file changed, 9 insertions(+) 1 file changed, 9 insertions(+)
diff --git a/softmmu/vl.c b/softmmu/vl.c diff --git a/softmmu/vl.c b/softmmu/vl.c
index 706bd7cff7..e08ef71108 100644 index 5115221efe..17188df528 100644
--- a/softmmu/vl.c --- a/softmmu/vl.c
+++ b/softmmu/vl.c +++ b/softmmu/vl.c
@@ -836,9 +836,17 @@ static void version(void) @@ -834,9 +834,17 @@ static void version(void)
QEMU_COPYRIGHT "\n"); QEMU_COPYRIGHT "\n");
} }
@ -42,7 +42,7 @@ index 706bd7cff7..e08ef71108 100644
printf("usage: %s [options] [disk_image]\n\n" printf("usage: %s [options] [disk_image]\n\n"
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n", "'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
g_get_prgname()); g_get_prgname());
@@ -864,6 +872,7 @@ static void help(int exitcode) @@ -862,6 +870,7 @@ static void help(int exitcode)
"\n" "\n"
QEMU_HELP_BOTTOM "\n"); QEMU_HELP_BOTTOM "\n");

View File

@ -1,4 +1,4 @@
From 62589d41546b4200fe5cff7504514bbe3aa72e45 Mon Sep 17 00:00:00 2001 From d8ded821aa698b3b03bd9089fbd6c2b33da87b9e Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com> From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 8 Jul 2020 08:35:50 +0200 Date: Wed, 8 Jul 2020 08:35:50 +0200
Subject: Use qemu-kvm in documentation instead of qemu-system-<arch> Subject: Use qemu-kvm in documentation instead of qemu-system-<arch>
@ -36,10 +36,10 @@ index 52d6454b93..d74dbdeca9 100644
.. |I2C| replace:: I\ :sup:`2`\ C .. |I2C| replace:: I\ :sup:`2`\ C
.. |I2S| replace:: I\ :sup:`2`\ S .. |I2S| replace:: I\ :sup:`2`\ S
diff --git a/qemu-options.hx b/qemu-options.hx diff --git a/qemu-options.hx b/qemu-options.hx
index 31c04f7eea..1290fab5ba 100644 index 7f99d15b23..ea02ca3a45 100644
--- a/qemu-options.hx --- a/qemu-options.hx
+++ b/qemu-options.hx +++ b/qemu-options.hx
@@ -3250,11 +3250,11 @@ SRST @@ -3300,11 +3300,11 @@ SRST
:: ::
@ -54,7 +54,7 @@ index 31c04f7eea..1290fab5ba 100644
+ -netdev type=vhost-user,id=net0,chardev=chr0 \ + -netdev type=vhost-user,id=net0,chardev=chr0 \
+ -device virtio-net-pci,netdev=net0 + -device virtio-net-pci,netdev=net0
``-netdev vhost-vdpa,vhostdev=/path/to/dev`` ``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]``
Establish a vhost-vdpa netdev. Establish a vhost-vdpa netdev.
-- --
2.31.1 2.31.1

View File

@ -1,4 +1,4 @@
From e0b9e638d4145e576409c754f525b83f630d7bb0 Mon Sep 17 00:00:00 2001 From 9c6acadb444c9300d7c18b6939ce4f96484aeacc Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com> From: David Gibson <dgibson@redhat.com>
Date: Wed, 6 Feb 2019 03:58:56 +0000 Date: Wed, 6 Feb 2019 03:58:56 +0000
Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts

View File

@ -1,4 +1,4 @@
From e87482425c6d8dafe0bd447a1e68710ea6969906 Mon Sep 17 00:00:00 2001 From 02fde2a0cbd679ebd4104fe5522572c31ec23abd Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com> From: Kevin Wolf <kwolf@redhat.com>
Date: Fri, 20 Aug 2021 18:25:12 +0200 Date: Fri, 20 Aug 2021 18:25:12 +0200
Subject: qcow2: Deprecation warning when opening v2 images rw Subject: qcow2: Deprecation warning when opening v2 images rw
@ -44,10 +44,10 @@ Rebase notes (6.1.0):
2 files changed, 7 insertions(+) 2 files changed, 7 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c diff --git a/block/qcow2.c b/block/qcow2.c
index c6c6692fb7..bccfbc0024 100644 index 4d6666d3ff..d2ba263e9d 100644
--- a/block/qcow2.c --- a/block/qcow2.c
+++ b/block/qcow2.c +++ b/block/qcow2.c
@@ -1335,6 +1335,12 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, @@ -1336,6 +1336,12 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
ret = -ENOTSUP; ret = -ENOTSUP;
goto fail; goto fail;
} }

View File

@ -0,0 +1,26 @@
From 21ed34787b9492c2cfe3d8fc12a32748bcf02307 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 9 Nov 2022 07:08:32 -0500
Subject: Addd 7.2 compat bits for RHEL 9.1 machine type
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
hw/core/machine.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 9edec1ca05..3d851d34da 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -54,6 +54,8 @@ GlobalProperty hw_compat_rhel_9_1[] = {
{ "arm-gicv3-common", "force-8-bit-prio", "on" },
/* hw_compat_rhel_9_1 from hw_compat_7_0 */
{ "nvme-ns", "eui64-default", "on"},
+ /* hw_compat_rhel_9_1 from hw_compat_7_1 */
+ { "virtio-device", "queue_reset", "false" },
};
const size_t hw_compat_rhel_9_1_len = G_N_ELEMENTS(hw_compat_rhel_9_1);
--
2.31.1

View File

@ -1,116 +0,0 @@
From 0be2889fa221ba98bd436fa4b4542e57f623d31b Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 1 Jun 2022 08:09:04 -0400
Subject: Introduce upstream 7.0 compat changes
Addding upstream compat changes to 9.1 structure
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
Rebase notes (weekly-220608):
- Added new 7.0 compat added upstream
Rebase notes (QEMU 7.1.0 RC3):
- Setting legacy_no_rng_seed to true for RHEL machine types
---
hw/arm/virt.c | 1 +
hw/core/machine.c | 11 +++++++++++
hw/i386/pc_piix.c | 3 +++
hw/i386/pc_q35.c | 3 +++
hw/s390x/s390-virtio-ccw.c | 1 +
include/hw/boards.h | 3 +++
6 files changed, 22 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9737b77eca..e80c5b7d8b 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3514,6 +3514,7 @@ static void rhel900_virt_options(MachineClass *mc)
VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
/* Disable FEAT_LPA2 since old kernels (<= v5.12) don't boot with that feature */
vmc->no_tcg_lpa2 = true;
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 909f75770b..5a3867692d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -46,6 +46,17 @@
const char *rhel_old_machine_deprecation =
"machine types for previous major releases are deprecated";
+/*
+ * Mostly the same as hw_compat_7_0
+ */
+GlobalProperty hw_compat_rhel_9_1[] = {
+ /* hw_compat_rhel_9_1 from hw_compat_7_0 */
+ { "arm-gicv3-common", "force-8-bit-prio", "on" },
+ /* hw_compat_rhel_9_1 from hw_compat_7_0 */
+ { "nvme-ns", "eui64-default", "on"},
+};
+const size_t hw_compat_rhel_9_1_len = G_N_ELEMENTS(hw_compat_rhel_9_1);
+
/*
* Mostly the same as hw_compat_6_2
*/
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 52111697cb..7f56ef4e81 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -927,6 +927,9 @@ static void pc_machine_rhel760_options(MachineClass *m)
pcmc->kvmclock_create_always = false;
/* From pc_i440fx_5_1_machine_options() */
pcmc->pci_root_uid = 1;
+ pcmc->legacy_no_rng_seed = true;
+ compat_props_add(m->compat_props, hw_compat_rhel_9_1,
+ hw_compat_rhel_9_1_len);
compat_props_add(m->compat_props, hw_compat_rhel_9_0,
hw_compat_rhel_9_0_len);
compat_props_add(m->compat_props, pc_rhel_9_0_compat,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 4e7f1a707c..f16dc3bff5 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -692,6 +692,9 @@ static void pc_q35_machine_rhel900_options(MachineClass *m)
m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)";
pcmc->smbios_stream_product = "RHEL";
pcmc->smbios_stream_version = "9.0.0";
+ pcmc->legacy_no_rng_seed = true;
+ compat_props_add(m->compat_props, hw_compat_rhel_9_1,
+ hw_compat_rhel_9_1_len);
compat_props_add(m->compat_props, hw_compat_rhel_9_0,
hw_compat_rhel_9_0_len);
compat_props_add(m->compat_props, pc_rhel_9_0_compat,
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index e1e6b6b5a7..de748a0a57 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1144,6 +1144,7 @@ static void ccw_machine_rhel900_instance_options(MachineState *machine)
static void ccw_machine_rhel900_class_options(MachineClass *mc)
{
+ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len);
}
DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", true);
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 0d22c19f4a..130f1c3424 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -453,6 +453,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_1[];
+extern const size_t hw_compat_rhel_9_1_len;
+
extern GlobalProperty hw_compat_rhel_9_0[];
extern const size_t hw_compat_rhel_9_0_len;
--
2.31.1

View File

@ -0,0 +1,47 @@
From 27c188c6a4cbd908269cf06affd24025708ecb5c Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Thu, 17 Nov 2022 16:47:16 +0100
Subject: redhat: Update s390x machine type compatibility for QEMU 7.2.0 update
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2143585
Upstream Status: n/a (rhel-only)
Add the compatibility handling for the rebase from QEMU 7.1 to 7.2,
i.e. the settings from ccw_machine_7_1_class_options() and
ccw_machine_7_1_instance_options() to the rhel9.1.0 machine type
(earlier settings have been added by previous rebases already).
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index ba640e3d9e..97e868ada0 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1195,12 +1195,21 @@ static void ccw_machine_rhel900_instance_options(MachineState *machine)
static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V6_2 };
s390_set_qemu_cpu_model(0x3906, 14, 2, qemu_cpu_feat);
+ s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE);
}
static void ccw_machine_rhel900_class_options(MachineClass *mc)
{
+ S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc);
+ static GlobalProperty compat[] = {
+ { TYPE_S390_PCI_DEVICE, "interpret", "off", },
+ { TYPE_S390_PCI_DEVICE, "forwarding-assist", "off", },
+ };
+
+ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len);
+ s390mc->max_threads = S390_MAX_CPUS;
}
DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", true);
--
2.31.1

View File

@ -0,0 +1,43 @@
From c1a21266d8bed27f1ef1f705818fde5f9350b73f Mon Sep 17 00:00:00 2001
From: Cornelia Huck <cohuck@redhat.com>
Date: Wed, 23 Nov 2022 14:15:37 +0100
Subject: redhat: aarch64: add rhel9.2.0 virt machine type
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2131982
Upstream: RHEL only
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
hw/arm/virt.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index dfcab40a73..0a94f31dd1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3518,14 +3518,21 @@ static void rhel_machine_init(void)
}
type_init(rhel_machine_init);
+static void rhel920_virt_options(MachineClass *mc)
+{
+}
+DEFINE_RHEL_MACHINE_AS_LATEST(9, 2, 0)
+
static void rhel900_virt_options(MachineClass *mc)
{
VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
+ rhel920_virt_options(mc);
+
compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
/* Disable FEAT_LPA2 since old kernels (<= v5.12) don't boot with that feature */
vmc->no_tcg_lpa2 = true;
}
-DEFINE_RHEL_MACHINE_AS_LATEST(9, 0, 0)
+DEFINE_RHEL_MACHINE(9, 0, 0)
--
2.31.1

View File

@ -0,0 +1,62 @@
From a932b8d4296066be01613ada84241b501488f99f Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Thu, 17 Nov 2022 17:03:24 +0100
Subject: redhat: Add new rhel-9.2.0 s390x machine type
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2136473
Upstream Status: n/a (rhel-only)
RHEL 9.2 will be an EUS release - we want to have a new machine
type here to make sure that we have a spot where we can wire up
fixes later.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 97e868ada0..aa142a1a4e 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1190,10 +1190,21 @@ DEFINE_CCW_MACHINE(2_4, "2.4", false);
#endif
+static void ccw_machine_rhel920_instance_options(MachineState *machine)
+{
+}
+
+static void ccw_machine_rhel920_class_options(MachineClass *mc)
+{
+}
+DEFINE_CCW_MACHINE(rhel920, "rhel9.2.0", true);
+
static void ccw_machine_rhel900_instance_options(MachineState *machine)
{
static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V6_2 };
+ ccw_machine_rhel920_instance_options(machine);
+
s390_set_qemu_cpu_model(0x3906, 14, 2, qemu_cpu_feat);
s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE);
}
@@ -1206,12 +1217,14 @@ static void ccw_machine_rhel900_class_options(MachineClass *mc)
{ TYPE_S390_PCI_DEVICE, "forwarding-assist", "off", },
};
+ ccw_machine_rhel920_class_options(mc);
+
compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len);
compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len);
s390mc->max_threads = S390_MAX_CPUS;
}
-DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", true);
+DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", false);
static void ccw_machine_rhel860_instance_options(MachineState *machine)
{
--
2.31.1

View File

@ -0,0 +1,75 @@
From f33ca8aed4744238230f1f2cc47df77aa4c9e0ac Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 17 Nov 2022 12:36:30 +0000
Subject: x86: rhel 9.2.0 machine type
Add a 9.2.0 x86 machine type, and fix up the compatibility
for 9.0.0 and older.
pc_compat_7_1 and pc_compat_7_0 are both empty upstream so there's
nothing to do there.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 21 ++++++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 173a1fd10b..fc06877344 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -944,6 +944,7 @@ static void pc_machine_rhel760_options(MachineClass *m)
/* From pc_i440fx_5_1_machine_options() */
pcmc->pci_root_uid = 1;
pcmc->legacy_no_rng_seed = true;
+ pcmc->enforce_amd_1tb_hole = false;
compat_props_add(m->compat_props, hw_compat_rhel_9_1,
hw_compat_rhel_9_1_len);
compat_props_add(m->compat_props, hw_compat_rhel_9_0,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 97c3630021..52cfe3bf45 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -692,6 +692,23 @@ static void pc_q35_machine_rhel_options(MachineClass *m)
compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len);
}
+static void pc_q35_init_rhel920(MachineState *machine)
+{
+ pc_q35_init(machine);
+}
+
+static void pc_q35_machine_rhel920_options(MachineClass *m)
+{
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
+ pc_q35_machine_rhel_options(m);
+ m->desc = "RHEL-9.2.0 PC (Q35 + ICH9, 2009)";
+ pcmc->smbios_stream_product = "RHEL";
+ pcmc->smbios_stream_version = "9.2.0";
+}
+
+DEFINE_PC_MACHINE(q35_rhel920, "pc-q35-rhel9.2.0", pc_q35_init_rhel920,
+ pc_q35_machine_rhel920_options);
+
static void pc_q35_init_rhel900(MachineState *machine)
{
pc_q35_init(machine);
@@ -700,11 +717,13 @@ static void pc_q35_init_rhel900(MachineState *machine)
static void pc_q35_machine_rhel900_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
- pc_q35_machine_rhel_options(m);
+ pc_q35_machine_rhel920_options(m);
m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)";
+ m->alias = NULL;
pcmc->smbios_stream_product = "RHEL";
pcmc->smbios_stream_version = "9.0.0";
pcmc->legacy_no_rng_seed = true;
+ pcmc->enforce_amd_1tb_hole = false;
compat_props_add(m->compat_props, hw_compat_rhel_9_1,
hw_compat_rhel_9_1_len);
compat_props_add(m->compat_props, hw_compat_rhel_9_0,
--
2.31.1

View File

@ -1,252 +0,0 @@
From 4ce18f26f30cfb8860153825c504289f43800f5e Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Mon, 19 Sep 2022 03:23:41 -0400
Subject: [PATCH 28/29] Revert "Re-enable capstone internal build"
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 119: Use capstone package for qemu-kvm build
RH-Bugzilla: 2127825
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Commit: [1/2] bd58ace2233e3071703a69ea9e7bfcd82416cda1 (mrezanin/centos-src-qemu-kvm)
This reverts commit c2c10b636a97d1cb9c4abbc4152a34ebf2f44817.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
configure | 12 ----
meson.build | 116 ++--------------------------------
meson_options.txt | 3 +-
scripts/meson-buildoptions.sh | 5 +-
4 files changed, 7 insertions(+), 129 deletions(-)
diff --git a/configure b/configure
index 448b0c82cb..72ab03f11a 100755
--- a/configure
+++ b/configure
@@ -322,10 +322,8 @@ vfio_user_server="disabled"
# 1. Track which submodules are needed
if test "$default_feature" = no ; then
- capstone="disabled"
slirp="disabled"
else
- capstone="auto"
slirp="auto"
fi
fdt="auto"
@@ -904,15 +902,6 @@ for opt do
--enable-uuid|--disable-uuid)
echo "$0: $opt is obsolete, UUID support is always built" >&2
;;
- --disable-capstone) capstone="disabled"
- ;;
- --enable-capstone) capstone="enabled"
- ;;
- --enable-capstone=git) capstone="internal"
- ;;
- --enable-capstone=*) capstone="$optarg"
- ;;
-
--with-git=*) git="$optarg"
;;
--with-git-submodules=*)
@@ -2753,7 +2742,6 @@ if test "$skip_meson" = no; then
test "$werror" = yes && meson_option_add -Dwerror=true
# QEMU options
- test "$capstone" != auto && meson_option_add "-Dcapstone=$capstone"
test "$cfi" != false && meson_option_add "-Dcfi=$cfi"
test "$fdt" != auto && meson_option_add "-Dfdt=$fdt"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
diff --git a/meson.build b/meson.build
index 9e6a979c13..20fddbd707 100644
--- a/meson.build
+++ b/meson.build
@@ -2596,13 +2596,10 @@ genh += custom_target('config-poison.h',
##############
capstone = not_found
-capstone_opt = get_option('capstone')
-if capstone_opt in ['enabled', 'auto', 'system']
- have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')
+if not get_option('capstone').auto() or have_system or have_user
capstone = dependency('capstone', version: '>=3.0.5',
kwargs: static_kwargs, method: 'pkg-config',
- required: capstone_opt == 'system' or
- capstone_opt == 'enabled' and not have_internal)
+ required: get_option('capstone'))
# Some versions of capstone have broken pkg-config file
# that reports a wrong -I path, causing the #include to
@@ -2611,113 +2608,10 @@ if capstone_opt in ['enabled', 'auto', 'system']
if capstone.found() and not cc.compiles('#include <capstone.h>',
dependencies: [capstone])
capstone = not_found
- if capstone_opt == 'system'
- error('system capstone requested, it does not appear to work')
+ if get_option('capstone').enabled()
+ error('capstone requested, but it does not appear to work')
endif
endif
-
- if capstone.found()
- capstone_opt = 'system'
- elif have_internal
- capstone_opt = 'internal'
- else
- capstone_opt = 'disabled'
- endif
-endif
-if capstone_opt == 'internal'
- capstone_data = configuration_data()
- capstone_data.set('CAPSTONE_USE_SYS_DYN_MEM', '1')
-
- capstone_files = files(
- 'capstone/cs.c',
- 'capstone/MCInst.c',
- 'capstone/MCInstrDesc.c',
- 'capstone/MCRegisterInfo.c',
- 'capstone/SStream.c',
- 'capstone/utils.c'
- )
-
- if 'CONFIG_ARM_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_ARM', '1')
- capstone_files += files(
- 'capstone/arch/ARM/ARMDisassembler.c',
- 'capstone/arch/ARM/ARMInstPrinter.c',
- 'capstone/arch/ARM/ARMMapping.c',
- 'capstone/arch/ARM/ARMModule.c'
- )
- endif
-
- # FIXME: This config entry currently depends on a c++ compiler.
- # Which is needed for building libvixl, but not for capstone.
- if 'CONFIG_ARM_A64_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_ARM64', '1')
- capstone_files += files(
- 'capstone/arch/AArch64/AArch64BaseInfo.c',
- 'capstone/arch/AArch64/AArch64Disassembler.c',
- 'capstone/arch/AArch64/AArch64InstPrinter.c',
- 'capstone/arch/AArch64/AArch64Mapping.c',
- 'capstone/arch/AArch64/AArch64Module.c'
- )
- endif
-
- if 'CONFIG_PPC_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_POWERPC', '1')
- capstone_files += files(
- 'capstone/arch/PowerPC/PPCDisassembler.c',
- 'capstone/arch/PowerPC/PPCInstPrinter.c',
- 'capstone/arch/PowerPC/PPCMapping.c',
- 'capstone/arch/PowerPC/PPCModule.c'
- )
- endif
-
- if 'CONFIG_S390_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_SYSZ', '1')
- capstone_files += files(
- 'capstone/arch/SystemZ/SystemZDisassembler.c',
- 'capstone/arch/SystemZ/SystemZInstPrinter.c',
- 'capstone/arch/SystemZ/SystemZMapping.c',
- 'capstone/arch/SystemZ/SystemZModule.c',
- 'capstone/arch/SystemZ/SystemZMCTargetDesc.c'
- )
- endif
-
- if 'CONFIG_I386_DIS' in config_all_disas
- capstone_data.set('CAPSTONE_HAS_X86', 1)
- capstone_files += files(
- 'capstone/arch/X86/X86Disassembler.c',
- 'capstone/arch/X86/X86DisassemblerDecoder.c',
- 'capstone/arch/X86/X86ATTInstPrinter.c',
- 'capstone/arch/X86/X86IntelInstPrinter.c',
- 'capstone/arch/X86/X86InstPrinterCommon.c',
- 'capstone/arch/X86/X86Mapping.c',
- 'capstone/arch/X86/X86Module.c'
- )
- endif
-
- configure_file(output: 'capstone-defs.h', configuration: capstone_data)
-
- capstone_cargs = [
- # FIXME: There does not seem to be a way to completely replace the c_args
- # that come from add_project_arguments() -- we can only add to them.
- # So: disable all warnings with a big hammer.
- '-Wno-error', '-w',
-
- # Include all configuration defines via a header file, which will wind up
- # as a dependency on the object file, and thus changes here will result
- # in a rebuild.
- '-include', 'capstone-defs.h',
-
- '-Wp,-D_GLIBCXX_ASSERTIONS',
-
- ]
-
- libcapstone = static_library('capstone',
- build_by_default: false,
- sources: capstone_files,
- c_args: capstone_cargs,
- include_directories: 'capstone/include')
- capstone = declare_dependency(link_with: libcapstone,
- include_directories: 'capstone/include/capstone')
endif
slirp = not_found
@@ -4083,7 +3977,7 @@ summary_info += {'bzip2 support': libbzip2}
summary_info += {'lzfse support': liblzfse}
summary_info += {'zstd support': zstd}
summary_info += {'NUMA host support': numa}
-summary_info += {'capstone': capstone_opt == 'internal' ? capstone_opt : capstone}
+summary_info += {'capstone': capstone}
summary_info += {'libpmem support': libpmem}
summary_info += {'libdaxctl support': libdaxctl}
summary_info += {'libudev': libudev}
diff --git a/meson_options.txt b/meson_options.txt
index 7cd920fcd6..e58e158396 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -262,8 +262,7 @@ option('libvduse', type: 'feature', value: 'auto',
option('vduse_blk_export', type: 'feature', value: 'auto',
description: 'VDUSE block export support')
-option('capstone', type: 'combo', value: 'auto',
- choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
+option('capstone', type: 'feature', value: 'auto',
description: 'Whether and how to find the capstone library')
option('slirp', type: 'combo', value: 'auto',
choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index b1001aa1db..359b04e0e6 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -16,9 +16,6 @@ meson_options_help() {
printf "%s\n" ' --enable-block-drv-whitelist-in-tools'
printf "%s\n" ' use block whitelist also in tools instead of only'
printf "%s\n" ' QEMU'
- printf "%s\n" ' --enable-capstone[=CHOICE]'
- printf "%s\n" ' Whether and how to find the capstone library'
- printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)'
printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)'
printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation'
printf "%s\n" ' --enable-debug-mutex mutex debugging support'
@@ -78,6 +75,7 @@ meson_options_help() {
printf "%s\n" ' bzip2 bzip2 support for DMG images'
printf "%s\n" ' canokey CanoKey support'
printf "%s\n" ' cap-ng cap_ng support'
+ printf "%s\n" ' capstone Whether and how to find the capstone library'
printf "%s\n" ' cloop cloop image format support'
printf "%s\n" ' cocoa Cocoa user interface (macOS only)'
printf "%s\n" ' coreaudio CoreAudio sound support'
@@ -218,7 +216,6 @@ _meson_option_parse() {
--disable-cap-ng) printf "%s" -Dcap_ng=disabled ;;
--enable-capstone) printf "%s" -Dcapstone=enabled ;;
--disable-capstone) printf "%s" -Dcapstone=disabled ;;
- --enable-capstone=*) quote_sh "-Dcapstone=$2" ;;
--enable-cfi) printf "%s" -Dcfi=true ;;
--disable-cfi) printf "%s" -Dcfi=false ;;
--enable-cfi-debug) printf "%s" -Dcfi_debug=true ;;
--
2.31.1

View File

@ -1,84 +0,0 @@
From 7f5289f426b25cf1113a450a3aa311170ac30397 Mon Sep 17 00:00:00 2001
From: Peter Xu <peterx@redhat.com>
Date: Mon, 26 Sep 2022 11:32:06 -0400
Subject: [PATCH] Revert "intel_iommu: Fix irqchip / X2APIC configuration
checks"
RH-Author: Peter Xu <peterx@redhat.com>
RH-MergeRequest: 121: Revert "intel_iommu: Fix irqchip / X2APIC configuration checks"
RH-Bugzilla: 2126095
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Commit: [1/1] 6218c5f81c205ab160f4ccdb203ae39d4af3339e (peterx/qemu-kvm)
It's true that when vcpus<=255 we don't require the length of 32bit APIC
IDs. However here since we already have EIM=ON it means the hypervisor
will declare the VM as x2apic supported (e.g. VT-d ECAP register will have
EIM bit 4 set), so the guest should assume the APIC IDs are 32bits width
even if vcpus<=255. In short, commit 77250171bdc breaks any simple cmdline
that wants to boot a VM with >=9 but <=255 vcpus with:
-device intel-iommu,intremap=on
For anyone who does not want to enable x2apic, we can use eim=off in the
intel-iommu parameters to skip enabling KVM x2apic.
This partly reverts commit 77250171bdc02aee106083fd2a068147befa1a38, while
keeping the valid bit on checking split irqchip, but revert the other change.
One thing to mention is that this patch may break migration compatibility
of such VM, however that's probably the best thing we can do, because the
old behavior was simply wrong and not working for >8 vcpus. For <=8 vcpus,
there could be a light guest ABI change (by enabling KVM x2apic after this
patch), but logically it shouldn't affect the migration from working.
Also, this is not the 1st commit to change x2apic behavior. Igor provided
a full history of how this evolved for the past few years:
https://lore.kernel.org/qemu-devel/20220922154617.57d1a1fb@redhat.com/
Relevant commits for reference:
fb506e701e ("intel_iommu: reject broken EIM", 2016-10-17)
c1bb5418e3 ("target/i386: Support up to 32768 CPUs without IRQ remapping", 2020-12-10)
77250171bd ("intel_iommu: Fix irqchip / X2APIC configuration checks", 2022-05-16)
dc89f32d92 ("target/i386: Fix sanity check on max APIC ID / X2APIC enablement", 2022-05-16)
We may want to have this for stable too (mostly for 7.1.0 only). Adding a
fixes tag.
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Claudio Fontana <cfontana@suse.de>
Cc: Igor Mammedov <imammedo@redhat.com>
Fixes: 77250171bd ("intel_iommu: Fix irqchip / X2APIC configuration checks")
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20220926153206.10881-1-peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
(cherry picked from commit 20ca47429e96df84e7b2e741f740bfce8a813fb2)
Signed-off-by: Peter Xu <peterx@redhat.com>
---
hw/i386/intel_iommu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 05d53a1aa9..6524c2ee32 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3818,6 +3818,11 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
error_setg(errp, "eim=on requires accel=kvm,kernel-irqchip=split");
return false;
}
+ if (!kvm_enable_x2apic()) {
+ error_setg(errp, "eim=on requires support on the KVM side"
+ "(X2APIC_API, first shipped in v4.7)");
+ return false;
+ }
}
/* Currently only address widths supported are 39 and 48 bits */
--
2.31.1

View File

@ -1,107 +0,0 @@
From 2c9b536fac44c15c44af385ac1b440a9f5c05d01 Mon Sep 17 00:00:00 2001
From: Keith Busch <kbusch@kernel.org>
Date: Thu, 29 Sep 2022 13:05:22 -0700
Subject: [PATCH 1/2] block: move bdrv_qiov_is_aligned to file-posix
RH-Author: Kevin Wolf <kwolf@redhat.com>
RH-MergeRequest: 123: block: Fix memory alignment of requests
RH-Bugzilla: 2143170
RH-Acked-by: Alberto Faria <None>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Commit: [1/2] 77b6ed2aaedfbd3dba7769b9a999ab3743f642cd (kmwolf/centos-qemu-kvm)
There is only user of bdrv_qiov_is_aligned(), so move the alignment
function to there and make it static.
Signed-off-by: Keith Busch <kbusch@kernel.org>
Message-Id: <20220929200523.3218710-2-kbusch@meta.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit a7c5f67a78569f8c275ea4ea9962e9c79b9d03cb)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/file-posix.c | 21 +++++++++++++++++++++
block/io.c | 21 ---------------------
include/block/block-io.h | 1 -
3 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 48cd096624..e3f3de2780 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2061,6 +2061,27 @@ static int coroutine_fn raw_thread_pool_submit(BlockDriverState *bs,
return thread_pool_submit_co(pool, func, arg);
}
+/*
+ * Check if all memory in this vector is sector aligned.
+ */
+static bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov)
+{
+ int i;
+ size_t alignment = bdrv_min_mem_align(bs);
+ IO_CODE();
+
+ for (i = 0; i < qiov->niov; i++) {
+ if ((uintptr_t) qiov->iov[i].iov_base % alignment) {
+ return false;
+ }
+ if (qiov->iov[i].iov_len % alignment) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
static int coroutine_fn raw_co_prw(BlockDriverState *bs, uint64_t offset,
uint64_t bytes, QEMUIOVector *qiov, int type)
{
diff --git a/block/io.c b/block/io.c
index 0a8cbefe86..96edc7f7cb 100644
--- a/block/io.c
+++ b/block/io.c
@@ -3236,27 +3236,6 @@ void *qemu_try_blockalign0(BlockDriverState *bs, size_t size)
return mem;
}
-/*
- * Check if all memory in this vector is sector aligned.
- */
-bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov)
-{
- int i;
- size_t alignment = bdrv_min_mem_align(bs);
- IO_CODE();
-
- for (i = 0; i < qiov->niov; i++) {
- if ((uintptr_t) qiov->iov[i].iov_base % alignment) {
- return false;
- }
- if (qiov->iov[i].iov_len % alignment) {
- return false;
- }
- }
-
- return true;
-}
-
void bdrv_io_plug(BlockDriverState *bs)
{
BdrvChild *child;
diff --git a/include/block/block-io.h b/include/block/block-io.h
index fd25ffa9be..492f95fc05 100644
--- a/include/block/block-io.h
+++ b/include/block/block-io.h
@@ -150,7 +150,6 @@ void *qemu_blockalign(BlockDriverState *bs, size_t size);
void *qemu_blockalign0(BlockDriverState *bs, size_t size);
void *qemu_try_blockalign(BlockDriverState *bs, size_t size);
void *qemu_try_blockalign0(BlockDriverState *bs, size_t size);
-bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov);
void bdrv_enable_copy_on_read(BlockDriverState *bs);
void bdrv_disable_copy_on_read(BlockDriverState *bs);
--
2.31.1

View File

@ -1,50 +0,0 @@
From 7e334715074c7a4090578ed178834f3318d4b969 Mon Sep 17 00:00:00 2001
From: Keith Busch <kbusch@kernel.org>
Date: Thu, 29 Sep 2022 13:05:23 -0700
Subject: [PATCH 2/2] block: use the request length for iov alignment
RH-Author: Kevin Wolf <kwolf@redhat.com>
RH-MergeRequest: 123: block: Fix memory alignment of requests
RH-Bugzilla: 2143170
RH-Acked-by: Alberto Faria <None>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Commit: [2/2] 50cfd394fff4dbad87d7c90c987e241ed2367746 (kmwolf/centos-qemu-kvm)
An iov length needs to be aligned to the logical block size, which may
be larger than the memory alignment.
Tested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Message-Id: <20220929200523.3218710-3-kbusch@meta.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 25474d90aa50bd32e0de395a33d8de42dd6f2aef)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/file-posix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index e3f3de2780..af994aba2b 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2068,13 +2068,14 @@ static bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov)
{
int i;
size_t alignment = bdrv_min_mem_align(bs);
+ size_t len = bs->bl.request_alignment;
IO_CODE();
for (i = 0; i < qiov->niov; i++) {
if ((uintptr_t) qiov->iov[i].iov_base % alignment) {
return false;
}
- if (qiov->iov[i].iov_len % alignment) {
+ if (qiov->iov[i].iov_len % len) {
return false;
}
}
--
2.31.1

View File

@ -1,64 +0,0 @@
From 529d7d039a8783cb5745330c9731626a608553db Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 9 Nov 2022 05:09:40 -0500
Subject: [PATCH 3/3] host-libusb: Remove unused variable
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 122: Remove variables causing 'Unused but set variable' warning on Clang 15
RH-Bugzilla: 2141218
RH-Commit: [3/3] 460bd469b6f262074c407475c5003581f8993855 (mrezanin/centos-src-qemu-kvm)
Variable unconnected used in usb_host_auto_check function is only incremented
but never read as line where it is read was disabled since introducing the code.
This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
Removing the variable and disabled code to prevent the warning.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
hw/usb/host-libusb.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 28f8af8941..176868d345 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1837,7 +1837,6 @@ static void usb_host_auto_check(void *unused)
struct USBAutoFilter *f;
libusb_device **devs = NULL;
struct libusb_device_descriptor ddesc;
- int unconnected = 0;
int i, n;
if (usb_host_init() != 0) {
@@ -1897,9 +1896,6 @@ static void usb_host_auto_check(void *unused)
libusb_free_device_list(devs, 1);
QTAILQ_FOREACH(s, &hostdevs, next) {
- if (s->dh == NULL) {
- unconnected++;
- }
if (s->seen == 0) {
if (s->dh) {
usb_host_close(s);
@@ -1908,17 +1904,6 @@ static void usb_host_auto_check(void *unused)
}
s->seen = 0;
}
-
-#if 0
- if (unconnected == 0) {
- /* nothing to watch */
- if (usb_auto_timer) {
- timer_del(usb_auto_timer);
- trace_usb_host_auto_scan_disabled();
- }
- return;
- }
-#endif
}
if (!usb_vmstate) {
--
2.31.1

View File

@ -1,83 +0,0 @@
From 108b687eb18d121d688e652ac13ba465083f4529 Mon Sep 17 00:00:00 2001
From: Jon Maloy <jmaloy@redhat.com>
Date: Mon, 5 Dec 2022 15:32:55 -0500
Subject: [PATCH] hw/acpi/erst.c: Fix memory handling issues
RH-Author: Jon Maloy <jmaloy@redhat.com>
RH-MergeRequest: 125: ACPI ERST: memory corruption issues in read_erst_record and write_erst_record
RH-Bugzilla: 2149108
RH-Acked-by: Gavin Shan <gshan@redhat.com>
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Commit: [1/1] cccd8b6b8f0f360c623f913dbc02d4eda2fbf972 (jmaloy/jmaloy-qemu-kvm-centos)
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2149108
Upstream: Merged
CVE: CVE-2022-4172
commit defb70980f6bed36100b74e84220f1764c0dd544
Author: Christian A. Ehrhardt <lk@c--e.de>
Date: Mon Oct 24 17:42:33 2022 +0200
hw/acpi/erst.c: Fix memory handling issues
- Fix memset argument order: The second argument is
the value, the length goes last.
- Fix an integer overflow reported by Alexander Bulekov.
Both issues allow the guest to overrun the host buffer
allocated for the ERST memory device.
Cc: Eric DeVolder <eric.devolder@oracle.com
Cc: Alexander Bulekov <alxndr@bu.edu>
Cc: qemu-stable@nongnu.org
Fixes: f7e26ffa590 ("ACPI ERST: support for ACPI ERST feature")
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
Message-Id: <20221024154233.1043347-1-lk@c--e.de>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1268
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit defb70980f6bed36100b74e84220f1764c0dd544)
Jon Maloy <jmaloy@redhat.com>
---
hw/acpi/erst.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c
index df856b2669..aefcc03ad6 100644
--- a/hw/acpi/erst.c
+++ b/hw/acpi/erst.c
@@ -635,7 +635,7 @@ static unsigned read_erst_record(ERSTDeviceState *s)
if (record_length < UEFI_CPER_RECORD_MIN_SIZE) {
rc = STATUS_FAILED;
}
- if ((s->record_offset + record_length) > exchange_length) {
+ if (record_length > exchange_length - s->record_offset) {
rc = STATUS_FAILED;
}
/* If all is ok, copy the record to the exchange buffer */
@@ -684,7 +684,7 @@ static unsigned write_erst_record(ERSTDeviceState *s)
if (record_length < UEFI_CPER_RECORD_MIN_SIZE) {
return STATUS_FAILED;
}
- if ((s->record_offset + record_length) > exchange_length) {
+ if (record_length > exchange_length - s->record_offset) {
return STATUS_FAILED;
}
@@ -716,7 +716,7 @@ static unsigned write_erst_record(ERSTDeviceState *s)
if (nvram) {
/* Write the record into the slot */
memcpy(nvram, exchange, record_length);
- memset(nvram + record_length, exchange_length - record_length, 0xFF);
+ memset(nvram + record_length, 0xFF, exchange_length - record_length);
/* If a new record, increment the record_count */
if (!record_found) {
uint32_t record_count;
--
2.37.3

View File

@ -1,66 +0,0 @@
From aba2a5cb19efa33be871dd951366439cf99c5f13 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Thu, 18 Aug 2022 17:01:13 +0200
Subject: [PATCH 27/29] i386: do kvm_put_msr_feature_control() first thing when
vCPU is reset
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 118: Synchronize qemu-kvm-7.0.0-13.el9
RH-Bugzilla: 2125281
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
RH-Commit: [2/2] 4986c35a04255c8fe2b62a48f5ea489339f3826a (mrezanin/centos-src-qemu-kvm)
kvm_put_sregs2() fails to reset 'locked' CR4/CR0 bits upon vCPU reset when
it is in VMX root operation. Do kvm_put_msr_feature_control() before
kvm_put_sregs2() to (possibly) kick vCPU out of VMX root operation. It also
seems logical to do kvm_put_msr_feature_control() before
kvm_put_nested_state() and not after it, especially when 'real' nested
state is set.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20220818150113.479917-3-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 45ed68a1a3a19754ade954d75a3c9d13ff560e5c)
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
target/i386/kvm/kvm.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index fd3237310b..a9eba247a5 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -4533,6 +4533,18 @@ int kvm_arch_put_registers(CPUState *cpu, int level)
assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
+ /*
+ * Put MSR_IA32_FEATURE_CONTROL first, this ensures the VM gets out of VMX
+ * root operation upon vCPU reset. kvm_put_msr_feature_control() should also
+ * preceed kvm_put_nested_state() when 'real' nested state is set.
+ */
+ if (level >= KVM_PUT_RESET_STATE) {
+ ret = kvm_put_msr_feature_control(x86_cpu);
+ if (ret < 0) {
+ return ret;
+ }
+ }
+
/* must be before kvm_put_nested_state so that EFER.SVME is set */
ret = has_sregs2 ? kvm_put_sregs2(x86_cpu) : kvm_put_sregs(x86_cpu);
if (ret < 0) {
@@ -4544,11 +4556,6 @@ int kvm_arch_put_registers(CPUState *cpu, int level)
if (ret < 0) {
return ret;
}
-
- ret = kvm_put_msr_feature_control(x86_cpu);
- if (ret < 0) {
- return ret;
- }
}
if (level == KVM_PUT_FULL_STATE) {
--
2.31.1

View File

@ -1,93 +0,0 @@
From 6f650e08efc35cc04730bf99cea7be8d4faa6e74 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Thu, 18 Aug 2022 17:01:12 +0200
Subject: [PATCH 26/29] i386: reset KVM nested state upon CPU reset
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 118: Synchronize qemu-kvm-7.0.0-13.el9
RH-Bugzilla: 2125281
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
RH-Commit: [1/2] b34da74a40fe32ef210c8127ba8bb032aaab6381 (mrezanin/centos-src-qemu-kvm)
Make sure env->nested_state is cleaned up when a vCPU is reset, it may
be stale after an incoming migration, kvm_arch_put_registers() may
end up failing or putting vCPU in a weird state.
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20220818150113.479917-2-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3cafdb67504a34a0305260f0c86a73d5a3fb000b)
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
target/i386/kvm/kvm.c | 37 +++++++++++++++++++++++++++----------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 4e5d4bafc4..fd3237310b 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1695,6 +1695,30 @@ static void kvm_init_xsave(CPUX86State *env)
env->xsave_buf_len);
}
+static void kvm_init_nested_state(CPUX86State *env)
+{
+ struct kvm_vmx_nested_state_hdr *vmx_hdr;
+ uint32_t size;
+
+ if (!env->nested_state) {
+ return;
+ }
+
+ size = env->nested_state->size;
+
+ memset(env->nested_state, 0, size);
+ env->nested_state->size = size;
+
+ if (cpu_has_vmx(env)) {
+ env->nested_state->format = KVM_STATE_NESTED_FORMAT_VMX;
+ vmx_hdr = &env->nested_state->hdr.vmx;
+ vmx_hdr->vmxon_pa = -1ull;
+ vmx_hdr->vmcs12_pa = -1ull;
+ } else if (cpu_has_svm(env)) {
+ env->nested_state->format = KVM_STATE_NESTED_FORMAT_SVM;
+ }
+}
+
int kvm_arch_init_vcpu(CPUState *cs)
{
struct {
@@ -2122,19 +2146,10 @@ int kvm_arch_init_vcpu(CPUState *cs)
assert(max_nested_state_len >= offsetof(struct kvm_nested_state, data));
if (cpu_has_vmx(env) || cpu_has_svm(env)) {
- struct kvm_vmx_nested_state_hdr *vmx_hdr;
-
env->nested_state = g_malloc0(max_nested_state_len);
env->nested_state->size = max_nested_state_len;
- if (cpu_has_vmx(env)) {
- env->nested_state->format = KVM_STATE_NESTED_FORMAT_VMX;
- vmx_hdr = &env->nested_state->hdr.vmx;
- vmx_hdr->vmxon_pa = -1ull;
- vmx_hdr->vmcs12_pa = -1ull;
- } else {
- env->nested_state->format = KVM_STATE_NESTED_FORMAT_SVM;
- }
+ kvm_init_nested_state(env);
}
}
@@ -2199,6 +2214,8 @@ void kvm_arch_reset_vcpu(X86CPU *cpu)
/* enabled by default */
env->poll_control_msr = 1;
+ kvm_init_nested_state(env);
+
sev_es_set_reset_vector(CPU(cpu));
}
--
2.31.1

View File

@ -1,45 +0,0 @@
From 2458bcc8497fb12ad81e9fd5d05a6164d25f00d6 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 9 Nov 2022 05:12:46 -0500
Subject: [PATCH 2/3] qemu-img: remove unused variable
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 122: Remove variables causing 'Unused but set variable' warning on Clang 15
RH-Bugzilla: 2141218
RH-Commit: [2/3] 9cd54891567781090accfb68aa5d80d2c6d68584 (mrezanin/centos-src-qemu-kvm)
Variable block_count used in img_dd function is only incremented but never read.
This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
Removing the variable to prevent the warning.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
qemu-img.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 7d4b33b3da..987da256ef 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4919,7 +4919,7 @@ static int img_dd(int argc, char **argv)
const char *out_fmt = "raw";
const char *fmt = NULL;
int64_t size = 0;
- int64_t block_count = 0, out_pos, in_pos;
+ int64_t out_pos, in_pos;
bool force_share = false;
struct DdInfo dd = {
.flags = 0,
@@ -5119,7 +5119,7 @@ static int img_dd(int argc, char **argv)
in.buf = g_new(uint8_t, in.bsz);
- for (out_pos = 0; in_pos < size; block_count++) {
+ for (out_pos = 0; in_pos < size; ) {
int bytes = (in_pos + in.bsz > size) ? size - in_pos : in.bsz;
ret = blk_pread(blk1, in_pos, bytes, in.buf, 0);
--
2.31.1

View File

@ -1,44 +0,0 @@
From a89fed7cdbee76f9a7083ca04e079ab991737eeb Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Wed, 9 Nov 2022 06:40:47 -0500
Subject: [PATCH 1/3] rtl8139: Remove unused variable
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 122: Remove variables causing 'Unused but set variable' warning on Clang 15
RH-Bugzilla: 2141218
RH-Commit: [1/3] ffec7ff0238c6859a5ddaea80fcd8e66049fd3fc (mrezanin/centos-src-qemu-kvm)
Variable send_count used in rtl8139_cplus_transmit_one function is only
incremented but never read. This causes 'Unused but set variable' warning
on Clang 15.0.1 compiler.
Removing the variable to prevent the warning.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
hw/net/rtl8139.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 75dacabc43..445cbd700c 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -2156,7 +2156,6 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
ip_data_len, saved_size - ETH_HLEN, large_send_mss);
int tcp_send_offset = 0;
- int send_count = 0;
/* maximum IP header length is 60 bytes */
uint8_t saved_ip_header[60];
@@ -2261,7 +2260,6 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
/* add transferred count to TCP sequence number */
stl_be_p(&p_tcp_hdr->th_seq,
chunk_size + ldl_be_p(&p_tcp_hdr->th_seq));
- ++send_count;
}
/* Stop sending this frame */
--
2.31.1

View File

@ -1,60 +0,0 @@
From f141182484fca38685cb246f77e311643cd2f4c7 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Fri, 7 Oct 2022 13:56:02 +0200
Subject: [PATCH] target/i386/kvm: fix kvmclock_current_nsec: Assertion
`time.tsc_timestamp <= migration_tsc' failed
RH-Author: Vitaly Kuznetsov <vkuznets@redhat.com>
RH-MergeRequest: 120: target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed
RH-Bugzilla: 2108531
RH-Acked-by: Marcelo Tosatti <None>
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Commit: [1/1] edc5bb2578f7f31ab4d87e343925f6f08e812c29 (vkuznets/qemu-kvm-c9s)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2108531
commit c4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb
Author: Ray Zhang <zhanglei002@gmail.com>
Date: Thu Sep 22 18:05:23 2022 +0800
target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed
New KVM_CLOCK flags were added in the kernel.(c68dc1b577eabd5605c6c7c08f3e07ae18d30d5d)
```
+ #define KVM_CLOCK_VALID_FLAGS \
+ (KVM_CLOCK_TSC_STABLE | KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC)
case KVM_CAP_ADJUST_CLOCK:
- r = KVM_CLOCK_TSC_STABLE;
+ r = KVM_CLOCK_VALID_FLAGS;
```
kvm_has_adjust_clock_stable needs to handle additional flags,
so that s->clock_is_reliable can be true and kvmclock_current_nsec doesn't need to be called.
Signed-off-by: Ray Zhang <zhanglei002@gmail.com>
Message-Id: <20220922100523.2362205-1-zhanglei002@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
target/i386/kvm/kvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index a9eba247a5..ba98b99d8f 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -157,7 +157,7 @@ bool kvm_has_adjust_clock_stable(void)
{
int ret = kvm_check_extension(kvm_state, KVM_CAP_ADJUST_CLOCK);
- return (ret == KVM_CLOCK_TSC_STABLE);
+ return (ret & KVM_CLOCK_TSC_STABLE);
}
bool kvm_has_adjust_clock(void)
--
2.37.3

View File

@ -1,182 +0,0 @@
From 3320d1883222bc551cf8ffd048882be4a97e872f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:04 +0200
Subject: [PATCH 03/29] util: accept iova_tree_remove_parameter by value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [3/25] 98190376f758aed31bc31ce3e478438787eb357c (redhat/centos-stream/src/qemu-kvm)
It's convenient to call iova_tree_remove from a map returned from
iova_tree_find or iova_tree_find_iova. With the current code this is not
possible, since we will free it, and then we will try to search for it
again.
Fix it making accepting the map by value, forcing a copy of the
argument. Not applying a fixes tag, since there is no use like that at
the moment.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 69292a8e40f4dae8af5f04724e06392cdf03c09e)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/i386/intel_iommu.c | 6 +++---
hw/virtio/vhost-iova-tree.c | 2 +-
hw/virtio/vhost-iova-tree.h | 2 +-
hw/virtio/vhost-vdpa.c | 6 +++---
include/qemu/iova-tree.h | 2 +-
net/vhost-vdpa.c | 4 ++--
util/iova-tree.c | 4 ++--
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 2162394e08..05d53a1aa9 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1187,7 +1187,7 @@ static int vtd_page_walk_one(IOMMUTLBEvent *event, vtd_page_walk_info *info)
return ret;
}
/* Drop any existing mapping */
- iova_tree_remove(as->iova_tree, &target);
+ iova_tree_remove(as->iova_tree, target);
/* Recover the correct type */
event->type = IOMMU_NOTIFIER_MAP;
entry->perm = cache_perm;
@@ -1200,7 +1200,7 @@ static int vtd_page_walk_one(IOMMUTLBEvent *event, vtd_page_walk_info *info)
trace_vtd_page_walk_one_skip_unmap(entry->iova, entry->addr_mask);
return 0;
}
- iova_tree_remove(as->iova_tree, &target);
+ iova_tree_remove(as->iova_tree, target);
}
trace_vtd_page_walk_one(info->domain_id, entry->iova,
@@ -3563,7 +3563,7 @@ static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n)
map.iova = n->start;
map.size = size;
- iova_tree_remove(as->iova_tree, &map);
+ iova_tree_remove(as->iova_tree, map);
}
static void vtd_address_space_unmap_all(IntelIOMMUState *s)
diff --git a/hw/virtio/vhost-iova-tree.c b/hw/virtio/vhost-iova-tree.c
index 67bf6d57ab..3d03395a77 100644
--- a/hw/virtio/vhost-iova-tree.c
+++ b/hw/virtio/vhost-iova-tree.c
@@ -104,7 +104,7 @@ int vhost_iova_tree_map_alloc(VhostIOVATree *tree, DMAMap *map)
* @iova_tree: The vhost iova tree
* @map: The map to remove
*/
-void vhost_iova_tree_remove(VhostIOVATree *iova_tree, const DMAMap *map)
+void vhost_iova_tree_remove(VhostIOVATree *iova_tree, DMAMap map)
{
iova_tree_remove(iova_tree->iova_taddr_map, map);
}
diff --git a/hw/virtio/vhost-iova-tree.h b/hw/virtio/vhost-iova-tree.h
index 6a4f24e0f9..4adfd79ff0 100644
--- a/hw/virtio/vhost-iova-tree.h
+++ b/hw/virtio/vhost-iova-tree.h
@@ -22,6 +22,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(VhostIOVATree, vhost_iova_tree_delete);
const DMAMap *vhost_iova_tree_find_iova(const VhostIOVATree *iova_tree,
const DMAMap *map);
int vhost_iova_tree_map_alloc(VhostIOVATree *iova_tree, DMAMap *map);
-void vhost_iova_tree_remove(VhostIOVATree *iova_tree, const DMAMap *map);
+void vhost_iova_tree_remove(VhostIOVATree *iova_tree, DMAMap map);
#endif
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 7e28d2f674..87e0ad393f 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -240,7 +240,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener,
fail_map:
if (v->shadow_vqs_enabled) {
- vhost_iova_tree_remove(v->iova_tree, &mem_region);
+ vhost_iova_tree_remove(v->iova_tree, mem_region);
}
fail:
@@ -300,7 +300,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener,
return;
}
iova = result->iova;
- vhost_iova_tree_remove(v->iova_tree, result);
+ vhost_iova_tree_remove(v->iova_tree, *result);
}
vhost_vdpa_iotlb_batch_begin_once(v);
ret = vhost_vdpa_dma_unmap(v, iova, int128_get64(llsize));
@@ -944,7 +944,7 @@ static bool vhost_vdpa_svq_map_ring(struct vhost_vdpa *v, DMAMap *needle,
needle->perm == IOMMU_RO);
if (unlikely(r != 0)) {
error_setg_errno(errp, -r, "Cannot map region to device");
- vhost_iova_tree_remove(v->iova_tree, needle);
+ vhost_iova_tree_remove(v->iova_tree, *needle);
}
return r == 0;
diff --git a/include/qemu/iova-tree.h b/include/qemu/iova-tree.h
index 16bbfdf5f8..8528e5c98f 100644
--- a/include/qemu/iova-tree.h
+++ b/include/qemu/iova-tree.h
@@ -73,7 +73,7 @@ int iova_tree_insert(IOVATree *tree, const DMAMap *map);
* all the mappings that are included in the provided range will be
* removed from the tree. Here map->translated_addr is meaningless.
*/
-void iova_tree_remove(IOVATree *tree, const DMAMap *map);
+void iova_tree_remove(IOVATree *tree, DMAMap map);
/**
* iova_tree_find:
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 303447a68e..a49e7e649d 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -244,7 +244,7 @@ static void vhost_vdpa_cvq_unmap_buf(struct vhost_vdpa *v, void *addr)
error_report("Device cannot unmap: %s(%d)", g_strerror(r), r);
}
- vhost_iova_tree_remove(tree, map);
+ vhost_iova_tree_remove(tree, *map);
}
static size_t vhost_vdpa_net_cvq_cmd_len(void)
@@ -297,7 +297,7 @@ static bool vhost_vdpa_cvq_map_buf(struct vhost_vdpa *v,
return true;
dma_map_err:
- vhost_iova_tree_remove(v->iova_tree, &map);
+ vhost_iova_tree_remove(v->iova_tree, map);
return false;
}
diff --git a/util/iova-tree.c b/util/iova-tree.c
index fee530a579..536789797e 100644
--- a/util/iova-tree.c
+++ b/util/iova-tree.c
@@ -164,11 +164,11 @@ void iova_tree_foreach(IOVATree *tree, iova_tree_iterator iterator)
g_tree_foreach(tree->tree, iova_tree_traverse, iterator);
}
-void iova_tree_remove(IOVATree *tree, const DMAMap *map)
+void iova_tree_remove(IOVATree *tree, DMAMap map)
{
const DMAMap *overlap;
- while ((overlap = iova_tree_find(tree, map))) {
+ while ((overlap = iova_tree_find(tree, &map))) {
g_tree_remove(tree->tree, overlap);
}
}
--
2.31.1

View File

@ -1,74 +0,0 @@
From 466adb0e641f5c918cbea84e962ae9352f440663 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Thu, 11 Aug 2022 14:28:47 +0200
Subject: [PATCH 22/29] vdpa: Add vhost_vdpa_net_load_mq
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [22/25] 01e861ad39d6b8e15870296f508726565101213b (redhat/centos-stream/src/qemu-kvm)
Upstream: Not merged yet
Same way as with the MAC, restore the expected number of queues at
device's start.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index e799e744cd..3950e4f25d 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -400,6 +400,28 @@ static int vhost_vdpa_net_load_mac(VhostVDPAState *s, const VirtIONet *n)
return 0;
}
+static int vhost_vdpa_net_load_mq(VhostVDPAState *s,
+ const VirtIONet *n)
+{
+ struct virtio_net_ctrl_mq mq;
+ uint64_t features = n->parent_obj.guest_features;
+ ssize_t dev_written;
+
+ if (!(features & BIT_ULL(VIRTIO_NET_F_MQ))) {
+ return 0;
+ }
+
+ mq.virtqueue_pairs = cpu_to_le16(n->curr_queue_pairs);
+ dev_written = vhost_vdpa_net_load_cmd(s, VIRTIO_NET_CTRL_MQ,
+ VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET, &mq,
+ sizeof(mq));
+ if (unlikely(dev_written < 0)) {
+ return dev_written;
+ }
+
+ return *s->status != VIRTIO_NET_OK;
+}
+
static int vhost_vdpa_net_load(NetClientState *nc)
{
VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc);
@@ -418,6 +440,10 @@ static int vhost_vdpa_net_load(NetClientState *nc)
if (unlikely(r < 0)) {
return r;
}
+ r = vhost_vdpa_net_load_mq(s, n);
+ if (unlikely(r)) {
+ return r;
+ }
return 0;
}
--
2.31.1

View File

@ -1,87 +0,0 @@
From 10157c62f06e86f2ccf1fd4130ef55f7f9beac2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:36 +0200
Subject: [PATCH 18/29] vdpa: Add virtio-net mac address via CVQ at start
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [18/25] f5b7a59a70e51450df8c58b48e4eb30ef2a44189 (redhat/centos-stream/src/qemu-kvm)
This is needed so the destination vdpa device see the same state a the
guest set in the source.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit dd036d8d278e6882803bccaa8c51b8527ea33f45)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 3575bf64ee..640434d1ea 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -363,11 +363,51 @@ static ssize_t vhost_vdpa_net_cvq_add(VhostVDPAState *s, size_t out_len,
return vhost_svq_poll(svq);
}
+static int vhost_vdpa_net_load(NetClientState *nc)
+{
+ VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc);
+ const struct vhost_vdpa *v = &s->vhost_vdpa;
+ const VirtIONet *n;
+ uint64_t features;
+
+ assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_VDPA);
+
+ if (!v->shadow_vqs_enabled) {
+ return 0;
+ }
+
+ n = VIRTIO_NET(v->dev->vdev);
+ features = n->parent_obj.guest_features;
+ if (features & BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR)) {
+ const struct virtio_net_ctrl_hdr ctrl = {
+ .class = VIRTIO_NET_CTRL_MAC,
+ .cmd = VIRTIO_NET_CTRL_MAC_ADDR_SET,
+ };
+ char *cursor = s->cvq_cmd_out_buffer;
+ ssize_t dev_written;
+
+ memcpy(cursor, &ctrl, sizeof(ctrl));
+ cursor += sizeof(ctrl);
+ memcpy(cursor, n->mac, sizeof(n->mac));
+
+ dev_written = vhost_vdpa_net_cvq_add(s, sizeof(ctrl) + sizeof(n->mac),
+ sizeof(virtio_net_ctrl_ack));
+ if (unlikely(dev_written < 0)) {
+ return dev_written;
+ }
+
+ return *((virtio_net_ctrl_ack *)s->cvq_cmd_in_buffer) != VIRTIO_NET_OK;
+ }
+
+ return 0;
+}
+
static NetClientInfo net_vhost_vdpa_cvq_info = {
.type = NET_CLIENT_DRIVER_VHOST_VDPA,
.size = sizeof(VhostVDPAState),
.receive = vhost_vdpa_receive,
.start = vhost_vdpa_net_cvq_start,
+ .load = vhost_vdpa_net_load,
.stop = vhost_vdpa_net_cvq_stop,
.cleanup = vhost_vdpa_cleanup,
.has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
--
2.31.1

View File

@ -1,41 +0,0 @@
From 4a1688ed7d06aef31ef48a018b1f4be7690481fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Thu, 11 Aug 2022 14:54:22 +0200
Subject: [PATCH 25/29] vdpa: Allow MQ feature in SVQ
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [25/25] e416f00fdbcf7af3ddd504e76519510e3bdc57b7 (redhat/centos-stream/src/qemu-kvm)
Upstream: Not merged yet
Finally enable SVQ with MQ feature.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index c6cbe2fb5c..4bc3fd01a8 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -94,6 +94,7 @@ static const uint64_t vdpa_svq_device_features =
BIT_ULL(VIRTIO_NET_F_MRG_RXBUF) |
BIT_ULL(VIRTIO_NET_F_STATUS) |
BIT_ULL(VIRTIO_NET_F_CTRL_VQ) |
+ BIT_ULL(VIRTIO_NET_F_MQ) |
BIT_ULL(VIRTIO_F_ANY_LAYOUT) |
BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR) |
BIT_ULL(VIRTIO_NET_F_RSC_EXT) |
--
2.31.1

View File

@ -1,98 +0,0 @@
From caa8a1d41ca1f2b9c4d1c6cc287c8ae22063b488 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:37 +0200
Subject: [PATCH 19/29] vdpa: Delete CVQ migration blocker
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [19/25] d3e6c009f66e1dc0069323684af28936ae10d155 (redhat/centos-stream/src/qemu-kvm)
We can restore the device state in the destination via CVQ now. Remove
the migration blocker.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 0e3fdcffead7c651ce06ab50cffb89e806f04e2b)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-vdpa.c | 15 ---------------
include/hw/virtio/vhost-vdpa.h | 1 -
net/vhost-vdpa.c | 2 --
3 files changed, 18 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 23ae5ef48b..7468e44b87 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1033,13 +1033,6 @@ static bool vhost_vdpa_svqs_start(struct vhost_dev *dev)
return true;
}
- if (v->migration_blocker) {
- int r = migrate_add_blocker(v->migration_blocker, &err);
- if (unlikely(r < 0)) {
- return false;
- }
- }
-
for (i = 0; i < v->shadow_vqs->len; ++i) {
VirtQueue *vq = virtio_get_queue(dev->vdev, dev->vq_index + i);
VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, i);
@@ -1082,10 +1075,6 @@ err:
vhost_svq_stop(svq);
}
- if (v->migration_blocker) {
- migrate_del_blocker(v->migration_blocker);
- }
-
return false;
}
@@ -1101,10 +1090,6 @@ static void vhost_vdpa_svqs_stop(struct vhost_dev *dev)
VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, i);
vhost_vdpa_svq_unmap_rings(dev, svq);
}
-
- if (v->migration_blocker) {
- migrate_del_blocker(v->migration_blocker);
- }
}
static int vhost_vdpa_dev_start(struct vhost_dev *dev, bool started)
diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h
index d10a89303e..1111d85643 100644
--- a/include/hw/virtio/vhost-vdpa.h
+++ b/include/hw/virtio/vhost-vdpa.h
@@ -35,7 +35,6 @@ typedef struct vhost_vdpa {
bool shadow_vqs_enabled;
/* IOVA mapping used by the Shadow Virtqueue */
VhostIOVATree *iova_tree;
- Error *migration_blocker;
GPtrArray *shadow_vqs;
const VhostShadowVirtqueueOps *shadow_vq_ops;
void *shadow_vq_ops_opaque;
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 640434d1ea..6ce68fcd3f 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -555,8 +555,6 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,
s->vhost_vdpa.shadow_vq_ops = &vhost_vdpa_net_svq_ops;
s->vhost_vdpa.shadow_vq_ops_opaque = s;
- error_setg(&s->vhost_vdpa.migration_blocker,
- "Migration disabled: vhost-vdpa uses CVQ.");
}
ret = vhost_vdpa_add(nc, (void *)&s->vhost_vdpa, queue_pair_index, nvqs);
if (ret) {
--
2.31.1

View File

@ -1,133 +0,0 @@
From 08d9ea9f9218ad628771f3962d52fb4b6c110262 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:06 +0200
Subject: [PATCH 05/29] vdpa: Make SVQ vring unmapping return void
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [5/25] 340a2246e85d30b6d30ab24198af0fb65520276e (redhat/centos-stream/src/qemu-kvm)
Nothing actually reads the return value, but an error in cleaning some
entries could cause device stop to abort, making a restart impossible.
Better ignore explicitely the return value.
Reported-by: Lei Yang <leiyang@redhat.com>
Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 5b590f51b923776a14d3bcafcb393279c1b72022)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-vdpa.c | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index e16e0e222e..e208dd000e 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -884,7 +884,7 @@ static int vhost_vdpa_svq_set_fds(struct vhost_dev *dev,
/**
* Unmap a SVQ area in the device
*/
-static bool vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v,
+static void vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v,
const DMAMap *needle)
{
const DMAMap *result = vhost_iova_tree_find_iova(v->iova_tree, needle);
@@ -893,38 +893,33 @@ static bool vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v,
if (unlikely(!result)) {
error_report("Unable to find SVQ address to unmap");
- return false;
+ return;
}
size = ROUND_UP(result->size, qemu_real_host_page_size());
r = vhost_vdpa_dma_unmap(v, result->iova, size);
if (unlikely(r < 0)) {
error_report("Unable to unmap SVQ vring: %s (%d)", g_strerror(-r), -r);
- return false;
+ return;
}
vhost_iova_tree_remove(v->iova_tree, *result);
- return r == 0;
}
-static bool vhost_vdpa_svq_unmap_rings(struct vhost_dev *dev,
+static void vhost_vdpa_svq_unmap_rings(struct vhost_dev *dev,
const VhostShadowVirtqueue *svq)
{
DMAMap needle = {};
struct vhost_vdpa *v = dev->opaque;
struct vhost_vring_addr svq_addr;
- bool ok;
vhost_svq_get_vring_addr(svq, &svq_addr);
needle.translated_addr = svq_addr.desc_user_addr;
- ok = vhost_vdpa_svq_unmap_ring(v, &needle);
- if (unlikely(!ok)) {
- return false;
- }
+ vhost_vdpa_svq_unmap_ring(v, &needle);
needle.translated_addr = svq_addr.used_user_addr;
- return vhost_vdpa_svq_unmap_ring(v, &needle);
+ vhost_vdpa_svq_unmap_ring(v, &needle);
}
/**
@@ -1095,26 +1090,22 @@ err:
return false;
}
-static bool vhost_vdpa_svqs_stop(struct vhost_dev *dev)
+static void vhost_vdpa_svqs_stop(struct vhost_dev *dev)
{
struct vhost_vdpa *v = dev->opaque;
if (!v->shadow_vqs) {
- return true;
+ return;
}
for (unsigned i = 0; i < v->shadow_vqs->len; ++i) {
VhostShadowVirtqueue *svq = g_ptr_array_index(v->shadow_vqs, i);
- bool ok = vhost_vdpa_svq_unmap_rings(dev, svq);
- if (unlikely(!ok)) {
- return false;
- }
+ vhost_vdpa_svq_unmap_rings(dev, svq);
}
if (v->migration_blocker) {
migrate_del_blocker(v->migration_blocker);
}
- return true;
}
static int vhost_vdpa_dev_start(struct vhost_dev *dev, bool started)
@@ -1131,10 +1122,7 @@ static int vhost_vdpa_dev_start(struct vhost_dev *dev, bool started)
}
vhost_vdpa_set_vring_ready(dev);
} else {
- ok = vhost_vdpa_svqs_stop(dev);
- if (unlikely(!ok)) {
- return -1;
- }
+ vhost_vdpa_svqs_stop(dev);
vhost_vdpa_host_notifiers_uninit(dev, dev->nvqs);
}
--
2.31.1

View File

@ -1,113 +0,0 @@
From d44701ad634f05c31a1b0f0b84b168ed1ec19f71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Wed, 24 Aug 2022 20:28:35 +0200
Subject: [PATCH 20/29] vdpa: Make VhostVDPAState cvq_cmd_in_buffer control ack
type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [20/25] fd7012502f7002f61ea2e0c90baac013e09282de (redhat/centos-stream/src/qemu-kvm)
Upstream: Not merged yet
This allows to simplify the code. Rename to status while we're at it.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 6ce68fcd3f..535315c1d0 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -35,7 +35,9 @@ typedef struct VhostVDPAState {
VHostNetState *vhost_net;
/* Control commands shadow buffers */
- void *cvq_cmd_out_buffer, *cvq_cmd_in_buffer;
+ void *cvq_cmd_out_buffer;
+ virtio_net_ctrl_ack *status;
+
bool started;
} VhostVDPAState;
@@ -158,7 +160,7 @@ static void vhost_vdpa_cleanup(NetClientState *nc)
struct vhost_dev *dev = &s->vhost_net->dev;
qemu_vfree(s->cvq_cmd_out_buffer);
- qemu_vfree(s->cvq_cmd_in_buffer);
+ qemu_vfree(s->status);
if (dev->vq_index + dev->nvqs == dev->vq_index_end) {
g_clear_pointer(&s->vhost_vdpa.iova_tree, vhost_iova_tree_delete);
}
@@ -310,7 +312,7 @@ static int vhost_vdpa_net_cvq_start(NetClientState *nc)
return r;
}
- r = vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, s->cvq_cmd_in_buffer,
+ r = vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, s->status,
vhost_vdpa_net_cvq_cmd_page_len(), true);
if (unlikely(r < 0)) {
vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->cvq_cmd_out_buffer);
@@ -327,7 +329,7 @@ static void vhost_vdpa_net_cvq_stop(NetClientState *nc)
if (s->vhost_vdpa.shadow_vqs_enabled) {
vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->cvq_cmd_out_buffer);
- vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->cvq_cmd_in_buffer);
+ vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->status);
}
}
@@ -340,7 +342,7 @@ static ssize_t vhost_vdpa_net_cvq_add(VhostVDPAState *s, size_t out_len,
.iov_len = out_len,
};
const struct iovec in = {
- .iov_base = s->cvq_cmd_in_buffer,
+ .iov_base = s->status,
.iov_len = sizeof(virtio_net_ctrl_ack),
};
VhostShadowVirtqueue *svq = g_ptr_array_index(s->vhost_vdpa.shadow_vqs, 0);
@@ -396,7 +398,7 @@ static int vhost_vdpa_net_load(NetClientState *nc)
return dev_written;
}
- return *((virtio_net_ctrl_ack *)s->cvq_cmd_in_buffer) != VIRTIO_NET_OK;
+ return *s->status != VIRTIO_NET_OK;
}
return 0;
@@ -491,8 +493,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
goto out;
}
- memcpy(&status, s->cvq_cmd_in_buffer, sizeof(status));
- if (status != VIRTIO_NET_OK) {
+ if (*s->status != VIRTIO_NET_OK) {
return VIRTIO_NET_ERR;
}
@@ -549,9 +550,9 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,
s->cvq_cmd_out_buffer = qemu_memalign(qemu_real_host_page_size(),
vhost_vdpa_net_cvq_cmd_page_len());
memset(s->cvq_cmd_out_buffer, 0, vhost_vdpa_net_cvq_cmd_page_len());
- s->cvq_cmd_in_buffer = qemu_memalign(qemu_real_host_page_size(),
- vhost_vdpa_net_cvq_cmd_page_len());
- memset(s->cvq_cmd_in_buffer, 0, vhost_vdpa_net_cvq_cmd_page_len());
+ s->status = qemu_memalign(qemu_real_host_page_size(),
+ vhost_vdpa_net_cvq_cmd_page_len());
+ memset(s->status, 0, vhost_vdpa_net_cvq_cmd_page_len());
s->vhost_vdpa.shadow_vq_ops = &vhost_vdpa_net_svq_ops;
s->vhost_vdpa.shadow_vq_ops_opaque = s;
--
2.31.1

View File

@ -1,251 +0,0 @@
From 0c03e18c49b62241d046ecb15c0ee3e7f9c2e547 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:33 +0200
Subject: [PATCH 15/29] vdpa: Move command buffers map to start of net device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [15/25] 216c18aa307f7bdef1575f581b767b6f023a73bd (redhat/centos-stream/src/qemu-kvm)
As this series will reuse them to restore the device state at the end of
a migration (or a device start), let's allocate only once at the device
start so we don't duplicate their map and unmap.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 7a7f87e94c4e75ca177564491595dd17b7e41a62)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 123 ++++++++++++++++++++++-------------------------
1 file changed, 58 insertions(+), 65 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 1a597c2e92..452d10ed93 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -263,29 +263,20 @@ static size_t vhost_vdpa_net_cvq_cmd_page_len(void)
return ROUND_UP(vhost_vdpa_net_cvq_cmd_len(), qemu_real_host_page_size());
}
-/** Copy and map a guest buffer. */
-static bool vhost_vdpa_cvq_map_buf(struct vhost_vdpa *v,
- const struct iovec *out_data,
- size_t out_num, size_t data_len, void *buf,
- size_t *written, bool write)
+/** Map CVQ buffer. */
+static int vhost_vdpa_cvq_map_buf(struct vhost_vdpa *v, void *buf, size_t size,
+ bool write)
{
DMAMap map = {};
int r;
- if (unlikely(!data_len)) {
- qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid legnth of %s buffer\n",
- __func__, write ? "in" : "out");
- return false;
- }
-
- *written = iov_to_buf(out_data, out_num, 0, buf, data_len);
map.translated_addr = (hwaddr)(uintptr_t)buf;
- map.size = vhost_vdpa_net_cvq_cmd_page_len() - 1;
+ map.size = size - 1;
map.perm = write ? IOMMU_RW : IOMMU_RO,
r = vhost_iova_tree_map_alloc(v->iova_tree, &map);
if (unlikely(r != IOVA_OK)) {
error_report("Cannot map injected element");
- return false;
+ return r;
}
r = vhost_vdpa_dma_map(v, map.iova, vhost_vdpa_net_cvq_cmd_page_len(), buf,
@@ -294,50 +285,58 @@ static bool vhost_vdpa_cvq_map_buf(struct vhost_vdpa *v,
goto dma_map_err;
}
- return true;
+ return 0;
dma_map_err:
vhost_iova_tree_remove(v->iova_tree, map);
- return false;
+ return r;
}
-/**
- * Copy the guest element into a dedicated buffer suitable to be sent to NIC
- *
- * @iov: [0] is the out buffer, [1] is the in one
- */
-static bool vhost_vdpa_net_cvq_map_elem(VhostVDPAState *s,
- VirtQueueElement *elem,
- struct iovec *iov)
+static int vhost_vdpa_net_cvq_start(NetClientState *nc)
{
- size_t in_copied;
- bool ok;
+ VhostVDPAState *s;
+ int r;
- iov[0].iov_base = s->cvq_cmd_out_buffer;
- ok = vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, elem->out_sg, elem->out_num,
- vhost_vdpa_net_cvq_cmd_len(), iov[0].iov_base,
- &iov[0].iov_len, false);
- if (unlikely(!ok)) {
- return false;
+ assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_VDPA);
+
+ s = DO_UPCAST(VhostVDPAState, nc, nc);
+ if (!s->vhost_vdpa.shadow_vqs_enabled) {
+ return 0;
}
- iov[1].iov_base = s->cvq_cmd_in_buffer;
- ok = vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, NULL, 0,
- sizeof(virtio_net_ctrl_ack), iov[1].iov_base,
- &in_copied, true);
- if (unlikely(!ok)) {
+ r = vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, s->cvq_cmd_out_buffer,
+ vhost_vdpa_net_cvq_cmd_page_len(), false);
+ if (unlikely(r < 0)) {
+ return r;
+ }
+
+ r = vhost_vdpa_cvq_map_buf(&s->vhost_vdpa, s->cvq_cmd_in_buffer,
+ vhost_vdpa_net_cvq_cmd_page_len(), true);
+ if (unlikely(r < 0)) {
vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->cvq_cmd_out_buffer);
- return false;
}
- iov[1].iov_len = sizeof(virtio_net_ctrl_ack);
- return true;
+ return r;
+}
+
+static void vhost_vdpa_net_cvq_stop(NetClientState *nc)
+{
+ VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc);
+
+ assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_VDPA);
+
+ if (s->vhost_vdpa.shadow_vqs_enabled) {
+ vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->cvq_cmd_out_buffer);
+ vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, s->cvq_cmd_in_buffer);
+ }
}
static NetClientInfo net_vhost_vdpa_cvq_info = {
.type = NET_CLIENT_DRIVER_VHOST_VDPA,
.size = sizeof(VhostVDPAState),
.receive = vhost_vdpa_receive,
+ .start = vhost_vdpa_net_cvq_start,
+ .stop = vhost_vdpa_net_cvq_stop,
.cleanup = vhost_vdpa_cleanup,
.has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
.has_ufo = vhost_vdpa_has_ufo,
@@ -348,19 +347,17 @@ static NetClientInfo net_vhost_vdpa_cvq_info = {
* Do not forward commands not supported by SVQ. Otherwise, the device could
* accept it and qemu would not know how to update the device model.
*/
-static bool vhost_vdpa_net_cvq_validate_cmd(const struct iovec *out,
- size_t out_num)
+static bool vhost_vdpa_net_cvq_validate_cmd(const void *out_buf, size_t len)
{
struct virtio_net_ctrl_hdr ctrl;
- size_t n;
- n = iov_to_buf(out, out_num, 0, &ctrl, sizeof(ctrl));
- if (unlikely(n < sizeof(ctrl))) {
+ if (unlikely(len < sizeof(ctrl))) {
qemu_log_mask(LOG_GUEST_ERROR,
- "%s: invalid legnth of out buffer %zu\n", __func__, n);
+ "%s: invalid legnth of out buffer %zu\n", __func__, len);
return false;
}
+ memcpy(&ctrl, out_buf, sizeof(ctrl));
switch (ctrl.class) {
case VIRTIO_NET_CTRL_MAC:
switch (ctrl.cmd) {
@@ -392,10 +389,14 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
VhostVDPAState *s = opaque;
size_t in_len, dev_written;
virtio_net_ctrl_ack status = VIRTIO_NET_ERR;
- /* out and in buffers sent to the device */
- struct iovec dev_buffers[2] = {
- { .iov_base = s->cvq_cmd_out_buffer },
- { .iov_base = s->cvq_cmd_in_buffer },
+ /* Out buffer sent to both the vdpa device and the device model */
+ struct iovec out = {
+ .iov_base = s->cvq_cmd_out_buffer,
+ };
+ /* In buffer sent to the device */
+ const struct iovec dev_in = {
+ .iov_base = s->cvq_cmd_in_buffer,
+ .iov_len = sizeof(virtio_net_ctrl_ack),
};
/* in buffer used for device model */
const struct iovec in = {
@@ -405,17 +406,15 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
int r = -EINVAL;
bool ok;
- ok = vhost_vdpa_net_cvq_map_elem(s, elem, dev_buffers);
- if (unlikely(!ok)) {
- goto out;
- }
-
- ok = vhost_vdpa_net_cvq_validate_cmd(&dev_buffers[0], 1);
+ out.iov_len = iov_to_buf(elem->out_sg, elem->out_num, 0,
+ s->cvq_cmd_out_buffer,
+ vhost_vdpa_net_cvq_cmd_len());
+ ok = vhost_vdpa_net_cvq_validate_cmd(s->cvq_cmd_out_buffer, out.iov_len);
if (unlikely(!ok)) {
goto out;
}
- r = vhost_svq_add(svq, &dev_buffers[0], 1, &dev_buffers[1], 1, elem);
+ r = vhost_svq_add(svq, &out, 1, &dev_in, 1, elem);
if (unlikely(r != 0)) {
if (unlikely(r == -ENOSPC)) {
qemu_log_mask(LOG_GUEST_ERROR, "%s: No space on device queue\n",
@@ -435,13 +434,13 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
goto out;
}
- memcpy(&status, dev_buffers[1].iov_base, sizeof(status));
+ memcpy(&status, s->cvq_cmd_in_buffer, sizeof(status));
if (status != VIRTIO_NET_OK) {
goto out;
}
status = VIRTIO_NET_ERR;
- virtio_net_handle_ctrl_iov(svq->vdev, &in, 1, dev_buffers, 1);
+ virtio_net_handle_ctrl_iov(svq->vdev, &in, 1, &out, 1);
if (status != VIRTIO_NET_OK) {
error_report("Bad CVQ processing in model");
}
@@ -454,12 +453,6 @@ out:
}
vhost_svq_push_elem(svq, elem, MIN(in_len, sizeof(status)));
g_free(elem);
- if (dev_buffers[0].iov_base) {
- vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, dev_buffers[0].iov_base);
- }
- if (dev_buffers[1].iov_base) {
- vhost_vdpa_cvq_unmap_buf(&s->vhost_vdpa, dev_buffers[1].iov_base);
- }
return r;
}
--
2.31.1

View File

@ -1,49 +0,0 @@
From dae6d9efac6d7307ccd1e1bebf0a14014f2a4f34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:05 +0200
Subject: [PATCH 04/29] vdpa: Remove SVQ vring from iova_tree at shutdown
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [4/25] 813fb80fc3c9872729e6b345e1e9209548aa7481 (redhat/centos-stream/src/qemu-kvm)
Although the device will be reset before usage, the right thing to do is
to clean it.
Reported-by: Lei Yang <leiyang@redhat.com>
Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit b37c12be962f95fd1e93b470a5ff05f6e2035d46)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-vdpa.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 87e0ad393f..e16e0e222e 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -898,6 +898,12 @@ static bool vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v,
size = ROUND_UP(result->size, qemu_real_host_page_size());
r = vhost_vdpa_dma_unmap(v, result->iova, size);
+ if (unlikely(r < 0)) {
+ error_report("Unable to unmap SVQ vring: %s (%d)", g_strerror(-r), -r);
+ return false;
+ }
+
+ vhost_iova_tree_remove(v->iova_tree, *result);
return r == 0;
}
--
2.31.1

View File

@ -1,48 +0,0 @@
From 67291df3eca8b3d74567c0e8211c9f7da65e74d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:02 +0200
Subject: [PATCH 01/29] vdpa: Skip the maps not in the iova tree
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [1/25] d385d5b600ac4f1a9f9fd4f523e5d4078df8478a (redhat/centos-stream/src/qemu-kvm)
Next patch will skip the registering of dma maps that the vdpa device
rejects in the iova tree. We need to consider that here or we cause a
SIGSEGV accessing result.
Reported-by: Lei Yang <leiyang@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 10dab9f2635b9bab23a2b29974b526e62bb61268)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-vdpa.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 3ff9ce3501..983d3697b0 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -289,6 +289,10 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener,
};
result = vhost_iova_tree_find_iova(v->iova_tree, &mem_region);
+ if (!result) {
+ /* The memory listener map wasn't mapped */
+ return;
+ }
iova = result->iova;
vhost_iova_tree_remove(v->iova_tree, result);
}
--
2.31.1

View File

@ -1,79 +0,0 @@
From c91852883439c3a5349f6787b11b7bc71d6504a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:08 +0200
Subject: [PATCH 07/29] vdpa: Use ring hwaddr at vhost_vdpa_svq_unmap_ring
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [7/25] 961d9854ae1088fc487b32b605fef207aad08924 (redhat/centos-stream/src/qemu-kvm)
Reduce code duplication.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 8b6d6119ad7fd983d192f60c4960fb6a9197d995)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-vdpa.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index e208dd000e..23ae5ef48b 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -884,10 +884,12 @@ static int vhost_vdpa_svq_set_fds(struct vhost_dev *dev,
/**
* Unmap a SVQ area in the device
*/
-static void vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v,
- const DMAMap *needle)
+static void vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v, hwaddr addr)
{
- const DMAMap *result = vhost_iova_tree_find_iova(v->iova_tree, needle);
+ const DMAMap needle = {
+ .translated_addr = addr,
+ };
+ const DMAMap *result = vhost_iova_tree_find_iova(v->iova_tree, &needle);
hwaddr size;
int r;
@@ -909,17 +911,14 @@ static void vhost_vdpa_svq_unmap_ring(struct vhost_vdpa *v,
static void vhost_vdpa_svq_unmap_rings(struct vhost_dev *dev,
const VhostShadowVirtqueue *svq)
{
- DMAMap needle = {};
struct vhost_vdpa *v = dev->opaque;
struct vhost_vring_addr svq_addr;
vhost_svq_get_vring_addr(svq, &svq_addr);
- needle.translated_addr = svq_addr.desc_user_addr;
- vhost_vdpa_svq_unmap_ring(v, &needle);
+ vhost_vdpa_svq_unmap_ring(v, svq_addr.desc_user_addr);
- needle.translated_addr = svq_addr.used_user_addr;
- vhost_vdpa_svq_unmap_ring(v, &needle);
+ vhost_vdpa_svq_unmap_ring(v, svq_addr.used_user_addr);
}
/**
@@ -997,7 +996,7 @@ static bool vhost_vdpa_svq_map_rings(struct vhost_dev *dev,
ok = vhost_vdpa_svq_map_ring(v, &device_region, errp);
if (unlikely(!ok)) {
error_prepend(errp, "Cannot create vq device region: ");
- vhost_vdpa_svq_unmap_ring(v, &driver_region);
+ vhost_vdpa_svq_unmap_ring(v, driver_region.translated_addr);
}
addr->used_user_addr = device_region.iova;
--
2.31.1

View File

@ -1,62 +0,0 @@
From a32ab5c3f2156ab098e8914437f1aa00c095450e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:32 +0200
Subject: [PATCH 14/29] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [14/25] 579b8389d759ae973552ade34369318e8c50aa90 (redhat/centos-stream/src/qemu-kvm)
Next patches will add a new info callback to restore NIC status through
CVQ. Since only the CVQ vhost device is needed, create it with a new
NetClientInfo.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit f8972b56eeace10a410990f032406250abe18d64)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index a49e7e649d..1a597c2e92 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -334,6 +334,16 @@ static bool vhost_vdpa_net_cvq_map_elem(VhostVDPAState *s,
return true;
}
+static NetClientInfo net_vhost_vdpa_cvq_info = {
+ .type = NET_CLIENT_DRIVER_VHOST_VDPA,
+ .size = sizeof(VhostVDPAState),
+ .receive = vhost_vdpa_receive,
+ .cleanup = vhost_vdpa_cleanup,
+ .has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
+ .has_ufo = vhost_vdpa_has_ufo,
+ .check_peer_type = vhost_vdpa_check_peer_type,
+};
+
/**
* Do not forward commands not supported by SVQ. Otherwise, the device could
* accept it and qemu would not know how to update the device model.
@@ -475,7 +485,7 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,
nc = qemu_new_net_client(&net_vhost_vdpa_info, peer, device,
name);
} else {
- nc = qemu_new_net_control_client(&net_vhost_vdpa_info, peer,
+ nc = qemu_new_net_control_client(&net_vhost_vdpa_cvq_info, peer,
device, name);
}
snprintf(nc->info_str, sizeof(nc->info_str), TYPE_VHOST_VDPA);
--
2.31.1

View File

@ -1,83 +0,0 @@
From 8b85c33c0efb0c6f2dc3705ee83082438db9d397 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:03 +0200
Subject: [PATCH 02/29] vdpa: do not save failed dma maps in SVQ iova tree
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [2/25] fc285fecfd400702f81345cef445f5218bcbacad (redhat/centos-stream/src/qemu-kvm)
If a map fails for whatever reason, it must not be saved in the tree.
Otherwise, qemu will try to unmap it in cleanup, leaving to more errors.
Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ")
Reported-by: Lei Yang <leiyang@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 7dab70bec397e3522211e7bcc36d879bad8154c5)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-vdpa.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 983d3697b0..7e28d2f674 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -176,6 +176,7 @@ static void vhost_vdpa_listener_commit(MemoryListener *listener)
static void vhost_vdpa_listener_region_add(MemoryListener *listener,
MemoryRegionSection *section)
{
+ DMAMap mem_region = {};
struct vhost_vdpa *v = container_of(listener, struct vhost_vdpa, listener);
hwaddr iova;
Int128 llend, llsize;
@@ -212,13 +213,13 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener,
llsize = int128_sub(llend, int128_make64(iova));
if (v->shadow_vqs_enabled) {
- DMAMap mem_region = {
- .translated_addr = (hwaddr)(uintptr_t)vaddr,
- .size = int128_get64(llsize) - 1,
- .perm = IOMMU_ACCESS_FLAG(true, section->readonly),
- };
+ int r;
- int r = vhost_iova_tree_map_alloc(v->iova_tree, &mem_region);
+ mem_region.translated_addr = (hwaddr)(uintptr_t)vaddr,
+ mem_region.size = int128_get64(llsize) - 1,
+ mem_region.perm = IOMMU_ACCESS_FLAG(true, section->readonly),
+
+ r = vhost_iova_tree_map_alloc(v->iova_tree, &mem_region);
if (unlikely(r != IOVA_OK)) {
error_report("Can't allocate a mapping (%d)", r);
goto fail;
@@ -232,11 +233,16 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener,
vaddr, section->readonly);
if (ret) {
error_report("vhost vdpa map fail!");
- goto fail;
+ goto fail_map;
}
return;
+fail_map:
+ if (v->shadow_vqs_enabled) {
+ vhost_iova_tree_remove(v->iova_tree, &mem_region);
+ }
+
fail:
/*
* On the initfn path, store the first error in the container so we
--
2.31.1

View File

@ -1,153 +0,0 @@
From 09b86938668bf6111fb6549fcd012f50418a7613 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:34 +0200
Subject: [PATCH 16/29] vdpa: extract vhost_vdpa_net_cvq_add from
vhost_vdpa_net_handle_ctrl_avail
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [16/25] 7d577b06dcd889f836d5bcbaf6a64998fb138543 (redhat/centos-stream/src/qemu-kvm)
So we can reuse it to inject state messages.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
--
v7:
* Remove double free error
v6:
* Do not assume in buffer sent to the device is sizeof(virtio_net_ctrl_ack)
v5:
* Do not use an artificial !NULL VirtQueueElement
* Use only out size instead of iovec dev_buffers for these functions.
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit be4278b65fc1be8fce87e1e7c01bc52602d304eb)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 59 +++++++++++++++++++++++++++++++-----------------
1 file changed, 38 insertions(+), 21 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 452d10ed93..3575bf64ee 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -331,6 +331,38 @@ static void vhost_vdpa_net_cvq_stop(NetClientState *nc)
}
}
+static ssize_t vhost_vdpa_net_cvq_add(VhostVDPAState *s, size_t out_len,
+ size_t in_len)
+{
+ /* Buffers for the device */
+ const struct iovec out = {
+ .iov_base = s->cvq_cmd_out_buffer,
+ .iov_len = out_len,
+ };
+ const struct iovec in = {
+ .iov_base = s->cvq_cmd_in_buffer,
+ .iov_len = sizeof(virtio_net_ctrl_ack),
+ };
+ VhostShadowVirtqueue *svq = g_ptr_array_index(s->vhost_vdpa.shadow_vqs, 0);
+ int r;
+
+ r = vhost_svq_add(svq, &out, 1, &in, 1, NULL);
+ if (unlikely(r != 0)) {
+ if (unlikely(r == -ENOSPC)) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: No space on device queue\n",
+ __func__);
+ }
+ return r;
+ }
+
+ /*
+ * We can poll here since we've had BQL from the time we sent the
+ * descriptor. Also, we need to take the answer before SVQ pulls by itself,
+ * when BQL is released
+ */
+ return vhost_svq_poll(svq);
+}
+
static NetClientInfo net_vhost_vdpa_cvq_info = {
.type = NET_CLIENT_DRIVER_VHOST_VDPA,
.size = sizeof(VhostVDPAState),
@@ -387,23 +419,18 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
void *opaque)
{
VhostVDPAState *s = opaque;
- size_t in_len, dev_written;
+ size_t in_len;
virtio_net_ctrl_ack status = VIRTIO_NET_ERR;
/* Out buffer sent to both the vdpa device and the device model */
struct iovec out = {
.iov_base = s->cvq_cmd_out_buffer,
};
- /* In buffer sent to the device */
- const struct iovec dev_in = {
- .iov_base = s->cvq_cmd_in_buffer,
- .iov_len = sizeof(virtio_net_ctrl_ack),
- };
/* in buffer used for device model */
const struct iovec in = {
.iov_base = &status,
.iov_len = sizeof(status),
};
- int r = -EINVAL;
+ ssize_t dev_written = -EINVAL;
bool ok;
out.iov_len = iov_to_buf(elem->out_sg, elem->out_num, 0,
@@ -414,21 +441,11 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
goto out;
}
- r = vhost_svq_add(svq, &out, 1, &dev_in, 1, elem);
- if (unlikely(r != 0)) {
- if (unlikely(r == -ENOSPC)) {
- qemu_log_mask(LOG_GUEST_ERROR, "%s: No space on device queue\n",
- __func__);
- }
+ dev_written = vhost_vdpa_net_cvq_add(s, out.iov_len, sizeof(status));
+ if (unlikely(dev_written < 0)) {
goto out;
}
- /*
- * We can poll here since we've had BQL from the time we sent the
- * descriptor. Also, we need to take the answer before SVQ pulls by itself,
- * when BQL is released
- */
- dev_written = vhost_svq_poll(svq);
if (unlikely(dev_written < sizeof(status))) {
error_report("Insufficient written data (%zu)", dev_written);
goto out;
@@ -436,7 +453,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadowVirtqueue *svq,
memcpy(&status, s->cvq_cmd_in_buffer, sizeof(status));
if (status != VIRTIO_NET_OK) {
- goto out;
+ return VIRTIO_NET_ERR;
}
status = VIRTIO_NET_ERR;
@@ -453,7 +470,7 @@ out:
}
vhost_svq_push_elem(svq, elem, MIN(in_len, sizeof(status)));
g_free(elem);
- return r;
+ return dev_written < 0 ? dev_written : 0;
}
static const VhostShadowVirtqueueOps vhost_vdpa_net_svq_ops = {
--
2.31.1

View File

@ -1,115 +0,0 @@
From e03f7e670e608e98fa771d3860574b95908ef3a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Thu, 11 Aug 2022 14:12:14 +0200
Subject: [PATCH 21/29] vdpa: extract vhost_vdpa_net_load_mac from
vhost_vdpa_net_load
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [21/25] b4b30be584aab265004648352361f25587e0ed98 (redhat/centos-stream/src/qemu-kvm)
Upstream: Not merged yet
Since there may be many commands we need to issue to load the NIC
state, let's split them in individual functions
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 62 +++++++++++++++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 22 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 535315c1d0..e799e744cd 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -365,12 +365,47 @@ static ssize_t vhost_vdpa_net_cvq_add(VhostVDPAState *s, size_t out_len,
return vhost_svq_poll(svq);
}
+static ssize_t vhost_vdpa_net_load_cmd(VhostVDPAState *s, uint8_t class,
+ uint8_t cmd, const void *data,
+ size_t data_size)
+{
+ const struct virtio_net_ctrl_hdr ctrl = {
+ .class = class,
+ .cmd = cmd,
+ };
+
+ assert(data_size < vhost_vdpa_net_cvq_cmd_page_len() - sizeof(ctrl));
+
+ memcpy(s->cvq_cmd_out_buffer, &ctrl, sizeof(ctrl));
+ memcpy(s->cvq_cmd_out_buffer + sizeof(ctrl), data, data_size);
+
+ return vhost_vdpa_net_cvq_add(s, sizeof(ctrl) + data_size,
+ sizeof(virtio_net_ctrl_ack));
+}
+
+static int vhost_vdpa_net_load_mac(VhostVDPAState *s, const VirtIONet *n)
+{
+ uint64_t features = n->parent_obj.guest_features;
+ if (features & BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR)) {
+ ssize_t dev_written = vhost_vdpa_net_load_cmd(s, VIRTIO_NET_CTRL_MAC,
+ VIRTIO_NET_CTRL_MAC_ADDR_SET,
+ n->mac, sizeof(n->mac));
+ if (unlikely(dev_written < 0)) {
+ return dev_written;
+ }
+
+ return *s->status != VIRTIO_NET_OK;
+ }
+
+ return 0;
+}
+
static int vhost_vdpa_net_load(NetClientState *nc)
{
VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc);
- const struct vhost_vdpa *v = &s->vhost_vdpa;
+ struct vhost_vdpa *v = &s->vhost_vdpa;
const VirtIONet *n;
- uint64_t features;
+ int r;
assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_VDPA);
@@ -379,26 +414,9 @@ static int vhost_vdpa_net_load(NetClientState *nc)
}
n = VIRTIO_NET(v->dev->vdev);
- features = n->parent_obj.guest_features;
- if (features & BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR)) {
- const struct virtio_net_ctrl_hdr ctrl = {
- .class = VIRTIO_NET_CTRL_MAC,
- .cmd = VIRTIO_NET_CTRL_MAC_ADDR_SET,
- };
- char *cursor = s->cvq_cmd_out_buffer;
- ssize_t dev_written;
-
- memcpy(cursor, &ctrl, sizeof(ctrl));
- cursor += sizeof(ctrl);
- memcpy(cursor, n->mac, sizeof(n->mac));
-
- dev_written = vhost_vdpa_net_cvq_add(s, sizeof(ctrl) + sizeof(n->mac),
- sizeof(virtio_net_ctrl_ack));
- if (unlikely(dev_written < 0)) {
- return dev_written;
- }
-
- return *s->status != VIRTIO_NET_OK;
+ r = vhost_vdpa_net_load_mac(s, n);
+ if (unlikely(r < 0)) {
+ return r;
}
return 0;
--
2.31.1

View File

@ -1,50 +0,0 @@
From b4a0334826d5b28dd8f63edaa606cc123b60a538 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Thu, 11 Aug 2022 14:53:10 +0200
Subject: [PATCH 23/29] vdpa: validate MQ CVQ commands
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [23/25] b727a8bba49a364c6c9afe3d7bfcc70e3ee942f4 (redhat/centos-stream/src/qemu-kvm)
Upstream: Not merged yet
So we are sure we can update the device model properly before sending to
the device.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
net/vhost-vdpa.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 3950e4f25d..c6cbe2fb5c 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -486,6 +486,15 @@ static bool vhost_vdpa_net_cvq_validate_cmd(const void *out_buf, size_t len)
__func__, ctrl.cmd);
};
break;
+ case VIRTIO_NET_CTRL_MQ:
+ switch (ctrl.cmd) {
+ case VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET:
+ return true;
+ default:
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid mq cmd %u\n",
+ __func__, ctrl.cmd);
+ };
+ break;
default:
qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid control class %u\n",
__func__, ctrl.class);
--
2.31.1

View File

@ -1,67 +0,0 @@
From 88ea456e00f5af59417ef2c397adfea4cf9c685e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:20:07 +0200
Subject: [PATCH 06/29] vhost: Always store new kick fd on
vhost_svq_set_svq_kick_fd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [6/25] 1c2ec6d321446505b9f9d0cc0cf0d812cfddd959 (redhat/centos-stream/src/qemu-kvm)
We can unbind twice a file descriptor if we call twice
vhost_svq_set_svq_kick_fd because of this. Since it comes from vhost and
not from SVQ, that file descriptor could be a different thing that
guest's vhost notifier.
Likewise, it can happens the same if a guest start and stop the device
multiple times.
Reported-by: Lei Yang <leiyang@redhat.com>
Fixes: dff4426fa6 ("vhost: Add Shadow VirtQueue kick forwarding capabilities")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 8b64e486423b09db4463799727bf1fad62fe496a)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index e4956728dd..82a784d250 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -602,13 +602,13 @@ void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd)
event_notifier_set_handler(svq_kick, NULL);
}
+ event_notifier_init_fd(svq_kick, svq_kick_fd);
/*
* event_notifier_set_handler already checks for guest's notifications if
* they arrive at the new file descriptor in the switch, so there is no
* need to explicitly check for them.
*/
if (poll_start) {
- event_notifier_init_fd(svq_kick, svq_kick_fd);
event_notifier_set(svq_kick);
event_notifier_set_handler(svq_kick, vhost_handle_guest_kick_notifier);
}
@@ -655,7 +655,7 @@ void vhost_svq_start(VhostShadowVirtqueue *svq, VirtIODevice *vdev,
*/
void vhost_svq_stop(VhostShadowVirtqueue *svq)
{
- event_notifier_set_handler(&svq->svq_kick, NULL);
+ vhost_svq_set_svq_kick_fd(svq, VHOST_FILE_UNBIND);
g_autofree VirtQueueElement *next_avail_elem = NULL;
if (!svq->vq) {
--
2.31.1

View File

@ -1,47 +0,0 @@
From 878a37760e34b54a3d92569f44b0b2f073bfa46a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:28 +0200
Subject: [PATCH 10/29] vhost: Delete useless read memory barrier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [10/25] 13fb2b317093323caf33a17f9de00a94a862ca2e (redhat/centos-stream/src/qemu-kvm)
As discussed in previous series [1], this memory barrier is useless with
the atomic read of used idx at vhost_svq_more_used. Deleting it.
[1] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02616.html
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 9e193cec5db949e4001070442a2f7de7042ef09b)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index b35aeef4bd..8df5296f24 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -509,9 +509,6 @@ size_t vhost_svq_poll(VhostShadowVirtqueue *svq)
if (unlikely(g_get_monotonic_time() - start_us > 10e6)) {
return 0;
}
-
- /* Make sure we read new used_idx */
- smp_rmb();
} while (true);
}
--
2.31.1

View File

@ -1,63 +0,0 @@
From 39659fb33b282188f005ba26bd2c40ce8b7a173c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:29 +0200
Subject: [PATCH 11/29] vhost: Do not depend on !NULL VirtQueueElement on
vhost_svq_flush
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [11/25] 2fec9b6bb72cf8ef42d08a28df3dc8b540f6f43f (redhat/centos-stream/src/qemu-kvm)
Since QEMU will be able to inject new elements on CVQ to restore the
state, we need not to depend on a VirtQueueElement to know if a new
element has been used by the device or not. Instead of check that, check
if there are new elements only using used idx on vhost_svq_flush.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit d368c0b052ad95d3bf4fcc5a5d25715a35c91d4b)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index 8df5296f24..e8e5bbc368 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -499,17 +499,20 @@ static void vhost_svq_flush(VhostShadowVirtqueue *svq,
size_t vhost_svq_poll(VhostShadowVirtqueue *svq)
{
int64_t start_us = g_get_monotonic_time();
+ uint32_t len;
+
do {
- uint32_t len;
- VirtQueueElement *elem = vhost_svq_get_buf(svq, &len);
- if (elem) {
- return len;
+ if (vhost_svq_more_used(svq)) {
+ break;
}
if (unlikely(g_get_monotonic_time() - start_us > 10e6)) {
return 0;
}
} while (true);
+
+ vhost_svq_get_buf(svq, &len);
+ return len;
}
/**
--
2.31.1

View File

@ -1,80 +0,0 @@
From 33c22dd3353f79a037f2473a69176932ac1a1c05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:26 +0200
Subject: [PATCH 08/29] vhost: stop transfer elem ownership in
vhost_handle_guest_kick
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [8/25] e9c6314fddeb1f7bc738efea90f2788cae27bab7 (redhat/centos-stream/src/qemu-kvm)
It was easier to allow vhost_svq_add to handle the memory. Now that we
will allow qemu to add elements to a SVQ without the guest's knowledge,
it's better to handle it in the caller.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 9c2ab2f1ec333be8614cc12272d4b91960704dbe)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index 82a784d250..a1261d4a0f 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -233,9 +233,6 @@ static void vhost_svq_kick(VhostShadowVirtqueue *svq)
/**
* Add an element to a SVQ.
*
- * The caller must check that there is enough slots for the new element. It
- * takes ownership of the element: In case of failure not ENOSPC, it is free.
- *
* Return -EINVAL if element is invalid, -ENOSPC if dev queue is full
*/
int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg,
@@ -252,7 +249,6 @@ int vhost_svq_add(VhostShadowVirtqueue *svq, const struct iovec *out_sg,
ok = vhost_svq_add_split(svq, out_sg, out_num, in_sg, in_num, &qemu_head);
if (unlikely(!ok)) {
- g_free(elem);
return -EINVAL;
}
@@ -293,7 +289,7 @@ static void vhost_handle_guest_kick(VhostShadowVirtqueue *svq)
virtio_queue_set_notification(svq->vq, false);
while (true) {
- VirtQueueElement *elem;
+ g_autofree VirtQueueElement *elem;
int r;
if (svq->next_guest_avail_elem) {
@@ -324,12 +320,14 @@ static void vhost_handle_guest_kick(VhostShadowVirtqueue *svq)
* queue the current guest descriptor and ignore kicks
* until some elements are used.
*/
- svq->next_guest_avail_elem = elem;
+ svq->next_guest_avail_elem = g_steal_pointer(&elem);
}
/* VQ is full or broken, just return and ignore kicks */
return;
}
+ /* elem belongs to SVQ or external caller now */
+ elem = NULL;
}
virtio_queue_set_notification(svq->vq, true);
--
2.31.1

View File

@ -1,55 +0,0 @@
From cf08dbe33683a66a79ec07b8450f9d3d27cff1c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:27 +0200
Subject: [PATCH 09/29] vhost: use SVQ element ndescs instead of opaque data
for desc validation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [9/25] 071eb2a0db612d516d630a15a1f0fd908ed86fd3 (redhat/centos-stream/src/qemu-kvm)
Since we're going to allow SVQ to add elements without the guest's
knowledge and without its own VirtQueueElement, it's easier to check if
an element is a valid head checking a different thing than the
VirtQueueElement.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 86f5f2546f03a3dfde421c715187b262e29b2848)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index a1261d4a0f..b35aeef4bd 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -414,7 +414,7 @@ static VirtQueueElement *vhost_svq_get_buf(VhostShadowVirtqueue *svq,
return NULL;
}
- if (unlikely(!svq->desc_state[used_elem.id].elem)) {
+ if (unlikely(!svq->desc_state[used_elem.id].ndescs)) {
qemu_log_mask(LOG_GUEST_ERROR,
"Device %s says index %u is used, but it was not available",
svq->vdev->name, used_elem.id);
@@ -422,6 +422,7 @@ static VirtQueueElement *vhost_svq_get_buf(VhostShadowVirtqueue *svq,
}
num = svq->desc_state[used_elem.id].ndescs;
+ svq->desc_state[used_elem.id].ndescs = 0;
last_used_chain = vhost_svq_last_desc_of_chain(svq, num, used_elem.id);
svq->desc_next[last_used_chain] = svq->free_head;
svq->free_head = used_elem.id;
--
2.31.1

View File

@ -1,73 +0,0 @@
From 0db23ec6808c3ff628d1b1940d2cd01fda0757d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:30 +0200
Subject: [PATCH 12/29] vhost_net: Add NetClientInfo start callback
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [12/25] b448657fa858a885879986059694d26d870155bc (redhat/centos-stream/src/qemu-kvm)
This is used by the backend to perform actions before the device is
started.
In particular, vdpa net use it to map CVQ buffers to the device, so it
can send control commands using them.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit eb92b75380fc0f2368e22be45d1e2d1e2cd2f79c)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/net/vhost_net.c | 7 +++++++
include/net/net.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index ccac5b7a64..2e0baeba26 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -244,6 +244,13 @@ static int vhost_net_start_one(struct vhost_net *net,
struct vhost_vring_file file = { };
int r;
+ if (net->nc->info->start) {
+ r = net->nc->info->start(net->nc);
+ if (r < 0) {
+ return r;
+ }
+ }
+
r = vhost_dev_enable_notifiers(&net->dev, dev);
if (r < 0) {
goto fail_notifiers;
diff --git a/include/net/net.h b/include/net/net.h
index 523136c7ac..ad9e80083a 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -44,6 +44,7 @@ typedef struct NICConf {
typedef void (NetPoll)(NetClientState *, bool enable);
typedef bool (NetCanReceive)(NetClientState *);
+typedef int (NetStart)(NetClientState *);
typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
typedef void (NetCleanup) (NetClientState *);
@@ -71,6 +72,7 @@ typedef struct NetClientInfo {
NetReceive *receive_raw;
NetReceiveIOV *receive_iov;
NetCanReceive *can_receive;
+ NetStart *start;
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
QueryRxFilter *query_rx_filter;
--
2.31.1

View File

@ -1,68 +0,0 @@
From cc3e96b81280fe45a34a26586718079072dbcf39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:31 +0200
Subject: [PATCH 13/29] vhost_net: Add NetClientInfo stop callback
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [13/25] cb90c1228e9af493def4818ea3b49e2b0cfae456 (redhat/centos-stream/src/qemu-kvm)
Used by the backend to perform actions after the device is stopped.
In particular, vdpa net use it to unmap CVQ buffers to the device,
cleaning the actions performed in prepare().
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit c5e5269d8a955a0f924218911c2f4a0b34e87a21)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/net/vhost_net.c | 3 +++
include/net/net.h | 2 ++
2 files changed, 5 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 2e0baeba26..9d4b334453 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -320,6 +320,9 @@ static void vhost_net_stop_one(struct vhost_net *net,
net->nc->info->poll(net->nc, true);
}
vhost_dev_stop(&net->dev, dev);
+ if (net->nc->info->stop) {
+ net->nc->info->stop(net->nc);
+ }
vhost_dev_disable_notifiers(&net->dev, dev);
}
diff --git a/include/net/net.h b/include/net/net.h
index ad9e80083a..476ad45b9a 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -45,6 +45,7 @@ typedef struct NICConf {
typedef void (NetPoll)(NetClientState *, bool enable);
typedef bool (NetCanReceive)(NetClientState *);
typedef int (NetStart)(NetClientState *);
+typedef void (NetStop)(NetClientState *);
typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
typedef void (NetCleanup) (NetClientState *);
@@ -73,6 +74,7 @@ typedef struct NetClientInfo {
NetReceiveIOV *receive_iov;
NetCanReceive *can_receive;
NetStart *start;
+ NetStop *stop;
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
QueryRxFilter *query_rx_filter;
--
2.31.1

View File

@ -1,73 +0,0 @@
From d91546b3bc3dd147b6327a4d8c5b523104a09aa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 23 Aug 2022 20:30:35 +0200
Subject: [PATCH 17/29] vhost_net: add NetClientState->load() callback
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [17/25] de71f2e8fc7b25f5197101703fbb5ff054ada984 (redhat/centos-stream/src/qemu-kvm)
It allows per-net client operations right after device's successful
start. In particular, to load the device status.
Vhost-vdpa net will use it to add the CVQ buffers to restore the device
status.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 539573c317dc0b8d50a128db60550f2f2898d2fc)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/net/vhost_net.c | 7 +++++++
include/net/net.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 9d4b334453..d28f8b974b 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -281,6 +281,13 @@ static int vhost_net_start_one(struct vhost_net *net,
}
}
}
+
+ if (net->nc->info->load) {
+ r = net->nc->info->load(net->nc);
+ if (r < 0) {
+ goto fail;
+ }
+ }
return 0;
fail:
file.fd = -1;
diff --git a/include/net/net.h b/include/net/net.h
index 476ad45b9a..81d0b21def 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -45,6 +45,7 @@ typedef struct NICConf {
typedef void (NetPoll)(NetClientState *, bool enable);
typedef bool (NetCanReceive)(NetClientState *);
typedef int (NetStart)(NetClientState *);
+typedef int (NetLoad)(NetClientState *);
typedef void (NetStop)(NetClientState *);
typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
@@ -74,6 +75,7 @@ typedef struct NetClientInfo {
NetReceiveIOV *receive_iov;
NetCanReceive *can_receive;
NetStart *start;
+ NetLoad *load;
NetStop *stop;
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
--
2.31.1

View File

@ -1,61 +0,0 @@
From 9e23182c5249f876e56ef9a31b22476b5268f246 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Thu, 11 Aug 2022 16:40:07 +0200
Subject: [PATCH 24/29] virtio-net: Update virtio-net curr_queue_pairs in vdpa
backends
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Laurent Vivier <lvivier@redhat.com>
RH-MergeRequest: 117: vDPA SVQ Multiqueue support
RH-Jira: RHELX-57
RH-Acked-by: Jason Wang <jasowang@redhat.com>
RH-Acked-by: Cindy Lu <lulu@redhat.com>
RH-Acked-by: Eugenio Pérez <eperezma@redhat.com>
RH-Commit: [24/25] e0e6978394d6496a7e12cf8424b2e9cb87281a90 (redhat/centos-stream/src/qemu-kvm)
Upstream: Not merged yet
It was returned as error before. Instead of it, simply update the
corresponding field so qemu can send it in the migration data.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/net/virtio-net.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index dd0d056fde..63a8332cd0 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1412,19 +1412,14 @@ static int virtio_net_handle_mq(VirtIONet *n, uint8_t cmd,
return VIRTIO_NET_ERR;
}
- /* Avoid changing the number of queue_pairs for vdpa device in
- * userspace handler. A future fix is needed to handle the mq
- * change in userspace handler with vhost-vdpa. Let's disable
- * the mq handling from userspace for now and only allow get
- * done through the kernel. Ripples may be seen when falling
- * back to userspace, but without doing it qemu process would
- * crash on a recursive entry to virtio_net_set_status().
- */
+ n->curr_queue_pairs = queue_pairs;
if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
- return VIRTIO_NET_ERR;
+ /*
+ * Avoid updating the backend for a vdpa device: We're only interested
+ * in updating the device model queues.
+ */
+ return VIRTIO_NET_OK;
}
-
- n->curr_queue_pairs = queue_pairs;
/* stop the backend before changing the number of queue_pairs to avoid handling a
* disabled queue */
virtio_net_set_status(vdev, vdev->status);
--
2.31.1

View File

@ -1,7 +1,7 @@
%global libfdt_version 1.6.0 %global libfdt_version 1.6.0
%global libseccomp_version 2.4.0 %global libseccomp_version 2.4.0
%global libusbx_version 1.0.23 %global libusbx_version 1.0.23
%global meson_version 0.58.2 %global meson_version 0.61.3
%global usbredir_version 0.7.1 %global usbredir_version 0.7.1
%global ipxe_version 20200823-5.git4bd064de %global ipxe_version 20200823-5.git4bd064de
@ -113,16 +113,13 @@ Requires: %{name}-ui-opengl = %{epoch}:%{version}-%{release} \
Requires: %{name}-ui-egl-headless = %{epoch}:%{version}-%{release} \ Requires: %{name}-ui-egl-headless = %{epoch}:%{version}-%{release} \
%endif \ %endif \
Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} \ Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} \
Requires: %{name}-device-display-virtio-gpu-gl = %{epoch}:%{version}-%{release} \
%ifarch s390x \ %ifarch s390x \
Requires: %{name}-device-display-virtio-gpu-ccw = %{epoch}:%{version}-%{release} \ Requires: %{name}-device-display-virtio-gpu-ccw = %{epoch}:%{version}-%{release} \
%else \ %else \
Requires: %{name}-device-display-virtio-gpu-pci = %{epoch}:%{version}-%{release} \ Requires: %{name}-device-display-virtio-gpu-pci = %{epoch}:%{version}-%{release} \
Requires: %{name}-device-display-virtio-gpu-pci-gl = %{epoch}:%{version}-%{release} \
%endif \ %endif \
%ifarch x86_64 %{power64} \ %ifarch x86_64 %{power64} \
Requires: %{name}-device-display-virtio-vga = %{epoch}:%{version}-%{release} \ Requires: %{name}-device-display-virtio-vga = %{epoch}:%{version}-%{release} \
Requires: %{name}-device-display-virtio-vga-gl = %{epoch}:%{version}-%{release} \
%endif \ %endif \
Requires: %{name}-device-usb-host = %{epoch}:%{version}-%{release} \ Requires: %{name}-device-usb-host = %{epoch}:%{version}-%{release} \
%if %{have_usbredir} \ %if %{have_usbredir} \
@ -150,8 +147,8 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \
Summary: QEMU is a machine emulator and virtualizer Summary: QEMU is a machine emulator and virtualizer
Name: qemu-kvm Name: qemu-kvm
Version: 7.1.0 Version: 7.2.0
Release: 7%{?rcrel}%{?dist}%{?cc_suffix} Release: 1%{?rcrel}%{?dist}%{?cc_suffix}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
# Epoch 15 used for RHEL 8 # Epoch 15 used for RHEL 8
# Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5) # Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5)
@ -177,92 +174,23 @@ Source36: README.tests
Patch0004: 0004-Initial-redhat-build.patch Patch0004: 0004-Initial-redhat-build.patch
Patch0005: 0005-Re-enable-capstone-internal-build.patch Patch0005: 0005-Enable-disable-devices-for-RHEL.patch
Patch0006: 0006-Enable-disable-devices-for-RHEL.patch Patch0006: 0006-Machine-type-related-general-changes.patch
Patch0007: 0007-Machine-type-related-general-changes.patch Patch0007: 0007-Add-aarch64-machine-types.patch
Patch0008: 0008-Add-aarch64-machine-types.patch Patch0008: 0008-Add-ppc64-machine-types.patch
Patch0009: 0009-Add-ppc64-machine-types.patch Patch0009: 0009-Add-s390x-machine-types.patch
Patch0010: 0010-Add-s390x-machine-types.patch Patch0010: 0010-Add-x86_64-machine-types.patch
Patch0011: 0011-Add-x86_64-machine-types.patch Patch0011: 0011-Enable-make-check.patch
Patch0012: 0012-Enable-make-check.patch Patch0012: 0012-vfio-cap-number-of-devices-that-can-be-assigned.patch
Patch0013: 0013-vfio-cap-number-of-devices-that-can-be-assigned.patch Patch0013: 0013-Add-support-statement-to-help-output.patch
Patch0014: 0014-Add-support-statement-to-help-output.patch Patch0014: 0014-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch
Patch0015: 0015-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch Patch0015: 0015-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch
Patch0016: 0016-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch Patch0016: 0016-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch
Patch0017: 0017-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch Patch0018: 0018-Addd-7.2-compat-bits-for-RHEL-9.1-machine-type.patch
Patch0018: 0018-Introduce-upstream-7.0-compat-changes.patch Patch0019: 0019-redhat-Update-s390x-machine-type-compatibility-for-Q.patch
# For RHELX-57 - vDPA SVQ Multiqueue support Patch0020: 0020-redhat-aarch64-add-rhel9.2.0-virt-machine-type.patch
Patch19: kvm-vdpa-Skip-the-maps-not-in-the-iova-tree.patch Patch0021: 0021-redhat-Add-new-rhel-9.2.0-s390x-machine-type.patch
# For RHELX-57 - vDPA SVQ Multiqueue support Patch0022: 0022-x86-rhel-9.2.0-machine-type.patch
Patch20: kvm-vdpa-do-not-save-failed-dma-maps-in-SVQ-iova-tree.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch21: kvm-util-accept-iova_tree_remove_parameter-by-value.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch22: kvm-vdpa-Remove-SVQ-vring-from-iova_tree-at-shutdown.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch23: kvm-vdpa-Make-SVQ-vring-unmapping-return-void.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch24: kvm-vhost-Always-store-new-kick-fd-on-vhost_svq_set_svq_.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch25: kvm-vdpa-Use-ring-hwaddr-at-vhost_vdpa_svq_unmap_ring.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch26: kvm-vhost-stop-transfer-elem-ownership-in-vhost_handle_g.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch27: kvm-vhost-use-SVQ-element-ndescs-instead-of-opaque-data-.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch28: kvm-vhost-Delete-useless-read-memory-barrier.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch29: kvm-vhost-Do-not-depend-on-NULL-VirtQueueElement-on-vhos.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch30: kvm-vhost_net-Add-NetClientInfo-start-callback.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch31: kvm-vhost_net-Add-NetClientInfo-stop-callback.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch32: kvm-vdpa-add-net_vhost_vdpa_cvq_info-NetClientInfo.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch33: kvm-vdpa-Move-command-buffers-map-to-start-of-net-device.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch34: kvm-vdpa-extract-vhost_vdpa_net_cvq_add-from-vhost_vdpa_.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch35: kvm-vhost_net-add-NetClientState-load-callback.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch36: kvm-vdpa-Add-virtio-net-mac-address-via-CVQ-at-start.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch37: kvm-vdpa-Delete-CVQ-migration-blocker.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch38: kvm-vdpa-Make-VhostVDPAState-cvq_cmd_in_buffer-control-a.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch39: kvm-vdpa-extract-vhost_vdpa_net_load_mac-from-vhost_vdpa.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch40: kvm-vdpa-Add-vhost_vdpa_net_load_mq.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch41: kvm-vdpa-validate-MQ-CVQ-commands.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch42: kvm-virtio-net-Update-virtio-net-curr_queue_pairs-in-vdp.patch
# For RHELX-57 - vDPA SVQ Multiqueue support
Patch43: kvm-vdpa-Allow-MQ-feature-in-SVQ.patch
# For bz#2125281 - [RHEL9.1] Guests in VMX root operation fail to reboot with QEMU's 'system_reset' command [rhel-9.2.0]
Patch44: kvm-i386-reset-KVM-nested-state-upon-CPU-reset.patch
# For bz#2125281 - [RHEL9.1] Guests in VMX root operation fail to reboot with QEMU's 'system_reset' command [rhel-9.2.0]
Patch45: kvm-i386-do-kvm_put_msr_feature_control-first-thing-when.patch
# For bz#2127825 - Use capstone for qemu-kvm build
Patch46: kvm-Revert-Re-enable-capstone-internal-build.patch
# For bz#2108531 - Windows guest reboot after migration with wsl2 installed inside
Patch47: kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch
# For bz#2126095 - [rhel9.2][intel_iommu]Booting guest with "-device intel-iommu,intremap=on,device-iotlb=on,caching-mode=on" causes kernel call trace
Patch48: kvm-Revert-intel_iommu-Fix-irqchip-X2APIC-configuration-.patch
# For bz#2141218 - qemu-kvm build fails with clang 15.0.1 due to false unused variable error
Patch49: kvm-rtl8139-Remove-unused-variable.patch
# For bz#2141218 - qemu-kvm build fails with clang 15.0.1 due to false unused variable error
Patch50: kvm-qemu-img-remove-unused-variable.patch
# For bz#2141218 - qemu-kvm build fails with clang 15.0.1 due to false unused variable error
Patch51: kvm-host-libusb-Remove-unused-variable.patch
# For bz#2143170 - The installation can not start when install files (iso) locate on a 4k disk
Patch52: kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch
# For bz#2143170 - The installation can not start when install files (iso) locate on a 4k disk
Patch53: kvm-block-use-the-request-length-for-iov-alignment.patch
# For bz#2149108 - CVE-2022-4172 qemu-kvm: QEMU: ACPI ERST: memory corruption issues in read_erst_record and write_erst_record [rhel-9]
Patch54: kvm-hw-acpi-erst.c-Fix-memory-handling-issues.patch
%if %{have_clang} %if %{have_clang}
BuildRequires: clang BuildRequires: clang
@ -361,10 +289,10 @@ Requires: edk2-ovmf
%ifarch aarch64 %ifarch aarch64
Requires: edk2-aarch64 Requires: edk2-aarch64
%endif %endif
Requires: capstone
Requires: libseccomp >= %{libseccomp_version} Requires: libseccomp >= %{libseccomp_version}
Requires: libusbx >= %{libusbx_version} Requires: libusbx >= %{libusbx_version}
Requires: capstone
%if %{have_fdt} %if %{have_fdt}
Requires: libfdt >= %{libfdt_version} Requires: libfdt >= %{libfdt_version}
%endif %endif
@ -515,30 +443,20 @@ Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
%description device-display-virtio-gpu %description device-display-virtio-gpu
This package provides the virtio-gpu display device for QEMU. This package provides the virtio-gpu display device for QEMU.
%package device-display-virtio-gpu-gl
Summary: QEMU virtio-gpu-gl display device
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
%description device-display-virtio-gpu-gl
This package provides the virtio-gpu-gl display device for QEMU.
%ifarch s390x %ifarch s390x
%package device-display-virtio-gpu-ccw %package device-display-virtio-gpu-ccw
Summary: QEMU virtio-gpu-ccw display device Summary: QEMU virtio-gpu-ccw display device
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release}
%description device-display-virtio-gpu-ccw %description device-display-virtio-gpu-ccw
This package provides the virtio-gpu-ccw display device for QEMU. This package provides the virtio-gpu-ccw display device for QEMU.
%else %else
%package device-display-virtio-gpu-pci %package device-display-virtio-gpu-pci
Summary: QEMU virtio-gpu-pci display device Summary: QEMU virtio-gpu-pci display device
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release}
%description device-display-virtio-gpu-pci %description device-display-virtio-gpu-pci
This package provides the virtio-gpu-pci display device for QEMU. This package provides the virtio-gpu-pci display device for QEMU.
%package device-display-virtio-gpu-pci-gl
Summary: QEMU virtio-gpu-pci-gl display device
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
%description device-display-virtio-gpu-pci-gl
This package provides the virtio-gpu-pci-gl display device for QEMU.
%endif %endif
%ifarch x86_64 %{power64} %ifarch x86_64 %{power64}
@ -547,12 +465,6 @@ Summary: QEMU virtio-vga display device
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
%description device-display-virtio-vga %description device-display-virtio-vga
This package provides the virtio-vga display device for QEMU. This package provides the virtio-vga display device for QEMU.
%package device-display-virtio-vga-gl
Summary: QEMU virtio-vga-gl display device
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
%description device-display-virtio-vga-gl
This package provides the virtio-vga-gl display device for QEMU.
%endif %endif
%package device-usb-host %package device-usb-host
@ -589,6 +501,7 @@ mkdir -p %{qemu_kvm_build}
--disable-auth-pam \\\ --disable-auth-pam \\\
--disable-avx2 \\\ --disable-avx2 \\\
--disable-avx512f \\\ --disable-avx512f \\\
--disable-blkio \\\
--disable-block-drv-whitelist-in-tools \\\ --disable-block-drv-whitelist-in-tools \\\
--disable-bochs \\\ --disable-bochs \\\
--disable-bpf \\\ --disable-bpf \\\
@ -678,6 +591,7 @@ mkdir -p %{qemu_kvm_build}
--disable-slirp-smbd \\\ --disable-slirp-smbd \\\
--disable-smartcard \\\ --disable-smartcard \\\
--disable-snappy \\\ --disable-snappy \\\
--disable-sndio \\\
--disable-sparse \\\ --disable-sparse \\\
--disable-spice \\\ --disable-spice \\\
--disable-spice-protocol \\\ --disable-spice-protocol \\\
@ -733,7 +647,7 @@ run_configure() {
--with-pkgversion="%{name}-%{version}-%{release}" \ --with-pkgversion="%{name}-%{version}-%{release}" \
--with-suffix="%{name}" \ --with-suffix="%{name}" \
--firmwarepath=%{firmwaredirs} \ --firmwarepath=%{firmwaredirs} \
--meson="internal" \ --meson="%{__meson}" \
--enable-trace-backend=dtrace \ --enable-trace-backend=dtrace \
--with-coroutine=ucontext \ --with-coroutine=ucontext \
--with-git=git \ --with-git=git \
@ -800,7 +714,7 @@ run_configure \
%endif %endif
--enable-seccomp \ --enable-seccomp \
--enable-selinux \ --enable-selinux \
--enable-slirp=system \ --enable-slirp \
--enable-snappy \ --enable-snappy \
--enable-spice-protocol \ --enable-spice-protocol \
--enable-system \ --enable-system \
@ -1085,6 +999,16 @@ install -D -m 0644 %{_sourcedir}/bridge.conf %{buildroot}%{_sysconfdir}/%{name}/
install -m 0644 contrib/systemd/qemu-pr-helper.service %{buildroot}%{_unitdir} install -m 0644 contrib/systemd/qemu-pr-helper.service %{buildroot}%{_unitdir}
install -m 0644 contrib/systemd/qemu-pr-helper.socket %{buildroot}%{_unitdir} install -m 0644 contrib/systemd/qemu-pr-helper.socket %{buildroot}%{_unitdir}
# We do not support gl display devices so we can remove their modules as they
# do not have expected functionality included.
#
# https://gitlab.com/qemu-project/qemu/-/issues/1352 was filed to stop building these
# modules in case all dependencies are not satisfied.
rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-gpu-gl.so
rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-gpu-pci-gl.so
rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-vga-gl.so
# We need to make the block device modules and other qemu SO files executable # We need to make the block device modules and other qemu SO files executable
# otherwise RPM won't pick up their dependencies. # otherwise RPM won't pick up their dependencies.
chmod +x %{buildroot}%{_libdir}/%{name}/*.so chmod +x %{buildroot}%{_libdir}/%{name}/*.so
@ -1242,25 +1166,17 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%files device-display-virtio-gpu %files device-display-virtio-gpu
%{_libdir}/%{name}/hw-display-virtio-gpu.so %{_libdir}/%{name}/hw-display-virtio-gpu.so
%files device-display-virtio-gpu-gl
%{_libdir}/%{name}/hw-display-virtio-gpu-gl.so
%ifarch s390x %ifarch s390x
%files device-display-virtio-gpu-ccw %files device-display-virtio-gpu-ccw
%{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so %{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so
%else %else
%files device-display-virtio-gpu-pci %files device-display-virtio-gpu-pci
%{_libdir}/%{name}/hw-display-virtio-gpu-pci.so %{_libdir}/%{name}/hw-display-virtio-gpu-pci.so
%files device-display-virtio-gpu-pci-gl
%{_libdir}/%{name}/hw-display-virtio-gpu-pci-gl.so
%endif %endif
%ifarch x86_64 %{power64} %ifarch x86_64 %{power64}
%files device-display-virtio-vga %files device-display-virtio-vga
%{_libdir}/%{name}/hw-display-virtio-vga.so %{_libdir}/%{name}/hw-display-virtio-vga.so
%files device-display-virtio-vga-gl
%{_libdir}/%{name}/hw-display-virtio-vga-gl.so
%endif %endif
%files tests %files tests
@ -1295,6 +1211,11 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%endif %endif
%changelog %changelog
* Thu Dec 15 2022 Miroslav Rezanina <mrezanin@redhat.com> - 7.2.0-1
- Rebase to QEMU 7.2.0 [bz#2135806]
- Resolves: bz#2135806
(Rebase to QEMU 7.2 for RHEL 9.2.0)
* Wed Dec 14 2022 Jon Maloy <jmaloy@redhat.com> - 7.1.0-7 * Wed Dec 14 2022 Jon Maloy <jmaloy@redhat.com> - 7.1.0-7
- kvm-hw-acpi-erst.c-Fix-memory-handling-issues.patch [bz#2149108] - kvm-hw-acpi-erst.c-Fix-memory-handling-issues.patch [bz#2149108]
- Resolves: bz#2149108 - Resolves: bz#2149108

View File

@ -1 +1 @@
SHA512 (qemu-7.1.0.tar.xz) = c60c5ff8ec99b7552e485768908920658fdd8035ff7a6fa370fb6881957dc8b7e5f18ff1a8f49bd6aa22909ede2a7c084986d8244f12074ccd33ebe40a0c411f SHA512 (qemu-7.2.0.tar.xz) = f3cfa00da739ba819a218d7e6e95c77fb79a8e0f487b024ddd281602e785249b81144595e3f8c746c32a4f5c4d1a88c6aebae3c162603edfbb50ae3722d7ed13