Rebase to qemu-4.0.0

This is the rebase to qemu-kvm-4.0.0, based on qemu-kvm-3.1.0-23 commits
This commit is contained in:
Danilo C. L. de Paula 2019-05-07 18:00:36 -03:00
parent c82fe81190
commit 837556b8d0
80 changed files with 2142 additions and 8614 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/qemu-3.1.0.tar.xz
/qemu-4.0.0.tar.xz

View File

@ -1,4 +1,4 @@
From 8ff84e7f181aa0f64b3b6178d9ac808c61f5bec8 Mon Sep 17 00:00:00 2001
From 223a694c9878013afa2ae9024cb35fbc3a334174 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 12 Oct 2018 07:31:11 +0200
Subject: Initial redhat build
@ -13,35 +13,57 @@ several issues are fixed in QEMU tree:
- Use "/share/qemu-kvm" as SHARE_SUFFIX
- We reconfigured our share to qemu-kvm to be consistent with used name
This rebase includes changes up to qemu-kvm-2.12.0-47.el8
This rebase includes changes up to qemu-kvm-3.1.0-23.el8
Rebase notes (3.1.0):
- added new configure options
Rebase notes (4.0.0):
- Added dependency to perl-Test-Harness (upstream)
- Added dependency to python3-sphinx (upstream)
- Change location of icons (upstream)
- Remove .desktop file (added upstream)
- Added qemu-trace-stap (added upstream)
- Removed elf2dmp (added upstream)
- Remove .buildinfo
- Added pvh.bin rom (added upstream)
- Added interop documentation files
- Use python module instead of qemu.py (upstream)
Merged patches (3.1.0):
- 01f0c9f RHEL8: Add disable configure options to qemu spec file
- Spec file cleanups
Merged patches (4.0.0):
- aa4297c Add edk2 Requires to qemu-kvm
- d124ff5779 Fixing brew build target
- eb204b5 Introduce the qemu-kvm-tests rpm
- 223cf0c Load kvm module during boot (partial)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
Makefile | 3 +-
block/Makefile.objs | 2 +-
block/vxhs.c | 119 ++-
block/vxhs.c | 119 +-
configure | 33 +-
os-posix.c | 2 +-
redhat/Makefile | 82 ++
redhat/Makefile.common | 49 +
redhat/qemu-kvm.spec.template | 1813 +++++++++++++++++++++++++++++++++++++
redhat/Makefile.common | 51 +
redhat/README.tests | 39 +
redhat/qemu-kvm.spec.template | 2082 +++++++++++++++++++++++++++++
redhat/scripts/process-patches.sh | 7 +-
ui/vnc.c | 2 +-
10 files changed, 2064 insertions(+), 48 deletions(-)
11 files changed, 2374 insertions(+), 48 deletions(-)
create mode 100644 redhat/Makefile
create mode 100644 redhat/Makefile.common
create mode 100644 redhat/README.tests
create mode 100644 redhat/qemu-kvm.spec.template
diff --git a/Makefile b/Makefile
index f294718..152821a 100644
index 04a0d45050..05f62eab3c 100644
--- a/Makefile
+++ b/Makefile
@@ -503,6 +503,7 @@ CAP_CFLAGS += -DCAPSTONE_HAS_ARM
@@ -470,6 +470,7 @@ CAP_CFLAGS += -DCAPSTONE_HAS_ARM
CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
CAP_CFLAGS += -DCAPSTONE_HAS_X86
@ -49,7 +71,7 @@ index f294718..152821a 100644
subdir-capstone: .git-submodule-status
$(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=no BUILDDIR="$(BUILD_DIR)/capstone" CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" CFLAGS="$(CAP_CFLAGS)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/$(LIBCAPSTONE))
@@ -830,7 +831,7 @@ install-doc: $(DOCS)
@@ -749,7 +750,7 @@ install-doc: $(DOCS) install-sphinxdocs
$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
ifdef CONFIG_POSIX
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
@ -59,7 +81,7 @@ index f294718..152821a 100644
$(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
$(INSTALL_DATA) docs/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
diff --git a/block/Makefile.objs b/block/Makefile.objs
index 46d585c..a244100 100644
index 7a81892a52..f4cf03bed9 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -30,7 +30,7 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
@ -72,7 +94,7 @@ index 46d585c..a244100 100644
block-obj-y += accounting.o dirty-bitmap.o
block-obj-y += write-threshold.o
diff --git a/block/vxhs.c b/block/vxhs.c
index 0cb0a00..9164b3e 100644
index 2e18229ba4..3dbb9544bc 100644
--- a/block/vxhs.c
+++ b/block/vxhs.c
@@ -9,7 +9,8 @@
@ -263,10 +285,10 @@ index 0cb0a00..9164b3e 100644
trace_vxhs_get_vdisk_stat_err(s->vdisk_guid, ret, errno);
return -EIO;
diff --git a/configure b/configure
index 0a3c6a7..98b05c5 100755
index 1c563a7027..eb0a0dde86 100755
--- a/configure
+++ b/configure
@@ -3459,7 +3459,7 @@ fi
@@ -3612,7 +3612,7 @@ fi
glib_req_ver=2.40
glib_modules=gthread-2.0
@ -275,10 +297,11 @@ index 0a3c6a7..98b05c5 100755
glib_modules="$glib_modules gmodule-export-2.0"
fi
@@ -5494,33 +5494,6 @@ if compile_prog "" "" ; then
@@ -5755,33 +5755,6 @@ if compile_prog "" "" ; then
have_sysmacros=yes
fi
##########################################
-##########################################
-# Veritas HyperScale block driver VxHS
-# Check if libvxhs is installed
-
@ -305,11 +328,10 @@ index 0a3c6a7..98b05c5 100755
- fi
-fi
-
-##########################################
##########################################
# check for _Static_assert()
have_static_assert=no
@@ -6854,8 +6827,8 @@ if test "$pthread_setname_np" = "yes" ; then
@@ -7218,8 +7191,8 @@ elif test "$pthread_setname_np_wo_tid" = "yes" ; then
fi
if test "$vxhs" = "yes" ; then
@ -321,7 +343,7 @@ index 0a3c6a7..98b05c5 100755
if test "$libpmem" = "yes" ; then
diff --git a/os-posix.c b/os-posix.c
index 4bd80e4..ca13206 100644
index 4bd80e44e6..ca13206b31 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -82,7 +82,7 @@ void os_setup_signal_handling(void)
@ -334,10 +356,10 @@ index 4bd80e4..ca13206 100644
char *os_find_datadir(void)
{
diff --git a/ui/vnc.c b/ui/vnc.c
index 0c1b477..d7903a7 100644
index 1871422e1d..8226524c16 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3962,7 +3962,7 @@ void vnc_display_open(const char *id, Error **errp)
@@ -3982,7 +3982,7 @@ void vnc_display_open(const char *id, Error **errp)
#ifdef CONFIG_VNC_SASL
if (sasl) {
@ -347,5 +369,5 @@ index 0c1b477..d7903a7 100644
if (saslErr != SASL_OK) {
error_setg(errp, "Failed to initialize SASL auth: %s",
--
1.8.3.1
2.20.1

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
From 01e49fb467fd831c62f3640e546e313298a7c5c0 Mon Sep 17 00:00:00 2001
From 4f20f7503073886c51e82fbbdfe78d6c79ea5df7 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 12:36:59 +0200
Date: Fri, 11 Jan 2019 09:54:45 +0100
Subject: Machine type related general changes
This patch is first part of original "Add RHEL machine types" patch we
@ -8,31 +8,40 @@ split to allow easier review. It contains changes not related to any
architecture.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase changes (4.0.0):
- Remove e1000 device duplication changes to reflect upstream solution
- Rewrite machine compat properties to upstream solution
Merged patches (4.0.0):
- d4c0957 compat: Generic HW_COMPAT_RHEL7_6
- cbac773 virtio: Make disable-legacy/disable-modern compat properties optional
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/acpi/ich9.c | 16 +++
hw/acpi/piix4.c | 6 +-
hw/char/serial.c | 16 +++
hw/core/machine.c | 268 ++++++++++++++++++++++++++++++++++++++++
hw/display/vga-isa.c | 2 +-
hw/net/e1000.c | 18 ++-
hw/net/e1000.c | 10 ++
hw/net/e1000e.c | 21 ++++
hw/net/rtl8139.c | 4 +-
hw/smbios/smbios.c | 1 +
hw/timer/i8254_common.c | 2 +-
hw/timer/mc146818rtc.c | 6 +
hw/usb/hcd-uhci.c | 4 +-
hw/usb/hcd-xhci.c | 20 ++++
hw/usb/hcd-xhci.c | 20 +++
hw/usb/hcd-xhci.h | 2 +
include/hw/acpi/ich9.h | 3 +
include/hw/compat.h | 229 ++++++++++++++++++++++++++++++++++++++
include/hw/boards.h | 18 +++
include/hw/usb.h | 4 +
migration/migration.c | 2 +
migration/migration.h | 5 +
qdev-monitor.c | 1 -
scripts/vmstate-static-checker.py | 1 -
20 files changed, 353 insertions(+), 10 deletions(-)
19 files changed, 403 insertions(+), 7 deletions(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index a4e87b8..23a7baa 100644
index 168a713eff..0a6346f1cf 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -441,6 +441,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
@ -66,10 +75,10 @@ index a4e87b8..23a7baa 100644
ich9_pm_get_disable_s3,
ich9_pm_set_disable_s3,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index e330f24..b213f65 100644
index 9c079d6834..d742777134 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -310,7 +310,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
@@ -315,7 +315,7 @@ static bool piix4_vmstate_need_smbus(void *opaque, int version_id)
static const VMStateDescription vmstate_acpi = {
.name = "piix4_pm",
.version_id = 3,
@ -78,7 +87,7 @@ index e330f24..b213f65 100644
.minimum_version_id_old = 1,
.load_state_old = acpi_load_old,
.post_load = vmstate_acpi_post_load,
@@ -670,8 +670,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
@@ -684,8 +684,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
static Property piix4_pm_properties[] = {
DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
@ -90,7 +99,7 @@ index e330f24..b213f65 100644
DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
use_acpi_pci_hotplug, true),
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 02463e3..a591387 100644
index 7c42a2abfc..ae63cc0104 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -30,6 +30,7 @@
@ -144,8 +153,287 @@ index 02463e3..a591387 100644
return s->poll_msl >= 0;
}
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 743fef2898..fd1594d1ad 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -24,6 +24,274 @@
#include "hw/pci/pci.h"
#include "hw/mem/nvdimm.h"
+/* Mostly like hw_compat_2_1 but:
+ * * we don't need virtio-scsi-pci since 7.0 already had that on
+ * *
+ * * RH: Note, qemu-extended-regs should have been enabled in the 7.1
+ * * machine type, but was accidentally turned off in 7.2 onwards.
+ * *
+ * */
+GlobalProperty hw_compat_rhel_7_1[] = {
+ { /* COMPAT_RHEL7.1 */
+ .driver = "intel-hda-generic",
+ .property = "old_msi_addr",
+ .value = "on",
+ },{
+ .driver = "VGA",
+ .property = "qemu-extended-regs",
+ .value = "off",
+ },{
+ .driver = "secondary-vga",
+ .property = "qemu-extended-regs",
+ .value = "off",
+ },{
+ .driver = "usb-mouse",
+ .property = "usb_version",
+ .value = stringify(1),
+ },{
+ .driver = "usb-kbd",
+ .property = "usb_version",
+ .value = stringify(1),
+ },{
+ .driver = "virtio-pci",
+ .property = "virtio-pci-bus-master-bug-migration",
+ .value = "on",
+ },{
+ .driver = "virtio-blk-pci",
+ .property = "any_layout",
+ .value = "off",
+ },{
+ .driver = "virtio-serial-pci",
+ .property = "any_layout",
+ .value = "off",
+ },{
+ .driver = "virtio-9p-pci",
+ .property = "any_layout",
+ .value = "off",
+ },{
+ .driver = "virtio-rng-pci",
+ .property = "any_layout",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */
+ .driver = "migration",
+ .property = "send-configuration",
+ .value = "off",
+ },
+};
+const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1);
+
+/* Mostly like hw_compat_2_4 + 2_3 but:
+ * * we don't need "any_layout" as it has been backported to 7.2
+ * */
+
+GlobalProperty hw_compat_rhel_7_2[] = {
+ {
+ .driver = "virtio-blk-device",
+ .property = "scsi",
+ .value = "true",
+ },{
+ .driver = "e1000-82540em",
+ .property = "extra_mac_registers",
+ .value = "off",
+ },{
+ .driver = "virtio-pci",
+ .property = "x-disable-pcie",
+ .value = "on",
+ },{
+ .driver = "virtio-pci",
+ .property = "migrate-extra",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = "fw_cfg_mem",
+ .property = "dma_enabled",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = "fw_cfg_io",
+ .property = "dma_enabled",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = "isa-fdc",
+ .property = "fallback",
+ .value = "144",
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = "virtio-pci",
+ .property = "disable-modern",
+ .value = "on",
+ .optional = true,
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = "virtio-pci",
+ .property = "disable-legacy",
+ .value = "off",
+ .optional = true,
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = TYPE_PCI_DEVICE,
+ .property = "x-pcie-lnksta-dllla",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_2 */
+ .driver = "virtio-pci",
+ .property = "page-per-vq",
+ .value = "on",
+ },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */
+ .driver = "migration",
+ .property = "send-section-footer",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */
+ .driver = "migration",
+ .property = "store-global-state",
+ .value = "off",
+ },
+};
+const size_t hw_compat_rhel_7_2_len = G_N_ELEMENTS(hw_compat_rhel_7_2);
+
+/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except
+ * * disable-modern, disable-legacy, page-per-vq have already been
+ * * backported to RHEL7.3
+ * */
+GlobalProperty hw_compat_rhel_7_3[] = {
+ { /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-mmio",
+ .property = "format_transport_address",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-serial-device",
+ .property = "emergency-write",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "ioapic",
+ .property = "version",
+ .value = "0x11",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "intel-iommu",
+ .property = "x-buggy-eim",
+ .value = "true",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-pci",
+ .property = "x-ignore-backend-features",
+ .value = "on",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "fw_cfg_mem",
+ .property = "x-file-slots",
+ .value = stringify(0x10),
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "fw_cfg_io",
+ .property = "x-file-slots",
+ .value = stringify(0x10),
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "pflash_cfi01",
+ .property = "old-multiple-chip-handling",
+ .value = "on",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = TYPE_PCI_DEVICE,
+ .property = "x-pcie-extcap-init",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-pci",
+ .property = "x-pcie-deverr-init",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-pci",
+ .property = "x-pcie-lnkctl-init",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-pci",
+ .property = "x-pcie-pm-init",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "virtio-net-device",
+ .property = "x-mtu-bypass-backend",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_3 */
+ .driver = "e1000e",
+ .property = "__redhat_e1000e_7_3_intr_state",
+ .value = "on",
+ },
+};
+const size_t hw_compat_rhel_7_3_len = G_N_ELEMENTS(hw_compat_rhel_7_3);
+
+/* Mostly like hw_compat_2_9 except
+ * * x-mtu-bypass-backend, x-migrate-msix has already been
+ * * backported to RHEL7.4. shpc was already on in 7.4.
+ * */
+GlobalProperty hw_compat_rhel_7_4[] = {
+ { /* HW_COMPAT_RHEL7_4 */
+ .driver = "intel-iommu",
+ .property = "pt",
+ .value = "off",
+ },
+};
+const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4);
+
+/* The same as hw_compat_2_11 + hw_compat_2_10 */
+GlobalProperty hw_compat_rhel_7_5[] = {
+ { /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */
+ .driver = "hpet",
+ .property = "hpet-offset-saved",
+ .value = "false",
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */
+ .driver = "virtio-blk-pci",
+ .property = "vectors",
+ .value = "2",
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */
+ .driver = "vhost-user-blk-pci",
+ .property = "vectors",
+ .value = "2",
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 but
+ bz 1608778 modified for our naming */
+ .driver = "e1000-82540em",
+ .property = "migrate_tso_props",
+ .value = "off",
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */
+ .driver = "virtio-mouse-device",
+ .property = "wheel-axis",
+ .value = "false",
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */
+ .driver = "virtio-tablet-device",
+ .property = "wheel-axis",
+ .value = "false",
+ },{ /* HW_COMPAT_RHEL7_5 */
+ .driver = "cirrus-vga",
+ .property = "vgamem_mb",
+ .value = "16",
+ },{ /* HW_COMPAT_RHEL7_5 */
+ .driver = "migration",
+ .property = "decompress-error-check",
+ .value = "off",
+ },
+};
+const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5);
+
+/* The same as hw_compat_3_0 + hw_compat_2_12
+ * * except that
+ * * there's nothing in 3_0
+ * * migration.decompress-error-check=off was in 7.5 from bz 1584139
+ * *
+ * */
+GlobalProperty hw_compat_rhel_7_6[] = {
+ { /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */
+ .driver = "hda-audio",
+ .property = "use-timer",
+ .value = "false",
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */
+ .driver = "cirrus-vga",
+ .property = "global-vmstate",
+ .value = "true",
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */
+ .driver = "VGA",
+ .property = "global-vmstate",
+ .value = "true",
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */
+ .driver = "vmware-svga",
+ .property = "global-vmstate",
+ .value = "true",
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */
+ .driver = "qxl-vga",
+ .property = "global-vmstate",
+ .value = "true",
+ },
+};
+const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6);
+
+
GlobalProperty hw_compat_3_1[] = {
{ "pcie-root-port", "x-speed", "2_5" },
{ "pcie-root-port", "x-width", "1" },
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
index fa44242..7835c83 100644
index fa44242e0d..7835c8380a 100644
--- a/hw/display/vga-isa.c
+++ b/hw/display/vga-isa.c
@@ -80,7 +80,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
@ -158,10 +446,10 @@ index fa44242..7835c83 100644
};
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 2e07880..e886e7c 100644
index 6ac19216df..a4de04ab89 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1673,6 +1673,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
@@ -1691,6 +1691,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
pci_conf = pci_dev->config;
@ -178,37 +466,8 @@ index 2e07880..e886e7c 100644
/* TODO: RST# value should be 0, PCI spec 6.2.4 */
pci_conf[PCI_CACHE_LINE_SIZE] = 0x10;
@@ -1773,7 +1783,7 @@ static const TypeInfo e1000_base_info = {
static const E1000Info e1000_devices[] = {
{
- .name = "e1000",
+ .name = "e1000-82540em",
.device_id = E1000_DEV_ID_82540EM,
.revision = 0x03,
.phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT,
@@ -1794,6 +1804,11 @@ static const E1000Info e1000_devices[] = {
#endif
};
+static const TypeInfo e1000_default_info = {
+ .name = "e1000",
+ .parent = "e1000-82540em",
+};
+
static void e1000_register_types(void)
{
int i;
@@ -1811,6 +1826,7 @@ static void e1000_register_types(void)
type_register(&type_info);
}
+ type_register_static(&e1000_default_info);
}
type_init(e1000_register_types)
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 510ddb3..f1de9e5 100644
index 510ddb3897..f1de9e5058 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -75,6 +75,11 @@ typedef struct E1000EState {
@ -282,7 +541,7 @@ index 510ddb3..f1de9e5 100644
e1000e_prop_disable_vnet, bool),
DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven,
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 2342a09..0c916b7 100644
index 2342a095e3..0c916b7a21 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3174,7 +3174,7 @@ static int rtl8139_pre_save(void *opaque)
@ -305,7 +564,7 @@ index 2342a09..0c916b7 100644
VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 9209394..43cf057 100644
index 47be9071fa..3ea04e621e 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -775,6 +775,7 @@ void smbios_set_defaults(const char *manufacturer, const char *product,
@ -317,7 +576,7 @@ index 9209394..43cf057 100644
SMBIOS_SET_DEFAULT(type2.product, product);
SMBIOS_SET_DEFAULT(type2.version, version);
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
index 6190b6f..ad2ad2d 100644
index 6190b6fc5d..ad2ad2d09f 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -268,7 +268,7 @@ static const VMStateDescription vmstate_pit_common = {
@ -330,11 +589,11 @@ index 6190b6f..ad2ad2d 100644
vmstate_pit_channel, PITChannelState),
VMSTATE_INT64(channels[0].next_transition_time,
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index e4e4de8..3eced9c 100644
index 513f105e62..10a3d44be1 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -35,6 +35,7 @@
#include "qapi/qapi-events-misc.h"
#include "qapi/qapi-events-target.h"
#include "qapi/visitor.h"
#include "exec/address-spaces.h"
+#include "migration/migration.h"
@ -354,10 +613,10 @@ index e4e4de8..3eced9c 100644
}
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 836b11f..9d7b9df 100644
index 09df29ff9c..95542290ff 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1214,12 +1214,14 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
@@ -1216,12 +1216,14 @@ static void usb_uhci_common_realize(PCIDevice *dev, Error **errp)
UHCIState *s = UHCI(dev);
uint8_t *pci_conf = s->dev.config;
int i;
@ -374,10 +633,10 @@ index 836b11f..9d7b9df 100644
if (s->masterbus) {
USBPort *ports[NB_PORTS];
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 8f1a01a..ca19474 100644
index ec28bee319..ad351a7b6d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3560,9 +3560,27 @@ static const VMStateDescription vmstate_xhci_slot = {
@@ -3580,9 +3580,27 @@ static const VMStateDescription vmstate_xhci_slot = {
}
};
@ -405,7 +664,7 @@ index 8f1a01a..ca19474 100644
.fields = (VMStateField[]) {
VMSTATE_UINT32(type, XHCIEvent),
VMSTATE_UINT32(ccode, XHCIEvent),
@@ -3571,6 +3589,8 @@ static const VMStateDescription vmstate_xhci_event = {
@@ -3591,6 +3609,8 @@ static const VMStateDescription vmstate_xhci_event = {
VMSTATE_UINT32(flags, XHCIEvent),
VMSTATE_UINT8(slotid, XHCIEvent),
VMSTATE_UINT8(epid, XHCIEvent),
@ -415,10 +674,10 @@ index 8f1a01a..ca19474 100644
}
};
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index fc36a4c..89d4cf7 100644
index 240caa4e51..11bd05dfd5 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -153,6 +153,8 @@ typedef struct XHCIEvent {
@@ -154,6 +154,8 @@ typedef struct XHCIEvent {
uint32_t flags;
uint8_t slotid;
uint8_t epid;
@ -428,7 +687,7 @@ index fc36a4c..89d4cf7 100644
typedef struct XHCIInterrupter {
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 59aeb06..7b5cc25 100644
index 41568d1837..1a23ccc412 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -61,6 +61,9 @@ typedef struct ICH9LPCPMRegs {
@ -441,249 +700,38 @@ index 59aeb06..7b5cc25 100644
} ICH9LPCPMRegs;
#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
diff --git a/include/hw/compat.h b/include/hw/compat.h
index 6f4d5fc..f08cc7c 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -285,4 +285,233 @@
.value = "on",\
},
diff --git a/include/hw/boards.h b/include/hw/boards.h
index e231860666..456e4a944c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -335,4 +335,22 @@ extern const size_t hw_compat_2_2_len;
extern GlobalProperty hw_compat_2_1[];
extern const size_t hw_compat_2_1_len;
+/* Mostly like HW_COMPAT_2_1 but:
+ * we don't need virtio-scsi-pci since 7.0 already had that on
+ *
+ * RH: Note, qemu-extended-regs should have been enabled in the 7.1
+ * machine type, but was accidentally turned off in 7.2 onwards.
+ *
+ */
+#define HW_COMPAT_RHEL7_1 \
+ { /* COMPAT_RHEL7.1 */ \
+ .driver = "intel-hda-generic",\
+ .property = "old_msi_addr",\
+ .value = "on",\
+ },{\
+ .driver = "VGA",\
+ .property = "qemu-extended-regs",\
+ .value = "off",\
+ },{\
+ .driver = "secondary-vga",\
+ .property = "qemu-extended-regs",\
+ .value = "off",\
+ },{\
+ .driver = "usb-mouse",\
+ .property = "usb_version",\
+ .value = stringify(1),\
+ },{\
+ .driver = "usb-kbd",\
+ .property = "usb_version",\
+ .value = stringify(1),\
+ },{\
+ .driver = "virtio-pci",\
+ .property = "virtio-pci-bus-master-bug-migration",\
+ .value = "on",\
+ },{\
+ .driver = "virtio-blk-pci",\
+ .property = "any_layout",\
+ .value = "off",\
+ },{\
+ .driver = "virtio-balloon-pci",\
+ .property = "any_layout",\
+ .value = "off",\
+ },{\
+ .driver = "virtio-serial-pci",\
+ .property = "any_layout",\
+ .value = "off",\
+ },{\
+ .driver = "virtio-9p-pci",\
+ .property = "any_layout",\
+ .value = "off",\
+ },{\
+ .driver = "virtio-rng-pci",\
+ .property = "any_layout",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */ \
+ .driver = "migration",\
+ .property = "send-configuration",\
+ .value = "off",\
+ },
+extern GlobalProperty hw_compat_rhel_7_6[];
+extern const size_t hw_compat_rhel_7_6_len;
+
+/* Mostly like HW_COMPAT_2_4 + 2_3 but:
+ * we don't need "any_layout" as it has been backported to 7.2
+ */
+extern GlobalProperty hw_compat_rhel_7_5[];
+extern const size_t hw_compat_rhel_7_5_len;
+
+#define HW_COMPAT_RHEL7_2 \
+ {\
+ .driver = "virtio-blk-device",\
+ .property = "scsi",\
+ .value = "true",\
+ },{\
+ .driver = "e1000-82540em",\
+ .property = "extra_mac_registers",\
+ .value = "off",\
+ },{\
+ .driver = "virtio-pci",\
+ .property = "x-disable-pcie",\
+ .value = "on",\
+ },{\
+ .driver = "virtio-pci",\
+ .property = "migrate-extra",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = "fw_cfg_mem",\
+ .property = "dma_enabled",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = "fw_cfg_io",\
+ .property = "dma_enabled",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = "isa-fdc",\
+ .property = "fallback",\
+ .value = "144",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = "virtio-pci",\
+ .property = "disable-modern",\
+ .value = "on",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = "virtio-pci",\
+ .property = "disable-legacy",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = TYPE_PCI_DEVICE,\
+ .property = "x-pcie-lnksta-dllla",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_2 */ \
+ .driver = "virtio-pci",\
+ .property = "page-per-vq",\
+ .value = "on",\
+ },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
+ .driver = "migration",\
+ .property = "send-section-footer",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_2 - introduced with 2.10.0 */ \
+ .driver = "migration",\
+ .property = "store-global-state",\
+ .value = "off",\
+ },
+extern GlobalProperty hw_compat_rhel_7_4[];
+extern const size_t hw_compat_rhel_7_4_len;
+
+/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except
+ * disable-modern, disable-legacy, page-per-vq have already been
+ * backported to RHEL7.3
+ */
+#define HW_COMPAT_RHEL7_3 \
+ { /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-mmio",\
+ .property = "format_transport_address",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-serial-device",\
+ .property = "emergency-write",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "ioapic",\
+ .property = "version",\
+ .value = "0x11",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "intel-iommu",\
+ .property = "x-buggy-eim",\
+ .value = "true",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-pci",\
+ .property = "x-ignore-backend-features",\
+ .value = "on",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "fw_cfg_mem",\
+ .property = "x-file-slots",\
+ .value = stringify(0x10),\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "fw_cfg_io",\
+ .property = "x-file-slots",\
+ .value = stringify(0x10),\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "pflash_cfi01",\
+ .property = "old-multiple-chip-handling",\
+ .value = "on",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = TYPE_PCI_DEVICE,\
+ .property = "x-pcie-extcap-init",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-pci",\
+ .property = "x-pcie-deverr-init",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-pci",\
+ .property = "x-pcie-lnkctl-init",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-pci",\
+ .property = "x-pcie-pm-init",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "virtio-net-device",\
+ .property = "x-mtu-bypass-backend",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_3 */ \
+ .driver = "e1000e",\
+ .property = "__redhat_e1000e_7_3_intr_state",\
+ .value = "on",\
+ },
+extern GlobalProperty hw_compat_rhel_7_3[];
+extern const size_t hw_compat_rhel_7_3_len;
+
+/* Mostly like HW_COMPAT_2_9 except
+ * x-mtu-bypass-backend, x-migrate-msix has already been
+ * backported to RHEL7.4. shpc was already on in 7.4.
+ */
+#define HW_COMPAT_RHEL7_4 \
+ { /* HW_COMPAT_RHEL7_4 */ \
+ .driver = "intel-iommu",\
+ .property = "pt",\
+ .value = "off",\
+ },
+extern GlobalProperty hw_compat_rhel_7_2[];
+extern const size_t hw_compat_rhel_7_2_len;
+
+/* The same as HW_COMPAT_2_11 + HW_COMPAT_2_10 */
+#define HW_COMPAT_RHEL7_5 \
+ { /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
+ .driver = "hpet",\
+ .property = "hpet-offset-saved",\
+ .value = "false",\
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
+ .driver = "virtio-blk-pci",\
+ .property = "vectors",\
+ .value = "2",\
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 */ \
+ .driver = "vhost-user-blk-pci",\
+ .property = "vectors",\
+ .value = "2",\
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_11 but \
+ bz 1608778 modified for our naming */ \
+ .driver = "e1000-82540em",\
+ .property = "migrate_tso_props",\
+ .value = "off",\
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
+ .driver = "virtio-mouse-device",\
+ .property = "wheel-axis",\
+ .value = "false",\
+ },{ /* HW_COMPAT_RHEL7_5 from HW_COMPAT_2_10 */ \
+ .driver = "virtio-tablet-device",\
+ .property = "wheel-axis",\
+ .value = "false",\
+ },{ /* HW_COMPAT_RHEL7_5 */ \
+ .driver = "cirrus-vga",\
+ .property = "vgamem_mb",\
+ .value = "16",\
+ },{ /* HW_COMPAT_RHEL7_5 */ \
+ .driver = "migration",\
+ .property = "decompress-error-check",\
+ .value = "off",\
+ },
+extern GlobalProperty hw_compat_rhel_7_1[];
+extern const size_t hw_compat_rhel_7_1_len;
+
+
#endif /* HW_COMPAT_H */
#endif
diff --git a/include/hw/usb.h b/include/hw/usb.h
index a5080ad..b943ec9 100644
index c21f41c8a9..71502b0bad 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -606,4 +606,8 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
@@ -604,4 +604,8 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
uint8_t interface_class, uint8_t interface_subclass,
uint8_t interface_protocol);
@ -693,10 +741,10 @@ index a5080ad..b943ec9 100644
+
#endif
diff --git a/migration/migration.c b/migration/migration.c
index 49ffb99..0d9cb7a 100644
index 609e0df5d0..a160172a0c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -105,6 +105,8 @@ enum mig_rp_message_type {
@@ -116,6 +116,8 @@ enum mig_rp_message_type {
MIG_RP_MSG_MAX
};
@ -706,13 +754,13 @@ index 49ffb99..0d9cb7a 100644
migrations at once. For now we don't need to add
dynamic creation of migration */
diff --git a/migration/migration.h b/migration/migration.h
index e413d4d..795238c 100644
index 438f17edad..c793dcc50b 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -292,6 +292,11 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
@@ -307,6 +307,11 @@ void init_dirty_bitmap_incoming_migration(void);
void migrate_add_address(SocketAddress *address);
void dirty_bitmap_mig_before_vm_start(void);
void init_dirty_bitmap_incoming_migration(void);
int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
+/*
+ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards
+ * migration compatibility.
@ -720,31 +768,7 @@ index e413d4d..795238c 100644
+extern bool migrate_pre_2_2;
#define qemu_ram_foreach_block \
#warning "Use qemu_ram_foreach_block_migratable in migration code"
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 07147c6..47ea051 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -47,7 +47,6 @@ typedef struct QDevAlias
/* Please keep this table sorted by typename. */
static const QDevAlias qdev_alias_table[] = {
- { "e1000", "e1000-82540em" },
{ "ich9-ahci", "ahci" },
{ "lsi53c895a", "lsi" },
{ "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
index d346728..4bca2bf 100755
--- a/scripts/vmstate-static-checker.py
+++ b/scripts/vmstate-static-checker.py
@@ -105,7 +105,6 @@ def get_changed_sec_name(sec):
# Section names can change -- see commit 292b1634 for an example.
changes = {
"ICH9 LPC": "ICH9-LPC",
- "e1000-82540em": "e1000",
}
for item in changes:
#warning "Use foreach_not_ignored_block in migration code"
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From 68e46b1a3bc650bc35ccc49606c3f31e29165512 Mon Sep 17 00:00:00 2001
From b2c73bd35f8c0fa536004d18275ffcfe63096622 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 12:53:31 +0200
Subject: Add aarch64 machine types
@ -6,24 +6,37 @@ Subject: Add aarch64 machine types
Adding changes to add RHEL machine types for aarch64 architecture.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase changes (weekly-190111):
- Use upstream compat handling
Rebase changes (weekly-190308):
- Removed a15memmap (upstream)
Merged patches (weekly-190125):
- 7bfdb4c aarch64: Add virt-rhel8.0.0 machine type for ARM
- 3433e69 aarch64: Set virt-rhel8.0.0 max_cpus to 512
- 4d20863 aarch64: Use 256MB ECAM region by default
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++-
include/hw/arm/virt.h | 22 +++++++++
2 files changed, 147 insertions(+), 1 deletion(-)
hw/arm/virt.c | 140 +++++++++++++++++++++++++++++++++++++++++-
include/hw/arm/virt.h | 11 ++++
2 files changed, 150 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index f69e7eb..84a86c1 100644
index ce2664a30b..5602d9f6b0 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -60,6 +60,7 @@
#include "standard-headers/linux/input.h"
#include "hw/arm/smmuv3.h"
@@ -62,6 +62,7 @@
#include "hw/acpi/acpi.h"
#include "target/arm/internals.h"
+#if 0 /* disabled Red Hat Enterprise Linux */
+#if 0 /* Disabled for Red Hat Enterprise Linux */
#define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \
static void virt_##major##_##minor##_class_init(ObjectClass *oc, \
void *data) \
@@ -87,7 +88,36 @@
@@ -88,7 +89,49 @@
DEFINE_VIRT_MACHINE_LATEST(major, minor, true)
#define DEFINE_VIRT_MACHINE(major, minor) \
DEFINE_VIRT_MACHINE_LATEST(major, minor, false)
@ -58,18 +71,31 @@ index f69e7eb..84a86c1 100644
+ DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, true)
+#define DEFINE_RHEL_MACHINE(major, minor, subminor) \
+ DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, false)
+
+/* This variable is for changes to properties that are RHEL specific,
+ * different to the current upstream and to be applied to the latest
+ * machine type.
+ */
+GlobalProperty arm_rhel_compat[] = {
+ {
+ .driver = "virtio-net-pci",
+ .property = "romfile",
+ .value = "",
+ },
+};
+const size_t arm_rhel_compat_len = G_N_ELEMENTS(arm_rhel_compat);
/* Number of external interrupt lines to configure the GIC with */
#define NUM_IRQS 256
@@ -1578,6 +1608,7 @@ static void machvirt_init(MachineState *machine)
@@ -1658,6 +1701,7 @@ static void machvirt_init(MachineState *machine)
qemu_add_machine_init_done_notifier(&vms->machine_done);
}
+#if 0 /* disabled for RHEL */
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static bool virt_get_secure(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1606,6 +1637,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
@@ -1686,6 +1730,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp)
vms->virt = value;
}
@ -77,41 +103,31 @@ index f69e7eb..84a86c1 100644
static bool virt_get_highmem(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1660,6 +1692,7 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)
@@ -1740,6 +1785,7 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)
}
}
+#if 0
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static char *virt_get_iommu(Object *obj, Error **errp)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1687,6 +1720,7 @@ static void virt_set_iommu(Object *obj, const char *value, Error **errp)
@@ -1767,6 +1813,7 @@ static void virt_set_iommu(Object *obj, const char *value, Error **errp)
error_append_hint(errp, "Valid values are none, smmuv3.\n");
}
}
+#endif
+#endif /* disabled for RHEL */
static CpuInstanceProperties
virt_cpu_index_to_props(MachineState *ms, unsigned cpu_index)
@@ -1726,6 +1760,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
@@ -1806,6 +1853,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
return ms->possible_cpus;
}
+#if 0 /* disabled for RHEL */
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
@@ -1890,6 +1925,9 @@ DEFINE_VIRT_MACHINE(3, 0)
#define VIRT_COMPAT_2_12 \
HW_COMPAT_2_12
+#define VIRT_COMPAT_2_12 \
+ HW_COMPAT_2_12
+
static void virt_2_12_instance_init(Object *obj)
{
virt_3_0_instance_init(obj);
@@ -2017,3 +2055,89 @@ static void virt_machine_2_6_options(MachineClass *mc)
@@ -2071,3 +2119,93 @@ static void virt_machine_2_6_options(MachineClass *mc)
vmc->no_pmu = true;
}
DEFINE_VIRT_MACHINE(2, 6)
@ -123,11 +139,11 @@ index f69e7eb..84a86c1 100644
+
+ mc->family = "virt-rhel-Z";
+ mc->init = machvirt_init;
+ /* Start max_cpus at the maximum QEMU supports. We'll further restrict
+ * it later in machvirt_init, where we have more information about the
+ /* Start with max_cpus set to 512, which is the maximum supported by KVM.
+ * The value may be reduced later when we have more information about the
+ * configuration of the particular instance.
+ */
+ mc->max_cpus = 255;
+ mc->max_cpus = 512;
+ mc->block_default_type = IF_VIRTIO;
+ mc->no_cdrom = 1;
+ mc->pci_allow_0_address = true;
@ -154,7 +170,7 @@ index f69e7eb..84a86c1 100644
+}
+type_init(rhel_machine_init);
+
+static void rhel760_virt_instance_init(Object *obj)
+static void rhel800_virt_instance_init(Object *obj)
+{
+ VirtMachineState *vms = VIRT_MACHINE(obj);
+ VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@ -179,6 +195,8 @@ index f69e7eb..84a86c1 100644
+ "Set GIC version. "
+ "Valid values are 2, 3 and host", NULL);
+
+ vms->highmem_ecam = !vmc->no_highmem_ecam;
+
+ if (vmc->no_its) {
+ vms->its = false;
+ } else {
@ -192,28 +210,30 @@ index f69e7eb..84a86c1 100644
+ NULL);
+ }
+
+ vms->memmap=a15memmap;
+ /* IOMMU is disabled by default and non-configurable for RHEL */
+ vms->iommu = VIRT_IOMMU_NONE;
+
+ vms->irqmap=a15irqmap;
+}
+
+static void rhel760_virt_options(MachineClass *mc)
+static void rhel800_virt_options(MachineClass *mc)
+{
+ SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT);
+ compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len);
+}
+DEFINE_RHEL_MACHINE_AS_LATEST(7, 6, 0)
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 0, 0)
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 4cc57a7..3237e97 100644
index 507517c603..e49f872b1c 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -130,6 +130,7 @@ typedef struct {
@@ -136,6 +136,7 @@ typedef struct {
#define VIRT_ECAM_ID(high) (high ? VIRT_PCIE_ECAM_HIGH : VIRT_PCIE_ECAM)
#define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM)
+#if 0 /* disabled for Red Hat Enterprise Linux */
#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt")
#define VIRT_MACHINE(obj) \
OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE)
@@ -138,6 +139,27 @@ typedef struct {
@@ -144,6 +145,16 @@ typedef struct {
#define VIRT_MACHINE_CLASS(klass) \
OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE)
@ -226,21 +246,10 @@ index 4cc57a7..3237e97 100644
+#define VIRT_MACHINE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_RHEL_MACHINE)
+#endif
+
+/* This macro is for changes to properties that are RHEL specific,
+ * different to the current upstream and to be applied to the latest
+ * machine type.
+ */
+#define ARM_RHEL_COMPAT \
+ {\
+ .driver = "virtio-net-pci",\
+ .property = "romfile",\
+ .value = "",\
+ },
+
void virt_acpi_setup(VirtMachineState *vms);
/* Return the number of used redistributor regions */
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From 4f9094b11eb831317879d9c6108f6f706546fea5 Mon Sep 17 00:00:00 2001
From 373a3f8f11227ba6bce10dab17ddfb6caffc75cf Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:27:13 +0200
Subject: Add ppc64 machine types
@ -6,8 +6,25 @@ Subject: Add ppc64 machine types
Adding changes to add RHEL machine types for ppc64 architecture.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase changes (weekly-190111):
- remove instance options and use upstream solution
- Use upstream compat handling
- Replace SPAPR_PCI_2_7_MMIO_WIN_SIZE with value (changed upstream)
Rebase changes (weekly-190104):
- re-add handling of instance_options (removed upstream)
- Use p8 as default for rhel machine types (p9 default upstream)
Rebase changes (weekly-190315):
- sPAPRMachineClass renamed to SpaprMachineClass (upstream)
Merged patches (weekly-190104):
- 467d59a redhat: define pseries-rhel8.0.0 machine type
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 252 ++++++++++++++++++++++++++++++++++++++++++++++++
hw/ppc/spapr.c | 252 ++++++++++++++++++++++++++++++++++++++++
hw/ppc/spapr_cpu_core.c | 13 +++
include/hw/ppc/spapr.h | 1 +
target/ppc/compat.c | 13 ++-
@ -15,75 +32,112 @@ Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
5 files changed, 279 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7afd1a1..76a4e83 100644
index b52b82d298..daa59203ea 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3906,6 +3906,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
smc->default_caps.caps[SPAPR_CAP_NESTED_KVM_HV] = SPAPR_CAP_OFF;
@@ -4300,6 +4300,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
spapr_caps_add_properties(smc, &error_abort);
smc->irq = &spapr_irq_xics;
smc->dr_phb_enabled = true;
+ smc->has_power9_support = true;
}
static const TypeInfo spapr_machine_info = {
@@ -3956,6 +3957,7 @@ static const TypeInfo spapr_machine_info = {
@@ -4344,6 +4345,7 @@ static const TypeInfo spapr_machine_info = {
} \
type_init(spapr_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
/*
* pseries-3.1
* pseries-4.0
*/
@@ -4499,6 +4501,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
/*
* pseries-2.7
*/
@@ -4169,6 +4171,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
.property = "pre-2.8-migration", \
.value = "on", \
},
+#endif
static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
static void phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
uint64_t *buid, hwaddr *pio,
@@ -4219,6 +4222,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
@@ -4549,6 +4552,7 @@ static void phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
*/
}
+#if 0 /* Disabled for Red Hat Enterprise Linux */
static void spapr_machine_2_7_instance_options(MachineState *machine)
static void spapr_machine_2_7_class_options(MachineClass *mc)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
@@ -4378,6 +4382,254 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1);
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
@@ -4663,6 +4667,254 @@ 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);
}
DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
+#endif
+
+/*
+ * pseries-rhel7.6.0
+ * pseries-rhel8.0.0
+ */
+
+static void spapr_machine_rhel760_instance_options(MachineState *machine)
+{
+}
+
+static void spapr_machine_rhel760_class_options(MachineClass *mc)
+static void spapr_machine_rhel800_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", true);
+DEFINE_SPAPR_MACHINE(rhel800, "rhel8.0.0", true);
+
+/*
+ * pseries-rhel7.6.0
+ * like spapr_compat_2_12 and spapr_compat_3_0
+ * spapr_compat_0 is empty
+ */
+GlobalProperty spapr_compat_rhel7_6[] = {
+ {
+ .driver = TYPE_POWERPC_CPU,
+ .property = "pre-3.0-migration",
+ .value = "on",
+ },
+ {
+ .driver = TYPE_SPAPR_CPU_CORE,
+ .property = "pre-3.0-migration",
+ .value = "on",
+ },
+};
+const size_t spapr_compat_rhel7_6_len = G_N_ELEMENTS(spapr_compat_rhel7_6);
+
+
+static void spapr_machine_rhel760_class_options(MachineClass *mc)
+{
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel800_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
+ compat_props_add(mc->compat_props, spapr_compat_rhel7_6, spapr_compat_rhel7_6_len);
+
+ /* from spapr_machine_3_0_class_options() */
+ smc->legacy_irq_allocation = true;
+ smc->irq = &spapr_irq_xics_legacy;
+
+ /* from spapr_machine_2_12_class_options() */
+ /* We depend on kvm_enabled() to choose a default value for the
+ * hpt-max-page-size capability. Of course we can't do it here
+ * because this is too early and the HW accelerator isn't initialzed
+ * yet. Postpone this to machine init (see default_caps_with_cpu()).
+ */
+ smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 0;
+ /* Defaults for the latest behaviour inherited from the base class */
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0");
+}
+
+DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", false);
+
+/*
+ * pseries-rhel7.6.0-sxxm
+ *
+ * pseries-rhel7.6.0 with speculative execution exploit mitigations enabled by default
+ */
+static void spapr_machine_rhel760sxxm_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel760_instance_options(machine);
+}
+
+static void spapr_machine_rhel760sxxm_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel760_class_options(mc);
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
@ -93,24 +147,11 @@ index 7afd1a1..76a4e83 100644
+
+DEFINE_SPAPR_MACHINE(rhel760sxxm, "rhel7.6.0-sxxm", false);
+
+/*
+ * pseries-rhel7.5.0
+ * like SPAPR_COMPAT_2_11 and SPAPR_COMPAT_2_10
+ * SPAPR_CAP_HTM already enabled in 7.4
+ *
+ */
+#define SPAPR_COMPAT_RHEL7_5 \
+ HW_COMPAT_RHEL7_5 \
+
+static void spapr_machine_rhel750_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel760_instance_options(machine);
+}
+
+static void spapr_machine_rhel750_class_options(MachineClass *mc)
+{
+ spapr_machine_rhel760_class_options(mc);
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_5);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
+
+}
+
+DEFINE_SPAPR_MACHINE(rhel750, "rhel7.5.0", false);
@ -120,14 +161,10 @@ index 7afd1a1..76a4e83 100644
+ *
+ * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default
+ */
+static void spapr_machine_rhel750sxxm_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel750_instance_options(machine);
+}
+
+static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel750_class_options(mc);
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
@ -139,28 +176,24 @@ index 7afd1a1..76a4e83 100644
+
+/*
+ * pseries-rhel7.4.0
+ * like SPAPR_COMPAT_2_9
+ * like spapr_compat_2_9
+ */
+
+#define SPAPR_COMPAT_RHEL7_4 \
+ HW_COMPAT_RHEL7_4 \
+ { \
+ .driver = TYPE_POWERPC_CPU, \
+ .property = "pre-2.10-migration", \
+ .value = "on", \
+ }, \
+
+static void spapr_machine_rhel740_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel750_instance_options(machine);
+}
+GlobalProperty spapr_compat_rhel7_4[] = {
+ {
+ .driver = TYPE_POWERPC_CPU,
+ .property = "pre-2.10-migration",
+ .value = "on",
+ },
+};
+const size_t spapr_compat_rhel7_4_len = G_N_ELEMENTS(spapr_compat_rhel7_4);
+
+static void spapr_machine_rhel740_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel750_class_options(mc);
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_4);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
+ compat_props_add(mc->compat_props, spapr_compat_rhel7_4, spapr_compat_rhel7_4_len);
+ mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
+ smc->has_power9_support = false;
+ smc->pre_2_10_has_unused_icps = true;
@ -175,14 +208,10 @@ index 7afd1a1..76a4e83 100644
+ *
+ * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default
+ */
+static void spapr_machine_rhel740sxxm_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel740_instance_options(machine);
+}
+
+static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel740_class_options(mc);
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
@ -194,51 +223,47 @@ index 7afd1a1..76a4e83 100644
+
+/*
+ * pseries-rhel7.3.0
+ * like SPAPR_COMPAT_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3
+ * like spapr_compat_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3
+ */
+#define SPAPR_COMPAT_RHEL7_3 \
+ HW_COMPAT_RHEL7_3 \
+ { \
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
+ .property = "mem_win_size", \
+ .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),\
+ }, \
+ { \
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
+ .property = "mem64_win_size", \
+ .value = "0", \
+ }, \
+ { \
+ .driver = TYPE_POWERPC_CPU, \
+ .property = "pre-2.8-migration", \
+ .value = "on", \
+ }, \
+ { \
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
+ .property = "pre-2.8-migration", \
+ .value = "on", \
+ }, \
+ { \
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
+ .property = "pcie-extended-configuration-space",\
+ .value = "off", \
+GlobalProperty spapr_compat_rhel7_3[] = {
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "mem_win_size",
+ .value = "0xf80000000",
+ },
+
+static void spapr_machine_rhel730_instance_options(MachineState *machine)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(machine);
+
+ spapr_machine_rhel740_instance_options(machine);
+ spapr->use_hotplug_event_source = false;
+}
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "mem64_win_size",
+ .value = "0",
+ },
+ {
+ .driver = TYPE_POWERPC_CPU,
+ .property = "pre-2.8-migration",
+ .value = "on",
+ },
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "pre-2.8-migration",
+ .value = "on",
+ },
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "pcie-extended-configuration-space",
+ .value = "off",
+ },
+};
+const size_t spapr_compat_rhel7_3_len = G_N_ELEMENTS(spapr_compat_rhel7_3);
+
+static void spapr_machine_rhel730_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel740_class_options(mc);
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3");
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_3);
+ mc->default_machine_opts = "modern-hotplug-events=off";
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len);
+ compat_props_add(mc->compat_props, spapr_compat_rhel7_3, spapr_compat_rhel7_3_len);
+
+ smc->phb_placement = phb_placement_2_7;
+}
+
@ -249,14 +274,10 @@ index 7afd1a1..76a4e83 100644
+ *
+ * pseries-rhel7.3.0 with speculative execution exploit mitigations enabled by default
+ */
+static void spapr_machine_rhel730sxxm_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel730_instance_options(machine);
+}
+
+static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel730_class_options(mc);
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
@ -269,36 +290,32 @@ index 7afd1a1..76a4e83 100644
+/*
+ * pseries-rhel7.2.0
+ */
+/* Should be like SPAPR_COMPAT_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration"
+/* Should be like spapr_compat_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration"
+ * has been backported to RHEL7_2 so we don't need it here.
+ */
+
+#define SPAPR_COMPAT_RHEL7_2 \
+ HW_COMPAT_RHEL7_2 \
+ { \
+ .driver = "spapr-vlan", \
+ .property = "use-rx-buffer-pools", \
+ .value = "off", \
+ },{ \
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
+ .property = "ddw",\
+ .value = stringify(off),\
+GlobalProperty spapr_compat_rhel7_2[] = {
+ {
+ .driver = "spapr-vlan",
+ .property = "use-rx-buffer-pools",
+ .value = "off",
+ },{
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "ddw",
+ .value = "off",
+ },
+
+
+static void spapr_machine_rhel720_instance_options(MachineState *machine)
+{
+ spapr_machine_rhel730_instance_options(machine);
+}
+};
+const size_t spapr_compat_rhel7_2_len = G_N_ELEMENTS(spapr_compat_rhel7_2);
+
+static void spapr_machine_rhel720_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel730_class_options(mc);
+ smc->use_ohci_by_default = true;
+ mc->has_hotpluggable_cpus = NULL;
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_2);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len);
+ compat_props_add(mc->compat_props, spapr_compat_rhel7_2, spapr_compat_rhel7_2_len);
+}
+
+DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false);
@ -306,10 +323,10 @@ index 7afd1a1..76a4e83 100644
static void spapr_machine_register_types(void)
{
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 63a7bb6..fcf6174 100644
index c664969b5b..7556debbef 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -22,6 +22,7 @@
@@ -21,6 +21,7 @@
#include "sysemu/numa.h"
#include "sysemu/hw_accel.h"
#include "qemu/error-report.h"
@ -317,15 +334,15 @@ index 63a7bb6..fcf6174 100644
static void spapr_cpu_reset(void *opaque)
{
@@ -218,6 +219,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, sPAPRMachineState *spapr,
@@ -222,6 +223,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu);
Error *local_err = NULL;
+ sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
+ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
object_property_set_bool(OBJECT(cpu), true, "realized", &local_err);
if (local_err) {
@@ -230,6 +232,17 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, sPAPRMachineState *spapr,
@@ -234,6 +236,17 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
kvmppc_set_papr(cpu);
@ -344,19 +361,19 @@ index 63a7bb6..fcf6174 100644
spapr_cpu_reset(cpu);
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 6279711..d2370e5 100644
index 5ea8081041..8737516ada 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -106,6 +106,7 @@ struct sPAPRMachineClass {
bool pre_2_10_has_unused_icps;
@@ -120,6 +120,7 @@ struct SpaprMachineClass {
bool legacy_irq_allocation;
bool broken_host_serial_model; /* present real host info to the guest */
+ bool has_power9_support;
void (*phb_placement)(sPAPRMachineState *spapr, uint32_t index,
void (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
uint64_t *buid, hwaddr *pio,
hwaddr *mmio32, hwaddr *mmio64,
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
index 7de4bf3..3e2e353 100644
index 7de4bf3122..3e2e35342d 100644
--- a/target/ppc/compat.c
+++ b/target/ppc/compat.c
@@ -105,8 +105,19 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr)
@ -381,10 +398,10 @@ index 7de4bf3..3e2e353 100644
const CompatInfo *compat = compat_by_pvr(compat_pvr);
const CompatInfo *min = compat_by_pvr(min_compat_pvr);
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index ab68abe..c559740 100644
index 0707177584..60cc41fd53 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1376,6 +1376,7 @@ static inline int cpu_mmu_index (CPUPPCState *env, bool ifetch)
@@ -1381,6 +1381,7 @@ static inline int cpu_mmu_index (CPUPPCState *env, bool ifetch)
/* Compatibility modes */
#if defined(TARGET_PPC64)
@ -393,5 +410,5 @@ index ab68abe..c559740 100644
uint32_t min_compat_pvr, uint32_t max_compat_pvr);
bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr,
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From 07b2731f23166ca13bace5faacd35ab5129fb878 Mon Sep 17 00:00:00 2001
From 4f7991558861584776c7c61dd56f339ed453372d Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:47:32 +0200
Subject: Add s390x machine types
@ -7,17 +7,25 @@ Adding changes to add RHEL machine types for s390x architecture.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase changes (weekly-190111):
- Use upstream compat handling
Merged patches (3.1.0):
- 29df663 s390x/cpumodel: default enable bpb and ppa15 for z196 and later
Merged patches (weekly-190118):
- 6c200d665b hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 50 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
hw/s390x/s390-virtio-ccw.c | 73 +++++++++++++++++++++++++++++++++++++-
1 file changed, 72 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index a0615a8..04f4c1a 100644
index d11069b860..8c672dfd02 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -627,7 +627,7 @@ bool css_migration_enabled(void)
@@ -622,7 +622,7 @@ bool css_migration_enabled(void)
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
ccw_machine_##suffix##_class_options(mc); \
@ -26,41 +34,62 @@ index a0615a8..04f4c1a 100644
if (latest) { \
mc->alias = "s390-ccw-virtio"; \
mc->is_default = 1; \
@@ -657,6 +657,8 @@ bool css_migration_enabled(void)
#define CCW_COMPAT_2_12 \
HW_COMPAT_2_12
@@ -646,6 +646,9 @@ bool css_migration_enabled(void)
} \
type_init(ccw_machine_register_##suffix)
+
+#if 0 /* Disabled for Red Hat Enterprise Linux */
+
#define CCW_COMPAT_2_11 \
HW_COMPAT_2_11 \
{\
@@ -894,6 +896,52 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
static void ccw_machine_4_0_instance_options(MachineState *machine)
{
}
@@ -846,6 +849,74 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
}
DEFINE_CCW_MACHINE(2_4, "2.4", false);
+#else
+
+/*
+ * like CCW_COMPAT_2_11, but includes HW_COMPAT_RHEL7_5 (derived from
+ * HW_COMPAT_2_11 and HW_COMPAT_2_10) instead of HW_COMPAT_2_11
+ * like CCW_COMPAT_2_12 + CCW_COMPAT_3_0 (which are empty), but includes
+ * HW_COMPAT_RHEL7_6 instead of HW_COMPAT_2_11 and HW_COMPAT_3_0
+ */
+#define CCW_COMPAT_RHEL7_5 \
+ HW_COMPAT_RHEL7_5 \
+ {\
+ .driver = TYPE_SCLP_EVENT_FACILITY,\
+ .property = "allow_all_mask_sizes",\
+ .value = "off",\
+
+GlobalProperty ccw_compat_rhel_7_6[] =
+{
+};
+const size_t ccw_compat_rhel_7_6_len = G_N_ELEMENTS(ccw_compat_rhel_7_6);
+
+GlobalProperty ccw_compat_rhel_7_5[] = {
+ {
+ .driver = TYPE_SCLP_EVENT_FACILITY,
+ .property = "allow_all_mask_sizes",
+ .value = "off",
+ },
+};
+const size_t ccw_compat_rhel_7_5_len = G_N_ELEMENTS(ccw_compat_rhel_7_5);
+
+static void ccw_machine_rhel800_instance_options(MachineState *machine)
+{
+}
+
+static void ccw_machine_rhel800_class_options(MachineClass *mc)
+{
+}
+DEFINE_CCW_MACHINE(rhel800, "rhel8.0.0", true);
+
+static void ccw_machine_rhel760_instance_options(MachineState *machine)
+{
+ ccw_machine_rhel800_instance_options(machine);
+}
+
+static void ccw_machine_rhel760_class_options(MachineClass *mc)
+{
+ ccw_machine_rhel800_class_options(mc);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
+ compat_props_add(mc->compat_props, ccw_compat_rhel_7_6, ccw_compat_rhel_7_6_len);
+}
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", true);
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false);
+
+static void ccw_machine_rhel750_instance_options(MachineState *machine)
+{
@ -79,7 +108,9 @@ index a0615a8..04f4c1a 100644
+static void ccw_machine_rhel750_class_options(MachineClass *mc)
+{
+ ccw_machine_rhel760_class_options(mc);
+ SET_MACHINE_COMPAT(mc, CCW_COMPAT_RHEL7_5);
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
+ compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len);
+ S390_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
+}
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
+
@ -89,5 +120,5 @@ index a0615a8..04f4c1a 100644
{
type_register_static(&ccw_machine_info);
--
1.8.3.1
2.20.1

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 5a614332800ab5367d0be248e665250fe92964ba Mon Sep 17 00:00:00 2001
From 0442a72cf9da8f79fe26b08999f2dca900af6ad0 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 19 Oct 2018 13:48:41 +0200
Subject: Enable make check
@ -7,34 +7,35 @@ Fixing tests after device disabling and machine types changes and enabling
make check run during build.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase changes (4.0.0):
- Remove testing for pseries-2.7 in endianess test
- Disable device-plug-test on s390x as it use disabled device
- Do not run cpu-plug-tests on 7.3 and older machine types
Merged patches (4.0.0:
- f7ffd13 Remove 7 qcow2 and luks iotests that are taking > 25 sec to run during the fast train build proce
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
redhat/qemu-kvm.spec.template | 2 +-
tests/Makefile.include | 20 ++++++++++----------
redhat/qemu-kvm.spec.template | 8 +++++++-
tests/Makefile.include | 10 +++++-----
tests/boot-serial-test.c | 6 +++++-
tests/cpu-plug-test.c | 3 ++-
tests/cpu-plug-test.c | 4 ++--
tests/e1000-test.c | 2 ++
tests/endianness-test.c | 2 ++
tests/prom-env-test.c | 2 ++
tests/qemu-iotests/051 | 12 ++++++------
tests/qemu-iotests/group | 4 ++--
tests/test-x86-cpuid-compat.c | 2 ++
tests/usb-hcd-xhci-test.c | 4 ++++
10 files changed, 36 insertions(+), 21 deletions(-)
11 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index fb0b449..f2305a5 100644
index 36fc73fef5..e8f5fbc2c6 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -171,20 +171,20 @@ check-qtest-pci-$(CONFIG_IPACK) += $(check-qtest-ipack-y)
check-qtest-pci-y += tests/display-vga-test$(EXESUF)
check-qtest-pci-$(CONFIG_HDA) += tests/intel-hda-test$(EXESUF)
check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) += tests/ivshmem-test$(EXESUF)
-check-qtest-pci-y += tests/megasas-test$(EXESUF)
+#check-qtest-pci-y += tests/megasas-test$(EXESUF)
check-qtest-i386-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
-check-qtest-i386-y += tests/fdc-test$(EXESUF)
+#check-qtest-i386-y += tests/fdc-test$(EXESUF)
check-qtest-i386-y += tests/ide-test$(EXESUF)
@@ -162,7 +162,7 @@ check-qtest-i386-y += tests/ide-test$(EXESUF)
check-qtest-i386-y += tests/ahci-test$(EXESUF)
check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
check-qtest-i386-y += tests/boot-order-test$(EXESUF)
@ -43,14 +44,7 @@ index fb0b449..f2305a5 100644
check-qtest-i386-$(CONFIG_SGA) += tests/boot-serial-test$(EXESUF)
check-qtest-i386-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
check-qtest-i386-y += tests/rtc-test$(EXESUF)
-check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF)
-check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF)
+#check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF)
+#check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF)
check-qtest-i386-y += tests/i440fx-test$(EXESUF)
check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
check-qtest-i386-y += tests/drive_del-test$(EXESUF)
@@ -238,15 +238,15 @@ check-qtest-mips64el-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
@@ -221,7 +221,7 @@ check-qtest-mips64el-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-moxie-y += tests/boot-serial-test$(EXESUF)
check-qtest-ppc-$(CONFIG_ISA_TESTDEV) = tests/endianness-test$(EXESUF)
@ -59,32 +53,31 @@ index fb0b449..f2305a5 100644
check-qtest-ppc-y += tests/prom-env-test$(EXESUF)
check-qtest-ppc-y += tests/drive_del-test$(EXESUF)
check-qtest-ppc-y += tests/boot-serial-test$(EXESUF)
-check-qtest-ppc-y += tests/m48t59-test$(EXESUF)
+#check-qtest-ppc-y += tests/m48t59-test$(EXESUF)
check-qtest-ppc64-y += $(check-qtest-ppc-y)
check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
-check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF)
+#check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF)
check-qtest-ppc64-y += tests/migration-test$(EXESUF)
check-qtest-ppc64-y += tests/rtas-test$(EXESUF)
@@ -235,8 +235,8 @@ check-qtest-ppc64-$(CONFIG_PSERIES) += tests/rtas-test$(EXESUF)
check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
@@ -254,8 +254,8 @@ check-qtest-ppc64-$(CONFIG_USB_OHCI) += tests/usb-hcd-ohci-test$(EXESUF)
check-qtest-ppc64-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF)
check-qtest-ppc64-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF)
check-qtest-ppc64-y += $(check-qtest-virtio-y)
-check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
-check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
+#check-qtest-ppc64-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
+#check-qtest-ppc64-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
check-qtest-ppc64-$(CONFIG_RTL8139_PCI) += tests/test-filter-redirector$(EXESUF)
check-qtest-ppc64-y += tests/display-vga-test$(EXESUF)
check-qtest-ppc64-$(CONFIG_VGA) += tests/display-vga-test$(EXESUF)
check-qtest-ppc64-y += tests/numa-test$(EXESUF)
@@ -278,7 +278,7 @@ check-qtest-s390x-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF)
check-qtest-s390x-y += tests/drive_del-test$(EXESUF)
-check-qtest-s390x-y += tests/device-plug-test$(EXESUF)
+#check-qtest-s390x-y += tests/device-plug-test$(EXESUF)
check-qtest-s390x-y += tests/virtio-ccw-test$(EXESUF)
check-qtest-s390x-y += tests/cpu-plug-test$(EXESUF)
check-qtest-s390x-y += tests/migration-test$(EXESUF)
diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c
index 8ec6aed..6a533b9 100644
index c591748aaf..c5873f8b24 100644
--- a/tests/boot-serial-test.c
+++ b/tests/boot-serial-test.c
@@ -97,16 +97,20 @@ static testdef_t tests[] = {
@@ -97,18 +97,22 @@ static testdef_t tests[] = {
{ "ppc", "g3beige", "", "PowerPC,750" },
{ "ppc", "mac99", "", "PowerPC,G4" },
{ "ppc", "sam460ex", "-m 256", "DRAM: 256 MiB" },
@ -93,7 +86,9 @@ index 8ec6aed..6a533b9 100644
{ "ppc64", "40p", "-m 192", "Memory: 192M" },
{ "ppc64", "mac99", "", "PowerPC,970FX" },
+#endif
{ "ppc64", "pseries", "", "Open Firmware" },
{ "ppc64", "pseries",
"-machine cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken",
"Open Firmware" },
+#if 0 /* Disabled for Red Hat Enterprise Linux */
{ "ppc64", "powernv", "-cpu POWER8", "OPAL" },
{ "ppc64", "sam460ex", "-device e1000", "8086 100e" },
@ -107,39 +102,56 @@ index 8ec6aed..6a533b9 100644
{ "sparc", "LX", "", "TMS390S10" },
{ "sparc", "SS-4", "", "MB86904" },
diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c
index f4a677d..70a3d1d 100644
index 668f00144e..453ca8e583 100644
--- a/tests/cpu-plug-test.c
+++ b/tests/cpu-plug-test.c
@@ -193,7 +193,8 @@ static void add_pseries_test_case(const char *mname)
@@ -190,8 +190,8 @@ static void add_pseries_test_case(const char *mname)
char *path;
PlugTestData *data;
if (!g_str_has_prefix(mname, "pseries-") ||
- if (!g_str_has_prefix(mname, "pseries-") ||
- (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7)) {
+ (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7) ||
+ strcmp(mname,"pseries-rhel7.2.0") == 0) {
+ if (!g_str_has_prefix(mname, "pseries-rhel") ||
+ (g_str_has_prefix(mname, "pseries-rhel7.") && atoi(&mname[14]) < 4)) {
return;
}
data = g_new(PlugTestData, 1);
diff --git a/tests/e1000-test.c b/tests/e1000-test.c
index 0c5fcdc..b830432 100644
index 9e67916169..adbd07f997 100644
--- a/tests/e1000-test.c
+++ b/tests/e1000-test.c
@@ -29,8 +29,10 @@ static void test_device(gconstpointer data)
@@ -21,9 +21,11 @@ struct QE1000 {
static const char *models[] = {
"e1000",
"e1000-82540em",
+#if 0 /* Disabled for Red Hat Enterprise Linux */
"e1000-82540em",
"e1000-82544gc",
"e1000-82545em",
+#endif
};
int main(int argc, char **argv)
static void *e1000_get_driver(void *obj, const char *interface)
diff --git a/tests/endianness-test.c b/tests/endianness-test.c
index 58527952a5..1d729ec7f2 100644
--- a/tests/endianness-test.c
+++ b/tests/endianness-test.c
@@ -39,8 +39,10 @@ static const TestCase test_cases[] = {
{ "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" },
{ "ppc64", "mac99", 0xf2000000, .bswap = true, .superio = "i82378" },
{ "ppc64", "pseries", (1ULL << 45), .bswap = true, .superio = "i82378" },
+#if 0 /* Disabled in Red Hat Enterprise Linux */
{ "ppc64", "pseries-2.7", 0x10080000000ULL,
.bswap = true, .superio = "i82378" },
+#endif
{ "sh4", "r2d", 0xfe240000, .superio = "i82378" },
{ "sh4eb", "r2d", 0xfe240000, .bswap = true, .superio = "i82378" },
{ "sparc64", "sun4u", 0x1fe02000000LL, .bswap = true },
diff --git a/tests/prom-env-test.c b/tests/prom-env-test.c
index 198d007..4bea07f 100644
index 61bc1d1e7b..aeb76b0bc3 100644
--- a/tests/prom-env-test.c
+++ b/tests/prom-env-test.c
@@ -82,7 +82,9 @@ int main(int argc, char *argv[])
@@ -88,7 +88,9 @@ int main(int argc, char *argv[])
if (!strcmp(arch, "ppc")) {
add_tests(ppc_machines);
} else if (!strcmp(arch, "ppc64")) {
@ -150,7 +162,7 @@ index 198d007..4bea07f 100644
qtest_add_data_func("prom-env/pseries", "pseries", test_machine);
}
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 32741d7..85ef52e 100755
index 02ac960da4..29f13440c0 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -182,11 +182,11 @@ run_qemu -drive if=virtio
@ -184,7 +196,7 @@ index 32741d7..85ef52e 100755
*)
;;
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 61a6d98..05996ae 100644
index bae7718380..0db5e68af1 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -77,7 +77,7 @@
@ -206,7 +218,7 @@ index 61a6d98..05996ae 100644
101 rw auto quick
102 rw auto quick
diff --git a/tests/test-x86-cpuid-compat.c b/tests/test-x86-cpuid-compat.c
index e75b959..6b46b73 100644
index e75b959950..6b46b73dd0 100644
--- a/tests/test-x86-cpuid-compat.c
+++ b/tests/test-x86-cpuid-compat.c
@@ -300,6 +300,7 @@ int main(int argc, char **argv)
@ -226,7 +238,7 @@ index e75b959..6b46b73 100644
/* Test feature parsing */
add_feature_test("x86/cpuid/features/plus",
diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c
index 9eb24b0..465ed26 100644
index 9eb24b00e4..465ed26dfc 100644
--- a/tests/usb-hcd-xhci-test.c
+++ b/tests/usb-hcd-xhci-test.c
@@ -21,6 +21,7 @@ static void test_xhci_hotplug(void)
@ -256,5 +268,5 @@ index 9eb24b0..465ed26 100644
qtest_start("-device nec-usb-xhci,id=xhci"
--
1.8.3.1
2.20.1

View File

@ -1,41 +0,0 @@
From 445df6a548c20d21c3275d91bcd96c6b0fde9c97 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Thu, 18 Dec 2014 06:27:49 +0100
Subject: Use kvm by default
Bugzilla: 906185
RHEL uses kvm accelerator by default, if available.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Rebase notes (2.10.0)
- variable rename (upstream)
Rebase notes (2.2.0):
- Move code from vl.c to accel.c
(cherry picked from commit abcd662eb8e516ebe4a6b401e83a62f749491a15)
(cherry picked from commit eca6d5766d956c37e3f7f28d70903d357308c846)
---
accel/accel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/accel/accel.c b/accel/accel.c
index 966b2d8..e8ca7bb 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -79,8 +79,8 @@ void configure_accelerator(MachineState *ms)
accel = qemu_opt_get(qemu_get_machine_opts(), "accel");
if (accel == NULL) {
- /* Use the default "accelerator", tcg */
- accel = "tcg";
+ /* RHEL uses kvm as the default accelerator, fallback to tcg */
+ accel = "kvm:tcg";
}
accel_list = g_strsplit(accel, ":", 0);
--
1.8.3.1

View File

@ -1,4 +1,4 @@
From 0b8b44ec1fc3a0d17f13c07ac4c7351769a63300 Mon Sep 17 00:00:00 2001
From b0626d1bb4f6ec6fba1973ebb26a297e79e95437 Mon Sep 17 00:00:00 2001
From: Bandan Das <bsd@redhat.com>
Date: Tue, 3 Dec 2013 20:05:13 +0100
Subject: vfio: cap number of devices that can be assigned
@ -32,12 +32,13 @@ Merged patches (2.9.0):
(cherry picked from commit 9fa3c9fc6dfcde76d80db1aa601b2d577f72ceec)
(cherry picked from commit 3cb35556dc7d994f203d732fe952f95fcdb03c0a)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/vfio/pci.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 6e0000c..d242c62 100644
index 13badcd6ed..7c998afc0f 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -36,6 +36,7 @@
@ -48,7 +49,7 @@ index 6e0000c..d242c62 100644
#define TYPE_VFIO_PCI "vfio-pci"
#define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
@@ -2811,9 +2812,21 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
@@ -2806,9 +2807,21 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
ssize_t len;
struct stat st;
int groupid;
@ -72,5 +73,5 @@ index 6e0000c..d242c62 100644
if (!(~vdev->host.domain || ~vdev->host.bus ||
~vdev->host.slot || ~vdev->host.function)) {
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From f06750384e9e241c7cc6f14b6fdedea3c4237790 Mon Sep 17 00:00:00 2001
From 6ae79fe200eab13f75050a10b48cea3b5bf21aab Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 4 Dec 2013 18:53:17 +0100
Subject: Add support statement to -help output
@ -18,15 +18,16 @@ as unsupported by Red Hat, and advising users to use libvirt instead.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 2a07700936e39856cc9f149c6a6517f0715536a6)
(cherry picked from commit 5dd2f4706e2fef945771949e59a8fcc1b5452de9)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
vl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/vl.c b/vl.c
index 22bd99c..74b32c4 100644
index 3ada215270..32886ebf7f 100644
--- a/vl.c
+++ b/vl.c
@@ -1904,9 +1904,17 @@ static void version(void)
@@ -1982,9 +1982,17 @@ static void version(void)
QEMU_COPYRIGHT "\n");
}
@ -44,7 +45,7 @@ index 22bd99c..74b32c4 100644
printf("usage: %s [options] [disk_image]\n\n"
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
error_get_progname());
@@ -1923,6 +1931,7 @@ static void help(int exitcode)
@@ -2001,6 +2009,7 @@ static void help(int exitcode)
"\n"
QEMU_HELP_BOTTOM "\n");
@ -53,5 +54,5 @@ index 22bd99c..74b32c4 100644
}
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From b64599f8f72d89ac75557608f1890abb8effb88b Mon Sep 17 00:00:00 2001
From 4d15d2010db402f5910a9b7e4c147a9a3e2f2604 Mon Sep 17 00:00:00 2001
From: Andrew Jones <drjones@redhat.com>
Date: Tue, 21 Jan 2014 10:46:52 +0100
Subject: globally limit the maximum number of CPUs
@ -77,16 +77,18 @@ This commit matches the limit to current KVM_CAP_NR_VCPUS value.
Conflicts:
vl.c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
accel/kvm/kvm-all.c | 12 ++++++++++++
vl.c | 18 ++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 4880a05..a8f5d47 100644
index 241db496c3..003c0abee2 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -1627,6 +1627,18 @@ static int kvm_init(MachineState *ms)
@@ -1630,6 +1630,18 @@ static int kvm_init(MachineState *ms)
soft_vcpus_limit = kvm_recommended_vcpus(s);
hard_vcpus_limit = kvm_max_vcpus(s);
@ -106,10 +108,10 @@ index 4880a05..a8f5d47 100644
if (nc->num > soft_vcpus_limit) {
warn_report("Number of %s cpus requested (%d) exceeds "
diff --git a/vl.c b/vl.c
index 74b32c4..0a9bdc2 100644
index 32886ebf7f..2b95925f9b 100644
--- a/vl.c
+++ b/vl.c
@@ -134,6 +134,8 @@ int main(int argc, char **argv)
@@ -131,6 +131,8 @@ int main(int argc, char **argv)
#define MAX_VIRTIO_CONSOLES 1
@ -118,7 +120,7 @@ index 74b32c4..0a9bdc2 100644
static const char *data_dir[16];
static int data_dir_idx;
const char *bios_name = NULL;
@@ -1463,6 +1465,20 @@ MachineClass *find_default_machine(void)
@@ -1508,6 +1510,20 @@ MachineClass *find_default_machine(void)
return mc;
}
@ -139,7 +141,7 @@ index 74b32c4..0a9bdc2 100644
MachineInfoList *qmp_query_machines(Error **errp)
{
GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
@@ -4021,6 +4037,8 @@ int main(int argc, char **argv, char **envp)
@@ -3994,6 +4010,8 @@ int main(int argc, char **argv, char **envp)
"mutually exclusive");
exit(EXIT_FAILURE);
}
@ -149,5 +151,5 @@ index 74b32c4..0a9bdc2 100644
configure_rtc(qemu_find_opts_singleton("rtc"));
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From 490f864563ddcb367e6cf58d1be4a9cbed3a5e2b Mon Sep 17 00:00:00 2001
From 75da6e38041efca51934a46a4d481eaac57d4b1e Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Thu, 8 Oct 2015 09:50:17 +0200
Subject: Add support for simpletrace
@ -23,23 +23,24 @@ Merged patches (2.3.0):
- 85c4c8f trace: add systemtap-initscript README file to RPM
(cherry picked from commit bfc1d7f3628f2ffbabbae71d57a506cea6663ddf)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
.gitignore | 2 ++
Makefile | 4 +++
README.systemtap | 43 +++++++++++++++++++++++++++++++++
redhat/qemu-kvm.spec.template | 29 ++++++++++++++++++++--
README.systemtap | 43 +++++++++++++++++++++++++
redhat/qemu-kvm.spec.template | 26 ++++++++++++++-
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +++
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
6 files changed, 81 insertions(+), 2 deletions(-)
6 files changed, 79 insertions(+), 1 deletion(-)
create mode 100644 README.systemtap
create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf
create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp
diff --git a/Makefile b/Makefile
index 152821a..8710720 100644
index 05f62eab3c..41a77a90af 100644
--- a/Makefile
+++ b/Makefile
@@ -892,6 +892,10 @@ endif
@@ -832,6 +832,10 @@ endif
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
done
$(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
@ -52,7 +53,7 @@ index 152821a..8710720 100644
done
diff --git a/README.systemtap b/README.systemtap
new file mode 100644
index 0000000..ad913fc
index 0000000000..ad913fc990
--- /dev/null
+++ b/README.systemtap
@@ -0,0 +1,43 @@
@ -101,7 +102,7 @@ index 0000000..ad913fc
+ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log
diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf
new file mode 100644
index 0000000..372d816
index 0000000000..372d8160a4
--- /dev/null
+++ b/scripts/systemtap/conf.d/qemu_kvm.conf
@@ -0,0 +1,4 @@
@ -111,11 +112,11 @@ index 0000000..372d816
+qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes
diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp
new file mode 100644
index 0000000..c04abf9
index 0000000000..c04abf9449
--- /dev/null
+++ b/scripts/systemtap/script.d/qemu_kvm.stp
@@ -0,0 +1 @@
+probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {}
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From 081800f80d82ce8d71a1075b3d888f2e298ad183 Mon Sep 17 00:00:00 2001
From ec354bd88aaaf383bdb2177f94dec39b930cbf90 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Fri, 30 Nov 2018 09:11:03 +0100
Subject: Use qemu-kvm in documentation instead of qemu-system-<arch>
@ -16,15 +16,16 @@ We change the name and location of qemu-kvm binaries. Update documentation
to reflect this change. Only architectures available in RHEL are updated.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
docs/qemu-block-drivers.texi | 70 +++++++++++-----------
docs/qemu-cpu-models.texi | 8 +--
qemu-doc.texi | 70 +++++++++++-----------
qemu-options.hx | 140 ++++++++++++++++++++++---------------------
docs/qemu-block-drivers.texi | 70 +++++++++---------
docs/qemu-cpu-models.texi | 8 +-
qemu-doc.texi | 70 +++++++++---------
qemu-options.hx | 140 ++++++++++++++++++-----------------
4 files changed, 146 insertions(+), 142 deletions(-)
diff --git a/docs/qemu-block-drivers.texi b/docs/qemu-block-drivers.texi
index 38e9f34..2e71ec9 100644
index da06a9bc83..03c6705505 100644
--- a/docs/qemu-block-drivers.texi
+++ b/docs/qemu-block-drivers.texi
@@ -405,7 +405,7 @@ QEMU can automatically create a virtual FAT disk image from a
@ -235,10 +236,10 @@ index 38e9f34..2e71ec9 100644
@var{host}:@var{bus}:@var{slot}.@var{func} is the NVMe controller's PCI device
diff --git a/docs/qemu-cpu-models.texi b/docs/qemu-cpu-models.texi
index 1935f98..93672de 100644
index 23c11dc86f..8697254ad4 100644
--- a/docs/qemu-cpu-models.texi
+++ b/docs/qemu-cpu-models.texi
@@ -387,25 +387,25 @@ CPU models / features in QEMU and libvirt
@@ -566,25 +566,25 @@ CPU models / features in QEMU and libvirt
@item Host passthrough
@example
@ -269,10 +270,10 @@ index 1935f98..93672de 100644
@end table
diff --git a/qemu-doc.texi b/qemu-doc.texi
index f7ad1df..0e4b34a 100644
index ae3c3f9632..a8cd3660bc 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -205,12 +205,12 @@ Note that, by default, GUS shares IRQ(7) with parallel ports and so
@@ -206,12 +206,12 @@ Note that, by default, GUS shares IRQ(7) with parallel ports and so
QEMU must be told to not have parallel ports to have working GUS.
@example
@ -287,7 +288,7 @@ index f7ad1df..0e4b34a 100644
@end example
Or some other unclaimed IRQ.
@@ -226,7 +226,7 @@ CS4231A is the chip used in Windows Sound System and GUSMAX products
@@ -227,7 +227,7 @@ CS4231A is the chip used in Windows Sound System and GUSMAX products
Download and uncompress the linux image (@file{linux.img}) and type:
@example
@ -296,7 +297,7 @@ index f7ad1df..0e4b34a 100644
@end example
Linux should boot and give you a prompt.
@@ -236,7 +236,7 @@ Linux should boot and give you a prompt.
@@ -237,7 +237,7 @@ Linux should boot and give you a prompt.
@example
@c man begin SYNOPSIS
@ -305,7 +306,7 @@ index f7ad1df..0e4b34a 100644
@c man end
@end example
@@ -276,21 +276,21 @@ is specified in seconds. The default is 0 which means no timeout. Libiscsi
@@ -277,21 +277,21 @@ is specified in seconds. The default is 0 which means no timeout. Libiscsi
Example (without authentication):
@example
@ -330,7 +331,7 @@ index f7ad1df..0e4b34a 100644
@end example
@item NBD
@@ -305,12 +305,12 @@ Syntax for specifying a NBD device using Unix Domain Sockets
@@ -306,12 +306,12 @@ Syntax for specifying a NBD device using Unix Domain Sockets
Example for TCP
@example
@ -345,7 +346,7 @@ index f7ad1df..0e4b34a 100644
@end example
@item SSH
@@ -318,8 +318,8 @@ QEMU supports SSH (Secure Shell) access to remote disks.
@@ -319,8 +319,8 @@ QEMU supports SSH (Secure Shell) access to remote disks.
Examples:
@example
@ -356,7 +357,7 @@ index f7ad1df..0e4b34a 100644
@end example
Currently authentication must be done using ssh-agent. Other
@@ -337,7 +337,7 @@ sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
@@ -338,7 +338,7 @@ sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
Example
@example
@ -365,7 +366,7 @@ index f7ad1df..0e4b34a 100644
@end example
See also @url{https://sheepdog.github.io/sheepdog/}.
@@ -363,17 +363,17 @@ JSON:
@@ -364,17 +364,17 @@ JSON:
Example
@example
URI:
@ -386,7 +387,7 @@ index f7ad1df..0e4b34a 100644
@ file.debug=9,file.logfile=/var/log/qemu-gluster.log,
@ file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,
@ file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
@@ -438,9 +438,9 @@ of <protocol>.
@@ -439,9 +439,9 @@ of <protocol>.
Example: boot from a remote Fedora 20 live ISO image
@example
@ -398,7 +399,7 @@ index f7ad1df..0e4b34a 100644
@end example
Example: boot from a remote Fedora 20 cloud image using a local overlay for
@@ -448,7 +448,7 @@ writes, copy-on-read, and a readahead of 64k
@@ -449,7 +449,7 @@ writes, copy-on-read, and a readahead of 64k
@example
qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"http",, "file.url":"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2",, "file.readahead":"64k"@}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2
@ -407,7 +408,7 @@ index f7ad1df..0e4b34a 100644
@end example
Example: boot from an image stored on a VMware vSphere server with a self-signed
@@ -457,7 +457,7 @@ of 10 seconds.
@@ -458,7 +458,7 @@ of 10 seconds.
@example
qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"https",, "file.url":"https://user:password@@vsphere.example.com/folder/test/test-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10@}' /tmp/test.qcow2
@ -416,7 +417,7 @@ index f7ad1df..0e4b34a 100644
@end example
@end table
@@ -824,7 +824,7 @@ On Linux hosts, a shared memory device is available. The basic syntax
@@ -825,7 +825,7 @@ On Linux hosts, a shared memory device is available. The basic syntax
is:
@example
@ -425,7 +426,7 @@ index f7ad1df..0e4b34a 100644
@end example
where @var{hostmem} names a host memory backend. For a POSIX shared
@@ -845,7 +845,7 @@ memory server is:
@@ -846,7 +846,7 @@ memory server is:
ivshmem-server -p @var{pidfile} -S @var{path} -m @var{shm-name} -l @var{shm-size} -n @var{vectors}
# Then start your qemu instances with matching arguments
@ -434,7 +435,7 @@ index f7ad1df..0e4b34a 100644
-chardev socket,path=@var{path},id=@var{id}
@end example
@@ -870,7 +870,7 @@ Instead of specifying the <shm size> using POSIX shm, you may specify
@@ -871,7 +871,7 @@ Instead of specifying the <shm size> using POSIX shm, you may specify
a memory backend that has hugepage support:
@example
@ -443,7 +444,7 @@ index f7ad1df..0e4b34a 100644
-device ivshmem-plain,memdev=mb1
@end example
@@ -886,7 +886,7 @@ kernel testing.
@@ -887,7 +887,7 @@ kernel testing.
The syntax is:
@example
@ -452,7 +453,7 @@ index f7ad1df..0e4b34a 100644
@end example
Use @option{-kernel} to provide the Linux kernel image and
@@ -901,7 +901,7 @@ If you do not need graphical output, you can disable it and redirect
@@ -902,7 +902,7 @@ If you do not need graphical output, you can disable it and redirect
the virtual serial port and the QEMU monitor to the console with the
@option{-nographic} option. The typical command line is:
@example
@ -461,7 +462,7 @@ index f7ad1df..0e4b34a 100644
-append "root=/dev/hda console=ttyS0" -nographic
@end example
@@ -967,7 +967,7 @@ Network adapter that supports CDC ethernet and RNDIS protocols. @var{id}
@@ -968,7 +968,7 @@ Network adapter that supports CDC ethernet and RNDIS protocols. @var{id}
specifies a netdev defined with @code{-netdev @dots{},id=@var{id}}.
For instance, user-mode networking can be used with
@example
@ -470,7 +471,7 @@ index f7ad1df..0e4b34a 100644
@end example
@item usb-ccid
Smartcard reader device
@@ -986,7 +986,7 @@ no type is given, the HCI logic corresponds to @code{-bt hci,vlan=0}.
@@ -987,7 +987,7 @@ no type is given, the HCI logic corresponds to @code{-bt hci,vlan=0}.
This USB device implements the USB Transport Layer of HCI. Example
usage:
@example
@ -479,7 +480,7 @@ index f7ad1df..0e4b34a 100644
@end example
@end table
@@ -1063,7 +1063,7 @@ For this setup it is recommended to restrict it to listen on a UNIX domain
@@ -1064,7 +1064,7 @@ For this setup it is recommended to restrict it to listen on a UNIX domain
socket only. For example
@example
@ -488,7 +489,7 @@ index f7ad1df..0e4b34a 100644
@end example
This ensures that only users on local box with read/write access to that
@@ -1086,7 +1086,7 @@ is running the password is set with the monitor. Until the monitor is used to
@@ -1087,7 +1087,7 @@ is running the password is set with the monitor. Until the monitor is used to
set the password all clients will be rejected.
@example
@ -497,7 +498,7 @@ index f7ad1df..0e4b34a 100644
(qemu) change vnc password
Password: ********
(qemu)
@@ -1103,7 +1103,7 @@ support provides a secure session, but no authentication. This allows any
@@ -1104,7 +1104,7 @@ support provides a secure session, but no authentication. This allows any
client to connect, and provides an encrypted session.
@example
@ -506,7 +507,7 @@ index f7ad1df..0e4b34a 100644
-object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=no \
-vnc :1,tls-creds=tls0 -monitor stdio
@end example
@@ -1125,7 +1125,7 @@ same syntax as previously, but with @code{verify-peer} set to @code{yes}
@@ -1126,7 +1126,7 @@ same syntax as previously, but with @code{verify-peer} set to @code{yes}
instead.
@example
@ -515,7 +516,7 @@ index f7ad1df..0e4b34a 100644
-object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=yes \
-vnc :1,tls-creds=tls0 -monitor stdio
@end example
@@ -1138,7 +1138,7 @@ Finally, the previous method can be combined with VNC password authentication
@@ -1139,7 +1139,7 @@ Finally, the previous method can be combined with VNC password authentication
to provide two layers of authentication for clients.
@example
@ -524,7 +525,7 @@ index f7ad1df..0e4b34a 100644
-object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=yes \
-vnc :1,tls-creds=tls0,password -monitor stdio
(qemu) change vnc password
@@ -1163,7 +1163,7 @@ used for authentication, but assuming use of one supporting SSF,
@@ -1164,7 +1164,7 @@ used for authentication, but assuming use of one supporting SSF,
then QEMU can be launched with:
@example
@ -533,7 +534,7 @@ index f7ad1df..0e4b34a 100644
@end example
@node vnc_sec_certificate_sasl
@@ -1177,7 +1177,7 @@ credentials. This can be enabled, by combining the 'sasl' option
@@ -1178,7 +1178,7 @@ credentials. This can be enabled, by combining the 'sasl' option
with the aforementioned TLS + x509 options:
@example
@ -542,7 +543,7 @@ index f7ad1df..0e4b34a 100644
-object tls-creds-x509,id=tls0,dir=/etc/pki/qemu,endpoint=server,verify-peer=yes \
-vnc :1,tls-creds=tls0,sasl -monitor stdio
@end example
@@ -1572,7 +1572,7 @@ QEMU has a primitive support to work with gdb, so that you can do
@@ -1573,7 +1573,7 @@ QEMU has a primitive support to work with gdb, so that you can do
In order to use gdb, launch QEMU with the '-s' option. It will wait for a
gdb connection:
@example
@ -551,7 +552,7 @@ index f7ad1df..0e4b34a 100644
-append "root=/dev/hda"
Connected to host network interface: tun0
Waiting gdb connection on port 1234
@@ -1818,7 +1818,7 @@ Set the initial VGA graphic mode. The default is 800x600x32.
@@ -1819,7 +1819,7 @@ Set the initial VGA graphic mode. The default is 800x600x32.
Set OpenBIOS variables in NVRAM, for example:
@example
@ -561,7 +562,7 @@ index f7ad1df..0e4b34a 100644
-prom-env 'boot-args=conf=hd:2,\yaboot.conf'
@end example
diff --git a/qemu-options.hx b/qemu-options.hx
index 5e13aa9..2a60e51 100644
index 0f55062546..7ec1a3b099 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -253,7 +253,7 @@ This option defines a free-form string that can be used to describe @var{fd}.
@ -606,7 +607,7 @@ index 5e13aa9..2a60e51 100644
@end example
If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
@@ -438,12 +438,12 @@ Enable audio and selected sound hardware. Use 'help' to print all
@@ -668,12 +668,12 @@ Enable audio and selected sound hardware. Use 'help' to print all
available sound hardware.
@example
@ -625,7 +626,7 @@ index 5e13aa9..2a60e51 100644
@end example
Note that Linux's i810_audio OSS kernel (for AC97) module might
@@ -918,21 +918,21 @@ is off.
@@ -1148,21 +1148,21 @@ is off.
Instead of @option{-cdrom} you can use:
@example
@ -653,7 +654,7 @@ index 5e13aa9..2a60e51 100644
-add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
-add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
-drive file=/dev/fdset/2,index=0,media=disk
@@ -940,28 +940,28 @@ qemu-system-i386
@@ -1170,28 +1170,28 @@ qemu-system-i386
You can connect a CDROM to the slave of ide0:
@example
@ -688,7 +689,7 @@ index 5e13aa9..2a60e51 100644
@end example
ETEXI
@@ -1975,8 +1975,8 @@ The following two example do exactly the same, to show how @option{-nic} can
@@ -2217,8 +2217,8 @@ The following two example do exactly the same, to show how @option{-nic} can
be used to shorten the command line length (note that the e1000 is the default
on i386, so the @option{model=e1000} parameter could even be omitted here, too):
@example
@ -699,7 +700,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -nic none
@@ -2047,7 +2047,7 @@ can not be resolved.
@@ -2289,7 +2289,7 @@ can not be resolved.
Example:
@example
@ -708,7 +709,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item domainname=@var{domain}
@@ -2071,7 +2071,7 @@ a guest from a local directory.
@@ -2313,7 +2313,7 @@ a guest from a local directory.
Example (using pxelinux):
@example
@ -717,7 +718,7 @@ index 5e13aa9..2a60e51 100644
-netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
@end example
@@ -2105,7 +2105,7 @@ screen 0, use the following:
@@ -2347,7 +2347,7 @@ screen 0, use the following:
@example
# on the host
@ -726,7 +727,7 @@ index 5e13aa9..2a60e51 100644
# this host xterm should open in the guest X11 server
xterm -display :1
@end example
@@ -2115,7 +2115,7 @@ the guest, use the following:
@@ -2357,7 +2357,7 @@ the guest, use the following:
@example
# on the host
@ -735,7 +736,7 @@ index 5e13aa9..2a60e51 100644
telnet localhost 5555
@end example
@@ -2134,7 +2134,7 @@ lifetime, like in the following example:
@@ -2376,7 +2376,7 @@ lifetime, like in the following example:
@example
# open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
# the guest accesses it
@ -744,7 +745,7 @@ index 5e13aa9..2a60e51 100644
@end example
Or you can execute a command on every TCP connection established by the guest,
@@ -2143,7 +2143,7 @@ so that QEMU behaves similar to an inetd process for that virtual server:
@@ -2385,7 +2385,7 @@ so that QEMU behaves similar to an inetd process for that virtual server:
@example
# call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
# and connect the TCP stream to its stdin/stdout
@ -753,7 +754,7 @@ index 5e13aa9..2a60e51 100644
@end example
@end table
@@ -2170,21 +2170,22 @@ Examples:
@@ -2412,21 +2412,22 @@ Examples:
@example
#launch a QEMU instance with the default network script
@ -779,7 +780,7 @@ index 5e13aa9..2a60e51 100644
-netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
@end example
@@ -2201,13 +2202,13 @@ Examples:
@@ -2443,13 +2444,13 @@ Examples:
@example
#launch a QEMU instance with the default network helper to
#connect a TAP device to bridge br0
@ -795,7 +796,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
@@ -2222,13 +2223,13 @@ specifies an already opened TCP socket.
@@ -2464,13 +2465,13 @@ specifies an already opened TCP socket.
Example:
@example
# launch a first QEMU instance
@ -815,7 +816,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
@@ -2251,15 +2252,15 @@ Use @option{fd=h} to specify an already opened UDP multicast socket.
@@ -2493,15 +2494,15 @@ Use @option{fd=h} to specify an already opened UDP multicast socket.
Example:
@example
# launch one QEMU instance
@ -838,7 +839,7 @@ index 5e13aa9..2a60e51 100644
-device e1000,netdev=n3,mac=52:54:00:12:34:58 \
-netdev socket,id=n3,mcast=230.0.0.1:1234
@end example
@@ -2267,7 +2268,7 @@ qemu-system-i386 linux.img \
@@ -2509,7 +2510,7 @@ qemu-system-i386 linux.img \
Example (User Mode Linux compat.):
@example
# launch QEMU instance (note mcast address selected is UML's default)
@ -847,7 +848,7 @@ index 5e13aa9..2a60e51 100644
-device e1000,netdev=n1,mac=52:54:00:12:34:56 \
-netdev socket,id=n1,mcast=239.192.168.1:1102
# launch UML
@@ -2276,9 +2277,12 @@ qemu-system-i386 linux.img \
@@ -2518,9 +2519,12 @@ qemu-system-i386 linux.img \
Example (send packets from host's 1.2.3.4):
@example
@ -863,7 +864,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -netdev l2tpv3,id=@var{id},src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
@@ -2336,7 +2340,7 @@ brctl addif br-lan vmtunnel0
@@ -2578,7 +2582,7 @@ brctl addif br-lan vmtunnel0
# on 4.3.2.1
# launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
@ -872,7 +873,7 @@ index 5e13aa9..2a60e51 100644
-netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
@end example
@@ -2353,7 +2357,7 @@ Example:
@@ -2595,7 +2599,7 @@ Example:
# launch vde switch
vde_switch -F -sock /tmp/myswitch
# launch QEMU instance
@ -881,7 +882,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
@@ -2367,11 +2371,11 @@ be created for multiqueue vhost-user.
@@ -2609,11 +2613,11 @@ be created for multiqueue vhost-user.
Example:
@example
@ -898,7 +899,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -netdev hubport,id=@var{id},hubid=@var{hubid}[,netdev=@var{nd}]
@@ -2805,7 +2809,7 @@ and communicate. Requires the Linux @code{vhci} driver installed. Can
@@ -3053,7 +3057,7 @@ and communicate. Requires the Linux @code{vhci} driver installed. Can
be used as following:
@example
@ -907,7 +908,7 @@ index 5e13aa9..2a60e51 100644
@end example
@item -bt device:@var{dev}[,vlan=@var{n}]
@@ -3255,14 +3259,14 @@ ETEXI
@@ -3503,14 +3507,14 @@ ETEXI
DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
"-realtime [mlock=on|off]\n"
@ -925,7 +926,7 @@ index 5e13aa9..2a60e51 100644
(enabled by default).
ETEXI
@@ -3300,7 +3304,7 @@ connections will likely be TCP-based, but also UDP, pseudo TTY, or even
@@ -3548,7 +3552,7 @@ connections will likely be TCP-based, but also UDP, pseudo TTY, or even
stdio are reasonable use case. The latter is allowing to start QEMU from
within gdb and establish the connection via a pipe:
@example
@ -934,7 +935,7 @@ index 5e13aa9..2a60e51 100644
@end example
ETEXI
@@ -4251,7 +4255,7 @@ which specify the queue number of cryptodev backend, the default of
@@ -4467,7 +4471,7 @@ which specify the queue number of cryptodev backend, the default of
@example
@ -943,7 +944,7 @@ index 5e13aa9..2a60e51 100644
[...] \
-object cryptodev-backend-builtin,id=cryptodev0 \
-device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
@@ -4271,7 +4275,7 @@ of cryptodev backend for multiqueue vhost-user, the default of @var{queues} is 1
@@ -4487,7 +4491,7 @@ of cryptodev backend for multiqueue vhost-user, the default of @var{queues} is 1
@example
@ -953,5 +954,5 @@ index 5e13aa9..2a60e51 100644
-chardev socket,id=chardev0,path=/path/to/socket \
-object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From a3d01620dcbc301493f6704265edddf78f6bfe1b Mon Sep 17 00:00:00 2001
From a4af398c3849751bc240c4f8f1f0cf2fcf57d21e Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 5 May 2017 19:06:14 +0200
Subject: usb-xhci: Fix PCI capability order
@ -56,15 +56,16 @@ Conflicts:
(cherry picked from commit a42f86dc906cc7d2c16d02bf125ed76847b469cb)
(cherry picked from commit 992ab2e4f6e15d3e51bc716763aa8d6f45c6d29d)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/usb/hcd-xhci.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index ca19474..45fcce3 100644
index ad351a7b6d..43a47539aa 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3373,6 +3373,12 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
@@ -3393,6 +3393,12 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
xhci->max_pstreams_mask = 0;
}
@ -77,7 +78,7 @@ index ca19474..45fcce3 100644
if (xhci->msi != ON_OFF_AUTO_OFF) {
ret = msi_init(dev, 0x70, xhci->numintrs, true, false, &err);
/* Any error other than -ENOTSUP(board's MSI support is broken)
@@ -3421,12 +3427,6 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
@@ -3441,12 +3447,6 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64,
&xhci->mem);
@ -91,5 +92,5 @@ index ca19474..45fcce3 100644
/* TODO check for errors, and should fail when msix=on */
msix_init(dev, xhci->numintrs,
--
1.8.3.1
2.20.1

View File

@ -1,4 +1,4 @@
From 19f1b23aa923eab88c3fdda7b7fdc157c313e4eb Mon Sep 17 00:00:00 2001
From bf7fc2d5907b351ddfc85416d48e47f66024ccbe Mon Sep 17 00:00:00 2001
From: Fam Zheng <famz@redhat.com>
Date: Wed, 14 Jun 2017 15:37:01 +0200
Subject: virtio-scsi: Reject scsi-cd if data plane enabled [RHEL only]
@ -45,10 +45,10 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
1 file changed, 9 insertions(+)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 3aa9971..9f754c4 100644
index 839f120256..fd4b5c46ec 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -790,6 +790,15 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev,
@@ -796,6 +796,15 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev,
VirtIOSCSI *s = VIRTIO_SCSI(vdev);
SCSIDevice *sd = SCSI_DEVICE(dev);
@ -62,8 +62,8 @@ index 3aa9971..9f754c4 100644
+ return;
+ }
if (s->ctx && !s->dataplane_fenced) {
AioContext *ctx;
if (blk_op_is_blocked(sd->conf.blk, BLOCK_OP_TYPE_DATAPLANE, errp)) {
return;
--
1.8.3.1
2.20.1

View File

@ -1,8 +1,7 @@
From b5ede4ceec64a7b812f40457771948420cd3780f Mon Sep 17 00:00:00 2001
From 581909cc6cb4e8286126721b76a79e93a9880e1f Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Wed, 6 Feb 2019 03:58:56 +0000
Subject: [PATCH 4/8] BZ1653590: Require at least 64kiB pages for downstream
guests & hosts
Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20190206035856.19058-1-dgibson@redhat.com>
@ -23,9 +22,6 @@ Downstream, however, we simply don't support 4kiB pagesize configured
kernels in guest or host, so we can have qemu simply error out in this
situation.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1653590
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20089737
Branch: rhel8/master-3.1.0
Testing: Attempted to start a guest with cap-hpt-max-page-size=4k and verified
it failed immediately with a qemu error
@ -36,11 +32,11 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
1 file changed, 7 insertions(+)
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 64f98ae..ace7325 100644
index edc5ed0e0c..f59ab398d4 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -325,12 +325,19 @@ void spapr_check_pagesize(sPAPRMachineState *spapr, hwaddr pagesize,
static void cap_hpt_maxpagesize_apply(sPAPRMachineState *spapr,
@@ -340,12 +340,19 @@ void spapr_check_pagesize(SpaprMachineState *spapr, hwaddr pagesize,
static void cap_hpt_maxpagesize_apply(SpaprMachineState *spapr,
uint8_t val, Error **errp)
{
+#if 0 /* disabled for RHEL */
@ -60,5 +56,5 @@ index 64f98ae..ace7325 100644
spapr_check_pagesize(spapr, qemu_getrampagesize(), errp);
}
--
1.8.3.1
2.20.1

View File

@ -1,7 +1,7 @@
From a02908747e85b4064da8acabe724f9202ab17fba Mon Sep 17 00:00:00 2001
From b1799db735fe51f8b31c565814d79c7ec4fc82dc Mon Sep 17 00:00:00 2001
From: Danilo de Paula <ddepaula@redhat.com>
Date: Fri, 8 Feb 2019 11:51:14 +0000
Subject: [PATCH] doc: fix the configuration path
Subject: doc: fix the configuration path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -32,10 +32,10 @@ Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 8710720..24e9ef0 100644
index 41a77a90af..20c39c41a8 100644
--- a/Makefile
+++ b/Makefile
@@ -937,11 +937,14 @@ ui/shader.o: $(SRC_PATH)/ui/shader.c \
@@ -877,11 +877,14 @@ ui/shader.o: $(SRC_PATH)/ui/shader.c \
MAKEINFO=makeinfo
MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES)
@ -54,7 +54,7 @@ index 8710720..24e9ef0 100644
%.html: %.texi docs/version.texi
$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
diff --git a/qemu-ga.texi b/qemu-ga.texi
index 4c7a8fd..f00ad83 100644
index 4c7a8fd163..f00ad830f2 100644
--- a/qemu-ga.texi
+++ b/qemu-ga.texi
@@ -30,7 +30,7 @@ set user's password
@ -76,5 +76,5 @@ index 4c7a8fd..f00ad83 100644
@samp{-F/var/run/fsfreezehook.sh}).
--
1.8.3.1
2.20.1

View File

@ -1,105 +0,0 @@
From ba8f254594f7033183cda79b47e2c7a5c1f5bcfe Mon Sep 17 00:00:00 2001
From: Yash Mankad <ymankad@redhat.com>
Date: Mon, 4 Feb 2019 19:14:22 +0000
Subject: [PATCH 1/8] Acceptance tests: add Linux initrd checking test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Yash Mankad <ymankad@redhat.com>
Message-id: <cd36327815bc6d0836e5a51237f13302ef7eda25.1549307526.git.ymankad@redhat.com>
Patchwork-id: 84209
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] Acceptance tests: add Linux initrd checking test
Bugzilla: 1669922
RH-Acked-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
From: Wainer dos Santos Moschetta <wainersm@redhat.com>
QEMU used to exits with a not accurate error message when
an initrd > 2GiB was passed. That was fixed on patch:
commit f3839fda5771596152b75dd1e1a6d050e6e6e380
Author: Li Zhijian <lizhijian@cn.fujitsu.com>
Date: Thu Sep 13 18:07:13 2018 +0800
change get_image_size return type to int64_t
This change adds a regression test for that fix. It starts
QEMU with a 2GiB dummy initrd, and checks that it evaluates the
file size correctly and prints an accurate message.
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Caio Carrara <ccarrara@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181109182153.5390-1-wainersm@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 82d4c923a580751c86dc0852a7cc8e369a78e8ad)
Signed-off-by: Yash Mankad <ymankad@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/acceptance/linux_initrd.py | 48 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 tests/acceptance/linux_initrd.py
diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
new file mode 100644
index 0000000..737355c
--- /dev/null
+++ b/tests/acceptance/linux_initrd.py
@@ -0,0 +1,48 @@
+# Linux initrd acceptance test.
+#
+# Copyright (c) 2018 Red Hat, Inc.
+#
+# Author:
+# Wainer dos Santos Moschetta <wainersm@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+import tempfile
+from avocado.utils.process import run
+
+from avocado_qemu import Test
+
+
+class LinuxInitrd(Test):
+ """
+ Checks QEMU evaluates correctly the initrd file passed as -initrd option.
+
+ :avocado: enable
+ :avocado: tags=x86_64
+ """
+
+ timeout = 60
+
+ def test_with_2gib_file_should_exit_error_msg(self):
+ """
+ Pretends to boot QEMU with an initrd file with size of 2GiB
+ and expect it exits with error message.
+ """
+ kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/'
+ 'Everything/x86_64/os/images/pxeboot/vmlinuz')
+ kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a'
+ kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+ max_size = 2 * (1024 ** 3) - 1
+
+ with tempfile.NamedTemporaryFile() as initrd:
+ initrd.seek(max_size)
+ initrd.write(b'\0')
+ initrd.flush()
+ cmd = "%s -kernel %s -initrd %s" % (self.qemu_bin, kernel_path,
+ initrd.name)
+ res = run(cmd, ignore_status=True)
+ self.assertEqual(res.exit_status, 1)
+ expected_msg = r'.*initrd is too large.*max: \d+, need %s.*' % (
+ max_size + 1)
+ self.assertRegex(res.stderr_text, expected_msg)
--
1.8.3.1

View File

@ -1,57 +0,0 @@
From da2d528c3cffe22bd1b90b446a045376e4370845 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Sat, 16 Feb 2019 00:00:50 +0000
Subject: [PATCH 4/4] Revert "i386: Add CPUID bit for PCONFIG"
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <1550275250-41719-4-git-send-email-pbonzini@redhat.com>
Patchwork-id: 84524
O-Subject: [rhel-av-8.0.0 qemu-kvm PATCH 3/3] Revert "i386: Add CPUID bit for PCONFIG"
Bugzilla: 1661515
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
From: Robert Hoo <robert.hu@linux.intel.com>
This reverts commit 5131dc433df54b37e8e918d8fba7fe10344e7a7b.
For new instruction 'PCONFIG' will not be exposed to guest.
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1545227081-213696-3-git-send-email-robert.hu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 712f807e1965c8f1f1da5bbec2b92a8c540e6631)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 2 +-
target/i386/cpu.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 169a2ce..d990070 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1077,7 +1077,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- NULL, NULL, "pconfig", NULL,
+ NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, "spec-ctrl", NULL,
NULL, "arch-capabilities", NULL, "ssbd",
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index dd88151..26412f1 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -692,7 +692,6 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
#define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
#define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
-#define CPUID_7_0_EDX_PCONFIG (1U << 18) /* Platform Configuration */
#define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */
#define CPUID_7_0_EDX_ARCH_CAPABILITIES (1U << 29) /*Arch Capabilities*/
#define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) /* Speculative Store Bypass Disable */
--
1.8.3.1

View File

@ -1,70 +0,0 @@
From 7bfdb4cd2b490d6da5648b1bfeacf9078b4b3ecb Mon Sep 17 00:00:00 2001
From: Wei Huang <wei@redhat.com>
Date: Thu, 17 Jan 2019 17:33:55 +0000
Subject: [PATCH 5/7] aarch64: Add virt-rhel8.0.0 machine type for ARM
RH-Author: Wei Huang <wei@redhat.com>
Message-id: <20190117173357.31514-2-wei@redhat.com>
Patchwork-id: 84037
O-Subject: [RHEL8 qemu-kvm PATCH v3 1/3] aarch64: Add virt-rhel8.0.0 machine type for ARM
Bugzilla: 1656504
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
This patch adds a new machine type, virt-rhel8.0.0, for QEMU fast train
to replace old virt-rhel7.6.0 because virt-rhel7.6.0 was defined for
an unsupported preview product. Note that we explicitly disable
256MB ECAM region in virt-rhel8.0.0 to match what virt-rhel7.6.0 offered.
Signed-off-by: Wei Huang <wei@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 84a86c1..156721a 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2094,7 +2094,7 @@ static void rhel_machine_init(void)
}
type_init(rhel_machine_init);
-static void rhel760_virt_instance_init(Object *obj)
+static void rhel800_virt_instance_init(Object *obj)
{
VirtMachineState *vms = VIRT_MACHINE(obj);
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@@ -2119,6 +2119,8 @@ static void rhel760_virt_instance_init(Object *obj)
"Set GIC version. "
"Valid values are 2, 3 and host", NULL);
+ vms->highmem_ecam = !vmc->no_highmem_ecam;
+
if (vmc->no_its) {
vms->its = false;
} else {
@@ -2132,12 +2134,16 @@ static void rhel760_virt_instance_init(Object *obj)
NULL);
}
+ /* IOMMU is disabled by default and non-configurable for RHEL */
+ vms->iommu = VIRT_IOMMU_NONE;
+
vms->memmap=a15memmap;
vms->irqmap=a15irqmap;
}
-static void rhel760_virt_options(MachineClass *mc)
+static void rhel800_virt_options(MachineClass *mc)
{
SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT);
+ vmc->no_highmem_ecam = true;
}
-DEFINE_RHEL_MACHINE_AS_LATEST(7, 6, 0)
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 0, 0)
--
1.8.3.1

View File

@ -1,50 +0,0 @@
From 3433e6920a4aaa2177f3503ef08256a58f866b33 Mon Sep 17 00:00:00 2001
From: Wei Huang <wei@redhat.com>
Date: Thu, 17 Jan 2019 17:33:56 +0000
Subject: [PATCH 6/7] aarch64: Set virt-rhel8.0.0 max_cpus to 512
RH-Author: Wei Huang <wei@redhat.com>
Message-id: <20190117173357.31514-3-wei@redhat.com>
Patchwork-id: 84038
O-Subject: [RHEL8 qemu-kvm PATCH v3 2/3] aarch64: Set virt-rhel8.0.0 max_cpus to 512
Bugzilla: 1656504
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
This patch increases max_cpus of virt-rhel8.0.0 from 255 to 512.
This decision is made due to a recent trend of ARM servers Red Hat
received. Currently Red Hat has HPE Apollo machines that contains 256
cpu cores. It is reasonable to expect that we will see new machines
with > 256 cores very soon. We have verified this patch partially with a
256-vcpu VM on Apollo and expect 512 vcpus will work as well.
Signed-off-by: Wei Huang <wei@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 156721a..21965e4 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2063,11 +2063,11 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
mc->family = "virt-rhel-Z";
mc->init = machvirt_init;
- /* Start max_cpus at the maximum QEMU supports. We'll further restrict
- * it later in machvirt_init, where we have more information about the
+ /* Start with max_cpus set to 512, which is the maximum supported by KVM.
+ * The value may be reduced later when we have more information about the
* configuration of the particular instance.
*/
- mc->max_cpus = 255;
+ mc->max_cpus = 512;
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->pci_allow_0_address = true;
--
1.8.3.1

View File

@ -1,38 +0,0 @@
From 4d20863ae382c9ce2a8b7f88aee7a1d1228112a7 Mon Sep 17 00:00:00 2001
From: Wei Huang <wei@redhat.com>
Date: Thu, 17 Jan 2019 17:33:57 +0000
Subject: [PATCH 7/7] aarch64: Use 256MB ECAM region by default
RH-Author: Wei Huang <wei@redhat.com>
Message-id: <20190117173357.31514-4-wei@redhat.com>
Patchwork-id: 84039
O-Subject: [RHEL8 qemu-kvm PATCH v3 3/3] aarch64: Use 256MB ECAM region by default
Bugzilla: 1656504
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
This patch turns on 256MB ECAM region to support a larger number (up to
256) of PCIe buses on virt-rhel8.0.0.
Signed-off-by: Wei Huang <wei@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/arm/virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 21965e4..bee8f10 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2144,6 +2144,5 @@ static void rhel800_virt_instance_init(Object *obj)
static void rhel800_virt_options(MachineClass *mc)
{
SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT);
- vmc->no_highmem_ecam = true;
}
DEFINE_RHEL_MACHINE_AS_LATEST(8, 0, 0)
--
1.8.3.1

View File

@ -1,66 +0,0 @@
From fa7a2c6b323882bb64d0015b842f05d6078bbe48 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Wed, 20 Feb 2019 10:37:05 +0000
Subject: [PATCH] block: Apply auto-read-only for ro-whitelist drivers
RH-Author: Kevin Wolf <kwolf@redhat.com>
Message-id: <20190220103705.22630-2-kwolf@redhat.com>
Patchwork-id: 84561
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] block: Apply auto-read-only for ro-whitelist drivers
Bugzilla: 1678968
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
If QEMU was configured with a driver in --block-drv-ro-whitelist, trying
to use that driver read-write resulted in an error message even if
auto-read-only=on was set.
Consider auto-read-only=on for the whitelist checking and use it to
automatically degrade to read-only for block drivers on the read-only
whitelist.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 8be25de64315ef768353eb61f2b2bf6cddc34230)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/block.c b/block.c
index 1ec4512..f1f6924 100644
--- a/block.c
+++ b/block.c
@@ -1442,13 +1442,19 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
bs->read_only = !(bs->open_flags & BDRV_O_RDWR);
if (use_bdrv_whitelist && !bdrv_is_whitelisted(drv, bs->read_only)) {
- error_setg(errp,
- !bs->read_only && bdrv_is_whitelisted(drv, true)
- ? "Driver '%s' can only be used for read-only devices"
- : "Driver '%s' is not whitelisted",
- drv->format_name);
- ret = -ENOTSUP;
- goto fail_opts;
+ if (!bs->read_only && bdrv_is_whitelisted(drv, true)) {
+ ret = bdrv_apply_auto_read_only(bs, NULL, NULL);
+ } else {
+ ret = -ENOTSUP;
+ }
+ if (ret < 0) {
+ error_setg(errp,
+ !bs->read_only && bdrv_is_whitelisted(drv, true)
+ ? "Driver '%s' can only be used for read-only devices"
+ : "Driver '%s' is not whitelisted",
+ drv->format_name);
+ goto fail_opts;
+ }
}
/* bdrv_new() and bdrv_close() make it so */
--
1.8.3.1

View File

@ -1,69 +0,0 @@
From d6445c856c6199938eccbd73721c0c8257604557 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Wed, 6 Feb 2019 15:13:14 +0000
Subject: [PATCH 5/8] block: Fix invalidate_cache error path for parent
activation
RH-Author: Kevin Wolf <kwolf@redhat.com>
Message-id: <20190206151314.4789-2-kwolf@redhat.com>
Patchwork-id: 84251
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] block: Fix invalidate_cache error path for parent activation
Bugzilla: 1673014
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
bdrv_co_invalidate_cache() clears the BDRV_O_INACTIVE flag before
actually activating a node so that the correct permissions etc. are
taken. In case of errors, the flag must be restored so that the next
call to bdrv_co_invalidate_cache() retries activation.
Restoring the flag was missing in the error path for a failed
parent->role->activate() call. The consequence is that this attempt to
activate all images correctly fails because we still set errp, however
on the next attempt BDRV_O_INACTIVE is already clear, so we return
success without actually retrying the failed action.
An example where this is observable in practice is migration to a QEMU
instance that has a raw format block node attached to a guest device
with share-rw=off (the default) while another process holds
BLK_PERM_WRITE for the same image. In this case, all activation steps
before parent->role->activate() succeed because raw can tolerate other
writers to the image. Only the parent callback (in particular
blk_root_activate()) tries to implement the share-rw=on property and
requests exclusive write permissions. This fails when the migration
completes and correctly displays an error. However, a manual 'cont' will
incorrectly resume the VM without calling blk_root_activate() again.
This case is described in more detail in the following bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1531888
Fix this by correctly restoring the BDRV_O_INACTIVE flag in the error
path.
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 78fc3b3a26c145eebcdee992988644974b243a74)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block.c b/block.c
index 811239c..1ec4512 100644
--- a/block.c
+++ b/block.c
@@ -4553,6 +4553,7 @@ static void coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs,
if (parent->role->activate) {
parent->role->activate(parent, &local_err);
if (local_err) {
+ bs->open_flags |= BDRV_O_INACTIVE;
error_propagate(errp, local_err);
return;
}
--
1.8.3.1

View File

@ -1,58 +0,0 @@
From cc7dbe3ae92a2bb1557df184493a331fe2381003 Mon Sep 17 00:00:00 2001
From: Max Reitz <mreitz@redhat.com>
Date: Wed, 3 Apr 2019 17:53:52 +0100
Subject: [PATCH 9/9] block/file-posix: do not fail on unlock bytes
RH-Author: Max Reitz <mreitz@redhat.com>
Message-id: <20190403175352.27439-2-mreitz@redhat.com>
Patchwork-id: 85408
O-Subject: [RHEL-AV-8.0.1 qemu-kvm PATCH 1/1] block/file-posix: do not fail on unlock bytes
Bugzilla: 1652572
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
bdrv_replace_child() calls bdrv_check_perm() with error_abort on
loosening permissions. However file-locking operations may fail even
in this case, for example on NFS. And this leads to Qemu crash.
Let's avoid such errors. Note, that we ignore such things anyway on
permission update commit and abort.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 696aaaed579ac5bf5fa336216909b46d3d8f07a8)
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block/file-posix.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/block/file-posix.c b/block/file-posix.c
index 07bbdab..f0af144 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -812,6 +812,18 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
switch (op) {
case RAW_PL_PREPARE:
+ if ((s->perm | new_perm) == s->perm &&
+ (s->shared_perm & new_shared) == s->shared_perm)
+ {
+ /*
+ * We are going to unlock bytes, it should not fail. If it fail due
+ * to some fs-dependent permission-unrelated reasons (which occurs
+ * sometimes on NFS and leads to abort in bdrv_replace_child) we
+ * can't prevent such errors by any check here. And we ignore them
+ * anyway in ABORT and COMMIT.
+ */
+ return 0;
+ }
ret = raw_apply_lock_bytes(s, s->fd, s->perm | new_perm,
~s->shared_perm | ~new_shared,
false, errp);
--
1.8.3.1

View File

@ -1,119 +0,0 @@
From fece44d5054ef13f483d7531a8462cb7f8ff5b93 Mon Sep 17 00:00:00 2001
From: Bandan Das <bsd@redhat.com>
Date: Fri, 14 Dec 2018 19:33:40 +0000
Subject: [PATCH 7/8] kvm: clear out KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT for
older machine types
RH-Author: Bandan Das <bsd@redhat.com>
Message-id: <jpgmup79a3v.fsf@linux.bootlegged.copy>
Patchwork-id: 83523
O-Subject: [RHEL8 qemu-kvm PATCH] kvm: clear out KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT for older machine types
Bugzilla: 1659604
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1659604
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19521246
Upstream: Not applicable
Branch: rhel8/master-3.1.0 on top of [RHEL8 qemu-kvm PATCH v3 0/5] 8.0.0 x86 machine types
After the addition of support for async pf injection to L1, newer
hypervisors advertise the feature using bit 2 of the
MSR_KVM_ASYNC_PF_EN msr. However, this was reserved in older
hypervisors which results in an error during migration like so:
qemu-kvm: error: failed to set MSR 0x4b564d02 to 0x27fc13285
qemu-kvm: /builddir/build/BUILD/qemu-2.12.0/target/i386/kvm.c:1940: kvm_put_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
Aborted (core dumped)
This patch introduces a new bool that is set for older machine types.
When set, Qemu's stored value clears out bit 2. This should be safe
because the guest can still enable it by writing to the MSR after
checking for support. A reset/migration for <7.6 machine type would
reset the bit though.
Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc.c | 1 +
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
include/hw/boards.h | 2 ++
target/i386/kvm.c | 4 ++++
5 files changed, 9 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a609332..18268d3 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2391,6 +2391,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->linuxboot_dma_enabled = true;
assert(!mc->get_hotplug_handler);
pcmc->pc_rom_ro = true;
+ mc->async_pf_vmexit_disable = false;
mc->get_hotplug_handler = pc_get_hotpug_handler;
mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
mc->get_default_cpu_node_id = pc_get_default_cpu_node_id;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index efee5e7..46c494a 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1186,6 +1186,7 @@ static void pc_machine_rhel760_options(MachineClass *m)
{
pc_machine_rhel7_options(m);
m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
+ m->async_pf_vmexit_disable = true;
SET_MACHINE_COMPAT(m, PC_RHEL7_6_COMPAT);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 0b7223f..1810cf2 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -470,6 +470,7 @@ static void pc_q35_machine_rhel760_options(MachineClass *m)
pc_q35_machine_rhel800_options(m);
m->alias = NULL;
m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)";
+ m->async_pf_vmexit_disable = true;
SET_MACHINE_COMPAT(m, PC_RHEL7_6_COMPAT);
}
diff --git a/include/hw/boards.h b/include/hw/boards.h
index f82f284..27463fb 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -204,6 +204,8 @@ struct MachineClass {
const char **valid_cpu_types;
strList *allowed_dynamic_sysbus_devices;
bool auto_enable_numa_with_memhp;
+ /* RHEL only */
+ bool async_pf_vmexit_disable;
void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
int nb_nodes, ram_addr_t size);
bool ignore_boot_device_suffixes;
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index b2401d1..5b0ce82 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -2351,6 +2351,7 @@ static int kvm_get_msrs(X86CPU *cpu)
struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries;
int ret, i;
uint64_t mtrr_top_bits;
+ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
kvm_msr_buf_reset(cpu);
@@ -2648,6 +2649,9 @@ static int kvm_get_msrs(X86CPU *cpu)
break;
case MSR_KVM_ASYNC_PF_EN:
env->async_pf_en_msr = msrs[i].data;
+ if (mc->async_pf_vmexit_disable) {
+ env->async_pf_en_msr &= ~(1ULL << 2);
+ }
break;
case MSR_KVM_PV_EOI_EN:
env->pv_eoi_en_msr = msrs[i].data;
--
1.8.3.1

View File

@ -1,66 +0,0 @@
From a75b0a6a7ef6e14e3b65b34bbc6935491d3b016e Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 14 Dec 2018 17:02:07 +0000
Subject: [PATCH 2/8] compat: Generic HW_COMPAT_RHEL7_6
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20181214170211.14267-3-dgilbert@redhat.com>
Patchwork-id: 83516
O-Subject: [RHEL8 qemu-kvm PATCH v3 2/6] compat: Generic HW_COMPAT_RHEL7_6
Bugzilla: 1655820
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Add the HW_COMPAT_RHEL7_6 macro based on the 2.12 and 3.0 macros.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/compat.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/include/hw/compat.h b/include/hw/compat.h
index f08cc7c..40db243 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -513,5 +513,34 @@
.value = "off",\
},
+/* The same as HW_COMPAT_3_0 + HW_COMPAT_2_12
+ * except that
+ * there's nothing in 3_0
+ * migration.decompress-error-check=off was in 7.5 from bz 1584139
+ *
+ */
+#define HW_COMPAT_RHEL7_6 \
+ { /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */ \
+ .driver = "hda-audio",\
+ .property = "use-timer",\
+ .value = "false",\
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */ \
+ .driver = "cirrus-vga",\
+ .property = "global-vmstate",\
+ .value = "true",\
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */ \
+ .driver = "VGA",\
+ .property = "global-vmstate",\
+ .value = "true",\
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */ \
+ .driver = "vmware-svga",\
+ .property = "global-vmstate",\
+ .value = "true",\
+ },{ /* HW_COMPAT_RHEL7_6 from HW_COMPAT_2_12 */ \
+ .driver = "qxl-vga",\
+ .property = "global-vmstate",\
+ .value = "true",\
+ },
+
#endif /* HW_COMPAT_H */
--
1.8.3.1

View File

@ -1,62 +0,0 @@
From 5f57f764ebb7451c71ffa04130ad2f2e4cb531e8 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Wed, 23 Jan 2019 09:15:22 +0000
Subject: [PATCH 2/2] cpus: ignore ESRCH in qemu_cpu_kick_thread()
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20190123091522.17581-1-lvivier@redhat.com>
Patchwork-id: 84092
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH v2] cpus: ignore ESRCH in qemu_cpu_kick_thread()
Bugzilla: 1668205
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
We can have a race condition between qemu_cpu_kick_thread() and
qemu_kvm_cpu_thread_fn() when we hotunplug a CPU. In this case,
qemu_cpu_kick_thread() can try to kick a thread that is exiting.
pthread_kill() returns an error and qemu is stopped by an exit(1).
qemu:qemu_cpu_kick_thread: No such process
We can ignore safely this error.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit e9979ef245549b8e1fd240ec9937271c7fda0b57)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
BRANCH: rhel8/master-3.1.0
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1668205
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19905615
UPSTREAM: In maintainer pull request
git://github.com/bonzini/qemu.git tags/for-upstream
TEST: Upstream version tested by QE
---
v2: add BRANCH: tag to make happy virt-ci-maint-team
cpus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
cpus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 0ddeeef..4717490 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1778,7 +1778,7 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
}
cpu->thread_kicked = true;
err = pthread_kill(cpu->thread->thread, SIG_IPI);
- if (err) {
+ if (err && err != ESRCH) {
fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
exit(1);
}
--
1.8.3.1

View File

@ -1,60 +0,0 @@
From 1aefd1b8a1dbbf63d28901081102b31455f96290 Mon Sep 17 00:00:00 2001
From: Sergio Lopez Pascual <slp@redhat.com>
Date: Mon, 15 Apr 2019 12:22:02 +0100
Subject: [PATCH] device_tree: Fix integer overflowing in load_device_tree()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Sergio Lopez Pascual <slp@redhat.com>
Message-id: <20190415122202.52108-2-slp@redhat.com>
Patchwork-id: 85670
O-Subject: [RHEL-AV-8.0.1 qemu-kvm PATCH 1/1] device_tree: Fix integer overflowing in load_device_tree()
Bugzilla: 1693173
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
From: Markus Armbruster <armbru@redhat.com>
If the value of get_image_size() exceeds INT_MAX / 2 - 10000, the
computation of @dt_size overflows to a negative number, which then
gets converted to a very large size_t for g_malloc0() and
load_image_size(). In the (fortunately improbable) case g_malloc0()
succeeds and load_image_size() survives, we'd assign the negative
number to *sizep. What that would do to the callers I can't say, but
it's unlikely to be good.
Fix by rejecting images whose size would overflow.
Reported-by: Kurtis Miller <kurtis.miller@nccgroup.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20190409174018.25798-1-armbru@redhat.com>
(cherry picked from 065e6298a75164b4347682b63381dbe752c2b156)
Signed-off-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
device_tree.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/device_tree.c b/device_tree.c
index 6d9c972..fe61027 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -84,6 +84,10 @@ void *load_device_tree(const char *filename_path, int *sizep)
filename_path);
goto fail;
}
+ if (dt_size > INT_MAX / 2 - 10000) {
+ error_report("Device tree file '%s' is too large", filename_path);
+ goto fail;
+ }
/* Expand to 2x size to give enough room for manipulation. */
dt_size += 10000;
--
1.8.3.1

View File

@ -1,55 +0,0 @@
From f869cc062302515f4d031305584386ead0d32714 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 21 Feb 2019 09:11:01 +0000
Subject: [PATCH 2/2] fdc: Restrict floppy controllers to RHEL-7 machine types
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190221091101.31999-3-armbru@redhat.com>
Patchwork-id: 84693
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH v2 2/2] fdc: Restrict floppy controllers to RHEL-7 machine types
Bugzilla: 1664997
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Make floppy controllers' realize() fail except with RHEL-7 machine
types. The "is a RHEL-7 machine type" test is a bit of a hack: it
looks for "-rhel7." in the machine type name.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/block/fdc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 6f19f12..9ece2db 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -42,6 +42,8 @@
#include "qemu/log.h"
#include "trace.h"
+#include "hw/boards.h"
+
/********************************************************/
/* debug Floppy devices */
@@ -2629,6 +2631,14 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
int i, j;
static int command_tables_inited = 0;
+ /* Restricted for Red Hat Enterprise Linux: */
+ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
+ if (!strstr(mc->name, "-rhel7.")) {
+ error_setg(errp, "Device %s is not supported with machine type %s",
+ object_get_typename(OBJECT(dev)), mc->name);
+ return;
+ }
+
if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
}
--
1.8.3.1

View File

@ -1,41 +0,0 @@
From 20a51f6e5ebc56707554a52e2fb6a61bf6511315 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 21 Feb 2019 09:11:00 +0000
Subject: [PATCH 1/2] fdc: Revert downstream disablement of device "floppy"
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190221091101.31999-2-armbru@redhat.com>
Patchwork-id: 84691
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH v2 1/2] fdc: Revert downstream disablement of device "floppy"
Bugzilla: 1664997
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Board code creates floppy devices on behalf of -drive if=floppy,...
When they got qdevifified, they also became available with -device.
We made it unavailable downstream as per our policy to permit new
devices only when we have a use for them (commit 0533a6ee98f). We now
have a use: we need it to move from -drive to -blockdev.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/block/fdc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 56b7aeb..6f19f12 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -599,7 +599,6 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data)
k->bus_type = TYPE_FLOPPY_BUS;
k->props = floppy_drive_properties;
k->desc = "virtual floppy drive";
- k->user_creatable = false; /* RH state preserve */
}
static const TypeInfo floppy_drive_info = {
--
1.8.3.1

View File

@ -1,84 +0,0 @@
From c63a58b4e1d3db52301bec072ac8025216731f35 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 16 Jan 2019 23:18:18 +0000
Subject: [PATCH 3/7] globals: Allow global properties to be optional
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190116231819.29310-4-ehabkost@redhat.com>
Patchwork-id: 84029
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 3/4] globals: Allow global properties to be optional
Bugzilla: 1648023
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Upstream tree: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git
Upstream commit: d7741743f4f3d2683d1bb6938f88dc0167c21afa
Making some global properties optional will let us simplify
compat code when a given property works on most (but not all)
subclasses of a given type.
Device types will be able to opt out from optional compat
properties by simply not registering those properties.
Backport conflict notes:
Patching qdev_prop_set_globals(), because our downstream tree
still doesn't have object_apply_global_props() from commit
ea9ce8934c5d ("hw: apply accel compat properties without
touching globals")
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/core/qdev-properties.c | 3 +++
include/hw/qdev-core.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 35072de..2023c1a 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1255,6 +1255,9 @@ void qdev_prop_set_globals(DeviceState *dev)
if (object_dynamic_cast(OBJECT(dev), prop->driver) == NULL) {
continue;
}
+ if (prop->optional && !object_property_find(OBJECT(dev), prop->property, NULL)) {
+ continue;
+ }
prop->used = true;
object_property_parse(OBJECT(dev), prop->value, prop->property, &err);
if (err != NULL) {
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index a24d0dd..a10f60f 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -252,6 +252,8 @@ struct PropertyInfo {
* @user_provided: Set to true if property comes from user-provided config
* (command-line or config file).
* @used: Set to true if property was used when initializing a device.
+ * @optional: If set to true, GlobalProperty will be skipped without errors
+ * if the property doesn't exist.
* @errp: Error destination, used like first argument of error_setg()
* in case property setting fails later. If @errp is NULL, we
* print warnings instead of ignoring errors silently. For
@@ -264,6 +266,7 @@ typedef struct GlobalProperty {
const char *value;
bool user_provided;
bool used;
+ bool optional;
Error **errp;
} GlobalProperty;
--
1.8.3.1

View File

@ -1,183 +0,0 @@
From 1b9f228788eb2d7f50961241e28f7a9afadc62ab Mon Sep 17 00:00:00 2001
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Thu, 21 Mar 2019 10:56:08 +0000
Subject: [PATCH 7/9] hostmem-file: reject invalid pmem file sizes
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <20190321105608.29960-2-stefanha@redhat.com>
Patchwork-id: 85081
O-Subject: [RHEL-AV-8.0.1 qemu-kvm PATCH 1/1] hostmem-file: reject invalid pmem file sizes
Bugzilla: 1669053
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
Guests started with NVDIMMs larger than the underlying host file produce
confusing errors inside the guest. This happens because the guest
accesses pages beyond the end of the file.
Check the pmem file size on startup and print a clear error message if
the size is invalid.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1669053
Cc: Wei Yang <richardw.yang@linux.intel.com>
Cc: Zhang Yi <yi.z.zhang@linux.intel.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20190214031004.32522-3-stefanha@redhat.com>
Reviewed-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 314aec4a6e06844937f1677f6cba21981005f389)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
backends/hostmem-file.c | 23 +++++++++++++++++++++
include/qemu/osdep.h | 13 ++++++++++++
util/oslib-posix.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
util/oslib-win32.c | 5 +++++
4 files changed, 94 insertions(+)
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index 6630021..8d85d56 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -57,6 +57,29 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
#ifndef CONFIG_POSIX
error_setg(errp, "-mem-path not supported on this host");
#else
+
+ /*
+ * Verify pmem file size since starting a guest with an incorrect size
+ * leads to confusing failures inside the guest.
+ */
+ if (fb->is_pmem) {
+ Error *local_err = NULL;
+ uint64_t size;
+
+ size = qemu_get_pmem_size(fb->mem_path, &local_err);
+ if (!size) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
+ if (backend->size > size) {
+ error_setg(errp, "size property %" PRIu64 " is larger than "
+ "pmem file \"%s\" size %" PRIu64, backend->size,
+ fb->mem_path, size);
+ return;
+ }
+ }
+
backend->force_prealloc = mem_prealloc;
path = object_get_canonical_path(OBJECT(backend));
memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 3bf48bc..c68a85b 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -553,6 +553,19 @@ void os_mem_prealloc(int fd, char *area, size_t sz, int smp_cpus,
Error **errp);
/**
+ * qemu_get_pmem_size:
+ * @filename: path to a pmem file
+ * @errp: pointer to a NULL-initialized error object
+ *
+ * Determine the size of a persistent memory file. Besides supporting files on
+ * DAX file systems, this function also supports Linux devdax character
+ * devices.
+ *
+ * Returns: the size or 0 on failure
+ */
+uint64_t qemu_get_pmem_size(const char *filename, Error **errp);
+
+/**
* qemu_get_pid_name:
* @pid: pid of a process
*
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 97b2f3b..b173fc0 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -496,6 +496,59 @@ void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus,
}
}
+uint64_t qemu_get_pmem_size(const char *filename, Error **errp)
+{
+ struct stat st;
+
+ if (stat(filename, &st) < 0) {
+ error_setg(errp, "unable to stat pmem file \"%s\"", filename);
+ return 0;
+ }
+
+#if defined(__linux__)
+ /* Special handling for devdax character devices */
+ if (S_ISCHR(st.st_mode)) {
+ char *subsystem_path = NULL;
+ char *subsystem = NULL;
+ char *size_path = NULL;
+ char *size_str = NULL;
+ uint64_t ret = 0;
+
+ subsystem_path = g_strdup_printf("/sys/dev/char/%d:%d/subsystem",
+ major(st.st_rdev), minor(st.st_rdev));
+ subsystem = g_file_read_link(subsystem_path, NULL);
+ if (!subsystem) {
+ error_setg(errp, "unable to read subsystem for pmem file \"%s\"",
+ filename);
+ goto devdax_err;
+ }
+
+ if (!g_str_has_suffix(subsystem, "/dax")) {
+ error_setg(errp, "pmem file \"%s\" is not a dax device", filename);
+ goto devdax_err;
+ }
+
+ size_path = g_strdup_printf("/sys/dev/char/%d:%d/size",
+ major(st.st_rdev), minor(st.st_rdev));
+ if (!g_file_get_contents(size_path, &size_str, NULL, NULL)) {
+ error_setg(errp, "unable to read size for pmem file \"%s\"",
+ size_path);
+ goto devdax_err;
+ }
+
+ ret = g_ascii_strtoull(size_str, NULL, 0);
+
+devdax_err:
+ g_free(size_str);
+ g_free(size_path);
+ g_free(subsystem);
+ g_free(subsystem_path);
+ return ret;
+ }
+#endif /* defined(__linux__) */
+
+ return st.st_size;
+}
char *qemu_get_pid_name(pid_t pid)
{
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index b4c17f5..bd633af 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -560,6 +560,11 @@ void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus,
}
}
+uint64_t qemu_get_pmem_size(const char *filename, Error **errp)
+{
+ error_setg(errp, "pmem support not available");
+ return 0;
+}
char *qemu_get_pid_name(pid_t pid)
{
--
1.8.3.1

View File

@ -1,50 +0,0 @@
From c6ac9501471c3c931367b1967ad97ecfc498249c Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Fri, 21 Dec 2018 15:33:17 +0000
Subject: [PATCH 3/3] hw/s390x: Fix bad mask in time2tod()
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20181221153317.27647-3-david@redhat.com>
Patchwork-id: 83743
O-Subject: [RHEL-8.0 qemu-kvm v2 PATCH 2/2] hw/s390x: Fix bad mask in time2tod()
Bugzilla: 1659127
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
Since "s390x/tcg: avoid overflows in time2tod/tod2time", the
time2tod() function tries to deal with the 9 uppermost bits in the
time value, but uses the wrong mask for this: 0xff80000000000000 should
be used instead of 0xff10000000000000 here.
Fixes: 14055ce53c2d901d826ffad7fb7d6bb8ab46bdfd
Cc: qemu-stable@nongnu.org
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1544792887-14575-1-git-send-email-thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
[CH: tweaked commit message]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
(cherry picked from commit aba7a5a2de3dba5917024df25441f715b9249e31)
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/s390x/tod.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h
index cbd7552..47ef9de 100644
--- a/include/hw/s390x/tod.h
+++ b/include/hw/s390x/tod.h
@@ -56,7 +56,7 @@ typedef struct S390TODClass {
/* Converts ns to s390's clock format */
static inline uint64_t time2tod(uint64_t ns)
{
- return (ns << 9) / 125 + (((ns & 0xff10000000000000ull) / 125) << 9);
+ return (ns << 9) / 125 + (((ns & 0xff80000000000000ull) / 125) << 9);
}
/* Converts s390's clock format to ns */
--
1.8.3.1

View File

@ -1,106 +0,0 @@
From 6c200d665b8730ea86104e7aea2d59035b1398e5 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Fri, 21 Dec 2018 14:08:56 +0000
Subject: [PATCH 1/3] hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20181221150856.26324-3-david@redhat.com>
Patchwork-id: 83740
O-Subject: [RHEL8 qemu-kvm PATCH v3 2/2] hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
Bugzilla: 1656510
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1656510
Upstream: n/a (downstream only)
Branch: rhel8/master-3.1.0
Downstream s390x machine types for the Advanced Virtualization module.
s390mc->hpage_1m_allowed has to stay enabled for the rhel7.6.0 machine,
because RHEL 8 supports huge pages. For RHEL 7.6-alt, this is fenced
using a different mechanism (bail out if huge pages are used right from
the start).
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 04f4c1a..776a6d6 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -651,14 +651,14 @@ bool css_migration_enabled(void)
} \
type_init(ccw_machine_register_##suffix)
+#if 0 /* Disabled for Red Hat Enterprise Linux */
+
#define CCW_COMPAT_3_0 \
HW_COMPAT_3_0
#define CCW_COMPAT_2_12 \
HW_COMPAT_2_12
-#if 0 /* Disabled for Red Hat Enterprise Linux */
-
#define CCW_COMPAT_2_11 \
HW_COMPAT_2_11 \
{\
@@ -899,6 +899,13 @@ DEFINE_CCW_MACHINE(2_4, "2.4", false);
#else
/*
+ * like CCW_COMPAT_2_12 + CCW_COMPAT_3_0 (which are empty), but includes
+ * HW_COMPAT_RHEL7_6 instead of HW_COMPAT_2_11 and HW_COMPAT_3_0
+ */
+#define CCW_COMPAT_RHEL7_6 \
+ HW_COMPAT_RHEL7_6
+
+/*
* like CCW_COMPAT_2_11, but includes HW_COMPAT_RHEL7_5 (derived from
* HW_COMPAT_2_11 and HW_COMPAT_2_10) instead of HW_COMPAT_2_11
*/
@@ -910,14 +917,26 @@ DEFINE_CCW_MACHINE(2_4, "2.4", false);
.value = "off",\
},
+static void ccw_machine_rhel800_instance_options(MachineState *machine)
+{
+}
+
+static void ccw_machine_rhel800_class_options(MachineClass *mc)
+{
+}
+DEFINE_CCW_MACHINE(rhel800, "rhel8.0.0", true);
+
static void ccw_machine_rhel760_instance_options(MachineState *machine)
{
+ ccw_machine_rhel800_instance_options(machine);
}
static void ccw_machine_rhel760_class_options(MachineClass *mc)
{
+ ccw_machine_rhel800_class_options(mc);
+ SET_MACHINE_COMPAT(mc, CCW_COMPAT_RHEL7_6);
}
-DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", true);
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false);
static void ccw_machine_rhel750_instance_options(MachineState *machine)
{
@@ -937,6 +956,7 @@ static void ccw_machine_rhel750_class_options(MachineClass *mc)
{
ccw_machine_rhel760_class_options(mc);
SET_MACHINE_COMPAT(mc, CCW_COMPAT_RHEL7_5);
+ S390_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
}
DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
--
1.8.3.1

View File

@ -1,51 +0,0 @@
From 730ab8e3a8e9a703f2b2374b8f55429dd6b2254c Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Thu, 14 Mar 2019 19:41:28 +0000
Subject: [PATCH] i386: Add "stibp" flag name
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190314194128.15795-2-ehabkost@redhat.com>
Patchwork-id: 84870
O-Subject: [RHEL-AV-8.0.0 qemu-kvm PATCH 1/1] i386: Add "stibp" flag name
Bugzilla: 1686260
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
The STIBP flag may be supported by the host KVM module, so QEMU
can allow it to be configured manually, and it can be exposed to
guests when using "-cpu host".
No additional migration code is required because the whole
contents of spec_ctrl is already migrated in the "cpu/spec_ctrl"
section.
Corresponding KVM patch was submitted at:
https://lore.kernel.org/lkml/20181205191956.31480-1-ehabkost@redhat.com/
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20181210180250.31299-1-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 0e8916582991b9fd0b94850a8444b8b80d0a0955)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index d990070..c115572 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1079,7 +1079,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- NULL, NULL, "spec-ctrl", NULL,
+ NULL, NULL, "spec-ctrl", "stibp",
NULL, "arch-capabilities", NULL, "ssbd",
},
.cpuid = {
--
1.8.3.1

View File

@ -1,42 +0,0 @@
From f906636aa5024f6e64e2a1802b2eca448085d06a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 10 Apr 2019 20:50:03 +0100
Subject: [PATCH 2/2] i386: Make arch_capabilities migratable
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190410205003.18916-3-ehabkost@redhat.com>
Patchwork-id: 85551
O-Subject: [RHEL-AV-8.0.1 qemu-kvm PATCH 2/2] i386: Make arch_capabilities migratable
Bugzilla: 1687578
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
Now that kvm_arch_get_supported_cpuid() will only return
arch_capabilities if QEMU is able to initialize the MSR properly,
we know that the feature is safely migratable.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190125220606.4864-3-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 014018e19b3c54dd1bf5072bc912ceffea40abe8)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index c115572..d92c128 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1088,7 +1088,6 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
.reg = R_EDX,
},
.tcg_features = TCG_7_0_EDX_FEATURES,
- .unmigratable_flags = CPUID_7_0_EDX_ARCH_CAPABILITIES,
},
[FEAT_8000_0007_EDX] = {
.type = CPUID_FEATURE_WORD,
--
1.8.3.1

View File

@ -1,68 +0,0 @@
From 03f812fa6ea821f5d1c968ab6fc0fb92054f9a1b Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 10 Apr 2019 20:50:02 +0100
Subject: [PATCH 1/2] i386: kvm: Disable arch_capabilities if MSR can't be set
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190410205003.18916-2-ehabkost@redhat.com>
Patchwork-id: 85550
O-Subject: [RHEL-AV-8.0.1 qemu-kvm PATCH 1/2] i386: kvm: Disable arch_capabilities if MSR can't be set
Bugzilla: 1687578
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
KVM has two bugs in the handling of MSR_IA32_ARCH_CAPABILITIES:
1) Linux commit commit 1eaafe91a0df ("kvm: x86: IA32_ARCH_CAPABILITIES
is always supported") makes GET_SUPPORTED_CPUID return
arch_capabilities even if running on SVM. This makes "-cpu
host,migratable=off" incorrectly expose arch_capabilities on CPUID on
AMD hosts (where the MSR is not emulated by KVM).
2) KVM_GET_MSR_INDEX_LIST does not return MSR_IA32_ARCH_CAPABILITIES if
the MSR is not supported by the host CPU. This makes QEMU not
initialize the MSR properly at kvm_put_msrs() on those hosts.
Work around both bugs on the QEMU side, by checking if the MSR
was returned by KVM_GET_MSR_INDEX_LIST before returning the
feature flag on kvm_arch_get_supported_cpuid().
This has the unfortunate side effect of making arch_capabilities
unavailable on hosts without hardware support for the MSR until bug #2
is fixed on KVM, but I can't see another way to work around bug #1
without that side effect.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190125220606.4864-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 485b1d256bcb0874bcde0223727c159b6837e6f8)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/kvm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 0c9a5e4..720948a 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -389,6 +389,15 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
if (host_tsx_blacklisted()) {
ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
}
+ } else if (function == 7 && index == 0 && reg == R_EDX) {
+ /*
+ * Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM hosts.
+ * We can detect the bug by checking if MSR_IA32_ARCH_CAPABILITIES is
+ * returned by KVM_GET_MSR_INDEX_LIST.
+ */
+ if (!has_msr_arch_capabs) {
+ ret &= ~CPUID_7_0_EDX_ARCH_CAPABILITIES;
+ }
} else if (function == 0x80000001 && reg == R_ECX) {
/*
* It's safe to enable TOPOEXT even if it's not returned by
--
1.8.3.1

View File

@ -1,48 +0,0 @@
From 61470c276a7785f3615da564f15a5c2368354638 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Fri, 18 Jan 2019 11:57:05 +0000
Subject: [PATCH 2/2] i386/kvm: add a comment explaining why .feat_names are
commented out for Hyper-V feature bits
RH-Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-id: <20190118115705.19731-3-vkuznets@redhat.com>
Patchwork-id: 84048
O-Subject: [RHEL8 qemu-kvm PATCH 2/2] i386/kvm: add a comment explaining why .feat_names are commented out for Hyper-V feature bits
Bugzilla: 1653511
RH-Acked-by: Mohammed Gamal <mgamal@redhat.com>
RH-Acked-by: Eduardo Otubo <otubo@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Hyper-V .feat_names are, unlike hardware features, commented out and it is
not obvious why we do that. Document the current status quo.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20181221141604.16935-1-vkuznets@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit abd5fc4c862d033a989552914149f01c9476bb16)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 460fe06..8570b25 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -929,6 +929,13 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
*/
.no_autoenable_flags = ~0U,
},
+ /*
+ * .feat_names are commented out for Hyper-V enlightenments because we
+ * don't want to have two different ways for enabling them on QEMU command
+ * line. Some features (e.g. "hyperv_time", "hyperv_vapic", ...) require
+ * enabling several feature bits simultaneously, exposing these bits
+ * individually may just confuse guests.
+ */
[FEAT_HYPERV_EAX] = {
.type = CPUID_FEATURE_WORD,
.feat_names = {
--
1.8.3.1

View File

@ -1,211 +0,0 @@
From 4d58784a4a507fa1070b330846d941f91bb9abdc Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Fri, 18 Jan 2019 11:57:04 +0000
Subject: [PATCH 1/2] i386/kvm: expose HV_CPUID_ENLIGHTMENT_INFO.EAX and
HV_CPUID_NESTED_FEATURES.EAX as feature words
RH-Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-id: <20190118115705.19731-2-vkuznets@redhat.com>
Patchwork-id: 84046
O-Subject: [RHEL8 qemu-kvm PATCH 1/2] i386/kvm: expose HV_CPUID_ENLIGHTMENT_INFO.EAX and HV_CPUID_NESTED_FEATURES.EAX as feature words
Bugzilla: 1653511
RH-Acked-by: Mohammed Gamal <mgamal@redhat.com>
RH-Acked-by: Eduardo Otubo <otubo@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
It was found that QMP users of QEMU (e.g. libvirt) may need
HV_CPUID_ENLIGHTMENT_INFO.EAX/HV_CPUID_NESTED_FEATURES.EAX information. In
particular, 'hv_tlbflush' and 'hv_evmcs' enlightenments are only exposed in
HV_CPUID_ENLIGHTMENT_INFO.EAX.
HV_CPUID_NESTED_FEATURES.EAX is exposed for two reasons: convenience
(we don't need to export it from hyperv_handle_properties() and as
future-proof for Enlightened MSR-Bitmap, PV EPT invalidation and
direct virtual flush features.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20181126135958.20956-1-vkuznets@redhat.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit a2b107dbbd342ff2077aa5af705efaf68c375459)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 30 ++++++++++++++++++++
target/i386/cpu.h | 2 ++
target/i386/kvm.c | 85 +++++++++++++++++++++++++++++--------------------------
3 files changed, 77 insertions(+), 40 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 573de14..460fe06 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -980,6 +980,36 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
},
.cpuid = { .eax = 0x40000003, .reg = R_EDX, },
},
+ [FEAT_HV_RECOMM_EAX] = {
+ .type = CPUID_FEATURE_WORD,
+ .feat_names = {
+ NULL /* hv_recommend_pv_as_switch */,
+ NULL /* hv_recommend_pv_tlbflush_local */,
+ NULL /* hv_recommend_pv_tlbflush_remote */,
+ NULL /* hv_recommend_msr_apic_access */,
+ NULL /* hv_recommend_msr_reset */,
+ NULL /* hv_recommend_relaxed_timing */,
+ NULL /* hv_recommend_dma_remapping */,
+ NULL /* hv_recommend_int_remapping */,
+ NULL /* hv_recommend_x2apic_msrs */,
+ NULL /* hv_recommend_autoeoi_deprecation */,
+ NULL /* hv_recommend_pv_ipi */,
+ NULL /* hv_recommend_ex_hypercalls */,
+ NULL /* hv_hypervisor_is_nested */,
+ NULL /* hv_recommend_int_mbec */,
+ NULL /* hv_recommend_evmcs */,
+ NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ },
+ .cpuid = { .eax = 0x40000004, .reg = R_EAX, },
+ },
+ [FEAT_HV_NESTED_EAX] = {
+ .type = CPUID_FEATURE_WORD,
+ .cpuid = { .eax = 0x4000000A, .reg = R_EAX, },
+ },
[FEAT_SVM] = {
.type = CPUID_FEATURE_WORD,
.feat_names = {
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 9c52d0c..dd88151 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -497,6 +497,8 @@ typedef enum FeatureWord {
FEAT_HYPERV_EAX, /* CPUID[4000_0003].EAX */
FEAT_HYPERV_EBX, /* CPUID[4000_0003].EBX */
FEAT_HYPERV_EDX, /* CPUID[4000_0003].EDX */
+ FEAT_HV_RECOMM_EAX, /* CPUID[4000_0004].EAX */
+ FEAT_HV_NESTED_EAX, /* CPUID[4000_000A].EAX */
FEAT_SVM, /* CPUID[8000_000A].EDX */
FEAT_XSAVE, /* CPUID[EAX=0xd,ECX=1].EAX */
FEAT_6_EAX, /* CPUID[6].EAX */
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 5b0ce82..0c9a5e4 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -798,6 +798,48 @@ static int hyperv_handle_properties(CPUState *cs)
}
env->features[FEAT_HYPERV_EAX] |= HV_SYNTIMERS_AVAILABLE;
}
+ if (cpu->hyperv_relaxed_timing) {
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_RELAXED_TIMING_RECOMMENDED;
+ }
+ if (cpu->hyperv_vapic) {
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_APIC_ACCESS_RECOMMENDED;
+ }
+ if (cpu->hyperv_tlbflush) {
+ if (kvm_check_extension(cs->kvm_state,
+ KVM_CAP_HYPERV_TLBFLUSH) <= 0) {
+ fprintf(stderr, "Hyper-V TLB flush support "
+ "(requested by 'hv-tlbflush' cpu flag) "
+ " is not supported by kernel\n");
+ return -ENOSYS;
+ }
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_REMOTE_TLB_FLUSH_RECOMMENDED;
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_EX_PROCESSOR_MASKS_RECOMMENDED;
+ }
+ if (cpu->hyperv_ipi) {
+ if (kvm_check_extension(cs->kvm_state,
+ KVM_CAP_HYPERV_SEND_IPI) <= 0) {
+ fprintf(stderr, "Hyper-V IPI send support "
+ "(requested by 'hv-ipi' cpu flag) "
+ " is not supported by kernel\n");
+ return -ENOSYS;
+ }
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_CLUSTER_IPI_RECOMMENDED;
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_EX_PROCESSOR_MASKS_RECOMMENDED;
+ }
+ if (cpu->hyperv_evmcs) {
+ uint16_t evmcs_version;
+
+ if (kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_ENLIGHTENED_VMCS, 0,
+ (uintptr_t)&evmcs_version)) {
+ fprintf(stderr, "Hyper-V Enlightened VMCS "
+ "(requested by 'hv-evmcs' cpu flag) "
+ "is not supported by kernel\n");
+ return -ENOSYS;
+ }
+ env->features[FEAT_HV_RECOMM_EAX] |= HV_ENLIGHTENED_VMCS_RECOMMENDED;
+ env->features[FEAT_HV_NESTED_EAX] = evmcs_version;
+ }
+
return 0;
}
@@ -871,7 +913,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
uint32_t unused;
struct kvm_cpuid_entry2 *c;
uint32_t signature[3];
- uint16_t evmcs_version;
int kvm_base = KVM_CPUID_SIGNATURE;
int r;
Error *local_err = NULL;
@@ -946,44 +987,8 @@ int kvm_arch_init_vcpu(CPUState *cs)
c = &cpuid_data.entries[cpuid_i++];
c->function = HV_CPUID_ENLIGHTMENT_INFO;
- if (cpu->hyperv_relaxed_timing) {
- c->eax |= HV_RELAXED_TIMING_RECOMMENDED;
- }
- if (cpu->hyperv_vapic) {
- c->eax |= HV_APIC_ACCESS_RECOMMENDED;
- }
- if (cpu->hyperv_tlbflush) {
- if (kvm_check_extension(cs->kvm_state,
- KVM_CAP_HYPERV_TLBFLUSH) <= 0) {
- fprintf(stderr, "Hyper-V TLB flush support "
- "(requested by 'hv-tlbflush' cpu flag) "
- " is not supported by kernel\n");
- return -ENOSYS;
- }
- c->eax |= HV_REMOTE_TLB_FLUSH_RECOMMENDED;
- c->eax |= HV_EX_PROCESSOR_MASKS_RECOMMENDED;
- }
- if (cpu->hyperv_ipi) {
- if (kvm_check_extension(cs->kvm_state,
- KVM_CAP_HYPERV_SEND_IPI) <= 0) {
- fprintf(stderr, "Hyper-V IPI send support "
- "(requested by 'hv-ipi' cpu flag) "
- " is not supported by kernel\n");
- return -ENOSYS;
- }
- c->eax |= HV_CLUSTER_IPI_RECOMMENDED;
- c->eax |= HV_EX_PROCESSOR_MASKS_RECOMMENDED;
- }
- if (cpu->hyperv_evmcs) {
- if (kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_ENLIGHTENED_VMCS, 0,
- (uintptr_t)&evmcs_version)) {
- fprintf(stderr, "Hyper-V Enlightened VMCS "
- "(requested by 'hv-evmcs' cpu flag) "
- "is not supported by kernel\n");
- return -ENOSYS;
- }
- c->eax |= HV_ENLIGHTENED_VMCS_RECOMMENDED;
- }
+
+ c->eax = env->features[FEAT_HV_RECOMM_EAX];
c->ebx = cpu->hyperv_spinlock_attempts;
c = &cpuid_data.entries[cpuid_i++];
@@ -1007,7 +1012,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
c = &cpuid_data.entries[cpuid_i++];
c->function = HV_CPUID_NESTED_FEATURES;
- c->eax = evmcs_version;
+ c->eax = env->features[FEAT_HV_NESTED_EAX];
}
}
--
1.8.3.1

View File

@ -1,64 +0,0 @@
From adf78309059e3346dddac518601f88f348ec7758 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Sat, 16 Feb 2019 00:00:49 +0000
Subject: [PATCH 3/4] i386: remove the 'INTEL_PT' CPUID bit from named CPU
models
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <1550275250-41719-3-git-send-email-pbonzini@redhat.com>
Patchwork-id: 84522
O-Subject: [rhel-av-8.0.0 qemu-kvm PATCH 2/3] i386: remove the 'INTEL_PT' CPUID bit from named CPU models
Bugzilla: 1661515
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Processor tracing is not yet implemented for KVM and it will be an
opt in feature requiring a special module parameter.
Disable it, because it is wrong to enable it by default and
it is impossible that no one has ever used it.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 4c257911dcc7c4189768e9651755c849ce9db4e8)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 7b63900..169a2ce 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2555,8 +2555,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
- CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT |
- CPUID_7_0_EBX_INTEL_PT,
+ CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT,
.features[FEAT_7_0_ECX] =
CPUID_7_0_ECX_PKU | CPUID_7_0_ECX_OSPKE |
CPUID_7_0_ECX_AVX512VNNI,
@@ -2608,7 +2607,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_INTEL_PT,
+ CPUID_7_0_EBX_SMAP,
.features[FEAT_7_0_ECX] =
CPUID_7_0_ECX_VBMI | CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU |
CPUID_7_0_ECX_OSPKE | CPUID_7_0_ECX_VBMI2 | CPUID_7_0_ECX_GFNI |
@@ -2666,8 +2665,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
- CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT |
- CPUID_7_0_EBX_INTEL_PT,
+ CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT,
.features[FEAT_7_0_ECX] =
CPUID_7_0_ECX_VBMI | CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU |
CPUID_7_0_ECX_OSPKE | CPUID_7_0_ECX_VBMI2 | CPUID_7_0_ECX_GFNI |
--
1.8.3.1

View File

@ -1,48 +0,0 @@
From 9fc28ea52c88d603e85fa806a708b53b373f511e Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Sat, 16 Feb 2019 00:00:48 +0000
Subject: [PATCH 2/4] i386: remove the new CPUID 'PCONFIG' from Icelake-Server
CPU model
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <1550275250-41719-2-git-send-email-pbonzini@redhat.com>
Patchwork-id: 84526
O-Subject: [rhel-av-8.0.0 qemu-kvm PATCH 1/3] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model
Bugzilla: 1661515
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
From: Robert Hoo <robert.hu@linux.intel.com>
PCONFIG is not available to guests; it must be specifically enabled
using the PCONFIG_ENABLE execution control. Disable it, because
no one can ever use it.
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1545227081-213696-2-git-send-email-robert.hu@linux.intel.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 76e5a4d58357b9d077afccf7f7c82e17f733b722)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index dbcf632..7b63900 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2675,8 +2675,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_ECX_AVX512VNNI | CPUID_7_0_ECX_AVX512BITALG |
CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57,
.features[FEAT_7_0_EDX] =
- CPUID_7_0_EDX_PCONFIG | CPUID_7_0_EDX_SPEC_CTRL |
- CPUID_7_0_EDX_SPEC_CTRL_SSBD,
+ CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD,
/* Missing: XSAVES (not supported by some Linux versions,
* including v4.1 to v4.12).
* KVM doesn't yet expose any XSAVES state save component,
--
1.8.3.1

View File

@ -1,294 +0,0 @@
From dea7d39cce3b1da16de0bfb47a028f770547098a Mon Sep 17 00:00:00 2001
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Tue, 29 Jan 2019 13:58:57 +0000
Subject: [PATCH 1/3] io: ensure UNIX client doesn't unlink server socket
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Daniel P. Berrange <berrange@redhat.com>
Message-id: <20190129135857.10581-2-berrange@redhat.com>
Patchwork-id: 84141
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] io: ensure UNIX client doesn't unlink server socket
Bugzilla: 1665896
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
The qio_channel_socket_close method for was mistakenly unlinking the
UNIX server socket, even if the channel was a client connection. This
was not noticed with chardevs, since they never call close, but with the
VNC server, this caused the VNC server socket to be deleted after the
first client quit.
The qio_channel_socket_close method also needlessly reimplemented the
logic that already exists in socket_listen_cleanup(). Just call that
method directly, for listen sockets only.
This fixes a regression introduced in QEMU 3.0.0 with
commit d66f78e1eaa832f73c771d9df1b606fe75d52a50
Author: Pavel Balaev <mail@void.so>
Date: Mon May 21 19:17:35 2018 +0300
Delete AF_UNIX socket after close
Fixes launchpad #1795100
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 73564c407caedf992a1c688b5fea776a8b56ba2a)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
io/channel-socket.c | 19 ++--------
tests/test-io-channel-socket.c | 86 +++++++++++++++++++++++++++++++++++++-----
2 files changed, 80 insertions(+), 25 deletions(-)
diff --git a/io/channel-socket.c b/io/channel-socket.c
index b50e63a..bc5f80e 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -688,10 +688,13 @@ qio_channel_socket_close(QIOChannel *ioc,
int rc = 0;
if (sioc->fd != -1) {
- SocketAddress *addr = socket_local_address(sioc->fd, errp);
#ifdef WIN32
WSAEventSelect(sioc->fd, NULL, 0);
#endif
+ if (qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_LISTEN)) {
+ socket_listen_cleanup(sioc->fd, errp);
+ }
+
if (closesocket(sioc->fd) < 0) {
sioc->fd = -1;
error_setg_errno(errp, errno,
@@ -699,20 +702,6 @@ qio_channel_socket_close(QIOChannel *ioc,
return -1;
}
sioc->fd = -1;
-
- if (addr && addr->type == SOCKET_ADDRESS_TYPE_UNIX
- && addr->u.q_unix.path) {
- if (unlink(addr->u.q_unix.path) < 0 && errno != ENOENT) {
- error_setg_errno(errp, errno,
- "Failed to unlink socket %s",
- addr->u.q_unix.path);
- rc = -1;
- }
- }
-
- if (addr) {
- qapi_free_SocketAddress(addr);
- }
}
return rc;
}
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index 0597213..c253ae3 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -49,6 +49,7 @@ static void test_io_channel_set_socket_bufs(QIOChannel *src,
static void test_io_channel_setup_sync(SocketAddress *listen_addr,
SocketAddress *connect_addr,
+ QIOChannel **srv,
QIOChannel **src,
QIOChannel **dst)
{
@@ -78,7 +79,7 @@ static void test_io_channel_setup_sync(SocketAddress *listen_addr,
test_io_channel_set_socket_bufs(*src, *dst);
- object_unref(OBJECT(lioc));
+ *srv = QIO_CHANNEL(lioc);
}
@@ -99,6 +100,7 @@ static void test_io_channel_complete(QIOTask *task,
static void test_io_channel_setup_async(SocketAddress *listen_addr,
SocketAddress *connect_addr,
+ QIOChannel **srv,
QIOChannel **src,
QIOChannel **dst)
{
@@ -146,21 +148,34 @@ static void test_io_channel_setup_async(SocketAddress *listen_addr,
qio_channel_set_delay(*src, false);
test_io_channel_set_socket_bufs(*src, *dst);
- object_unref(OBJECT(lioc));
+ *srv = QIO_CHANNEL(lioc);
g_main_loop_unref(data.loop);
}
+static void test_io_channel_socket_path_exists(SocketAddress *addr,
+ bool expectExists)
+{
+ if (addr->type != SOCKET_ADDRESS_TYPE_UNIX) {
+ return;
+ }
+
+ g_assert(g_file_test(addr->u.q_unix.path,
+ G_FILE_TEST_EXISTS) == expectExists);
+}
+
+
static void test_io_channel(bool async,
SocketAddress *listen_addr,
SocketAddress *connect_addr,
bool passFD)
{
- QIOChannel *src, *dst;
+ QIOChannel *src, *dst, *srv;
QIOChannelTest *test;
if (async) {
- test_io_channel_setup_async(listen_addr, connect_addr, &src, &dst);
+ test_io_channel_setup_async(listen_addr, connect_addr,
+ &srv, &src, &dst);
g_assert(!passFD ||
qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
@@ -169,14 +184,25 @@ static void test_io_channel(bool async,
g_assert(qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_SHUTDOWN));
g_assert(qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_SHUTDOWN));
+ test_io_channel_socket_path_exists(listen_addr, true);
+
test = qio_channel_test_new();
qio_channel_test_run_threads(test, true, src, dst);
qio_channel_test_validate(test);
+ test_io_channel_socket_path_exists(listen_addr, true);
+
+ /* unref without close, to ensure finalize() cleans up */
+
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
+ test_io_channel_socket_path_exists(listen_addr, true);
- test_io_channel_setup_async(listen_addr, connect_addr, &src, &dst);
+ object_unref(OBJECT(srv));
+ test_io_channel_socket_path_exists(listen_addr, false);
+
+ test_io_channel_setup_async(listen_addr, connect_addr,
+ &srv, &src, &dst);
g_assert(!passFD ||
qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
@@ -189,10 +215,24 @@ static void test_io_channel(bool async,
qio_channel_test_run_threads(test, false, src, dst);
qio_channel_test_validate(test);
+ /* close before unref, to ensure finalize copes with already closed */
+
+ qio_channel_close(src, &error_abort);
+ qio_channel_close(dst, &error_abort);
+ test_io_channel_socket_path_exists(listen_addr, true);
+
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
+ test_io_channel_socket_path_exists(listen_addr, true);
+
+ qio_channel_close(srv, &error_abort);
+ test_io_channel_socket_path_exists(listen_addr, false);
+
+ object_unref(OBJECT(srv));
+ test_io_channel_socket_path_exists(listen_addr, false);
} else {
- test_io_channel_setup_sync(listen_addr, connect_addr, &src, &dst);
+ test_io_channel_setup_sync(listen_addr, connect_addr,
+ &srv, &src, &dst);
g_assert(!passFD ||
qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
@@ -201,14 +241,25 @@ static void test_io_channel(bool async,
g_assert(qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_SHUTDOWN));
g_assert(qio_channel_has_feature(dst, QIO_CHANNEL_FEATURE_SHUTDOWN));
+ test_io_channel_socket_path_exists(listen_addr, true);
+
test = qio_channel_test_new();
qio_channel_test_run_threads(test, true, src, dst);
qio_channel_test_validate(test);
+ test_io_channel_socket_path_exists(listen_addr, true);
+
+ /* unref without close, to ensure finalize() cleans up */
+
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
+ test_io_channel_socket_path_exists(listen_addr, true);
+
+ object_unref(OBJECT(srv));
+ test_io_channel_socket_path_exists(listen_addr, false);
- test_io_channel_setup_sync(listen_addr, connect_addr, &src, &dst);
+ test_io_channel_setup_sync(listen_addr, connect_addr,
+ &srv, &src, &dst);
g_assert(!passFD ||
qio_channel_has_feature(src, QIO_CHANNEL_FEATURE_FD_PASS));
@@ -221,8 +272,23 @@ static void test_io_channel(bool async,
qio_channel_test_run_threads(test, false, src, dst);
qio_channel_test_validate(test);
+ test_io_channel_socket_path_exists(listen_addr, true);
+
+ /* close before unref, to ensure finalize copes with already closed */
+
+ qio_channel_close(src, &error_abort);
+ qio_channel_close(dst, &error_abort);
+ test_io_channel_socket_path_exists(listen_addr, true);
+
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
+ test_io_channel_socket_path_exists(listen_addr, true);
+
+ qio_channel_close(srv, &error_abort);
+ test_io_channel_socket_path_exists(listen_addr, false);
+
+ object_unref(OBJECT(srv));
+ test_io_channel_socket_path_exists(listen_addr, false);
}
}
@@ -316,7 +382,6 @@ static void test_io_channel_unix(bool async)
qapi_free_SocketAddress(listen_addr);
qapi_free_SocketAddress(connect_addr);
- g_assert(g_file_test(TEST_SOCKET, G_FILE_TEST_EXISTS) == FALSE);
}
@@ -335,7 +400,7 @@ static void test_io_channel_unix_fd_pass(void)
{
SocketAddress *listen_addr = g_new0(SocketAddress, 1);
SocketAddress *connect_addr = g_new0(SocketAddress, 1);
- QIOChannel *src, *dst;
+ QIOChannel *src, *dst, *srv;
int testfd;
int fdsend[3];
int *fdrecv = NULL;
@@ -359,7 +424,7 @@ static void test_io_channel_unix_fd_pass(void)
connect_addr->type = SOCKET_ADDRESS_TYPE_UNIX;
connect_addr->u.q_unix.path = g_strdup(TEST_SOCKET);
- test_io_channel_setup_sync(listen_addr, connect_addr, &src, &dst);
+ test_io_channel_setup_sync(listen_addr, connect_addr, &srv, &src, &dst);
memcpy(bufsend, "Hello World", G_N_ELEMENTS(bufsend));
@@ -412,6 +477,7 @@ static void test_io_channel_unix_fd_pass(void)
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
+ object_unref(OBJECT(srv));
qapi_free_SocketAddress(listen_addr);
qapi_free_SocketAddress(connect_addr);
unlink(TEST_SOCKET);
--
1.8.3.1

View File

@ -1,62 +0,0 @@
From 887d5afffeff844b1284b380e53f178f68e15087 Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Wed, 3 Apr 2019 10:17:09 +0100
Subject: [PATCH 8/9] iotests: Fix test 200 on s390x without virtio-pci
RH-Author: Thomas Huth <thuth@redhat.com>
Message-id: <20190403101709.3284-2-thuth@redhat.com>
Patchwork-id: 85312
O-Subject: [RHEL-AV-8.0.1 qemu-kvm PATCH 1/1] iotests: Fix test 200 on s390x without virtio-pci
Bugzilla: 1687582
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: David Hildenbrand <david@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
virtio-pci is optional on s390x, e.g. in downstream RHEL builds, it
is disabled. On s390x, virtio-ccw should be used instead. Other tests
like 051 or 240 already use virtio-scsi-ccw instead of virtio-scsi-pci
on s390x, so let's do the same here and always use virtio-scsi-ccw on
s390x.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit e0a59749efc246646bb208e553489b894450cbcd)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/qemu-iotests/200 | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/200 b/tests/qemu-iotests/200
index b9ebd5a..8301ff5 100755
--- a/tests/qemu-iotests/200
+++ b/tests/qemu-iotests/200
@@ -52,13 +52,21 @@ ${QEMU_IMG} create -f $IMGFMT -F $IMGFMT "${TEST_IMG}" -b "${BACKING_IMG}" 512M
${QEMU_IO} -c "write -P 0xa5 512 300M" "${BACKING_IMG}" | _filter_qemu_io
+case "$QEMU_DEFAULT_MACHINE" in
+ s390-ccw-virtio)
+ virtio_scsi="-device virtio-scsi-ccw,id=scsi0,iothread=iothread0"
+ ;;
+ *)
+ virtio_scsi="-device pci-bridge,id=bridge1,chassis_nr=1,bus=pci.0
+ -device virtio-scsi-pci,bus=bridge1,addr=0x1f,id=scsi0,iothread=iothread0"
+ ;;
+esac
+
echo
echo === Starting QEMU VM ===
echo
qemu_comm_method="qmp"
-_launch_qemu -device pci-bridge,id=bridge1,chassis_nr=1,bus=pci.0 \
- -object iothread,id=iothread0 \
- -device virtio-scsi-pci,bus=bridge1,addr=0x1f,id=scsi0,iothread=iothread0 \
+_launch_qemu -object iothread,id=iothread0 $virtio_scsi \
-drive file="${TEST_IMG}",media=disk,if=none,cache=$CACHEMODE,id=drive_sysdisk,format=$IMGFMT \
-device scsi-hd,drive=drive_sysdisk,bus=scsi0.0,id=sysdisk,bootindex=0
h1=$QEMU_HANDLE
--
1.8.3.1

View File

@ -1,122 +0,0 @@
From 91ae068923b70fc62c8504f7c77e42829b4c2e18 Mon Sep 17 00:00:00 2001
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Tue, 29 Jan 2019 07:02:50 +0000
Subject: [PATCH 2/2] iotests: add 238 for throttling tgm unregister iothread
segfault
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <20190129070250.22709-3-stefanha@redhat.com>
Patchwork-id: 84138
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 2/2] iotests: add 238 for throttling tgm unregister iothread segfault
Bugzilla: 1655947
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
Hot-unplug a scsi-hd using an iothread. The previous patch fixes a
segfault in this scenario.
This patch adds a regression test.
Suggested-by: Alberto Garcia <berto@igalia.com>
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190114133257.30299-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 202277f43d544779b7a63123a51c54c3a16b74ad)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Conflicts:
tests/qemu-iotests/group
Context conflict because downstream doesn't have 236. This patch adds
238 and doesn't depend on 236.
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/qemu-iotests/238 | 47 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/238.out | 6 ++++++
tests/qemu-iotests/group | 1 +
3 files changed, 54 insertions(+)
create mode 100755 tests/qemu-iotests/238
create mode 100644 tests/qemu-iotests/238.out
diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238
new file mode 100755
index 0000000..f81ee11
--- /dev/null
+++ b/tests/qemu-iotests/238
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# Regression test for throttle group member unregister segfault with iothread
+#
+# Copyright (c) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import sys
+import os
+import iotests
+from iotests import log
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
+
+from qemu import QEMUMachine
+
+if iotests.qemu_default_machine == 's390-ccw-virtio':
+ virtio_scsi_device = 'virtio-scsi-ccw'
+else:
+ virtio_scsi_device = 'virtio-scsi-pci'
+
+vm = QEMUMachine(iotests.qemu_prog)
+vm.add_args('-machine', 'accel=kvm')
+vm.launch()
+
+log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co'))
+log(vm.qmp('object-add', qom_type='iothread', id='iothread0'))
+log(vm.qmp('device_add', id='scsi0', driver=virtio_scsi_device, iothread='iothread0'))
+log(vm.qmp('device_add', id='scsi-hd0', driver='scsi-hd', drive='hd0'))
+log(vm.qmp('block_set_io_throttle', id='scsi-hd0', bps=0, bps_rd=0, bps_wr=0,
+ iops=1000, iops_rd=0, iops_wr=0, conv_keys=False))
+log(vm.qmp('device_del', id='scsi-hd0'))
+
+vm.shutdown()
diff --git a/tests/qemu-iotests/238.out b/tests/qemu-iotests/238.out
new file mode 100644
index 0000000..4de840b
--- /dev/null
+++ b/tests/qemu-iotests/238.out
@@ -0,0 +1,6 @@
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 05996ae..268fefa 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -233,3 +233,4 @@
233 auto quick
234 auto quick migration
235 auto quick
+238 auto quick
--
1.8.3.1

View File

@ -1,113 +0,0 @@
From dcce446158c042fd0aa54a6ebcc61c00f8d4759e Mon Sep 17 00:00:00 2001
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Mon, 4 Mar 2019 08:54:27 +0000
Subject: [PATCH 4/9] iotests: add LUKS payload overhead to 178 qemu-img
measure test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <20190304085427.8148-3-stefanha@redhat.com>
Patchwork-id: 84777
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 2/2] iotests: add LUKS payload overhead to 178 qemu-img measure test
Bugzilla: 1655065
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
The previous patch includes the LUKS payload overhead into the qemu-img
measure calculation for qcow2. Update qemu-iotests 178 to exercise this
new code path.
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190218104525.23674-3-stefanha@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 0482098608b83b559bc1802e4c612051b51f6c4c)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
tests/qemu-iotests/178 | 8 ++++++++
tests/qemu-iotests/178.out.qcow2 | 24 ++++++++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178
index 3f4b4a4..927bf06 100755
--- a/tests/qemu-iotests/178
+++ b/tests/qemu-iotests/178
@@ -142,6 +142,14 @@ for ofmt in human json; do
# The backing file doesn't need to exist :)
$QEMU_IMG measure --output=$ofmt -o backing_file=x \
-f "$fmt" -O "$IMGFMT" "$TEST_IMG"
+
+ echo
+ echo "== $fmt input image and LUKS encryption =="
+ echo
+ $QEMU_IMG measure --output=$ofmt \
+ --object secret,id=sec0,data=base \
+ -o encrypt.format=luks,encrypt.key-secret=sec0,encrypt.iter-time=10 \
+ -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
fi
echo
diff --git a/tests/qemu-iotests/178.out.qcow2 b/tests/qemu-iotests/178.out.qcow2
index d42d4a4..55a8dc9 100644
--- a/tests/qemu-iotests/178.out.qcow2
+++ b/tests/qemu-iotests/178.out.qcow2
@@ -68,6 +68,11 @@ converted image file size in bytes: 458752
required size: 1074135040
fully allocated size: 1074135040
+== qcow2 input image and LUKS encryption ==
+
+required size: 2686976
+fully allocated size: 1076232192
+
== qcow2 input image and preallocation (human) ==
required size: 1074135040
@@ -114,6 +119,11 @@ converted image file size in bytes: 524288
required size: 1074135040
fully allocated size: 1074135040
+== raw input image and LUKS encryption ==
+
+required size: 2686976
+fully allocated size: 1076232192
+
== raw input image and preallocation (human) ==
required size: 1074135040
@@ -205,6 +215,13 @@ converted image file size in bytes: 458752
"fully-allocated": 1074135040
}
+== qcow2 input image and LUKS encryption ==
+
+{
+ "required": 2686976,
+ "fully-allocated": 1076232192
+}
+
== qcow2 input image and preallocation (json) ==
{
@@ -263,6 +280,13 @@ converted image file size in bytes: 524288
"fully-allocated": 1074135040
}
+== raw input image and LUKS encryption ==
+
+{
+ "required": 2686976,
+ "fully-allocated": 1076232192
+}
+
== raw input image and preallocation (json) ==
{
--
1.8.3.1

View File

@ -1,122 +0,0 @@
From ee704181e5f2dd1ebc6a2de0f9e750a11541cd47 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 31 Jan 2019 14:28:01 +0000
Subject: [PATCH 2/2] json: Fix % handling when not interpolating
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190131142801.15268-2-armbru@redhat.com>
Patchwork-id: 84158
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] json: Fix % handling when not interpolating
Bugzilla: 1668244
RH-Acked-by: Richard Jones <rjones@redhat.com>
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
From: Christophe Fergeau <cfergeau@redhat.com>
Commit 8bca4613 added support for %% in json strings when interpolating,
but in doing so broke handling of % when not interpolating.
When parse_string() is fed a string token containing '%', it skips the
'%' regardless of ctxt->ap, i.e. even it's not interpolating. If the
'%' is the string's last character, it fails an assertion. Else, it
"merely" swallows the '%'.
Fix parse_string() to handle '%' specially only when interpolating.
To gauge the bug's impact, let's review non-interpolating users of this
parser, i.e. code passing NULL context to json_message_parser_init():
* tests/check-qjson.c, tests/test-qobject-input-visitor.c,
tests/test-visitor-serialization.c
Plenty of tests, but we still failed to cover the buggy case.
* monitor.c: QMP input
* qga/main.c: QGA input
* qobject_from_json():
- qobject-input-visitor.c: JSON command line option arguments of
-display and -blockdev
Reproducer: -blockdev '{"%"}'
- block.c: JSON pseudo-filenames starting with "json:"
Reproducer: https://bugzilla.redhat.com/show_bug.cgi?id=1668244#c3
- block/rbd.c: JSON key pairs
Pseudo-filenames starting with "rbd:".
Command line, QMP and QGA input are trusted.
Filenames are trusted when they come from command line, QMP or HMP.
They are untrusted when they come from from image file headers.
Example: QCOW2 backing file name. Note that this is *not* the security
boundary between host and guest. It's the boundary between host and an
image file from an untrusted source.
Neither failing an assertion nor skipping a character in a filename of
your choice looks exploitable. Note that we don't support compiling
with NDEBUG.
Fixes: 8bca4613e6cddd948895b8db3def05950463495b
Cc: qemu-stable@nongnu.org
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Message-Id: <20190102140535.11512-1-cfergeau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
[Commit message extended to discuss impact]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit bbc0586ced6e9ffdfd29d89fcc917b3d90ac3938)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
qobject/json-parser.c | 10 ++++++----
tests/check-qjson.c | 5 +++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 5a840df..53e91cb 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -208,11 +208,13 @@ static QString *parse_string(JSONParserContext *ctxt, JSONToken *token)
}
break;
case '%':
- if (ctxt->ap && ptr[1] != '%') {
- parse_error(ctxt, token, "can't interpolate into string");
- goto out;
+ if (ctxt->ap) {
+ if (ptr[1] != '%') {
+ parse_error(ctxt, token, "can't interpolate into string");
+ goto out;
+ }
+ ptr++;
}
- ptr++;
/* fall through */
default:
cp = mod_utf8_codepoint(ptr, 6, &end);
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index d876a7a..fa2afcc 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -176,6 +176,11 @@ static void utf8_string(void)
"\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5",
"\\u03BA\\u1F79\\u03C3\\u03BC\\u03B5",
},
+ /* '%' character when not interpolating */
+ {
+ "100%",
+ "100%",
+ },
/* 2 Boundary condition test cases */
/* 2.1 First possible sequence of a certain length */
/*
--
1.8.3.1

View File

@ -1,75 +0,0 @@
From 31566a415b69d58fdf09f05e362685fcc3aee00b Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 7 Mar 2019 12:26:21 +0000
Subject: [PATCH 1/2] migration: Fix cancel state
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20190307122622.9387-2-dgilbert@redhat.com>
Patchwork-id: 84820
O-Subject: [RHEL-8.0 qemu-kvm AV PATCH 1/2] migration: Fix cancel state
Bugzilla: 1608649
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Peter Xu <peterx@redhat.com>
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
During a cancelled migration there's a race where the fd can
go into an error state before we get back around the migration loop
and migration_detect_error transitions from cancelling->failed.
Check for cancelled/cancelling and don't change the state.
Red Hat bug: https://bugzilla.redhat.com/show_bug.cgi?id=1608649
Fixes: b23c2ade250
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190219195928.12289-1-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
(cherry picked from commit c3c5eae6ac69d9f7d4618407aa6c8ac5edc2267c)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
migration/migration.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 0d9cb7a..ecdf01d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2824,6 +2824,13 @@ static MigThrError postcopy_pause(MigrationState *s)
static MigThrError migration_detect_error(MigrationState *s)
{
int ret;
+ int state = s->state;
+
+ if (state == MIGRATION_STATUS_CANCELLING ||
+ state == MIGRATION_STATUS_CANCELLED) {
+ /* End the migration, but don't set the state to failed */
+ return MIG_THR_ERR_FATAL;
+ }
/* Try to detect any file errors */
ret = qemu_file_get_error(s->to_dst_file);
@@ -2833,7 +2840,7 @@ static MigThrError migration_detect_error(MigrationState *s)
return MIG_THR_ERR_NONE;
}
- if (s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE && ret == -EIO) {
+ if (state == MIGRATION_STATUS_POSTCOPY_ACTIVE && ret == -EIO) {
/*
* For postcopy, we allow the network to be down for a
* while. After that, it can be continued by a
@@ -2845,7 +2852,7 @@ static MigThrError migration_detect_error(MigrationState *s)
* For precopy (or postcopy with error outside IO), we fail
* with no time.
*/
- migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
+ migrate_set_state(&s->state, state, MIGRATION_STATUS_FAILED);
trace_migration_thread_file_err();
/* Time to stop the migration, now. */
--
1.8.3.1

View File

@ -1,54 +0,0 @@
From aa5367b5e81cdc3cc3dc8dbc31daef6acecc1f97 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 7 Mar 2019 12:26:22 +0000
Subject: [PATCH 2/2] migration/rdma: Fix qemu_rdma_cleanup null check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20190307122622.9387-3-dgilbert@redhat.com>
Patchwork-id: 84819
O-Subject: [RHEL-8.0 qemu-kvm AV PATCH 2/2] migration/rdma: Fix qemu_rdma_cleanup null check
Bugzilla: 1608649
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Peter Xu <peterx@redhat.com>
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
If the migration fails before the channel is open (e.g. a bad
address) we end up in the cleanup with rdma->channel==NULL.
Spotted by Coverity: CID 1398634
Fixes: fbbaacab2758cb3f32a0
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190214185351.5927-1-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
(cherry picked from commit cf75e2684938413f0bbe95f5a4b7db5c845e42c8)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
migration/rdma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index 54a3c11..9fa3b17 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2321,7 +2321,9 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
rdma->connected = false;
}
- qemu_set_fd_handler(rdma->channel->fd, NULL, NULL, NULL);
+ if (rdma->channel) {
+ qemu_set_fd_handler(rdma->channel->fd, NULL, NULL, NULL);
+ }
g_free(rdma->dest_blocks);
rdma->dest_blocks = NULL;
--
1.8.3.1

View File

@ -1,53 +0,0 @@
From 93cfdba0a95999ba3d44afe5c15cc3810446f11b Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Thu, 24 Jan 2019 16:41:10 +0000
Subject: [PATCH 1/3] migration/rdma: unregister fd handler
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20190124164110.18787-2-dgilbert@redhat.com>
Patchwork-id: 84110
O-Subject: [RHEL-8.0 qemu-kvm PATCH 1/1] migration/rdma: unregister fd handler
Bugzilla: 1666601
RH-Acked-by: Peter Xu <peterx@redhat.com>
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Unregister the fd handler before we destroy the channel,
otherwise we've got a race where we might land in the
fd handler just as we're closing the device.
(The race is quite data dependent, you just have to have
the right set of devices for it to trigger).
Corresponds to RH bz: https://bugzilla.redhat.com/show_bug.cgi?id=1666601
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190122173111.29821-1-dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
(cherry picked from commit fbbaacab2758cb3f32a07524710533b1d6422be4)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
migration/rdma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/migration/rdma.c b/migration/rdma.c
index 9b2e7e1..54a3c11 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2321,6 +2321,7 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
rdma->connected = false;
}
+ qemu_set_fd_handler(rdma->channel->fd, NULL, NULL, NULL);
g_free(rdma->dest_blocks);
rdma->dest_blocks = NULL;
--
1.8.3.1

View File

@ -1,177 +0,0 @@
From 1a283b8cdd349b9085488a516f26f453c8591ce2 Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Tue, 5 Feb 2019 04:47:57 +0000
Subject: [PATCH 3/8] mmap-alloc: fix hugetlbfs misaligned length in ppc64
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20190205044757.13591-3-dgibson@redhat.com>
Patchwork-id: 84233
O-Subject: [RHELAV-8.0 qemu-kvm PATCH 2/2] mmap-alloc: fix hugetlbfs misaligned length in ppc64
Bugzilla: 1671519
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
From: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
The commit 7197fb4058bcb68986bae2bb2c04d6370f3e7218 ("util/mmap-alloc:
fix hugetlb support on ppc64") fixed Huge TLB mappings on ppc64.
However, we still need to consider the underlying huge page size
during munmap() because it requires that both address and length be a
multiple of the underlying huge page size for Huge TLB mappings.
Quote from "Huge page (Huge TLB) mappings" paragraph under NOTES
section of the munmap(2) manual:
"For munmap(), addr and length must both be a multiple of the
underlying huge page size."
On ppc64, the munmap() in qemu_ram_munmap() does not work for Huge TLB
mappings because the mapped segment can be aligned with the underlying
huge page size, not aligned with the native system page size, as
returned by getpagesize().
This has the side effect of not releasing huge pages back to the pool
after a hugetlbfs file-backed memory device is hot-unplugged.
This patch fixes the situation in qemu_ram_mmap() and
qemu_ram_munmap() by considering the underlying page size on ppc64.
After this patch, memory hot-unplug releases huge pages back to the
pool.
Fixes: 7197fb4058bcb68986bae2bb2c04d6370f3e7218
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 53adb9d43e1abba187387a51f238e878e934c647)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1671519
Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
exec.c | 4 ++--
include/qemu/mmap-alloc.h | 2 +-
util/mmap-alloc.c | 22 ++++++++++++++++------
util/oslib-posix.c | 2 +-
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/exec.c b/exec.c
index bb6170d..38eaf0f 100644
--- a/exec.c
+++ b/exec.c
@@ -1870,7 +1870,7 @@ static void *file_ram_alloc(RAMBlock *block,
if (mem_prealloc) {
os_mem_prealloc(fd, area, memory, smp_cpus, errp);
if (errp && *errp) {
- qemu_ram_munmap(area, memory);
+ qemu_ram_munmap(fd, area, memory);
return NULL;
}
}
@@ -2391,7 +2391,7 @@ static void reclaim_ramblock(RAMBlock *block)
xen_invalidate_map_cache_entry(block->host);
#ifndef _WIN32
} else if (block->fd >= 0) {
- qemu_ram_munmap(block->host, block->max_length);
+ qemu_ram_munmap(block->fd, block->host, block->max_length);
close(block->fd);
#endif
} else {
diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h
index 50385e3..ef04f0e 100644
--- a/include/qemu/mmap-alloc.h
+++ b/include/qemu/mmap-alloc.h
@@ -9,6 +9,6 @@ size_t qemu_mempath_getpagesize(const char *mem_path);
void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared);
-void qemu_ram_munmap(void *ptr, size_t size);
+void qemu_ram_munmap(int fd, void *ptr, size_t size);
#endif
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index f71ea03..8565885 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -80,6 +80,7 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
int flags;
int guardfd;
size_t offset;
+ size_t pagesize;
size_t total;
void *guardptr;
void *ptr;
@@ -100,7 +101,8 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
* anonymous memory is OK.
*/
flags = MAP_PRIVATE;
- if (fd == -1 || qemu_fd_getpagesize(fd) == getpagesize()) {
+ pagesize = qemu_fd_getpagesize(fd);
+ if (fd == -1 || pagesize == getpagesize()) {
guardfd = -1;
flags |= MAP_ANONYMOUS;
} else {
@@ -109,6 +111,7 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
}
#else
guardfd = -1;
+ pagesize = getpagesize();
flags = MAP_PRIVATE | MAP_ANONYMOUS;
#endif
@@ -120,7 +123,7 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
assert(is_power_of_2(align));
/* Always align to host page size */
- assert(align >= getpagesize());
+ assert(align >= pagesize);
flags = MAP_FIXED;
flags |= fd == -1 ? MAP_ANONYMOUS : 0;
@@ -143,17 +146,24 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
* a guard page guarding against potential buffer overflows.
*/
total -= offset;
- if (total > size + getpagesize()) {
- munmap(ptr + size + getpagesize(), total - size - getpagesize());
+ if (total > size + pagesize) {
+ munmap(ptr + size + pagesize, total - size - pagesize);
}
return ptr;
}
-void qemu_ram_munmap(void *ptr, size_t size)
+void qemu_ram_munmap(int fd, void *ptr, size_t size)
{
+ size_t pagesize;
+
if (ptr) {
/* Unmap both the RAM block and the guard page */
- munmap(ptr, size + getpagesize());
+#if defined(__powerpc64__) && defined(__linux__)
+ pagesize = qemu_fd_getpagesize(fd);
+#else
+ pagesize = getpagesize();
+#endif
+ munmap(ptr, size + pagesize);
}
}
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index c1bee2a..97b2f3b 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -226,7 +226,7 @@ void qemu_vfree(void *ptr)
void qemu_anon_ram_free(void *ptr, size_t size)
{
trace_qemu_anon_ram_free(ptr, size);
- qemu_ram_munmap(ptr, size);
+ qemu_ram_munmap(-1, ptr, size);
}
void qemu_set_block(int fd)
--
1.8.3.1

View File

@ -1,138 +0,0 @@
From 2215d38d1231284cced64d94b4430e92c9e2c017 Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Tue, 5 Feb 2019 04:47:56 +0000
Subject: [PATCH 2/8] mmap-alloc: unfold qemu_ram_mmap()
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20190205044757.13591-2-dgibson@redhat.com>
Patchwork-id: 84234
O-Subject: [RHELAV-8.0 qemu-kvm PATCH 1/2] mmap-alloc: unfold qemu_ram_mmap()
Bugzilla: 1671519
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
From: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Unfold parts of qemu_ram_mmap() for the sake of understanding, moving
declarations to the top, and keeping architecture-specifics in the
ifdef-else blocks. No changes in the function behaviour.
Give ptr and ptr1 meaningful names:
ptr -> guardptr : pointer to the PROT_NONE guard region
ptr1 -> ptr : pointer to the mapped memory returned to caller
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 2044c3e7116eeac0449dcb4a4130cc8f8b9310da)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1671519
Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
util/mmap-alloc.c | 53 ++++++++++++++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index fd329ec..f71ea03 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -77,11 +77,19 @@ size_t qemu_mempath_getpagesize(const char *mem_path)
void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
{
+ int flags;
+ int guardfd;
+ size_t offset;
+ size_t total;
+ void *guardptr;
+ void *ptr;
+
/*
* Note: this always allocates at least one extra page of virtual address
* space, even if size is already aligned.
*/
- size_t total = size + align;
+ total = size + align;
+
#if defined(__powerpc64__) && defined(__linux__)
/* On ppc64 mappings in the same segment (aka slice) must share the same
* page size. Since we will be re-allocating part of this segment
@@ -91,16 +99,22 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
* We do this unless we are using the system page size, in which case
* anonymous memory is OK.
*/
- int anonfd = fd == -1 || qemu_fd_getpagesize(fd) == getpagesize() ? -1 : fd;
- int flags = anonfd == -1 ? MAP_ANONYMOUS : MAP_NORESERVE;
- void *ptr = mmap(0, total, PROT_NONE, flags | MAP_PRIVATE, anonfd, 0);
+ flags = MAP_PRIVATE;
+ if (fd == -1 || qemu_fd_getpagesize(fd) == getpagesize()) {
+ guardfd = -1;
+ flags |= MAP_ANONYMOUS;
+ } else {
+ guardfd = fd;
+ flags |= MAP_NORESERVE;
+ }
#else
- void *ptr = mmap(0, total, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+ guardfd = -1;
+ flags = MAP_PRIVATE | MAP_ANONYMOUS;
#endif
- size_t offset;
- void *ptr1;
- if (ptr == MAP_FAILED) {
+ guardptr = mmap(0, total, PROT_NONE, flags, guardfd, 0);
+
+ if (guardptr == MAP_FAILED) {
return MAP_FAILED;
}
@@ -108,19 +122,20 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
/* Always align to host page size */
assert(align >= getpagesize());
- offset = QEMU_ALIGN_UP((uintptr_t)ptr, align) - (uintptr_t)ptr;
- ptr1 = mmap(ptr + offset, size, PROT_READ | PROT_WRITE,
- MAP_FIXED |
- (fd == -1 ? MAP_ANONYMOUS : 0) |
- (shared ? MAP_SHARED : MAP_PRIVATE),
- fd, 0);
- if (ptr1 == MAP_FAILED) {
- munmap(ptr, total);
+ flags = MAP_FIXED;
+ flags |= fd == -1 ? MAP_ANONYMOUS : 0;
+ flags |= shared ? MAP_SHARED : MAP_PRIVATE;
+ offset = QEMU_ALIGN_UP((uintptr_t)guardptr, align) - (uintptr_t)guardptr;
+
+ ptr = mmap(guardptr + offset, size, PROT_READ | PROT_WRITE, flags, fd, 0);
+
+ if (ptr == MAP_FAILED) {
+ munmap(guardptr, total);
return MAP_FAILED;
}
if (offset > 0) {
- munmap(ptr, offset);
+ munmap(guardptr, offset);
}
/*
@@ -129,10 +144,10 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared)
*/
total -= offset;
if (total > size + getpagesize()) {
- munmap(ptr1 + size + getpagesize(), total - size - getpagesize());
+ munmap(ptr + size + getpagesize(), total - size - getpagesize());
}
- return ptr1;
+ return ptr;
}
void qemu_ram_munmap(void *ptr, size_t size)
--
1.8.3.1

View File

@ -1,55 +0,0 @@
From d89b308fb81b12ff2f452739d103cfee8043f94a Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 14 Dec 2018 17:02:06 +0000
Subject: [PATCH 1/8] pc: 7.5 compat entries
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20181214170211.14267-2-dgilbert@redhat.com>
Patchwork-id: 83515
O-Subject: [RHEL8 qemu-kvm PATCH v3 1/6] pc: 7.5 compat entries
Bugzilla: 1655820
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
These are missing entries that are already in 7.6 from commits
64b860ac7db and 2f039646554 but are missing in the 3.1 rebase.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/i386/pc.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index f8f35af..efcb208 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1008,6 +1008,22 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
.driver = "Skylake-Server" "-" TYPE_X86_CPU,\
.property = "clflushopt",\
.value = "off",\
+ },{ /* PC_RHEL7_5_COMPAT from PC_COMPAT_2_12 */ \
+ .driver = TYPE_X86_CPU,\
+ .property = "legacy-cache",\
+ .value = "on",\
+ },{ /* PC_RHEL7_5_COMPAT from PC_COMPAT_2_12 */ \
+ .driver = TYPE_X86_CPU,\
+ .property = "topoext",\
+ .value = "off",\
+ },{ /* PC_RHEL7_5_COMPAT from PC_COMPAT_2_12 */ \
+ .driver = "EPYC-" TYPE_X86_CPU,\
+ .property = "xlevel",\
+ .value = stringify(0x8000000a),\
+ },{ /* PC_RHEL7_5_COMPAT from PC_COMPAT_2_12 */ \
+ .driver = "EPYC-IBPB-" TYPE_X86_CPU,\
+ .property = "xlevel",\
+ .value = stringify(0x8000000a),\
},
--
1.8.3.1

View File

@ -1,41 +0,0 @@
From 5121d3ce3d4a7932e8b62b7eb4c70aed802c9abd Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 14 Dec 2018 17:02:09 +0000
Subject: [PATCH 4/8] pc: Add compat for pc-i440fx-rhel7.6.0 machine type
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20181214170211.14267-5-dgilbert@redhat.com>
Patchwork-id: 83517
O-Subject: [RHEL8 qemu-kvm PATCH v3 4/6] pc: Add compat for pc-i440fx-rhel7.6.0 machine type
Bugzilla: 1655820
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Use the PC_RHEL7_6_COMPAT macro for our i440fx machine type.
We're not adding new RHEL8 i440 machine types at this time, so it's
just a matter of keeping the current i440fx machine types compatible.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc_piix.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index af9eb8c..efee5e7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1186,6 +1186,7 @@ static void pc_machine_rhel760_options(MachineClass *m)
{
pc_machine_rhel7_options(m);
m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
+ SET_MACHINE_COMPAT(m, PC_RHEL7_6_COMPAT);
}
DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760,
--
1.8.3.1

View File

@ -1,73 +0,0 @@
From b9db46a8df4b0eb25bf71205b188b903ff61936c Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 14 Dec 2018 17:02:10 +0000
Subject: [PATCH 5/8] pc: Add pc-q35-8.0.0 machine type
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20181214170211.14267-6-dgilbert@redhat.com>
Patchwork-id: 83518
O-Subject: [RHEL8 qemu-kvm PATCH v3 5/6] pc: Add pc-q35-8.0.0 machine type
Bugzilla: 1655820
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/i386/pc_q35.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 163546e..0b7223f 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -431,8 +431,8 @@ DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
/* Red Hat Enterprise Linux machine types */
-/* Options for the latest rhel7 q35 machine type */
-static void pc_q35_machine_rhel7_options(MachineClass *m)
+/* Options for the latest rhel q35 machine type */
+static void pc_q35_machine_rhel_options(MachineClass *m)
{
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pcmc->default_nic_model = "e1000e";
@@ -446,6 +446,20 @@ static void pc_q35_machine_rhel7_options(MachineClass *m)
SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT);
}
+static void pc_q35_init_rhel800(MachineState *machine)
+{
+ pc_q35_init(machine);
+}
+
+static void pc_q35_machine_rhel800_options(MachineClass *m)
+{
+ pc_q35_machine_rhel_options(m);
+ m->desc = "RHEL-8.0.0 PC (Q35 + ICH9, 2009)";
+}
+
+DEFINE_PC_MACHINE(q35_rhel800, "pc-q35-rhel8.0.0", pc_q35_init_rhel800,
+ pc_q35_machine_rhel800_options);
+
static void pc_q35_init_rhel760(MachineState *machine)
{
pc_q35_init(machine);
@@ -453,8 +467,10 @@ static void pc_q35_init_rhel760(MachineState *machine)
static void pc_q35_machine_rhel760_options(MachineClass *m)
{
- pc_q35_machine_rhel7_options(m);
+ pc_q35_machine_rhel800_options(m);
+ m->alias = NULL;
m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)";
+ SET_MACHINE_COMPAT(m, PC_RHEL7_6_COMPAT);
}
DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760,
--
1.8.3.1

View File

@ -1,60 +0,0 @@
From f58ebc7e755e7baa122b906e061feb4de10bbe4c Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 14 Dec 2018 17:02:11 +0000
Subject: [PATCH 6/8] pc: Add x-migrate-smi-count=off to PC_RHEL7_6_COMPAT
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20181214170211.14267-7-dgilbert@redhat.com>
Patchwork-id: 83514
O-Subject: [RHEL8 qemu-kvm PATCH v3 6/6] pc: Add x-migrate-smi-count=off to PC_RHEL7_6_COMPAT
Bugzilla: 1655820
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
MSR_SMI_COUNT started being migrated in QEMU 2.12 and in the 2.12
release this broke back migration to earlier versions; however
that didn't cause a problem on RHEL because it also relied on newer
kernel features that RHEL 7.* doesn't have.
QEMU 3.0 got a fix (in PC_COMPAT_2_11) to fix the 2.12->earlier
breakage, but given the kernel dependency, it makes more sense
for us to tie it to 8.* machine types and keep the feature off for
all 7.* machine types.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/i386/pc.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 5533863..426a975 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1000,6 +1000,9 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but:
* all of the 2_12 stuff was already in 7.6 from bz 1481253
+ * x-migrate-smi-count comes from PC_COMPAT_2_11 but
+ * is really tied to kernel version so keep it off on 7.x
+ * machine types irrespective of host.
*/
#define PC_RHEL7_6_COMPAT \
HW_COMPAT_RHEL7_6 \
@@ -1015,6 +1018,10 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
.driver = "Skylake-Server-IBRS" "-" TYPE_X86_CPU,\
.property = "pku",\
.value = "off",\
+ },{ /* PC_RHEL7_6_COMPAT from PC_COMPAT_2_11 */ \
+ .driver = TYPE_X86_CPU,\
+ .property = "x-migrate-smi-count",\
+ .value = "off",\
},
/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but:
--
1.8.3.1

View File

@ -1,58 +0,0 @@
From 83fd182901d50d150416afaa1236c3b798b320e7 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Date: Fri, 14 Dec 2018 17:02:08 +0000
Subject: [PATCH 3/8] pc: PC_RHEL7_6_COMPAT
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: <20181214170211.14267-4-dgilbert@redhat.com>
Patchwork-id: 83513
O-Subject: [RHEL8 qemu-kvm PATCH v3 3/6] pc: PC_RHEL7_6_COMPAT
Bugzilla: 1655820
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Add the PC_RHEL7_6_COMPAT macro derived from the 3.0 and 2.12
upstream macros.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/i386/pc.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index efcb208..5533863 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -998,6 +998,25 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
.value = "on",\
},
+/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but:
+ * all of the 2_12 stuff was already in 7.6 from bz 1481253
+ */
+#define PC_RHEL7_6_COMPAT \
+ HW_COMPAT_RHEL7_6 \
+ { /* PC_RHEL7_6_COMPAT from PC_COMPAT_3_0 */ \
+ .driver = TYPE_X86_CPU,\
+ .property = "x-hv-synic-kvm-only",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from PC_COMPAT_3_0 */ \
+ .driver = "Skylake-Server" "-" TYPE_X86_CPU,\
+ .property = "pku",\
+ .value = "off",\
+ },{ /* PC_RHEL7_6_COMPAT from PC_COMPAT_3_0 */ \
+ .driver = "Skylake-Server-IBRS" "-" TYPE_X86_CPU,\
+ .property = "pku",\
+ .value = "off",\
+ },
+
/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but:
* - x-hv-max-vps was backported to 7.5
* - x-pci-hole64-fix was backported to 7.5
--
1.8.3.1

View File

@ -1,148 +0,0 @@
From e5d1850f80df1b548b1c3bdc0914e7790702d543 Mon Sep 17 00:00:00 2001
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Mon, 4 Mar 2019 08:54:26 +0000
Subject: [PATCH 3/9] qcow2: include LUKS payload overhead in qemu-img measure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <20190304085427.8148-2-stefanha@redhat.com>
Patchwork-id: 84778
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/2] qcow2: include LUKS payload overhead in qemu-img measure
Bugzilla: 1655065
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
LUKS encryption reserves clusters for its own payload data. The size of
this area must be included in the qemu-img measure calculation so that
we arrive at the correct minimum required image size.
(Ab)use the qcrypto_block_create() API to determine the payload
overhead. We discard the payload data that qcrypto thinks will be
written to the image.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190218104525.23674-2-stefanha@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 61914f8906fabbae26372a576d9dd988c5e22b75)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block/qcow2.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 71 insertions(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 991d6ac..1b41e4c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4113,6 +4113,60 @@ static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs)
return ret;
}
+static ssize_t qcow2_measure_crypto_hdr_init_func(QCryptoBlock *block,
+ size_t headerlen, void *opaque, Error **errp)
+{
+ size_t *headerlenp = opaque;
+
+ /* Stash away the payload size */
+ *headerlenp = headerlen;
+ return 0;
+}
+
+static ssize_t qcow2_measure_crypto_hdr_write_func(QCryptoBlock *block,
+ size_t offset, const uint8_t *buf, size_t buflen,
+ void *opaque, Error **errp)
+{
+ /* Discard the bytes, we're not actually writing to an image */
+ return buflen;
+}
+
+/* Determine the number of bytes for the LUKS payload */
+static bool qcow2_measure_luks_headerlen(QemuOpts *opts, size_t *len,
+ Error **errp)
+{
+ QDict *opts_qdict;
+ QDict *cryptoopts_qdict;
+ QCryptoBlockCreateOptions *cryptoopts;
+ QCryptoBlock *crypto;
+
+ /* Extract "encrypt." options into a qdict */
+ opts_qdict = qemu_opts_to_qdict(opts, NULL);
+ qdict_extract_subqdict(opts_qdict, &cryptoopts_qdict, "encrypt.");
+ qobject_unref(opts_qdict);
+
+ /* Build QCryptoBlockCreateOptions object from qdict */
+ qdict_put_str(cryptoopts_qdict, "format", "luks");
+ cryptoopts = block_crypto_create_opts_init(cryptoopts_qdict, errp);
+ qobject_unref(cryptoopts_qdict);
+ if (!cryptoopts) {
+ return false;
+ }
+
+ /* Fake LUKS creation in order to determine the payload size */
+ crypto = qcrypto_block_create(cryptoopts, "encrypt.",
+ qcow2_measure_crypto_hdr_init_func,
+ qcow2_measure_crypto_hdr_write_func,
+ len, errp);
+ qapi_free_QCryptoBlockCreateOptions(cryptoopts);
+ if (!crypto) {
+ return false;
+ }
+
+ qcrypto_block_free(crypto);
+ return true;
+}
+
static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
Error **errp)
{
@@ -4122,11 +4176,13 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
uint64_t virtual_size; /* disk size as seen by guest */
uint64_t refcount_bits;
uint64_t l2_tables;
+ uint64_t luks_payload_size = 0;
size_t cluster_size;
int version;
char *optstr;
PreallocMode prealloc;
bool has_backing_file;
+ bool has_luks;
/* Parse image creation options */
cluster_size = qcow2_opt_get_cluster_size_del(opts, &local_err);
@@ -4156,6 +4212,20 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
has_backing_file = !!optstr;
g_free(optstr);
+ optstr = qemu_opt_get_del(opts, BLOCK_OPT_ENCRYPT_FORMAT);
+ has_luks = optstr && strcmp(optstr, "luks") == 0;
+ g_free(optstr);
+
+ if (has_luks) {
+ size_t headerlen;
+
+ if (!qcow2_measure_luks_headerlen(opts, &headerlen, &local_err)) {
+ goto err;
+ }
+
+ luks_payload_size = ROUND_UP(headerlen, cluster_size);
+ }
+
virtual_size = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0);
virtual_size = ROUND_UP(virtual_size, cluster_size);
@@ -4226,7 +4296,7 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
info = g_new(BlockMeasureInfo, 1);
info->fully_allocated =
qcow2_calc_prealloc_size(virtual_size, cluster_size,
- ctz32(refcount_bits));
+ ctz32(refcount_bits)) + luks_payload_size;
/* Remove data clusters that are not required. This overestimates the
* required size because metadata needed for the fully allocated file is
--
1.8.3.1

View File

@ -1,101 +0,0 @@
From 6eddc4b5d380a5a21b17ca5424a10619ff42ad56 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Thu, 20 Dec 2018 14:48:58 +0000
Subject: [PATCH] redhat: define pseries-rhel8.0.0 machine type
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20181220144858.2598-1-lvivier@redhat.com>
Patchwork-id: 83723
O-Subject: [RHEL8/rhel qemu-kvm PATCH] redhat: define pseries-rhel8.0.0 machine type
Bugzilla: 1656508
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1656508
BRANCH: rhel8/master-3.1.0
UPSTREAM: downstream only
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19589897
BASED-ON: <20181214170211.14267-1-dgilbert@redhat.com>
[RHEL8 qemu-kvm PATCH v3 0/6] 8.0.0 x86 machine types
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 76a4e83..91d38f9 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4385,19 +4385,64 @@ DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
#endif
/*
+ * pseries-rhel8.0.0
+ */
+
+static void spapr_machine_rhel800_instance_options(MachineState *machine)
+{
+}
+
+static void spapr_machine_rhel800_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(rhel800, "rhel8.0.0", true);
+
+/*
* pseries-rhel7.6.0
+ * like SPAPR_COMPAT_2_12 and SPAPR_COMPAT_3_0
+ * SPAPR_COMPAT_3_0 is empty
*/
+#define SPAPR_COMPAT_RHEL7_6 \
+ HW_COMPAT_RHEL7_6 \
+ { \
+ .driver = TYPE_POWERPC_CPU, \
+ .property = "pre-3.0-migration", \
+ .value = "on", \
+ }, \
+ { \
+ .driver = TYPE_SPAPR_CPU_CORE, \
+ .property = "pre-3.0-migration", \
+ .value = "on", \
+ },
static void spapr_machine_rhel760_instance_options(MachineState *machine)
{
+ spapr_machine_rhel800_instance_options(machine);
}
static void spapr_machine_rhel760_class_options(MachineClass *mc)
{
- /* Defaults for the latest behaviour inherited from the base class */
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel800_class_options(mc);
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_6);
+
+ /* from spapr_machine_3_0_class_options() */
+ smc->legacy_irq_allocation = true;
+ smc->irq = &spapr_irq_xics_legacy;
+
+ /* from spapr_machine_2_12_class_options() */
+ /* We depend on kvm_enabled() to choose a default value for the
+ * hpt-max-page-size capability. Of course we can't do it here
+ * because this is too early and the HW accelerator isn't initialzed
+ * yet. Postpone this to machine init (see default_caps_with_cpu()).
+ */
+ smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 0;
}
-DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", true);
+DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", false);
/*
* pseries-rhel7.6.0-sxxm
--
1.8.3.1

View File

@ -1,57 +0,0 @@
From e204c887357f2d2ee1df5436a7d7f68b227c4b64 Mon Sep 17 00:00:00 2001
From: "plai@redhat.com" <plai@redhat.com>
Date: Fri, 22 Mar 2019 17:45:15 +0000
Subject: [PATCH 2/2] rhel: Set host-phys-bits-limit=48 on rhel machine-types
RH-Author: plai@redhat.com
Message-id: <1553276715-26278-3-git-send-email-plai@redhat.com>
Patchwork-id: 85126
O-Subject: [RHEL8.0 qemu-kvm PATCH 2/2] rhel: Set host-phys-bits-limit=48 on rhel machine-types
Bugzilla: 1688915
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
From: Eduardo Habkost <ehabkost@redhat.com>
Upstream status: not applicable
Currently we use the host physical address size by default on
VMs. This was a good default on most cases, but this is not the
case on host CPUs supporting 5-level EPT. On those cases, we
want VMs to use 4-level EPT by default.
Ensure VMs will use 4-level EPT by default, by limiting physical
address bits to 48.
Not applicable upstream because upstream doesn't set
host-phys-bits=on by default.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
(cherry picked from commit 01a2ecb4c38fe4a35455ea706e76984ee8d5a769)
Signed-off-by: Paul Lai <plai@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/i386/pc.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 782d728..de25407 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -992,6 +992,11 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
.property = "host-phys-bits",\
.value = "on",\
},\
+ { /* PC_RHEL_COMPAT */ \
+ .driver = TYPE_X86_CPU,\
+ .property = "host-phys-bits-limit",\
+ .value = "48",\
+ },\
{ /* PC_RHEL_COMPAT bz 1508330 */ \
.driver = "vfio-pci",\
.property = "x-no-geforce-quirks",\
--
1.8.3.1

View File

@ -1,250 +0,0 @@
From 04a18cff27e2a0c93682adbdd2013c8f1473d520 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Fri, 21 Dec 2018 15:33:16 +0000
Subject: [PATCH 2/3] s390x/tod: Properly stop the KVM TOD while the guest is
not running
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20181221153317.27647-2-david@redhat.com>
Patchwork-id: 83741
O-Subject: [RHEL-8.0 qemu-kvm v2 PATCH 1/2] s390x/tod: Properly stop the KVM TOD while the guest is not running
Bugzilla: 1659127
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
Just like on other architectures, we should stop the clock while the guest
is not running. This is already properly done for TCG. Right now, doing an
offline migration (stop, migrate, cont) can easily trigger stalls in the
guest.
Even doing a
(hmp) stop
... wait 2 minutes ...
(hmp) cont
will already trigger stalls.
So whenever the guest stops, backup the KVM TOD. When continuing to run
the guest, restore the KVM TOD.
One special case is starting a simple VM: Reading the TOD from KVM to
stop it right away until the guest is actually started means that the
time of any simple VM will already differ to the host time. We can
simply leave the TOD running and the guest won't be able to recognize
it.
For migration, we actually want to keep the TOD stopped until really
starting the guest. To be able to catch most errors, we should however
try to set the TOD in addition to simply storing it. So we can still
catch basic migration problems.
If anything goes wrong while backing up/restoring the TOD, we have to
ignore it (but print a warning). This is then basically a fallback to
old behavior (TOD remains running).
I tested this very basically with an initrd:
1. Start a simple VM. Observed that the TOD is kept running. Old
behavior.
2. Ordinary live migration. Observed that the TOD is temporarily
stopped on the destination when setting the new value and
correctly started when finally starting the guest.
3. Offline live migration. (stop, migrate, cont). Observed that the
TOD will be stopped on the source with the "stop" command. On the
destination, the TOD is temporarily stopped when setting the new
value and correctly started when finally starting the guest via
"cont".
4. Simple stop/cont correctly stops/starts the TOD. (multiple stops
or conts in a row have no effect, so works as expected)
In the future, we might want to send the guest a special kind of time sync
interrupt under some conditions, so it can synchronize its tod to the
host tod. This is interesting for migration scenarios but also when we
get time sync interrupts ourselves. This however will most probably have
to be handled in KVM (e.g. when the tods differ too much) and is not
desired e.g. when debugging the guest (single stepping should not
result in permanent time syncs). I consider something like that an add-on
on top of this basic "don't break the guest" handling.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181130094957.4121-1-david@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
(cherry picked from commit 9bc9d3d1ae3bcd1caaad1946494726b52f58b291)
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/s390x/tod-kvm.c | 102 ++++++++++++++++++++++++++++++++++++++++++++++++-
include/hw/s390x/tod.h | 8 +++-
2 files changed, 107 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c
index df564ab..2456bf7 100644
--- a/hw/s390x/tod-kvm.c
+++ b/hw/s390x/tod-kvm.c
@@ -10,10 +10,11 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
+#include "sysemu/sysemu.h"
#include "hw/s390x/tod.h"
#include "kvm_s390x.h"
-static void kvm_s390_tod_get(const S390TODState *td, S390TOD *tod, Error **errp)
+static void kvm_s390_get_tod_raw(S390TOD *tod, Error **errp)
{
int r;
@@ -27,7 +28,17 @@ static void kvm_s390_tod_get(const S390TODState *td, S390TOD *tod, Error **errp)
}
}
-static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp)
+static void kvm_s390_tod_get(const S390TODState *td, S390TOD *tod, Error **errp)
+{
+ if (td->stopped) {
+ *tod = td->base;
+ return;
+ }
+
+ kvm_s390_get_tod_raw(tod, errp);
+}
+
+static void kvm_s390_set_tod_raw(const S390TOD *tod, Error **errp)
{
int r;
@@ -41,18 +52,105 @@ static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp)
}
}
+static void kvm_s390_tod_set(S390TODState *td, const S390TOD *tod, Error **errp)
+{
+ Error *local_err = NULL;
+
+ /*
+ * Somebody (e.g. migration) set the TOD. We'll store it into KVM to
+ * properly detect errors now but take a look at the runstate to decide
+ * whether really to keep the tod running. E.g. during migration, this
+ * is the point where we want to stop the initially running TOD to fire
+ * it back up when actually starting the migrated guest.
+ */
+ kvm_s390_set_tod_raw(tod, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
+ if (runstate_is_running()) {
+ td->stopped = false;
+ } else {
+ td->stopped = true;
+ td->base = *tod;
+ }
+}
+
+static void kvm_s390_tod_vm_state_change(void *opaque, int running,
+ RunState state)
+{
+ S390TODState *td = opaque;
+ Error *local_err = NULL;
+
+ if (running && td->stopped) {
+ /* Set the old TOD when running the VM - start the TOD clock. */
+ kvm_s390_set_tod_raw(&td->base, &local_err);
+ if (local_err) {
+ warn_report_err(local_err);
+ }
+ /* Treat errors like the TOD was running all the time. */
+ td->stopped = false;
+ } else if (!running && !td->stopped) {
+ /* Store the TOD when stopping the VM - stop the TOD clock. */
+ kvm_s390_get_tod_raw(&td->base, &local_err);
+ if (local_err) {
+ /* Keep the TOD running in case we could not back it up. */
+ warn_report_err(local_err);
+ } else {
+ td->stopped = true;
+ }
+ }
+}
+
+static void kvm_s390_tod_realize(DeviceState *dev, Error **errp)
+{
+ S390TODState *td = S390_TOD(dev);
+ S390TODClass *tdc = S390_TOD_GET_CLASS(td);
+ Error *local_err = NULL;
+
+ tdc->parent_realize(dev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
+ /*
+ * We need to know when the VM gets started/stopped to start/stop the TOD.
+ * As we can never have more than one TOD instance (and that will never be
+ * removed), registering here and never unregistering is good enough.
+ */
+ qemu_add_vm_change_state_handler(kvm_s390_tod_vm_state_change, td);
+}
+
static void kvm_s390_tod_class_init(ObjectClass *oc, void *data)
{
S390TODClass *tdc = S390_TOD_CLASS(oc);
+ device_class_set_parent_realize(DEVICE_CLASS(oc), kvm_s390_tod_realize,
+ &tdc->parent_realize);
tdc->get = kvm_s390_tod_get;
tdc->set = kvm_s390_tod_set;
}
+static void kvm_s390_tod_init(Object *obj)
+{
+ S390TODState *td = S390_TOD(obj);
+
+ /*
+ * The TOD is initially running (value stored in KVM). Avoid needless
+ * loading/storing of the TOD when starting a simple VM, so let it
+ * run although the (never started) VM is stopped. For migration, we
+ * will properly set the TOD later.
+ */
+ td->stopped = false;
+}
+
static TypeInfo kvm_s390_tod_info = {
.name = TYPE_KVM_S390_TOD,
.parent = TYPE_S390_TOD,
.instance_size = sizeof(S390TODState),
+ .instance_init = kvm_s390_tod_init,
.class_init = kvm_s390_tod_class_init,
.class_size = sizeof(S390TODClass),
};
diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h
index 413c0d7..cbd7552 100644
--- a/include/hw/s390x/tod.h
+++ b/include/hw/s390x/tod.h
@@ -31,13 +31,19 @@ typedef struct S390TODState {
/* private */
DeviceState parent_obj;
- /* unused by KVM implementation */
+ /*
+ * Used by TCG to remember the time base. Used by KVM to backup the TOD
+ * while the TOD is stopped.
+ */
S390TOD base;
+ /* Used by KVM to remember if the TOD is stopped and base is valid. */
+ bool stopped;
} S390TODState;
typedef struct S390TODClass {
/* private */
DeviceClass parent_class;
+ void (*parent_realize)(DeviceState *dev, Error **errp);
/* public */
void (*get)(const S390TODState *td, S390TOD *tod, Error **errp);
--
1.8.3.1

View File

@ -1,187 +0,0 @@
From acf3927aef42a4a380fa1366b2eca8a8f2b44bc4 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 7 Feb 2019 12:18:18 +0000
Subject: [PATCH 7/8] scsi-disk: Acquire the AioContext in scsi_*_realize()
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190207121819.20092-3-armbru@redhat.com>
Patchwork-id: 84291
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 2/3] scsi-disk: Acquire the AioContext in scsi_*_realize()
Bugzilla: 1656276 1662508
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
From: Alberto Garcia <berto@igalia.com>
This fixes a crash when attaching two disks with the same blockdev to
a SCSI device that is using iothreads. Test case included.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 3ff35ba391134e4e43ab96152deb38a62e62f858)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/scsi/scsi-disk.c | 23 ++++++++++++++++++++---
tests/qemu-iotests/240 | 18 ++++++++++++++++++
tests/qemu-iotests/240.out | 16 ++++++++++++++++
3 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index e74e1e7..e6db6d7 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2389,10 +2389,13 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
+ AioContext *ctx = NULL;
/* can happen for devices without drive. The error message for missing
* backend will be issued in scsi_realize
*/
if (s->qdev.conf.blk) {
+ ctx = blk_get_aio_context(s->qdev.conf.blk);
+ aio_context_acquire(ctx);
blkconf_blocksizes(&s->qdev.conf);
}
s->qdev.blocksize = s->qdev.conf.logical_block_size;
@@ -2401,11 +2404,15 @@ static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
s->product = g_strdup("QEMU HARDDISK");
}
scsi_realize(&s->qdev, errp);
+ if (ctx) {
+ aio_context_release(ctx);
+ }
}
static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
+ AioContext *ctx;
int ret;
if (!dev->conf.blk) {
@@ -2416,6 +2423,8 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
assert(ret == 0);
}
+ ctx = blk_get_aio_context(dev->conf.blk);
+ aio_context_acquire(ctx);
s->qdev.blocksize = 2048;
s->qdev.type = TYPE_ROM;
s->features |= 1 << SCSI_DISK_F_REMOVABLE;
@@ -2423,6 +2432,7 @@ static void scsi_cd_realize(SCSIDevice *dev, Error **errp)
s->product = g_strdup("QEMU CD-ROM");
}
scsi_realize(&s->qdev, errp);
+ aio_context_release(ctx);
}
static void scsi_disk_realize(SCSIDevice *dev, Error **errp)
@@ -2561,6 +2571,7 @@ static int get_device_type(SCSIDiskState *s)
static void scsi_block_realize(SCSIDevice *dev, Error **errp)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
+ AioContext *ctx;
int sg_version;
int rc;
@@ -2575,6 +2586,9 @@ static void scsi_block_realize(SCSIDevice *dev, Error **errp)
"be removed in a future version");
}
+ ctx = blk_get_aio_context(s->qdev.conf.blk);
+ aio_context_acquire(ctx);
+
/* check we are using a driver managing SG_IO (version 3 and after) */
rc = blk_ioctl(s->qdev.conf.blk, SG_GET_VERSION_NUM, &sg_version);
if (rc < 0) {
@@ -2582,18 +2596,18 @@ static void scsi_block_realize(SCSIDevice *dev, Error **errp)
if (rc != -EPERM) {
error_append_hint(errp, "Is this a SCSI device?\n");
}
- return;
+ goto out;
}
if (sg_version < 30000) {
error_setg(errp, "scsi generic interface too old");
- return;
+ goto out;
}
/* get device type from INQUIRY data */
rc = get_device_type(s);
if (rc < 0) {
error_setg(errp, "INQUIRY failed");
- return;
+ goto out;
}
/* Make a guess for the block size, we'll fix it when the guest sends.
@@ -2613,6 +2627,9 @@ static void scsi_block_realize(SCSIDevice *dev, Error **errp)
scsi_realize(&s->qdev, errp);
scsi_generic_read_device_inquiry(&s->qdev);
+
+out:
+ aio_context_release(ctx);
}
typedef struct SCSIBlockReq {
diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240
index ead7ee0..5d499c9 100755
--- a/tests/qemu-iotests/240
+++ b/tests/qemu-iotests/240
@@ -83,6 +83,24 @@ run_qemu <<EOF
{ "execute": "quit"}
EOF
+echo
+echo === Attach two SCSI disks using the same block device and the same iothread ===
+echo
+
+run_qemu <<EOF
+{ "execute": "qmp_capabilities" }
+{ "execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-only": true}}
+{ "execute": "object-add", "arguments": {"qom-type": "iothread", "id": "iothread0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi0", "driver": "${virtio_scsi}", "iothread": "iothread0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd0", "driver": "scsi-hd", "drive": "hd0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd1", "driver": "scsi-hd", "drive": "hd0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi-hd0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi-hd1"}}
+{ "execute": "device_del", "arguments": {"id": "scsi0"}}
+{ "execute": "blockdev-del", "arguments": {"node-name": "hd0"}}
+{ "execute": "quit"}
+EOF
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/240.out b/tests/qemu-iotests/240.out
index 432d981..701cb5c 100644
--- a/tests/qemu-iotests/240.out
+++ b/tests/qemu-iotests/240.out
@@ -15,4 +15,20 @@ QMP_VERSION
{"return": {}}
{"return": {}}
{"return": {}}
+
+=== Attach two SCSI disks using the same block device and the same iothread ===
+
+Testing:
+QMP_VERSION
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
*** done
--
1.8.3.1

View File

@ -1,98 +0,0 @@
From c9f6e5639cc9d7b1d336b55ccacb6673933a3864 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Wed, 6 Feb 2019 15:58:29 +0000
Subject: [PATCH 3/3] scsi-disk: Add device_id property
RH-Author: Kevin Wolf <kwolf@redhat.com>
Message-id: <20190206155829.14641-3-kwolf@redhat.com>
Patchwork-id: 84254
O-Subject: [RHEL-7.7/8.0-AV qemu-kvm-rhev PATCH 2/2] scsi-disk: Add device_id property
Bugzilla: 1668248
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
The new device_id property specifies which value to use for the vendor
specific designator in the Device Identification VPD page.
In particular, this is necessary for libvirt to maintain guest ABI
compatibility when no serial number is given and a VM is switched from
-drive (where the BlockBackend name is used) to -blockdev (where the
vendor specific designator is left out by default).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 7471a649fc3a391dd497297013fb2525ca9821ba)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/scsi/scsi-disk.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 93eef40..e74e1e7 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -104,6 +104,7 @@ typedef struct SCSIDiskState
char *serial;
char *vendor;
char *product;
+ char *device_id;
bool tray_open;
bool tray_locked;
/*
@@ -642,13 +643,8 @@ static int scsi_disk_emulate_vpd_page(SCSIRequest *req, uint8_t *outbuf)
case 0x83: /* Device identification page, mandatory */
{
- const char *str = s->serial ?: blk_name(s->qdev.conf.blk);
- int max_len = s->serial ? 20 : 255 - 8;
- int id_len = strlen(str);
+ int id_len = s->device_id ? MIN(strlen(s->device_id), 255 - 8) : 0;
- if (id_len > max_len) {
- id_len = max_len;
- }
DPRINTF("Inquiry EVPD[Device identification] "
"buffer size %zd\n", req->cmd.xfer);
@@ -657,7 +653,7 @@ static int scsi_disk_emulate_vpd_page(SCSIRequest *req, uint8_t *outbuf)
outbuf[buflen++] = 0; /* not officially assigned */
outbuf[buflen++] = 0; /* reserved */
outbuf[buflen++] = id_len; /* length of data following */
- memcpy(outbuf + buflen, str, id_len);
+ memcpy(outbuf + buflen, s->device_id, id_len);
buflen += id_len;
}
@@ -2363,6 +2359,16 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
if (!s->vendor) {
s->vendor = g_strdup("QEMU");
}
+ if (!s->device_id) {
+ if (s->serial) {
+ s->device_id = g_strdup_printf("%.20s", s->serial);
+ } else {
+ const char *str = blk_name(s->qdev.conf.blk);
+ if (str && *str) {
+ s->device_id = g_strdup(str);
+ }
+ }
+ }
if (blk_is_sg(s->qdev.conf.blk)) {
error_setg(errp, "unwanted /dev/sg*");
@@ -2904,7 +2910,9 @@ static const TypeInfo scsi_disk_base_info = {
DEFINE_PROP_STRING("ver", SCSIDiskState, version), \
DEFINE_PROP_STRING("serial", SCSIDiskState, serial), \
DEFINE_PROP_STRING("vendor", SCSIDiskState, vendor), \
- DEFINE_PROP_STRING("product", SCSIDiskState, product)
+ DEFINE_PROP_STRING("product", SCSIDiskState, product), \
+ DEFINE_PROP_STRING("device_id", SCSIDiskState, device_id)
+
static Property scsi_hd_properties[] = {
DEFINE_SCSI_DISK_PROPERTIES(),
--
1.8.3.1

View File

@ -1,71 +0,0 @@
From 18d600a76319abe59dc4b5e371e5807c089f9159 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Wed, 6 Feb 2019 15:58:28 +0000
Subject: [PATCH 2/3] scsi-disk: Don't use empty string as device id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Kevin Wolf <kwolf@redhat.com>
Message-id: <20190206155829.14641-2-kwolf@redhat.com>
Patchwork-id: 84253
O-Subject: [RHEL-7.7/8.0-AV qemu-kvm-rhev PATCH 1/2] scsi-disk: Don't use empty string as device id
Bugzilla: 1668248
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
scsi-disk includes in the Device Identification VPD page, depending on
configuration amongst others, a vendor specific designator that consists
either of the serial number if given or the BlockBackend name (which is
a host detail that better shouldn't have been leaked to the guest, but
now we have to maintain it for compatibility).
With anonymous BlockBackends, i.e. scsi-disk devices constructed with
drive=<node-name>, and no serial number explicitly specified, this ends
up as an empty string. If this happens to more than one disk, we have
accidentally signalled to the OS that this is a multipath setup, which
is obviously not what was intended.
Instead of using an empty string for the vendor specific designator,
simply leave out that designator, which makes Linux detect such setups
as separate disks again.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
(cherry picked from commit a8f58afcdb86e266e06c9dc41a71605e570244c3)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/scsi/scsi-disk.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 0e9027c..93eef40 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -652,12 +652,14 @@ static int scsi_disk_emulate_vpd_page(SCSIRequest *req, uint8_t *outbuf)
DPRINTF("Inquiry EVPD[Device identification] "
"buffer size %zd\n", req->cmd.xfer);
- outbuf[buflen++] = 0x2; /* ASCII */
- outbuf[buflen++] = 0; /* not officially assigned */
- outbuf[buflen++] = 0; /* reserved */
- outbuf[buflen++] = id_len; /* length of data following */
- memcpy(outbuf + buflen, str, id_len);
- buflen += id_len;
+ if (id_len) {
+ outbuf[buflen++] = 0x2; /* ASCII */
+ outbuf[buflen++] = 0; /* not officially assigned */
+ outbuf[buflen++] = 0; /* reserved */
+ outbuf[buflen++] = id_len; /* length of data following */
+ memcpy(outbuf + buflen, str, id_len);
+ buflen += id_len;
+ }
if (s->qdev.wwn) {
outbuf[buflen++] = 0x1; /* Binary */
--
1.8.3.1

View File

@ -1,124 +0,0 @@
From 41c461465fb5b0d23f5826cd4b62a78f25607420 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Thu, 3 Jan 2019 12:51:40 +0000
Subject: [PATCH 2/3] spapr: Add H-Call H_HOME_NODE_ASSOCIATIVITY
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20190103135140.13948-2-lvivier@redhat.com>
Patchwork-id: 83848
O-Subject: [RHEL8/rhel qemu-kvm PATCH 1/1] spapr: Add H-Call H_HOME_NODE_ASSOCIATIVITY
Bugzilla: 1661967
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1661967
H_HOME_NODE_ASSOCIATIVITY H-Call returns the associativity domain
designation associated with the identifier input parameter
This fixes a crash when we try to hotplug a CPU in memory-less and
CPU-less numa node. In this case, the kernel tries to online the
node, but without the information provided by this h-call, the node id,
it cannot and the CPU is started while the node is not onlined.
It also removes the warning message from the kernel:
VPHN is not supported. Disabling polling..
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit c24ba3d0a34f68ad2c6bf1a15bc43770005f6cc0)
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 1 +
hw/ppc/spapr_hcall.c | 40 ++++++++++++++++++++++++++++++++++++++++
include/hw/ppc/spapr.h | 1 +
3 files changed, 42 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 91d38f9..d5d2eb4 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1051,6 +1051,7 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
add_str(hypertas, "hcall-sprg0");
add_str(hypertas, "hcall-copy");
add_str(hypertas, "hcall-debug");
+ add_str(hypertas, "hcall-vphn");
add_str(qemu_hypertas, "hcall-memop1");
if (!kvm_enabled() || kvmppc_spapr_use_multitce()) {
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index ae913d0..f131c7e 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1663,6 +1663,42 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,
return H_SUCCESS;
}
+static target_ulong h_home_node_associativity(PowerPCCPU *cpu,
+ sPAPRMachineState *spapr,
+ target_ulong opcode,
+ target_ulong *args)
+{
+ target_ulong flags = args[0];
+ target_ulong procno = args[1];
+ PowerPCCPU *tcpu;
+ int idx;
+
+ /* only support procno from H_REGISTER_VPA */
+ if (flags != 0x1) {
+ return H_FUNCTION;
+ }
+
+ tcpu = spapr_find_cpu(procno);
+ if (tcpu == NULL) {
+ return H_P2;
+ }
+
+ /* sequence is the same as in the "ibm,associativity" property */
+
+ idx = 0;
+#define ASSOCIATIVITY(a, b) (((uint64_t)(a) << 32) | \
+ ((uint64_t)(b) & 0xffffffff))
+ args[idx++] = ASSOCIATIVITY(0, 0);
+ args[idx++] = ASSOCIATIVITY(0, tcpu->node_id);
+ args[idx++] = ASSOCIATIVITY(procno, -1);
+ for ( ; idx < 6; idx++) {
+ args[idx] = -1;
+ }
+#undef ASSOCIATIVITY
+
+ return H_SUCCESS;
+}
+
static target_ulong h_get_cpu_characteristics(PowerPCCPU *cpu,
sPAPRMachineState *spapr,
target_ulong opcode,
@@ -1822,6 +1858,10 @@ static void hypercall_register_types(void)
/* ibm,client-architecture-support support */
spapr_register_hypercall(KVMPPC_H_CAS, h_client_architecture_support);
+
+ /* Virtual Processor Home Node */
+ spapr_register_hypercall(H_HOME_NODE_ASSOCIATIVITY,
+ h_home_node_associativity);
}
type_init(hypercall_register_types)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index d2370e5..0cc123e 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -442,6 +442,7 @@ struct sPAPRMachineState {
#define H_GET_EM_PARMS 0x2B8
#define H_SET_MPP 0x2D0
#define H_GET_MPP 0x2D4
+#define H_HOME_NODE_ASSOCIATIVITY 0x2EC
#define H_XIRR_X 0x2FC
#define H_RANDOM 0x300
#define H_SET_MODE 0x31C
--
1.8.3.1

View File

@ -1,149 +0,0 @@
From f39913b42600b838c415f6fb561be940bea265dd Mon Sep 17 00:00:00 2001
From: Serhii Popovych <spopovyc@redhat.com>
Date: Wed, 9 Jan 2019 13:31:49 +0000
Subject: [PATCH 1/2] spapr: Fix ibm, max-associativity-domains property number
of nodes
RH-Author: Serhii Popovych <spopovyc@redhat.com>
Message-id: <1547040709-797-1-git-send-email-spopovyc@redhat.com>
Patchwork-id: 83920
O-Subject: [RHEL-8.0 qemu-kvm PATCH v2] spapr: Fix ibm, max-associativity-domains property number of nodes
Bugzilla: 1653114
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1653114
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19727263
Branch: rhel8/master-3.1.0
Upstream: Merged
Testing: Build and boot tested on rhel-7.6 with steps described in
comment 0. Issue no longer reproducible.
Laurent Vivier reported off by one with maximum number of NUMA nodes
provided by qemu-kvm being less by one than required according to
description of "ibm,max-associativity-domains" property in LoPAPR.
It appears that I incorrectly treated LoPAPR description of this
property assuming it provides last valid domain (NUMA node here)
instead of maximum number of domains.
### Before hot-add
(qemu) info numa
3 nodes
node 0 cpus: 0
node 0 size: 0 MB
node 0 plugged: 0 MB
node 1 cpus:
node 1 size: 1024 MB
node 1 plugged: 0 MB
node 2 cpus:
node 2 size: 0 MB
node 2 plugged: 0 MB
$ numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0
node 0 size: 0 MB
node 0 free: 0 MB
node 1 cpus:
node 1 size: 999 MB
node 1 free: 658 MB
node distances:
node 0 1
0: 10 40
1: 40 10
### Hot-add
(qemu) object_add memory-backend-ram,id=mem0,size=1G
(qemu) device_add pc-dimm,id=dimm1,memdev=mem0,node=2
(qemu) [ 87.704898] pseries-hotplug-mem: Attempting to hot-add 4 ...
<there is no "Initmem setup node 2 [mem 0xHEX-0xHEX]">
[ 87.705128] lpar: Attempting to resize HPT to shift 21
... <HPT resize messages>
### After hot-add
(qemu) info numa
3 nodes
node 0 cpus: 0
node 0 size: 0 MB
node 0 plugged: 0 MB
node 1 cpus:
node 1 size: 1024 MB
node 1 plugged: 0 MB
node 2 cpus:
node 2 size: 1024 MB
node 2 plugged: 1024 MB
$ numactl -H
available: 2 nodes (0-1)
^^^^^^^^^^^^^^^^^^^^^^^^
Still only two nodes (and memory hot-added to node 0 below)
node 0 cpus: 0
node 0 size: 1024 MB
node 0 free: 1021 MB
node 1 cpus:
node 1 size: 999 MB
node 1 free: 658 MB
node distances:
node 0 1
0: 10 40
1: 40 10
After fix applied numactl(8) reports 3 nodes available and memory
plugged into node 2 as expected.
>From David Gibson:
------------------
Qemu makes a distinction between "non NUMA" (nb_numa_nodes == 0) and
"NUMA with one node" (nb_numa_nodes == 1). But from a PAPR guests's
point of view these are equivalent. I don't want to present two
different cases to the guest when we don't need to, so even though the
guest can handle it, I'd prefer we put a '1' here for both the
nb_numa_nodes == 0 and nb_numa_nodes == 1 case.
This consolidates everything discussed previously on mailing list.
Fixes: da9f80fbad21 ("spapr: Add ibm,max-associativity-domains property")
Reported-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
(cherry picked from commit 3908a24fcb83913079d315de0ca6d598e8616dbb)
Signed-off-by: Serhii Popovych <spopovyc@redhat.com>
---
v2:
Rebased against rhel8/qemu-kvm-3.1.0 for RHEL Advanced Virtualization
product.
Added "Brach:" tag to commint message as suggested by Laurent Vivier.
hw/ppc/spapr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d5d2eb4..bd2abb7 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1033,7 +1033,7 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
cpu_to_be32(0),
cpu_to_be32(0),
cpu_to_be32(0),
- cpu_to_be32(nb_numa_nodes ? nb_numa_nodes - 1 : 0),
+ cpu_to_be32(nb_numa_nodes ? nb_numa_nodes : 1),
};
_FDT(rtas = fdt_add_subnode(fdt, 0, "rtas"));
--
1.8.3.1

View File

@ -1,74 +0,0 @@
From 2744bd7eb7955e7ae995a48784760e48c33c1e73 Mon Sep 17 00:00:00 2001
From: David Gibson <dgibson@redhat.com>
Date: Wed, 27 Feb 2019 04:54:34 +0000
Subject: [PATCH 2/9] spapr: fix out of bounds write in spapr_populate_drmem_v2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: David Gibson <dgibson@redhat.com>
Message-id: <20190227045434.23465-1-dgibson@redhat.com>
Patchwork-id: 84720
O-Subject: [RHELAV-8.1 qemu-kvm PATCH] spapr: fix out of bounds write in spapr_populate_drmem_v2
Bugzilla: 1674438
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
From: Fabiano Rosas <farosas@linux.ibm.com>
buf_len is uint8_t which is not large enough to hold the result of:
nr_entries * sizeof(struct sPAPRDrconfCellV2) + sizeof(uint32_t);
for a nr_entries greater than 10.
This causes the allocated buffer 'int_buf' to be smaller than expected
and we eventually overwrite some of glibc's control structures (see
"chunk" in https://sourceware.org/glibc/wiki/MallocInternals)
The following error is seen while trying to free int_buf:
"free(): invalid next size (fast)"
Fixes: a324d6f166 "spapr: Support ibm,dynamic-memory-v2 property"
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20190213172926.21740-1-farosas@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit cc941111a5bc5f498185fa3824c3b6579c7d45ad)
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1674438
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=20382722
Branch: rhel8/master-3.1.0
Signed-off-by: David Gibson <dgibson@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bd2abb7..c1478bf 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -688,14 +688,14 @@ static int spapr_populate_drmem_v2(sPAPRMachineState *spapr, void *fdt,
int offset, MemoryDeviceInfoList *dimms)
{
MachineState *machine = MACHINE(spapr);
- uint8_t *int_buf, *cur_index, buf_len;
+ uint8_t *int_buf, *cur_index;
int ret;
uint64_t lmb_size = SPAPR_MEMORY_BLOCK_SIZE;
uint64_t addr, cur_addr, size;
uint32_t nr_boot_lmbs = (machine->device_memory->base / lmb_size);
uint64_t mem_end = machine->device_memory->base +
memory_region_size(&machine->device_memory->mr);
- uint32_t node, nr_entries = 0;
+ uint32_t node, buf_len, nr_entries = 0;
sPAPRDRConnector *drc;
DrconfCellQueue *elem, *next;
MemoryDeviceInfoList *info;
--
1.8.3.1

View File

@ -1,153 +0,0 @@
From 18cf0d751c615e83243e13f3170508289cd78457 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Sat, 16 Feb 2019 00:01:45 +0000
Subject: [PATCH 1/4] target/i386: Disable MPX support on named CPU models
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Message-id: <1550275305-42020-1-git-send-email-pbonzini@redhat.com>
Patchwork-id: 84525
O-Subject: [rhel-av-8.0.0 qemu-kvm PATCH] target/i386: Disable MPX support on named CPU models
Bugzilla: 1661030
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Bugzilla: 1661030
Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=20232369
MPX support is being phased out by Intel; GCC has dropped it, Linux
is also going to do that. Even though KVM will have special code
to support MPX after the kernel proper stops enabling it in XCR0,
we probably also want to deprecate that in a few years. As a start,
do not enable it by default for any named CPU model starting with
the 4.0 machine types; this include Skylake, Icelake and Cascadelake.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20181220121100.21554-1-pbonzini@redhat.com>
Reviewed-by:   Wainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit ecb85fe48cacb2f8740186e81f2f38a2e02bd963)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Conflicts:
hw/i386/pc.c [old-style global properties]
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/i386/pc.h | 28 ++++++++++++++++++++++++++++
target/i386/cpu.c | 14 +++++++-------
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 426a975..782d728 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1022,6 +1022,34 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
.driver = TYPE_X86_CPU,\
.property = "x-migrate-smi-count",\
.value = "off",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Skylake-Client" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Skylake-Client-IBRS" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Skylake-Server" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Skylake-Server-IBRS" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Cascadelake-Server" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Icelake-Client" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
+ },{ /* PC_RHEL7_6_COMPAT from pc_compat_3_1 */ \
+ .driver = "Icelake-Server" "-" TYPE_X86_CPU,\
+ .property = "mpx",\
+ .value = "on",\
},
/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but:
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 8570b25..dbcf632 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2358,7 +2358,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX,
+ CPUID_7_0_EBX_SMAP,
/* Missing: XSAVES (not supported by some Linux versions,
* including v4.1 to v4.12).
* KVM doesn't yet expose any XSAVES state save component,
@@ -2405,7 +2405,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX,
+ CPUID_7_0_EBX_SMAP,
/* Missing: XSAVES (not supported by some Linux versions,
* including v4.1 to v4.12).
* KVM doesn't yet expose any XSAVES state save component,
@@ -2450,7 +2450,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_CLWB |
+ CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT,
@@ -2502,7 +2502,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_CLWB |
+ CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
CPUID_7_0_EBX_AVX512VL,
@@ -2552,7 +2552,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_CLWB |
+ CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT |
@@ -2608,7 +2608,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_INTEL_PT,
+ CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_INTEL_PT,
.features[FEAT_7_0_ECX] =
CPUID_7_0_ECX_VBMI | CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU |
CPUID_7_0_ECX_OSPKE | CPUID_7_0_ECX_VBMI2 | CPUID_7_0_ECX_GFNI |
@@ -2663,7 +2663,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX |
- CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_MPX | CPUID_7_0_EBX_CLWB |
+ CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLWB |
CPUID_7_0_EBX_AVX512F | CPUID_7_0_EBX_AVX512DQ |
CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512CD |
CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT |
--
1.8.3.1

View File

@ -1,120 +0,0 @@
From 02287430957782ffb1db0d7d17693a73925ea02f Mon Sep 17 00:00:00 2001
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Tue, 29 Jan 2019 07:02:49 +0000
Subject: [PATCH 1/2] throttle-groups: fix restart coroutine iothread race
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: <20190129070250.22709-2-stefanha@redhat.com>
Patchwork-id: 84139
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/2] throttle-groups: fix restart coroutine iothread race
Bugzilla: 1655947
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
The following QMP command leads to a crash when iothreads are used:
{ 'execute': 'device_del', 'arguments': {'id': 'data'} }
The backtrace involves the queue restart coroutine where
tgm->throttle_state is a NULL pointer because
throttle_group_unregister_tgm() has already been called:
(gdb) bt full
#0 0x00005585a7a3b378 in qemu_mutex_lock_impl (mutex=0xffffffffffffffd0, file=0x5585a7bb3d54 "block/throttle-groups.c", line=412) at util/qemu-thread-posix.c:64
err = <optimized out>
__PRETTY_FUNCTION__ = "qemu_mutex_lock_impl"
__func__ = "qemu_mutex_lock_impl"
#1 0x00005585a79be074 in throttle_group_restart_queue_entry (opaque=0x5585a9de4eb0) at block/throttle-groups.c:412
_f = <optimized out>
data = 0x5585a9de4eb0
tgm = 0x5585a9079440
ts = 0x0
tg = 0xffffffffffffff98
is_write = false
empty_queue = 255
This coroutine should not execute in the iothread after the throttle
group member has been unregistered!
The root cause is that the device_del code path schedules the restart
coroutine in the iothread while holding the AioContext lock. Therefore
the iothread cannot execute the coroutine until after device_del
releases the lock - by this time it's too late.
This patch adds a reference count to ThrottleGroupMember so we can
synchronously wait for restart coroutines to complete. Once they are
done it is safe to unregister the ThrottleGroupMember.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190114133257.30299-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit bc19a0a6e4505390f99d3c593ebaf11b7962cc59)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
block/throttle-groups.c | 9 +++++++++
include/block/throttle-groups.h | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 5d8213a..a5a2037 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -415,6 +415,9 @@ static void coroutine_fn throttle_group_restart_queue_entry(void *opaque)
}
g_free(data);
+
+ atomic_dec(&tgm->restart_pending);
+ aio_wait_kick();
}
static void throttle_group_restart_queue(ThrottleGroupMember *tgm, bool is_write)
@@ -430,6 +433,8 @@ static void throttle_group_restart_queue(ThrottleGroupMember *tgm, bool is_write
* be no timer pending on this tgm at this point */
assert(!timer_pending(tgm->throttle_timers.timers[is_write]));
+ atomic_inc(&tgm->restart_pending);
+
co = qemu_coroutine_create(throttle_group_restart_queue_entry, rd);
aio_co_enter(tgm->aio_context, co);
}
@@ -538,6 +543,7 @@ void throttle_group_register_tgm(ThrottleGroupMember *tgm,
tgm->throttle_state = ts;
tgm->aio_context = ctx;
+ atomic_set(&tgm->restart_pending, 0);
qemu_mutex_lock(&tg->lock);
/* If the ThrottleGroup is new set this ThrottleGroupMember as the token */
@@ -584,6 +590,9 @@ void throttle_group_unregister_tgm(ThrottleGroupMember *tgm)
return;
}
+ /* Wait for throttle_group_restart_queue_entry() coroutines to finish */
+ AIO_WAIT_WHILE(tgm->aio_context, atomic_read(&tgm->restart_pending) > 0);
+
qemu_mutex_lock(&tg->lock);
for (i = 0; i < 2; i++) {
assert(tgm->pending_reqs[i] == 0);
diff --git a/include/block/throttle-groups.h b/include/block/throttle-groups.h
index e2fd051..712a8e6 100644
--- a/include/block/throttle-groups.h
+++ b/include/block/throttle-groups.h
@@ -43,6 +43,11 @@ typedef struct ThrottleGroupMember {
*/
unsigned int io_limits_disabled;
+ /* Number of pending throttle_group_restart_queue_entry() coroutines.
+ * Accessed with atomic operations.
+ */
+ unsigned int restart_pending;
+
/* The following fields are protected by the ThrottleGroup lock.
* See the ThrottleGroup documentation for details.
* throttle_state tells us if I/O limits are configured. */
--
1.8.3.1

View File

@ -1,553 +0,0 @@
From 8a7371fb25d2072d60b029eb092a083cfa064afb Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 16 Jan 2019 23:18:16 +0000
Subject: [PATCH 1/7] virtio: Helper for registering virtio device types
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190116231819.29310-2-ehabkost@redhat.com>
Patchwork-id: 84027
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/4] virtio: Helper for registering virtio device types
Bugzilla: 1648023
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Introduce a helper for registering different flavours of virtio
devices. Convert code to use the helper, but keep only the
existing generic types. Transitional and non-transitional device
types will be added by another patch.
Backport conflicts:
hw/virtio/virtio-pci.c: because our downstream tree doesn't
have commit e6a74868d92f ("build-sys: add --disable-vhost-user")
Acked-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit a4ee4c8baa37154f42b4dc6a13fee79268d15238)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/display/virtio-gpu-pci.c | 7 +-
hw/display/virtio-vga.c | 7 +-
hw/virtio/virtio-crypto-pci.c | 7 +-
hw/virtio/virtio-pci.c | 231 ++++++++++++++++++++++++++++++------------
hw/virtio/virtio-pci.h | 54 ++++++++++
5 files changed, 228 insertions(+), 78 deletions(-)
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index cece4aa..faf76a8 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -69,9 +69,8 @@ static void virtio_gpu_initfn(Object *obj)
TYPE_VIRTIO_GPU);
}
-static const TypeInfo virtio_gpu_pci_info = {
- .name = TYPE_VIRTIO_GPU_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_info = {
+ .generic_name = TYPE_VIRTIO_GPU_PCI,
.instance_size = sizeof(VirtIOGPUPCI),
.instance_init = virtio_gpu_initfn,
.class_init = virtio_gpu_pci_class_init,
@@ -79,6 +78,6 @@ static const TypeInfo virtio_gpu_pci_info = {
static void virtio_gpu_pci_register_types(void)
{
- type_register_static(&virtio_gpu_pci_info);
+ virtio_pci_types_register(&virtio_gpu_pci_info);
}
type_init(virtio_gpu_pci_register_types)
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index ab2e369..8db4d91 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -207,9 +207,8 @@ static void virtio_vga_inst_initfn(Object *obj)
TYPE_VIRTIO_GPU);
}
-static TypeInfo virtio_vga_info = {
- .name = TYPE_VIRTIO_VGA,
- .parent = TYPE_VIRTIO_PCI,
+static VirtioPCIDeviceTypeInfo virtio_vga_info = {
+ .generic_name = TYPE_VIRTIO_VGA,
.instance_size = sizeof(struct VirtIOVGA),
.instance_init = virtio_vga_inst_initfn,
.class_init = virtio_vga_class_init,
@@ -217,7 +216,7 @@ static TypeInfo virtio_vga_info = {
static void virtio_vga_register_types(void)
{
- type_register_static(&virtio_vga_info);
+ virtio_pci_types_register(&virtio_vga_info);
}
type_init(virtio_vga_register_types)
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index bf64996..8cc3fa3 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -64,9 +64,8 @@ static void virtio_crypto_initfn(Object *obj)
TYPE_VIRTIO_CRYPTO);
}
-static const TypeInfo virtio_crypto_pci_info = {
- .name = TYPE_VIRTIO_CRYPTO_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_crypto_pci_info = {
+ .generic_name = TYPE_VIRTIO_CRYPTO_PCI,
.instance_size = sizeof(VirtIOCryptoPCI),
.instance_init = virtio_crypto_initfn,
.class_init = virtio_crypto_pci_class_init,
@@ -74,6 +73,6 @@ static const TypeInfo virtio_crypto_pci_info = {
static void virtio_crypto_pci_register_types(void)
{
- type_register_static(&virtio_crypto_pci_info);
+ virtio_pci_types_register(&virtio_crypto_pci_info);
}
type_init(virtio_crypto_pci_register_types)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 9a987cb..bee3509 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1119,9 +1119,8 @@ static void virtio_9p_pci_instance_init(Object *obj)
TYPE_VIRTIO_9P);
}
-static const TypeInfo virtio_9p_pci_info = {
- .name = TYPE_VIRTIO_9P_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_9p_pci_info = {
+ .generic_name = TYPE_VIRTIO_9P_PCI,
.instance_size = sizeof(V9fsPCIState),
.instance_init = virtio_9p_pci_instance_init,
.class_init = virtio_9p_pci_class_init,
@@ -1877,9 +1876,6 @@ static void virtio_pci_reset(DeviceState *qdev)
static Property virtio_pci_properties[] = {
DEFINE_PROP_BIT("virtio-pci-bus-master-bug-migration", VirtIOPCIProxy, flags,
VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT, false),
- DEFINE_PROP_ON_OFF_AUTO("disable-legacy", VirtIOPCIProxy, disable_legacy,
- ON_OFF_AUTO_AUTO),
- DEFINE_PROP_BOOL("disable-modern", VirtIOPCIProxy, disable_modern, false),
DEFINE_PROP_BIT("migrate-extra", VirtIOPCIProxy, flags,
VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT, true),
DEFINE_PROP_BIT("modern-pio-notify", VirtIOPCIProxy, flags,
@@ -1939,13 +1935,123 @@ static const TypeInfo virtio_pci_info = {
.class_init = virtio_pci_class_init,
.class_size = sizeof(VirtioPCIClass),
.abstract = true,
- .interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
- { INTERFACE_CONVENTIONAL_PCI_DEVICE },
- { }
- },
};
+static Property virtio_pci_generic_properties[] = {
+ DEFINE_PROP_ON_OFF_AUTO("disable-legacy", VirtIOPCIProxy, disable_legacy,
+ ON_OFF_AUTO_AUTO),
+ DEFINE_PROP_BOOL("disable-modern", VirtIOPCIProxy, disable_modern, false),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void virtio_pci_base_class_init(ObjectClass *klass, void *data)
+{
+ const VirtioPCIDeviceTypeInfo *t = data;
+ if (t->class_init) {
+ t->class_init(klass, NULL);
+ }
+}
+
+static void virtio_pci_generic_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ dc->props = virtio_pci_generic_properties;
+}
+
+/* Used when the generic type and the base type is the same */
+static void virtio_pci_generic_base_class_init(ObjectClass *klass, void *data)
+{
+ virtio_pci_base_class_init(klass, data);
+ virtio_pci_generic_class_init(klass, NULL);
+}
+
+static void virtio_pci_transitional_instance_init(Object *obj)
+{
+ VirtIOPCIProxy *proxy = VIRTIO_PCI(obj);
+
+ proxy->disable_legacy = ON_OFF_AUTO_OFF;
+ proxy->disable_modern = false;
+}
+
+static void virtio_pci_non_transitional_instance_init(Object *obj)
+{
+ VirtIOPCIProxy *proxy = VIRTIO_PCI(obj);
+
+ proxy->disable_legacy = ON_OFF_AUTO_ON;
+ proxy->disable_modern = false;
+}
+
+void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
+{
+ TypeInfo base_type_info = {
+ .name = t->base_name,
+ .parent = t->parent ? t->parent : TYPE_VIRTIO_PCI,
+ .instance_size = t->instance_size,
+ .instance_init = t->instance_init,
+ .class_init = virtio_pci_base_class_init,
+ .class_data = (void *)t,
+ .abstract = true,
+ };
+ TypeInfo generic_type_info = {
+ .name = t->generic_name,
+ .parent = base_type_info.name,
+ .class_init = virtio_pci_generic_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { INTERFACE_PCIE_DEVICE },
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { }
+ },
+ };
+
+ if (!base_type_info.name) {
+ /* No base type -> register a single generic device type */
+ base_type_info.name = t->generic_name;
+ base_type_info.class_init = virtio_pci_generic_base_class_init;
+ base_type_info.interfaces = generic_type_info.interfaces;
+ base_type_info.abstract = false;
+ generic_type_info.name = NULL;
+ assert(!t->non_transitional_name);
+ assert(!t->transitional_name);
+ }
+
+ type_register(&base_type_info);
+ if (generic_type_info.name) {
+ type_register(&generic_type_info);
+ }
+
+ if (t->non_transitional_name) {
+ const TypeInfo non_transitional_type_info = {
+ .name = t->non_transitional_name,
+ .parent = base_type_info.name,
+ .instance_init = virtio_pci_non_transitional_instance_init,
+ .interfaces = (InterfaceInfo[]) {
+ { INTERFACE_PCIE_DEVICE },
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { }
+ },
+ };
+ type_register(&non_transitional_type_info);
+ }
+
+ if (t->transitional_name) {
+ const TypeInfo transitional_type_info = {
+ .name = t->transitional_name,
+ .parent = base_type_info.name,
+ .instance_init = virtio_pci_transitional_instance_init,
+ .interfaces = (InterfaceInfo[]) {
+ /*
+ * Transitional virtio devices work only as Conventional PCI
+ * devices because they require PIO ports.
+ */
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { }
+ },
+ };
+ type_register(&transitional_type_info);
+ }
+}
+
/* virtio-blk-pci */
static Property virtio_blk_pci_properties[] = {
@@ -1995,9 +2101,8 @@ static void virtio_blk_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo virtio_blk_pci_info = {
- .name = TYPE_VIRTIO_BLK_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_blk_pci_info = {
+ .generic_name = TYPE_VIRTIO_BLK_PCI,
.instance_size = sizeof(VirtIOBlkPCI),
.instance_init = virtio_blk_pci_instance_init,
.class_init = virtio_blk_pci_class_init,
@@ -2051,9 +2156,8 @@ static void vhost_user_blk_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo vhost_user_blk_pci_info = {
- .name = TYPE_VHOST_USER_BLK_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_user_blk_pci_info = {
+ .generic_name = TYPE_VHOST_USER_BLK_PCI,
.instance_size = sizeof(VHostUserBlkPCI),
.instance_init = vhost_user_blk_pci_instance_init,
.class_init = vhost_user_blk_pci_class_init,
@@ -2119,9 +2223,8 @@ static void virtio_scsi_pci_instance_init(Object *obj)
TYPE_VIRTIO_SCSI);
}
-static const TypeInfo virtio_scsi_pci_info = {
- .name = TYPE_VIRTIO_SCSI_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_scsi_pci_info = {
+ .generic_name = TYPE_VIRTIO_SCSI_PCI,
.instance_size = sizeof(VirtIOSCSIPCI),
.instance_init = virtio_scsi_pci_instance_init,
.class_init = virtio_scsi_pci_class_init,
@@ -2174,9 +2277,8 @@ static void vhost_scsi_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo vhost_scsi_pci_info = {
- .name = TYPE_VHOST_SCSI_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_scsi_pci_info = {
+ .generic_name = TYPE_VHOST_SCSI_PCI,
.instance_size = sizeof(VHostSCSIPCI),
.instance_init = vhost_scsi_pci_instance_init,
.class_init = vhost_scsi_pci_class_init,
@@ -2229,9 +2331,8 @@ static void vhost_user_scsi_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo vhost_user_scsi_pci_info = {
- .name = TYPE_VHOST_USER_SCSI_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_user_scsi_pci_info = {
+ .generic_name = TYPE_VHOST_USER_SCSI_PCI,
.instance_size = sizeof(VHostUserSCSIPCI),
.instance_init = vhost_user_scsi_pci_instance_init,
.class_init = vhost_user_scsi_pci_class_init,
@@ -2277,9 +2378,8 @@ static void vhost_vsock_pci_instance_init(Object *obj)
TYPE_VHOST_VSOCK);
}
-static const TypeInfo vhost_vsock_pci_info = {
- .name = TYPE_VHOST_VSOCK_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_vsock_pci_info = {
+ .generic_name = TYPE_VHOST_VSOCK_PCI,
.instance_size = sizeof(VHostVSockPCI),
.instance_init = vhost_vsock_pci_instance_init,
.class_init = vhost_vsock_pci_class_init,
@@ -2334,9 +2434,8 @@ static void virtio_balloon_pci_instance_init(Object *obj)
"guest-stats-polling-interval", &error_abort);
}
-static const TypeInfo virtio_balloon_pci_info = {
- .name = TYPE_VIRTIO_BALLOON_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_balloon_pci_info = {
+ .generic_name = TYPE_VIRTIO_BALLOON_PCI,
.instance_size = sizeof(VirtIOBalloonPCI),
.instance_init = virtio_balloon_pci_instance_init,
.class_init = virtio_balloon_pci_class_init,
@@ -2407,9 +2506,8 @@ static void virtio_serial_pci_instance_init(Object *obj)
TYPE_VIRTIO_SERIAL);
}
-static const TypeInfo virtio_serial_pci_info = {
- .name = TYPE_VIRTIO_SERIAL_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_serial_pci_info = {
+ .generic_name = TYPE_VIRTIO_SERIAL_PCI,
.instance_size = sizeof(VirtIOSerialPCI),
.instance_init = virtio_serial_pci_instance_init,
.class_init = virtio_serial_pci_class_init,
@@ -2462,9 +2560,8 @@ static void virtio_net_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo virtio_net_pci_info = {
- .name = TYPE_VIRTIO_NET_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_net_pci_info = {
+ .generic_name = TYPE_VIRTIO_NET_PCI,
.instance_size = sizeof(VirtIONetPCI),
.instance_init = virtio_net_pci_instance_init,
.class_init = virtio_net_pci_class_init,
@@ -2513,9 +2610,8 @@ static void virtio_rng_initfn(Object *obj)
TYPE_VIRTIO_RNG);
}
-static const TypeInfo virtio_rng_pci_info = {
- .name = TYPE_VIRTIO_RNG_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_rng_pci_info = {
+ .generic_name = TYPE_VIRTIO_RNG_PCI,
.instance_size = sizeof(VirtIORngPCI),
.instance_init = virtio_rng_initfn,
.class_init = virtio_rng_pci_class_init,
@@ -2605,24 +2701,24 @@ static const TypeInfo virtio_input_hid_pci_info = {
.abstract = true,
};
-static const TypeInfo virtio_keyboard_pci_info = {
- .name = TYPE_VIRTIO_KEYBOARD_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_keyboard_pci_info = {
+ .generic_name = TYPE_VIRTIO_KEYBOARD_PCI,
.parent = TYPE_VIRTIO_INPUT_HID_PCI,
.class_init = virtio_input_hid_kbd_pci_class_init,
.instance_size = sizeof(VirtIOInputHIDPCI),
.instance_init = virtio_keyboard_initfn,
};
-static const TypeInfo virtio_mouse_pci_info = {
- .name = TYPE_VIRTIO_MOUSE_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_mouse_pci_info = {
+ .generic_name = TYPE_VIRTIO_MOUSE_PCI,
.parent = TYPE_VIRTIO_INPUT_HID_PCI,
.class_init = virtio_input_hid_mouse_pci_class_init,
.instance_size = sizeof(VirtIOInputHIDPCI),
.instance_init = virtio_mouse_initfn,
};
-static const TypeInfo virtio_tablet_pci_info = {
- .name = TYPE_VIRTIO_TABLET_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_tablet_pci_info = {
+ .generic_name = TYPE_VIRTIO_TABLET_PCI,
.parent = TYPE_VIRTIO_INPUT_HID_PCI,
.instance_size = sizeof(VirtIOInputHIDPCI),
.instance_init = virtio_tablet_initfn,
@@ -2637,8 +2733,8 @@ static void virtio_host_initfn(Object *obj)
TYPE_VIRTIO_INPUT_HOST);
}
-static const TypeInfo virtio_host_pci_info = {
- .name = TYPE_VIRTIO_INPUT_HOST_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_host_pci_info = {
+ .generic_name = TYPE_VIRTIO_INPUT_HOST_PCI,
.parent = TYPE_VIRTIO_INPUT_PCI,
.instance_size = sizeof(VirtIOInputHostPCI),
.instance_init = virtio_host_initfn,
@@ -2692,36 +2788,39 @@ static const TypeInfo virtio_pci_bus_info = {
static void virtio_pci_register_types(void)
{
- type_register_static(&virtio_rng_pci_info);
+ /* Base types: */
+ type_register_static(&virtio_pci_bus_info);
+ type_register_static(&virtio_pci_info);
type_register_static(&virtio_input_pci_info);
type_register_static(&virtio_input_hid_pci_info);
- type_register_static(&virtio_keyboard_pci_info);
- type_register_static(&virtio_mouse_pci_info);
- type_register_static(&virtio_tablet_pci_info);
+
+ /* Implementations: */
+ virtio_pci_types_register(&virtio_rng_pci_info);
+ virtio_pci_types_register(&virtio_keyboard_pci_info);
+ virtio_pci_types_register(&virtio_mouse_pci_info);
+ virtio_pci_types_register(&virtio_tablet_pci_info);
#ifdef CONFIG_LINUX
- type_register_static(&virtio_host_pci_info);
+ virtio_pci_types_register(&virtio_host_pci_info);
#endif
- type_register_static(&virtio_pci_bus_info);
- type_register_static(&virtio_pci_info);
#ifdef CONFIG_VIRTFS
- type_register_static(&virtio_9p_pci_info);
+ virtio_pci_types_register(&virtio_9p_pci_info);
#endif
- type_register_static(&virtio_blk_pci_info);
+ virtio_pci_types_register(&virtio_blk_pci_info);
#if defined(CONFIG_VHOST_USER_BLK)
- type_register_static(&vhost_user_blk_pci_info);
+ virtio_pci_types_register(&vhost_user_blk_pci_info);
#endif
- type_register_static(&virtio_scsi_pci_info);
- type_register_static(&virtio_balloon_pci_info);
- type_register_static(&virtio_serial_pci_info);
- type_register_static(&virtio_net_pci_info);
+ virtio_pci_types_register(&virtio_scsi_pci_info);
+ virtio_pci_types_register(&virtio_balloon_pci_info);
+ virtio_pci_types_register(&virtio_serial_pci_info);
+ virtio_pci_types_register(&virtio_net_pci_info);
#ifdef CONFIG_VHOST_SCSI
- type_register_static(&vhost_scsi_pci_info);
+ virtio_pci_types_register(&vhost_scsi_pci_info);
#endif
#if defined(CONFIG_VHOST_USER_SCSI)
- type_register_static(&vhost_user_scsi_pci_info);
+ virtio_pci_types_register(&vhost_user_scsi_pci_info);
#endif
#ifdef CONFIG_VHOST_VSOCK
- type_register_static(&vhost_vsock_pci_info);
+ virtio_pci_types_register(&vhost_vsock_pci_info);
#endif
}
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index 813082b..8cd5466 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -417,4 +417,58 @@ struct VirtIOCryptoPCI {
/* Virtio ABI version, if we increment this, we break the guest driver. */
#define VIRTIO_PCI_ABI_VERSION 0
+/* Input for virtio_pci_types_register() */
+typedef struct VirtioPCIDeviceTypeInfo {
+ /*
+ * Common base class for the subclasses below.
+ *
+ * Required only if transitional_name or non_transitional_name is set.
+ *
+ * We need a separate base type instead of making all types
+ * inherit from generic_name for two reasons:
+ * 1) generic_name implements INTERFACE_PCIE_DEVICE, but
+ * transitional_name does not.
+ * 2) generic_name has the "disable-legacy" and "disable-modern"
+ * properties, transitional_name and non_transitional name don't.
+ */
+ const char *base_name;
+ /*
+ * Generic device type. Optional.
+ *
+ * Supports both transitional and non-transitional modes,
+ * using the disable-legacy and disable-modern properties.
+ * If disable-legacy=auto, (non-)transitional mode is selected
+ * depending on the bus where the device is plugged.
+ *
+ * Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE,
+ * but PCI Express is supported only in non-transitional mode.
+ *
+ * The only type implemented by QEMU 3.1 and older.
+ */
+ const char *generic_name;
+ /*
+ * The transitional device type. Optional.
+ *
+ * Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE.
+ */
+ const char *transitional_name;
+ /*
+ * The non-transitional device type. Optional.
+ *
+ * Implements INTERFACE_CONVENTIONAL_PCI_DEVICE only.
+ */
+ const char *non_transitional_name;
+
+ /* Parent type. If NULL, TYPE_VIRTIO_PCI is used */
+ const char *parent;
+
+ /* Same as TypeInfo fields: */
+ size_t instance_size;
+ void (*instance_init)(Object *obj);
+ void (*class_init)(ObjectClass *klass, void *data);
+} VirtioPCIDeviceTypeInfo;
+
+/* Register virtio-pci type(s). @t must be static. */
+void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t);
+
#endif
--
1.8.3.1

View File

@ -1,73 +0,0 @@
From cbac773c0218dc23f2c434f2d04e3e3cc1d081a9 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 16 Jan 2019 23:18:19 +0000
Subject: [PATCH 4/7] virtio: Make disable-legacy/disable-modern compat
properties optional
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190116231819.29310-5-ehabkost@redhat.com>
Patchwork-id: 84030
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 4/4] virtio: Make disable-legacy/disable-modern compat properties optional
Bugzilla: 1648023
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Upstream tree: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git
Upstream commit: 53921bfdce3f8fffcc22338633855247fb7b7a74
The disable-legacy and disable-modern properties apply only to
some virtio-pci devices. Make those properties optional.
This fixes the crash introduced by commit f6e501a28ef9 ("virtio: Provide
version-specific variants of virtio PCI devices"):
$ qemu-system-x86_64 -machine pc-i440fx-2.6 \
-device virtio-net-pci-non-transitional
Unexpected error in object_property_find() at qom/object.c:1092:
qemu-system-x86_64: -device virtio-net-pci-non-transitional: can't apply \
global virtio-pci.disable-modern=on: Property '.disable-modern' not found
Aborted (core dumped)
Backport notes:
HW_COMPAT_RHEL7_2 (include/hw/compat.h) being patched instead
of hw_compat_2_6 (hw/core/machine.c). Our downstream tree
doesn't have the equivalent of commit ff8f261f113b ("compat:
replace PC_COMPAT_2_6 & HW_COMPAT_2_6 macros")
Reported-by: Thomas Huth <thuth@redhat.com>
Fixes: f6e501a28ef9 ("virtio: Provide version-specific variants of virtio PCI devices")
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 1b0ba10643110f9590c0da0167d0cb1db48ca2e4)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
include/hw/compat.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/hw/compat.h b/include/hw/compat.h
index 40db243..aeb2f73 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -380,10 +380,14 @@
.driver = "virtio-pci",\
.property = "disable-modern",\
.value = "on",\
+ /* Optional because not all virtio-pci devices support legacy mode */ \
+ .optional = true,\
},{ /* HW_COMPAT_RHEL7_2 */ \
.driver = "virtio-pci",\
.property = "disable-legacy",\
.value = "off",\
+ /* Optional because not all virtio-pci devices support legacy mode */ \
+ .optional = true,\
},{ /* HW_COMPAT_RHEL7_2 */ \
.driver = TYPE_PCI_DEVICE,\
.property = "x-pcie-lnksta-dllla",\
--
1.8.3.1

View File

@ -1,519 +0,0 @@
From 14004eb28d1e573365ed21ed09afad85d239c769 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 16 Jan 2019 23:18:17 +0000
Subject: [PATCH 2/7] virtio: Provide version-specific variants of virtio PCI
devices
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20190116231819.29310-3-ehabkost@redhat.com>
Patchwork-id: 84028
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 2/4] virtio: Provide version-specific variants of virtio PCI devices
Bugzilla: 1648023
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
Many of the current virtio-*-pci device types actually represent
3 different types of devices:
* virtio 1.0 non-transitional devices
* virtio 1.0 transitional devices
* virtio 0.9 ("legacy device" in virtio 1.0 terminology)
That would be just an annoyance if it didn't break our device/bus
compatibility QMP interfaces. With these multi-purpose device
types, there's no way to tell management software that
transitional devices and legacy devices require a Conventional
PCI bus.
The multi-purpose device types would also prevent us from telling
management software what's the PCI vendor/device ID for them,
because their PCI IDs change at runtime depending on the bus
where they were plugged.
This patch adds separate device types for each of those virtio
device flavors:
- virtio-*-pci: the existing multi-purpose device types
- Configurable using `disable-legacy` and `disable-modern`
properties
- Legacy driver support is automatically enabled/disabled
depending on the bus where it is plugged
- Supports Conventional PCI and PCI Express buses
(but Conventional PCI is incompatible with
disable-legacy=off)
- Changes PCI vendor/device IDs at runtime
- virtio-*-pci-transitional: virtio-1.0 device supporting legacy drivers
- Supports Conventional PCI buses only, because
it has a PIO BAR
- virtio-*-pci-non-transitional: modern-only
- Supports both Conventional PCI and PCI Express buses
The existing TYPE_* macros for these types will point to an
abstract base type, so existing casts in the code will keep
working for all variants.
A simple test script (tests/acceptance/virtio_version.py) is
included, to check if the new device types are equivalent to
using the `disable-legacy` and `disable-modern` options.
Acked-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit f6e501a28ef9b69f6df6252160aa87876cc92a1a)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/virtio/virtio-pci.c | 60 ++++++++++---
hw/virtio/virtio-pci.h | 24 ++---
tests/acceptance/virtio_version.py | 176 +++++++++++++++++++++++++++++++++++++
3 files changed, 236 insertions(+), 24 deletions(-)
create mode 100644 tests/acceptance/virtio_version.py
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index bee3509..68cffcd 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1120,7 +1120,10 @@ static void virtio_9p_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_9p_pci_info = {
- .generic_name = TYPE_VIRTIO_9P_PCI,
+ .base_name = TYPE_VIRTIO_9P_PCI,
+ .generic_name = "virtio-9p-pci",
+ .transitional_name = "virtio-9p-pci-transitional",
+ .non_transitional_name = "virtio-9p-pci-non-transitional",
.instance_size = sizeof(V9fsPCIState),
.instance_init = virtio_9p_pci_instance_init,
.class_init = virtio_9p_pci_class_init,
@@ -2102,7 +2105,10 @@ static void virtio_blk_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_blk_pci_info = {
- .generic_name = TYPE_VIRTIO_BLK_PCI,
+ .base_name = TYPE_VIRTIO_BLK_PCI,
+ .generic_name = "virtio-blk-pci",
+ .transitional_name = "virtio-blk-pci-transitional",
+ .non_transitional_name = "virtio-blk-pci-non-transitional",
.instance_size = sizeof(VirtIOBlkPCI),
.instance_init = virtio_blk_pci_instance_init,
.class_init = virtio_blk_pci_class_init,
@@ -2157,7 +2163,10 @@ static void vhost_user_blk_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo vhost_user_blk_pci_info = {
- .generic_name = TYPE_VHOST_USER_BLK_PCI,
+ .base_name = TYPE_VHOST_USER_BLK_PCI,
+ .generic_name = "vhost-user-blk-pci",
+ .transitional_name = "vhost-user-blk-pci-transitional",
+ .non_transitional_name = "vhost-user-blk-pci-non-transitional",
.instance_size = sizeof(VHostUserBlkPCI),
.instance_init = vhost_user_blk_pci_instance_init,
.class_init = vhost_user_blk_pci_class_init,
@@ -2224,7 +2233,10 @@ static void virtio_scsi_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_scsi_pci_info = {
- .generic_name = TYPE_VIRTIO_SCSI_PCI,
+ .base_name = TYPE_VIRTIO_SCSI_PCI,
+ .generic_name = "virtio-scsi-pci",
+ .transitional_name = "virtio-scsi-pci-transitional",
+ .non_transitional_name = "virtio-scsi-pci-non-transitional",
.instance_size = sizeof(VirtIOSCSIPCI),
.instance_init = virtio_scsi_pci_instance_init,
.class_init = virtio_scsi_pci_class_init,
@@ -2278,7 +2290,10 @@ static void vhost_scsi_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo vhost_scsi_pci_info = {
- .generic_name = TYPE_VHOST_SCSI_PCI,
+ .base_name = TYPE_VHOST_SCSI_PCI,
+ .generic_name = "vhost-scsi-pci",
+ .transitional_name = "vhost-scsi-pci-transitional",
+ .non_transitional_name = "vhost-scsi-pci-non-transitional",
.instance_size = sizeof(VHostSCSIPCI),
.instance_init = vhost_scsi_pci_instance_init,
.class_init = vhost_scsi_pci_class_init,
@@ -2332,7 +2347,10 @@ static void vhost_user_scsi_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo vhost_user_scsi_pci_info = {
- .generic_name = TYPE_VHOST_USER_SCSI_PCI,
+ .base_name = TYPE_VHOST_USER_SCSI_PCI,
+ .generic_name = "vhost-user-scsi-pci",
+ .transitional_name = "vhost-user-scsi-pci-transitional",
+ .non_transitional_name = "vhost-user-scsi-pci-non-transitional",
.instance_size = sizeof(VHostUserSCSIPCI),
.instance_init = vhost_user_scsi_pci_instance_init,
.class_init = vhost_user_scsi_pci_class_init,
@@ -2379,7 +2397,10 @@ static void vhost_vsock_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo vhost_vsock_pci_info = {
- .generic_name = TYPE_VHOST_VSOCK_PCI,
+ .base_name = TYPE_VHOST_VSOCK_PCI,
+ .generic_name = "vhost-vsock-pci",
+ .transitional_name = "vhost-vsock-pci-transitional",
+ .non_transitional_name = "vhost-vsock-pci-non-transitional",
.instance_size = sizeof(VHostVSockPCI),
.instance_init = vhost_vsock_pci_instance_init,
.class_init = vhost_vsock_pci_class_init,
@@ -2435,7 +2456,10 @@ static void virtio_balloon_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_balloon_pci_info = {
- .generic_name = TYPE_VIRTIO_BALLOON_PCI,
+ .base_name = TYPE_VIRTIO_BALLOON_PCI,
+ .generic_name = "virtio-balloon-pci",
+ .transitional_name = "virtio-balloon-pci-transitional",
+ .non_transitional_name = "virtio-balloon-pci-non-transitional",
.instance_size = sizeof(VirtIOBalloonPCI),
.instance_init = virtio_balloon_pci_instance_init,
.class_init = virtio_balloon_pci_class_init,
@@ -2507,7 +2531,10 @@ static void virtio_serial_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_serial_pci_info = {
- .generic_name = TYPE_VIRTIO_SERIAL_PCI,
+ .base_name = TYPE_VIRTIO_SERIAL_PCI,
+ .generic_name = "virtio-serial-pci",
+ .transitional_name = "virtio-serial-pci-transitional",
+ .non_transitional_name = "virtio-serial-pci-non-transitional",
.instance_size = sizeof(VirtIOSerialPCI),
.instance_init = virtio_serial_pci_instance_init,
.class_init = virtio_serial_pci_class_init,
@@ -2561,7 +2588,10 @@ static void virtio_net_pci_instance_init(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_net_pci_info = {
- .generic_name = TYPE_VIRTIO_NET_PCI,
+ .base_name = TYPE_VIRTIO_NET_PCI,
+ .generic_name = "virtio-net-pci",
+ .transitional_name = "virtio-net-pci-transitional",
+ .non_transitional_name = "virtio-net-pci-non-transitional",
.instance_size = sizeof(VirtIONetPCI),
.instance_init = virtio_net_pci_instance_init,
.class_init = virtio_net_pci_class_init,
@@ -2611,7 +2641,10 @@ static void virtio_rng_initfn(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_rng_pci_info = {
- .generic_name = TYPE_VIRTIO_RNG_PCI,
+ .base_name = TYPE_VIRTIO_RNG_PCI,
+ .generic_name = "virtio-rng-pci",
+ .transitional_name = "virtio-rng-pci-transitional",
+ .non_transitional_name = "virtio-rng-pci-non-transitional",
.instance_size = sizeof(VirtIORngPCI),
.instance_init = virtio_rng_initfn,
.class_init = virtio_rng_pci_class_init,
@@ -2734,7 +2767,10 @@ static void virtio_host_initfn(Object *obj)
}
static const VirtioPCIDeviceTypeInfo virtio_host_pci_info = {
- .generic_name = TYPE_VIRTIO_INPUT_HOST_PCI,
+ .base_name = TYPE_VIRTIO_INPUT_HOST_PCI,
+ .generic_name = "virtio-input-host-pci",
+ .transitional_name = "virtio-input-host-pci-transitional",
+ .non_transitional_name = "virtio-input-host-pci-non-transitional",
.parent = TYPE_VIRTIO_INPUT_PCI,
.instance_size = sizeof(VirtIOInputHostPCI),
.instance_init = virtio_host_initfn,
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index 8cd5466..29b4216 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -216,7 +216,7 @@ static inline void virtio_pci_disable_modern(VirtIOPCIProxy *proxy)
/*
* virtio-scsi-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_SCSI_PCI "virtio-scsi-pci"
+#define TYPE_VIRTIO_SCSI_PCI "virtio-scsi-pci-base"
#define VIRTIO_SCSI_PCI(obj) \
OBJECT_CHECK(VirtIOSCSIPCI, (obj), TYPE_VIRTIO_SCSI_PCI)
@@ -229,7 +229,7 @@ struct VirtIOSCSIPCI {
/*
* vhost-scsi-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VHOST_SCSI_PCI "vhost-scsi-pci"
+#define TYPE_VHOST_SCSI_PCI "vhost-scsi-pci-base"
#define VHOST_SCSI_PCI(obj) \
OBJECT_CHECK(VHostSCSIPCI, (obj), TYPE_VHOST_SCSI_PCI)
@@ -239,7 +239,7 @@ struct VHostSCSIPCI {
};
#endif
-#define TYPE_VHOST_USER_SCSI_PCI "vhost-user-scsi-pci"
+#define TYPE_VHOST_USER_SCSI_PCI "vhost-user-scsi-pci-base"
#define VHOST_USER_SCSI_PCI(obj) \
OBJECT_CHECK(VHostUserSCSIPCI, (obj), TYPE_VHOST_USER_SCSI_PCI)
@@ -252,7 +252,7 @@ struct VHostUserSCSIPCI {
/*
* vhost-user-blk-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VHOST_USER_BLK_PCI "vhost-user-blk-pci"
+#define TYPE_VHOST_USER_BLK_PCI "vhost-user-blk-pci-base"
#define VHOST_USER_BLK_PCI(obj) \
OBJECT_CHECK(VHostUserBlkPCI, (obj), TYPE_VHOST_USER_BLK_PCI)
@@ -265,7 +265,7 @@ struct VHostUserBlkPCI {
/*
* virtio-blk-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci"
+#define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci-base"
#define VIRTIO_BLK_PCI(obj) \
OBJECT_CHECK(VirtIOBlkPCI, (obj), TYPE_VIRTIO_BLK_PCI)
@@ -277,7 +277,7 @@ struct VirtIOBlkPCI {
/*
* virtio-balloon-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_BALLOON_PCI "virtio-balloon-pci"
+#define TYPE_VIRTIO_BALLOON_PCI "virtio-balloon-pci-base"
#define VIRTIO_BALLOON_PCI(obj) \
OBJECT_CHECK(VirtIOBalloonPCI, (obj), TYPE_VIRTIO_BALLOON_PCI)
@@ -289,7 +289,7 @@ struct VirtIOBalloonPCI {
/*
* virtio-serial-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_SERIAL_PCI "virtio-serial-pci"
+#define TYPE_VIRTIO_SERIAL_PCI "virtio-serial-pci-base"
#define VIRTIO_SERIAL_PCI(obj) \
OBJECT_CHECK(VirtIOSerialPCI, (obj), TYPE_VIRTIO_SERIAL_PCI)
@@ -301,7 +301,7 @@ struct VirtIOSerialPCI {
/*
* virtio-net-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_NET_PCI "virtio-net-pci"
+#define TYPE_VIRTIO_NET_PCI "virtio-net-pci-base"
#define VIRTIO_NET_PCI(obj) \
OBJECT_CHECK(VirtIONetPCI, (obj), TYPE_VIRTIO_NET_PCI)
@@ -316,7 +316,7 @@ struct VirtIONetPCI {
#ifdef CONFIG_VIRTFS
-#define TYPE_VIRTIO_9P_PCI "virtio-9p-pci"
+#define TYPE_VIRTIO_9P_PCI "virtio-9p-pci-base"
#define VIRTIO_9P_PCI(obj) \
OBJECT_CHECK(V9fsPCIState, (obj), TYPE_VIRTIO_9P_PCI)
@@ -330,7 +330,7 @@ typedef struct V9fsPCIState {
/*
* virtio-rng-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci"
+#define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci-base"
#define VIRTIO_RNG_PCI(obj) \
OBJECT_CHECK(VirtIORngPCI, (obj), TYPE_VIRTIO_RNG_PCI)
@@ -365,7 +365,7 @@ struct VirtIOInputHIDPCI {
#ifdef CONFIG_LINUX
-#define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci"
+#define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci-base"
#define VIRTIO_INPUT_HOST_PCI(obj) \
OBJECT_CHECK(VirtIOInputHostPCI, (obj), TYPE_VIRTIO_INPUT_HOST_PCI)
@@ -392,7 +392,7 @@ struct VirtIOGPUPCI {
/*
* vhost-vsock-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci"
+#define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci-base"
#define VHOST_VSOCK_PCI(obj) \
OBJECT_CHECK(VHostVSockPCI, (obj), TYPE_VHOST_VSOCK_PCI)
diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_version.py
new file mode 100644
index 0000000..ce99025
--- /dev/null
+++ b/tests/acceptance/virtio_version.py
@@ -0,0 +1,176 @@
+"""
+Check compatibility of virtio device types
+"""
+# Copyright (c) 2018 Red Hat, Inc.
+#
+# Author:
+# Eduardo Habkost <ehabkost@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+import sys
+import os
+
+sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "scripts"))
+from qemu import QEMUMachine
+from avocado_qemu import Test
+
+# Virtio Device IDs:
+VIRTIO_NET = 1
+VIRTIO_BLOCK = 2
+VIRTIO_CONSOLE = 3
+VIRTIO_RNG = 4
+VIRTIO_BALLOON = 5
+VIRTIO_RPMSG = 7
+VIRTIO_SCSI = 8
+VIRTIO_9P = 9
+VIRTIO_RPROC_SERIAL = 11
+VIRTIO_CAIF = 12
+VIRTIO_GPU = 16
+VIRTIO_INPUT = 18
+VIRTIO_VSOCK = 19
+VIRTIO_CRYPTO = 20
+
+PCI_VENDOR_ID_REDHAT_QUMRANET = 0x1af4
+
+# Device IDs for legacy/transitional devices:
+PCI_LEGACY_DEVICE_IDS = {
+ VIRTIO_NET: 0x1000,
+ VIRTIO_BLOCK: 0x1001,
+ VIRTIO_BALLOON: 0x1002,
+ VIRTIO_CONSOLE: 0x1003,
+ VIRTIO_SCSI: 0x1004,
+ VIRTIO_RNG: 0x1005,
+ VIRTIO_9P: 0x1009,
+ VIRTIO_VSOCK: 0x1012,
+}
+
+def pci_modern_device_id(virtio_devid):
+ return virtio_devid + 0x1040
+
+def devtype_implements(vm, devtype, implements):
+ return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)]
+
+def get_pci_interfaces(vm, devtype):
+ interfaces = ('pci-express-device', 'conventional-pci-device')
+ return [i for i in interfaces if devtype_implements(vm, devtype, i)]
+
+class VirtioVersionCheck(Test):
+ """
+ Check if virtio-version-specific device types result in the
+ same device tree created by `disable-modern` and
+ `disable-legacy`.
+
+ :avocado: enable
+ :avocado: tags=x86_64
+ """
+
+ # just in case there are failures, show larger diff:
+ maxDiff = 4096
+
+ def run_device(self, devtype, opts=None, machine='pc'):
+ """
+ Run QEMU with `-device DEVTYPE`, return device info from `query-pci`
+ """
+ with QEMUMachine(self.qemu_bin) as vm:
+ vm.set_machine(machine)
+ if opts:
+ devtype += ',' + opts
+ vm.add_args('-device', '%s,id=devfortest' % (devtype))
+ vm.add_args('-S')
+ vm.launch()
+
+ pcibuses = vm.command('query-pci')
+ alldevs = [dev for bus in pcibuses for dev in bus['devices']]
+ devfortest = [dev for dev in alldevs
+ if dev['qdev_id'] == 'devfortest']
+ return devfortest[0], get_pci_interfaces(vm, devtype)
+
+
+ def assert_devids(self, dev, devid, non_transitional=False):
+ self.assertEqual(dev['id']['vendor'], PCI_VENDOR_ID_REDHAT_QUMRANET)
+ self.assertEqual(dev['id']['device'], devid)
+ if non_transitional:
+ self.assertTrue(0x1040 <= dev['id']['device'] <= 0x107f)
+ self.assertGreaterEqual(dev['id']['subsystem'], 0x40)
+
+ def check_all_variants(self, qemu_devtype, virtio_devid):
+ """Check if a virtio device type and its variants behave as expected"""
+ # Force modern mode:
+ dev_modern, _ = self.run_device(qemu_devtype,
+ 'disable-modern=off,disable-legacy=on')
+ self.assert_devids(dev_modern, pci_modern_device_id(virtio_devid),
+ non_transitional=True)
+
+ # <prefix>-non-transitional device types should be 100% equivalent to
+ # <prefix>,disable-modern=off,disable-legacy=on
+ dev_1_0, nt_ifaces = self.run_device('%s-non-transitional' % (qemu_devtype))
+ self.assertEqual(dev_modern, dev_1_0)
+
+ # Force transitional mode:
+ dev_trans, _ = self.run_device(qemu_devtype,
+ 'disable-modern=off,disable-legacy=off')
+ self.assert_devids(dev_trans, PCI_LEGACY_DEVICE_IDS[virtio_devid])
+
+ # Force legacy mode:
+ dev_legacy, _ = self.run_device(qemu_devtype,
+ 'disable-modern=on,disable-legacy=off')
+ self.assert_devids(dev_legacy, PCI_LEGACY_DEVICE_IDS[virtio_devid])
+
+ # No options: default to transitional on PC machine-type:
+ no_opts_pc, generic_ifaces = self.run_device(qemu_devtype)
+ self.assertEqual(dev_trans, no_opts_pc)
+
+ #TODO: check if plugging on a PCI Express bus will make the
+ # device non-transitional
+ #no_opts_q35 = self.run_device(qemu_devtype, machine='q35')
+ #self.assertEqual(dev_modern, no_opts_q35)
+
+ # <prefix>-transitional device types should be 100% equivalent to
+ # <prefix>,disable-modern=off,disable-legacy=off
+ dev_trans, trans_ifaces = self.run_device('%s-transitional' % (qemu_devtype))
+ self.assertEqual(dev_trans, dev_trans)
+
+ # ensure the interface information is correct:
+ self.assertIn('conventional-pci-device', generic_ifaces)
+ self.assertIn('pci-express-device', generic_ifaces)
+
+ self.assertIn('conventional-pci-device', nt_ifaces)
+ self.assertIn('pci-express-device', nt_ifaces)
+
+ self.assertIn('conventional-pci-device', trans_ifaces)
+ self.assertNotIn('pci-express-device', trans_ifaces)
+
+
+ def test_conventional_devs(self):
+ self.check_all_variants('virtio-net-pci', VIRTIO_NET)
+ # virtio-blk requires 'driver' parameter
+ #self.check_all_variants('virtio-blk-pci', VIRTIO_BLOCK)
+ self.check_all_variants('virtio-serial-pci', VIRTIO_CONSOLE)
+ self.check_all_variants('virtio-rng-pci', VIRTIO_RNG)
+ self.check_all_variants('virtio-balloon-pci', VIRTIO_BALLOON)
+ self.check_all_variants('virtio-scsi-pci', VIRTIO_SCSI)
+ # virtio-9p requires 'fsdev' parameter
+ #self.check_all_variants('virtio-9p-pci', VIRTIO_9P)
+
+ def check_modern_only(self, qemu_devtype, virtio_devid):
+ """Check if a modern-only virtio device type behaves as expected"""
+ # Force modern mode:
+ dev_modern, _ = self.run_device(qemu_devtype,
+ 'disable-modern=off,disable-legacy=on')
+ self.assert_devids(dev_modern, pci_modern_device_id(virtio_devid),
+ non_transitional=True)
+
+ # No options: should be modern anyway
+ dev_no_opts, ifaces = self.run_device(qemu_devtype)
+ self.assertEqual(dev_modern, dev_no_opts)
+
+ self.assertIn('conventional-pci-device', ifaces)
+ self.assertIn('pci-express-device', ifaces)
+
+ def test_modern_only_devs(self):
+ self.check_modern_only('virtio-vga', VIRTIO_GPU)
+ self.check_modern_only('virtio-gpu-pci', VIRTIO_GPU)
+ self.check_modern_only('virtio-mouse-pci', VIRTIO_INPUT)
+ self.check_modern_only('virtio-tablet-pci', VIRTIO_INPUT)
+ self.check_modern_only('virtio-keyboard-pci', VIRTIO_INPUT)
--
1.8.3.1

View File

@ -1,116 +0,0 @@
From 5910975bcc4445e366399a438b811cdc8c3dd87e Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 7 Feb 2019 12:18:19 +0000
Subject: [PATCH 8/8] virtio-scsi: Forbid devices with different iothreads
sharing a blockdev
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190207121819.20092-4-armbru@redhat.com>
Patchwork-id: 84289
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev
Bugzilla: 1656276 1662508
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
From: Alberto Garcia <berto@igalia.com>
This patch forbids attaching a disk to a SCSI device if its using a
different AioContext. Test case included.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit eb97813ff5fd5bdffc8ed9f5be5a3a50eae70a2c)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/scsi/virtio-scsi.c | 7 +++++++
tests/qemu-iotests/240 | 22 ++++++++++++++++++++++
tests/qemu-iotests/240.out | 20 ++++++++++++++++++++
3 files changed, 49 insertions(+)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index f0d4f10..66df30d 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -800,9 +800,16 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev,
return;
}
if (s->ctx && !s->dataplane_fenced) {
+ AioContext *ctx;
if (blk_op_is_blocked(sd->conf.blk, BLOCK_OP_TYPE_DATAPLANE, errp)) {
return;
}
+ ctx = blk_get_aio_context(sd->conf.blk);
+ if (ctx != s->ctx && ctx != qemu_get_aio_context()) {
+ error_setg(errp, "Cannot attach a blockdev that is using "
+ "a different iothread");
+ return;
+ }
virtio_scsi_acquire(s);
blk_set_aio_context(sd->conf.blk, s->ctx);
virtio_scsi_release(s);
diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240
index 5d499c9..65cc3b3 100755
--- a/tests/qemu-iotests/240
+++ b/tests/qemu-iotests/240
@@ -101,6 +101,28 @@ run_qemu <<EOF
{ "execute": "quit"}
EOF
+echo
+echo === Attach two SCSI disks using the same block device but different iothreads ===
+echo
+
+run_qemu <<EOF
+{ "execute": "qmp_capabilities" }
+{ "execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-only": true}}
+{ "execute": "object-add", "arguments": {"qom-type": "iothread", "id": "iothread0"}}
+{ "execute": "object-add", "arguments": {"qom-type": "iothread", "id": "iothread1"}}
+{ "execute": "device_add", "arguments": {"id": "scsi0", "driver": "${virtio_scsi}", "iothread": "iothread0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi1", "driver": "${virtio_scsi}", "iothread": "iothread1"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd0", "driver": "scsi-hd", "drive": "hd0", "bus": "scsi0.0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd1", "driver": "scsi-hd", "drive": "hd0", "bus": "scsi1.0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi-hd0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd1", "driver": "scsi-hd", "drive": "hd0", "bus": "scsi1.0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi-hd1"}}
+{ "execute": "device_del", "arguments": {"id": "scsi0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi1"}}
+{ "execute": "blockdev-del", "arguments": {"node-name": "hd0"}}
+{ "execute": "quit"}
+EOF
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/240.out b/tests/qemu-iotests/240.out
index 701cb5c..d763929 100644
--- a/tests/qemu-iotests/240.out
+++ b/tests/qemu-iotests/240.out
@@ -31,4 +31,24 @@ QMP_VERSION
{"return": {}}
{"return": {}}
{"return": {}}
+
+=== Attach two SCSI disks using the same block device but different iothreads ===
+
+Testing:
+QMP_VERSION
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"error": {"class": "GenericError", "desc": "Cannot attach a blockdev that is using a different iothread"}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
*** done
--
1.8.3.1

View File

@ -1,186 +0,0 @@
From c5f17f695247757f61b430ad32079b903331be02 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 7 Feb 2019 12:18:17 +0000
Subject: [PATCH 6/8] virtio-scsi: Move BlockBackend back to the main
AioContext on unplug
RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <20190207121819.20092-2-armbru@redhat.com>
Patchwork-id: 84290
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/3] virtio-scsi: Move BlockBackend back to the main AioContext on unplug
Bugzilla: 1656276 1662508
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
From: Alberto Garcia <berto@igalia.com>
This fixes a crash when attaching a disk to a SCSI device using
iothreads, then detaching it and reattaching it again. Test case
included.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit a6f230c8d13a7ff3a0c7f1097412f44bfd9eff0b)
[Trivial conflict in tests/qemu-iotests/group due to lack of commit
1c4e7b640b resolved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/scsi/virtio-scsi.c | 6 ++++
tests/qemu-iotests/240 | 89 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/240.out | 18 ++++++++++
tests/qemu-iotests/group | 1 +
4 files changed, 114 insertions(+)
create mode 100755 tests/qemu-iotests/240
create mode 100644 tests/qemu-iotests/240.out
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 9f754c4..f0d4f10 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -833,6 +833,12 @@ static void virtio_scsi_hotunplug(HotplugHandler *hotplug_dev, DeviceState *dev,
virtio_scsi_release(s);
}
+ if (s->ctx) {
+ virtio_scsi_acquire(s);
+ blk_set_aio_context(sd->conf.blk, qemu_get_aio_context());
+ virtio_scsi_release(s);
+ }
+
qdev_simple_device_unplug_cb(hotplug_dev, dev, errp);
}
diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240
new file mode 100755
index 0000000..ead7ee0
--- /dev/null
+++ b/tests/qemu-iotests/240
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+# Test hot plugging and unplugging with iothreads
+#
+# Copyright (C) 2019 Igalia, S.L.
+# Author: Alberto Garcia <berto@igalia.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=berto@igalia.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+status=1 # failure is the default!
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt generic
+_supported_proto generic
+_supported_os Linux
+
+do_run_qemu()
+{
+ echo Testing: "$@"
+ $QEMU -nographic -qmp stdio -serial none "$@"
+ echo
+}
+
+# Remove QMP events from (pretty-printed) output. Doesn't handle
+# nested dicts correctly, but we don't get any of those in this test.
+_filter_qmp_events()
+{
+ tr '\n' '\t' | sed -e \
+ 's/{\s*"timestamp":\s*{[^}]*},\s*"event":[^,}]*\(,\s*"data":\s*{[^}]*}\)\?\s*}\s*//g' \
+ | tr '\t' '\n'
+}
+
+run_qemu()
+{
+ do_run_qemu "$@" 2>&1 | _filter_qmp | _filter_qmp_events
+}
+
+case "$QEMU_DEFAULT_MACHINE" in
+ s390-ccw-virtio)
+ virtio_scsi=virtio-scsi-ccw
+ ;;
+ *)
+ virtio_scsi=virtio-scsi-pci
+ ;;
+esac
+
+echo
+echo === Unplug a SCSI disk and then plug it again ===
+echo
+
+run_qemu <<EOF
+{ "execute": "qmp_capabilities" }
+{ "execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0"}}
+{ "execute": "object-add", "arguments": {"qom-type": "iothread", "id": "iothread0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi0", "driver": "${virtio_scsi}", "iothread": "iothread0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd0", "driver": "scsi-hd", "drive": "hd0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi-hd0"}}
+{ "execute": "device_add", "arguments": {"id": "scsi-hd0", "driver": "scsi-hd", "drive": "hd0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi-hd0"}}
+{ "execute": "device_del", "arguments": {"id": "scsi0"}}
+{ "execute": "blockdev-del", "arguments": {"node-name": "hd0"}}
+{ "execute": "quit"}
+EOF
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/240.out b/tests/qemu-iotests/240.out
new file mode 100644
index 0000000..432d981
--- /dev/null
+++ b/tests/qemu-iotests/240.out
@@ -0,0 +1,18 @@
+QA output created by 240
+
+=== Unplug a SCSI disk and then plug it again ===
+
+Testing:
+QMP_VERSION
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+{"return": {}}
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 268fefa..27cfeeb 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -234,3 +234,4 @@
234 auto quick migration
235 auto quick
238 auto quick
+240 auto quick
--
1.8.3.1

View File

@ -1,95 +0,0 @@
From c233fdd40580baf460b34655aa72a9a489b4501b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 7 Mar 2019 09:11:50 +0000
Subject: [PATCH 5/9] vnc: detect and optimize pageflips
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <20190307091150.6551-2-kraxel@redhat.com>
Patchwork-id: 84816
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] vnc: detect and optimize pageflips
Bugzilla: 1666206
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: John Snow <jsnow@redhat.com>
When size and format of the display surface stays the same we can just
tag the guest display as dirty and be done with it.
There is no need need to resize the vnc server display or to touch the
vnc client dirty bits. On the next refresh cycle
vnc_refresh_server_surface() will check for actual display content
changes and update the client dirty bits as needed.
The desktop resize and framebuffer format notifications to the vnc
client will be skipped too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190116101049.8929-1-kraxel@redhat.com
(cherry picked from commit 61e77a5f0c788495566aecb437bcf6b2cf9cda97)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
ui/vnc.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index d7903a7..765bdc5 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -742,6 +742,17 @@ static void vnc_update_server_surface(VncDisplay *vd)
width, height);
}
+static bool vnc_check_pageflip(DisplaySurface *s1,
+ DisplaySurface *s2)
+{
+ return (s1 != NULL &&
+ s2 != NULL &&
+ surface_width(s1) == surface_width(s2) &&
+ surface_height(s1) == surface_height(s2) &&
+ surface_format(s1) == surface_format(s2));
+
+}
+
static void vnc_dpy_switch(DisplayChangeListener *dcl,
DisplaySurface *surface)
{
@@ -749,6 +760,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
"Display output is not active.";
static DisplaySurface *placeholder;
VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
+ bool pageflip = vnc_check_pageflip(vd->ds, surface);
VncState *vs;
if (surface == NULL) {
@@ -761,14 +773,21 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
vnc_abort_display_jobs(vd);
vd->ds = surface;
- /* server surface */
- vnc_update_server_surface(vd);
-
/* guest surface */
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(surface->image);
vd->guest.format = surface->format;
+ if (pageflip) {
+ vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0,
+ surface_width(surface),
+ surface_height(surface));
+ return;
+ }
+
+ /* server surface */
+ vnc_update_server_surface(vd);
+
QTAILQ_FOREACH(vs, &vd->clients, next) {
vnc_colordepth(vs);
vnc_desktop_resize(vs);
--
1.8.3.1

View File

@ -1,97 +0,0 @@
From 5588db6fc02b530c73e51b43a0119562aa93f51d Mon Sep 17 00:00:00 2001
From: "plai@redhat.com" <plai@redhat.com>
Date: Fri, 22 Mar 2019 17:45:14 +0000
Subject: [PATCH 1/2] x86: host-phys-bits-limit option
RH-Author: plai@redhat.com
Message-id: <1553276715-26278-2-git-send-email-plai@redhat.com>
Patchwork-id: 85128
O-Subject: [RHEL8.0 qemu-kvm PATCH 1/2] x86: host-phys-bits-limit option
Bugzilla: 1688915
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
From: Eduardo Habkost <ehabkost@redhat.com>
Some downstream distributions of QEMU set host-phys-bits=on by
default. This worked very well for most use cases, because
phys-bits really didn't have huge consequences. The only
difference was on the CPUID data seen by guests, and on the
handling of reserved bits.
This changed in KVM commit 855feb673640 ("KVM: MMU: Add 5 level
EPT & Shadow page table support"). Now choosing a large
phys-bits value for a VM has bigger impact: it will make KVM use
5-level EPT even when it's not really necessary. This means
using the host phys-bits value may not be the best choice.
Management software could address this problem by manually
configuring phys-bits depending on the size of the VM and the
amount of MMIO address space required for hotplug. But this is
not trivial to implement.
However, there's another workaround that would work for most
cases: keep using the host phys-bits value, but only if it's
smaller than 48. This patch makes this possible by introducing a
new "-cpu" option: "host-phys-bits-limit". Management software
or users can make sure they will always use 4-level EPT using:
"host-phys-bits=on,host-phys-bits-limit=48".
This behavior is still not enabled by default because QEMU
doesn't enable host-phys-bits=on by default. But users,
management software, or downstream distributions may choose to
change their defaults using the new option.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20181211192527.13254-1-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
(cherry picked from commit b6a062c64f9639558a88f46edc3dd76b54b26bb5)
Signed-off-by: Paul Lai <plai@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
target/i386/cpu.c | 5 +++++
target/i386/cpu.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index d92c128..0c2e1c7 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5211,6 +5211,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
if (cpu->host_phys_bits) {
/* The user asked for us to use the host physical bits */
cpu->phys_bits = host_phys_bits;
+ if (cpu->host_phys_bits_limit &&
+ cpu->phys_bits > cpu->host_phys_bits_limit) {
+ cpu->phys_bits = cpu->host_phys_bits_limit;
+ }
}
/* Print a warning if the user set it to a value that's not the
@@ -5798,6 +5802,7 @@ static Property x86_cpu_properties[] = {
DEFINE_PROP_BOOL("kvm", X86CPU, expose_kvm, true),
DEFINE_PROP_UINT32("phys-bits", X86CPU, phys_bits, 0),
DEFINE_PROP_BOOL("host-phys-bits", X86CPU, host_phys_bits, false),
+ DEFINE_PROP_UINT8("host-phys-bits-limit", X86CPU, host_phys_bits_limit, 0),
DEFINE_PROP_BOOL("fill-mtrr-mask", X86CPU, fill_mtrr_mask, true),
DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, UINT32_MAX),
DEFINE_PROP_UINT32("xlevel", X86CPU, env.cpuid_xlevel, UINT32_MAX),
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 26412f1..db49f44 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1458,6 +1458,9 @@ struct X86CPU {
/* if true override the phys_bits value with a value read from the host */
bool host_phys_bits;
+ /* if set, limit maximum value for phys_bits when host_phys_bits is true */
+ uint8_t host_phys_bits_limit;
+
/* Stop SMI delivery for migration compatibility with old machines */
bool kvm_no_smi_migration;
--
1.8.3.1

View File

@ -68,8 +68,8 @@ Obsoletes: %1-rhev
Summary: QEMU is a machine emulator and virtualizer
Name: qemu-kvm
Version: 3.1.0
Release: 24%{?dist}
Version: 4.0.0
Release: 0%{?dist}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
Epoch: 15
License: GPLv2 and GPLv2+ and CC-BY
@ -78,7 +78,7 @@ URL: http://www.qemu.org/
ExclusiveArch: x86_64 %{power64} aarch64 s390x
Source0: http://wiki.qemu.org/download/qemu-3.1.0.tar.xz
Source0: http://wiki.qemu.org/download/qemu-4.0.0.tar.xz
# KSM control scripts
Source4: ksm.service
@ -114,139 +114,15 @@ Patch0008: 0008-Add-ppc64-machine-types.patch
Patch0009: 0009-Add-s390x-machine-types.patch
Patch0010: 0010-Add-x86_64-machine-types.patch
Patch0011: 0011-Enable-make-check.patch
Patch0012: 0012-Use-kvm-by-default.patch
Patch0013: 0013-vfio-cap-number-of-devices-that-can-be-assigned.patch
Patch0014: 0014-Add-support-statement-to-help-output.patch
Patch0015: 0015-globally-limit-the-maximum-number-of-CPUs.patch
Patch0016: 0016-Add-support-for-simpletrace.patch
Patch0017: 0017-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch
Patch0018: 0018-usb-xhci-Fix-PCI-capability-order.patch
Patch0019: 0019-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch
# For bz#1655820 - Can't migarate between rhel8 and rhel7 when guest has device "video"
Patch20: kvm-pc-7.5-compat-entries.patch
# For bz#1655820 - Can't migarate between rhel8 and rhel7 when guest has device "video"
Patch21: kvm-compat-Generic-HW_COMPAT_RHEL7_6.patch
# For bz#1655820 - Can't migarate between rhel8 and rhel7 when guest has device "video"
Patch22: kvm-pc-PC_RHEL7_6_COMPAT.patch
# For bz#1655820 - Can't migarate between rhel8 and rhel7 when guest has device "video"
Patch23: kvm-pc-Add-compat-for-pc-i440fx-rhel7.6.0-machine-type.patch
# For bz#1655820 - Can't migarate between rhel8 and rhel7 when guest has device "video"
Patch24: kvm-pc-Add-pc-q35-8.0.0-machine-type.patch
# For bz#1655820 - Can't migarate between rhel8 and rhel7 when guest has device "video"
Patch25: kvm-pc-Add-x-migrate-smi-count-off-to-PC_RHEL7_6_COMPAT.patch
# For bz#1659604 - 8->7 migration failed: qemu-kvm: error: failed to set MSR 0x4b564d02 to 0x27fc13285
Patch26: kvm-clear-out-KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT-for.patch
# For bz#1656508 - Machine types for qemu-kvm based on rebase to qemu-3.1 (ppc64le)
Patch27: kvm-redhat-define-pseries-rhel8.0.0-machine-type.patch
# For bz#1656510 - Machine types for qemu-kvm based on rebase to qemu-3.1 (s390x)
Patch28: kvm-hw-s390x-s390-virtio-ccw-Add-machine-types-for-RHEL8.patch
# For bz#1661967 - Kernel prints the message "VPHN is not supported. Disabling polling..."
Patch29: kvm-spapr-Add-H-Call-H_HOME_NODE_ASSOCIATIVITY.patch
# For bz#1648023 - Provide separate device types for transitional virtio PCI devices - Fast Train
Patch30: kvm-virtio-Helper-for-registering-virtio-device-types.patch
# For bz#1648023 - Provide separate device types for transitional virtio PCI devices - Fast Train
Patch31: kvm-virtio-Provide-version-specific-variants-of-virtio-P.patch
# For bz#1648023 - Provide separate device types for transitional virtio PCI devices - Fast Train
Patch32: kvm-globals-Allow-global-properties-to-be-optional.patch
# For bz#1648023 - Provide separate device types for transitional virtio PCI devices - Fast Train
Patch33: kvm-virtio-Make-disable-legacy-disable-modern-compat-pro.patch
# For bz#1656504 - Machine types for qemu-kvm based on rebase to qemu-3.1 (aarch64)
Patch34: kvm-aarch64-Add-virt-rhel8.0.0-machine-type-for-ARM.patch
# For bz#1656504 - Machine types for qemu-kvm based on rebase to qemu-3.1 (aarch64)
Patch35: kvm-aarch64-Set-virt-rhel8.0.0-max_cpus-to-512.patch
# For bz#1656504 - Machine types for qemu-kvm based on rebase to qemu-3.1 (aarch64)
Patch36: kvm-aarch64-Use-256MB-ECAM-region-by-default.patch
# For bz#1653114 - Incorrect NUMA nodes passed to qemu-kvm guest in ibm,max-associativity-domains property
Patch37: kvm-spapr-Fix-ibm-max-associativity-domains-property-num.patch
# For bz#1668205 - Guest quit with error when hotunplug cpu
Patch38: kvm-cpus-ignore-ESRCH-in-qemu_cpu_kick_thread.patch
# For bz#1653511 - qemu doesn't report all support cpu features which cause libvirt cannot get the support status of hv_tlbflush
Patch39: kvm-i386-kvm-expose-HV_CPUID_ENLIGHTMENT_INFO.EAX-and-HV.patch
# For bz#1653511 - qemu doesn't report all support cpu features which cause libvirt cannot get the support status of hv_tlbflush
Patch40: kvm-i386-kvm-add-a-comment-explaining-why-.feat_names-ar.patch
# For bz#1666601 - [q35] dst qemu core dumped when do rdma migration with Mellanox IB QDR card
Patch41: kvm-migration-rdma-unregister-fd-handler.patch
# For bz#1659127 - Stress guest and stop it, then do live migration, guest hit call trace on destination end
Patch42: kvm-s390x-tod-Properly-stop-the-KVM-TOD-while-the-guest-.patch
# For bz#1659127 - Stress guest and stop it, then do live migration, guest hit call trace on destination end
Patch43: kvm-hw-s390x-Fix-bad-mask-in-time2tod.patch
# For bz#1655947 - qemu-kvm core dumped after unplug the device which was set io throttling parameters
Patch44: kvm-throttle-groups-fix-restart-coroutine-iothread-race.patch
# For bz#1655947 - qemu-kvm core dumped after unplug the device which was set io throttling parameters
Patch45: kvm-iotests-add-238-for-throttling-tgm-unregister-iothre.patch
# For bz#1668244 - qemu-img: /var/tmp/v2vovl9951f8.qcow2: CURL: Error opening file: The requested URL returned error: 404 Not Found
Patch47: kvm-json-Fix-handling-when-not-interpolating.patch
# For bz#1665896 - VNC unix listener socket is deleted after first client quits
Patch48: kvm-io-ensure-UNIX-client-doesn-t-unlink-server-socket.patch
# For bz#1668248 - "An unknown error has occurred" when using cdrom to install the system with two blockdev disks.(when choose installation destination)
Patch49: kvm-scsi-disk-Don-t-use-empty-string-as-device-id.patch
# For bz#1668248 - "An unknown error has occurred" when using cdrom to install the system with two blockdev disks.(when choose installation destination)
Patch50: kvm-scsi-disk-Add-device_id-property.patch
# For bz#1669922 - Backport avocado-qemu tests for QEMU 3.1
Patch51: kvm-Acceptance-tests-add-Linux-initrd-checking-test.patch
# For bz#1671519 - RHEL8.0 Snapshot3 - qemu doesn't free up hugepage memory when hotplug/hotunplug using memory-backend-file (qemu-kvm)
Patch52: kvm-mmap-alloc-unfold-qemu_ram_mmap.patch
# For bz#1671519 - RHEL8.0 Snapshot3 - qemu doesn't free up hugepage memory when hotplug/hotunplug using memory-backend-file (qemu-kvm)
Patch53: kvm-mmap-alloc-fix-hugetlbfs-misaligned-length-in-ppc64.patch
# For bz#1653590 - [Fast train]had better stop qemu immediately while guest was making use of an improper page size
Patch54: kvm-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch
# For bz#1673014 - Local VM and migrated VM on the same host can run with same RAW file as visual disk source while without shareable configured or lock manager enabled
Patch55: kvm-block-Fix-invalidate_cache-error-path-for-parent-act.patch
# For bz#1656276 - qemu-kvm core dumped after hotplug the deleted disk with iothread parameter
# For bz#1662508 - Qemu core dump when start guest with two disks using same drive
Patch56: kvm-virtio-scsi-Move-BlockBackend-back-to-the-main-AioCo.patch
# For bz#1656276 - qemu-kvm core dumped after hotplug the deleted disk with iothread parameter
# For bz#1662508 - Qemu core dump when start guest with two disks using same drive
Patch57: kvm-scsi-disk-Acquire-the-AioContext-in-scsi_-_realize.patch
# For bz#1656276 - qemu-kvm core dumped after hotplug the deleted disk with iothread parameter
# For bz#1662508 - Qemu core dump when start guest with two disks using same drive
Patch58: kvm-virtio-scsi-Forbid-devices-with-different-iothreads-.patch
# For bz#1644985 - The "fsfreeze-hook" script path shown by command "qemu-ga --help" or "man qemu-ga" is wrong - Fast Train
Patch59: kvm-doc-fix-the-configuration-path.patch
# For bz#1664997 - Restrict floppy device to RHEL-7 machine types
Patch60: kvm-fdc-Revert-downstream-disablement-of-device-floppy.patch
# For bz#1664997 - Restrict floppy device to RHEL-7 machine types
Patch61: kvm-fdc-Restrict-floppy-controllers-to-RHEL-7-machine-ty.patch
# For bz#1678968 - -blockdev: auto-read-only is ineffective for drivers on read-only whitelist
Patch62: kvm-block-Apply-auto-read-only-for-ro-whitelist-drivers.patch
# For bz#1661030 - Remove MPX support from 8.0 machine types
Patch63: kvm-target-i386-Disable-MPX-support-on-named-CPU-models.patch
# For bz#1661515 - Remove PCONFIG and INTEL_PT from Icelake-* CPU models
Patch64: kvm-i386-remove-the-new-CPUID-PCONFIG-from-Icelake-Serve.patch
# For bz#1661515 - Remove PCONFIG and INTEL_PT from Icelake-* CPU models
Patch65: kvm-i386-remove-the-INTEL_PT-CPUID-bit-from-named-CPU-mo.patch
# For bz#1661515 - Remove PCONFIG and INTEL_PT from Icelake-* CPU models
Patch66: kvm-Revert-i386-Add-CPUID-bit-for-PCONFIG.patch
# For bz#1608649 - Query-migrate get "failed" status after migrate-cancel
Patch67: kvm-migration-Fix-cancel-state.patch
# For bz#1608649 - Query-migrate get "failed" status after migrate-cancel
Patch68: kvm-migration-rdma-Fix-qemu_rdma_cleanup-null-check.patch
# For bz#1686260 - stibp is missing on qemu 3.0 and qemu 3.1
Patch69: kvm-i386-Add-stibp-flag-name.patch
# For bz#1674438 - RHEL8.0 - Guest reboot fails after memory hotplug multiple times (kvm)
Patch71: kvm-spapr-fix-out-of-bounds-write-in-spapr_populate_drme.patch
# For bz#1655065 - [rhel.8.0][fast train]'qemu-img measure' size does not match the real allocated size for luks-inside-qcow2 image
Patch72: kvm-qcow2-include-LUKS-payload-overhead-in-qemu-img-meas.patch
# For bz#1655065 - [rhel.8.0][fast train]'qemu-img measure' size does not match the real allocated size for luks-inside-qcow2 image
Patch73: kvm-iotests-add-LUKS-payload-overhead-to-178-qemu-img-me.patch
# For bz#1666206 - vnc server should detect page-flips and avoid sending fullscreen updates then.
Patch74: kvm-vnc-detect-and-optimize-pageflips.patch
# For bz#1669053 - Guest call trace when boot with nvdimm device backed by /dev/dax
Patch76: kvm-hostmem-file-reject-invalid-pmem-file-sizes.patch
# For bz#1687582 - QEMU IOTEST 200 fails with 'virtio-scsi-pci is not a valid device model name'
Patch77: kvm-iotests-Fix-test-200-on-s390x-without-virtio-pci.patch
# For bz#1652572 - QEMU core dumped if stop nfs service during migration
Patch78: kvm-block-file-posix-do-not-fail-on-unlock-bytes.patch
# For bz#1687578 - Incorrect CVE vulnerabilities reported on Cascade Lake cpus
Patch79: kvm-i386-kvm-Disable-arch_capabilities-if-MSR-can-t-be-s.patch
# For bz#1687578 - Incorrect CVE vulnerabilities reported on Cascade Lake cpus
Patch80: kvm-i386-Make-arch_capabilities-migratable.patch
# For bz#1693173 - CVE-2018-20815 qemu-kvm: QEMU: device_tree: heap buffer overflow while loading device tree blob [rhel-av-8]
Patch81: kvm-device_tree-Fix-integer-overflowing-in-load_device_t.patch
# For bz#1688915 - [Intel 8.0 Alpha] physical bits should <= 48 when host with 5level paging &EPT5 and qemu command with "-cpu qemu64" parameters.
Patch82: kvm-x86-host-phys-bits-limit-option.patch
# For bz#1688915 - [Intel 8.0 Alpha] physical bits should <= 48 when host with 5level paging &EPT5 and qemu command with "-cpu qemu64" parameters.
Patch83: kvm-rhel-Set-host-phys-bits-limit-48-on-rhel-machine-typ.patch
Patch0012: 0012-vfio-cap-number-of-devices-that-can-be-assigned.patch
Patch0013: 0013-Add-support-statement-to-help-output.patch
Patch0014: 0014-globally-limit-the-maximum-number-of-CPUs.patch
Patch0015: 0015-Add-support-for-simpletrace.patch
Patch0016: 0016-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch
Patch0017: 0017-usb-xhci-Fix-PCI-capability-order.patch
Patch0018: 0018-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch
Patch0019: 0019-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch
Patch0020: 0020-doc-fix-the-configuration-path.patch
BuildRequires: zlib-devel
BuildRequires: glib2-devel
@ -304,6 +180,7 @@ BuildRequires: pixman-devel
# Documentation requirement
BuildRequires: perl-podlators
BuildRequires: texinfo
BuildRequires: python3-sphinx
# For rdma
%if 0%{?have_librdma}
BuildRequires: rdma-core-devel
@ -349,6 +226,8 @@ Requires: mesa-libEGL
Requires: mesa-dri-drivers
%endif
BuildRequires: perl-Test-Harness
Requires: qemu-kvm-core = %{epoch}:%{version}-%{release}
%rhev_ma_conflicts qemu-kvm
@ -692,7 +571,9 @@ buildldflags="VL_LDFLAGS=-Wl,--build-id"
--disable-vvfat \
--disable-qed \
--disable-parallels \
--disable-sheepdog
--disable-sheepdog \
--without-default-devices
echo "config-host.mak contents:"
echo "==="
@ -702,15 +583,17 @@ echo "==="
make V=1 %{?_smp_mflags} $buildldflags
# Setup back compat qemu-kvm binary
%{__python3} scripts/tracetool.py --backend dtrace --format stap --group=all \
--binary %{_libexecdir}/qemu-kvm --target-name %{kvm_target} \
--target-type system --probe-prefix \
qemu.kvm trace-events-all > qemu-kvm.stp
%{__python3} scripts/tracetool.py --backend dtrace --format stap \
--group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \
trace-events-all > qemu-kvm.stp
%{__python3} scripts/tracetool.py --backends=dtrace --format=log-stap \
--group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \
trace-events-all > qemu-kvm-log.stp
%{__python3} scripts/tracetool.py --backend dtrace --format simpletrace-stap \
--group=all --binary %{_libexecdir}/qemu-kvm --target-name %{kvm_target} \
--target-type system --probe-prefix \
qemu.kvm trace-events-all > qemu-kvm-simpletrace.stp
--group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \
trace-events-all > qemu-kvm-simpletrace.stp
cp -a %{kvm_target}-softmmu/qemu-system-%{kvm_target} qemu-kvm
@ -744,10 +627,10 @@ mkdir -p $RPM_BUILD_ROOT%{_udevrulesdir}/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
# Create new directories and put them all under tests-src
mkdir -p $RPM_BUILD_ROOT%{testsdir}/tests/
mkdir -p $RPM_BUILD_ROOT%{testsdir}/python
mkdir -p $RPM_BUILD_ROOT%{testsdir}/tests
mkdir -p $RPM_BUILD_ROOT%{testsdir}/tests/acceptance
mkdir -p $RPM_BUILD_ROOT%{testsdir}/tests/qemu-iotests
mkdir -p $RPM_BUILD_ROOT%{testsdir}/scripts
mkdir -p $RPM_BUILD_ROOT%{testsdir}/scripts/qmp
install -p -m 0755 udev-kvm-check $RPM_BUILD_ROOT%{_udevdir}
@ -760,7 +643,7 @@ install -m 0644 scripts/dump-guest-memory.py \
cp -R tests/acceptance/* $RPM_BUILD_ROOT%{testsdir}/tests/acceptance/
# Install qemu.py and qmp/ scripts required to run avocado_qemu tests
install -p -m 0644 scripts/qemu.py $RPM_BUILD_ROOT%{testsdir}/scripts/
cp -R python/qemu $RPM_BUILD_ROOT%{testsdir}/python
cp -R scripts/qmp/* $RPM_BUILD_ROOT%{testsdir}/scripts/qmp
install -p -m 0755 tests/Makefile.include $RPM_BUILD_ROOT%{testsdir}/tests/
@ -811,11 +694,18 @@ install -m 0644 qemu-ga.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/
install -m 0755 qemu-kvm $RPM_BUILD_ROOT%{_libexecdir}/
install -m 0644 qemu-kvm.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/
install -m 0644 qemu-kvm-log.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/
install -m 0644 qemu-kvm-simpletrace.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/
rm $RPM_BUILD_ROOT/%{_datadir}/applications/qemu.desktop
rm $RPM_BUILD_ROOT%{_bindir}/qemu-system-%{kvm_target}
rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp
rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-simpletrace.stp
rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-log.stp
rm $RPM_BUILD_ROOT%{_bindir}/elf2dmp
# Mangle qemu-kvm-stap
sed -i -e '1 s/python/python3/' $RPM_BUILD_ROOT%{_bindir}/qemu-trace-stap
# Install simpletrace
install -m 0755 scripts/simpletrace.py $RPM_BUILD_ROOT%{_datadir}/%{name}/simpletrace.py
@ -872,6 +762,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/u-boot-sam460-20100605.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/kvmvapic.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/linuxboot.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/multiboot.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/pvh.bin
%endif
# Remove sparc files
@ -951,11 +842,14 @@ find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f
# RPM won't pick up their dependencies.
chmod +x $RPM_BUILD_ROOT%{_libdir}/qemu-kvm/block-*.so
# Remove buildinfo
rm -rf $RPM_BUILD_ROOT%{qemudocdir}/interop/.buildinfo
%check
export DIFF=diff; make check V=1
pushd tests/qemu-iotests
./check -v -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 045 048 052 063 077 086 101 104 106 120 132 140 143 145 147 150 152 157 159 160 162 170 171 175 181 184 194 205 208 218 221 222 226 227 232
./check -v -qcow2 001 002 003 004 005 007 008 009 010 011 012 017 018 019 020 021 022 024 025 027 028 029 031 032 033 034 035 036 037 038 039 042 043 046 047 048 049 050 052 053 054 056 057 058 062 063 065 066 068 069 072 073 074 080 085 086 087 089 090 091 095 096 097 098 102 103 104 105 107 108 110 111 114 117 120 126 127 130 132 133 134 137 138 140 141 142 143 144 145 147 150 151 152 156 157 158 159 162 165 170 174 177 179 181 184 187 188 189 190 191 194 195 196 198 201 202 203 204 205 206 208 209 214 216 217 218 222 223 226 227 232
./check -v -qcow2 001 002 003 004 005 007 008 009 010 011 012 017 018 019 020 021 022 024 025 027 028 029 031 032 033 034 035 036 037 038 039 042 043 046 047 048 049 050 052 053 054 056 057 058 062 063 065 066 068 069 072 073 074 080 085 086 087 089 090 091 095 096 097 098 102 103 104 105 107 108 110 111 114 117 120 126 127 130 132 133 134 137 138 140 141 142 143 144 145 147 150 151 152 156 157 158 159 162 165 170 174 177 179 181 184 187 188 189 190 191 194 195 196 198 201 202 203 204 205 206 208 209 214 216 217 218 222 226 227 232
./check -v -luks 001 002 003 004 005 008 009 010 011 012 021 032 033 052 140 143 145 157 162 174 181 184 208 218 227
./check -v -nbd 001 002 003 004 005 008 009 010 011 021 032 033 045 077 094 104 119 123 132 143 145 147 151 152 162 181 184 194 205 208 218 222
popd
@ -997,14 +891,6 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%systemd_postun_with_restart ksm.service
%systemd_postun_with_restart ksmtuned.service
%global qemu_kvm_files \
%{_libexecdir}/qemu-kvm \
%{_datadir}/systemtap/tapset/qemu-kvm.stp \
%{_datadir}/%{name}/trace-events-all \
%{_datadir}/systemtap/tapset/qemu-kvm-simpletrace.stp \
%{_datadir}/%{name}/systemtap/script.d/qemu_kvm.stp \
%{_datadir}/%{name}/systemtap/conf.d/qemu_kvm.conf
%files
# Deliberately empty
@ -1025,11 +911,13 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%doc %{qemudocdir}/qemu-ga-ref.txt
%doc %{qemudocdir}/qemu-qmp-ref.html
%doc %{qemudocdir}/qemu-qmp-ref.txt
%doc %{qemudocdir}/interop/*
%{_mandir}/man7/qemu-qmp-ref.7*
%{_mandir}/man7/qemu-cpu-models.7*
%{_bindir}/qemu-keymap
%{_bindir}/qemu-pr-helper
%{_bindir}/qemu-edid
%{_bindir}/qemu-trace-stap
%{_unitdir}/qemu-pr-helper.service
%{_unitdir}/qemu-pr-helper.socket
%{_mandir}/man7/qemu-ga-ref.7*
@ -1037,6 +925,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/keymaps/
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/qemu-trace-stap.1*
%{_mandir}/man7/qemu-block-drivers.7*
%attr(4755, -, -) %{_libexecdir}/qemu-bridge-helper
%config(noreplace) %{_sysconfdir}/sasl2/%{name}.conf
@ -1067,6 +956,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%{_datadir}/%{name}/multiboot.bin
%{_datadir}/%{name}/kvmvapic.bin
%{_datadir}/%{name}/sgabios.bin
%{_datadir}/%{name}/pvh.bin
%endif
%ifarch s390x
%{_datadir}/%{name}/s390-ccw.img
@ -1086,14 +976,19 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%{_datadir}/%{name}/efi-rtl8139.rom
%{_datadir}/%{name}/efi-ne2k_pci.rom
%endif
%{_datadir}/%{name}/qemu-icon.bmp
%{_datadir}/%{name}/qemu_logo_no_text.svg
%{_datadir}/icons/*
%{_datadir}/%{name}/linuxboot_dma.bin
%{_datadir}/%{name}/dump-guest-memory.py*
%ifarch %{power64}
%{_datadir}/%{name}/spapr-rtas.bin
%endif
%{?qemu_kvm_files:}
%{_libexecdir}/qemu-kvm
%{_datadir}/systemtap/tapset/qemu-kvm.stp
%{_datadir}/systemtap/tapset/qemu-kvm-log.stp
%{_datadir}/%{name}/trace-events-all
%{_datadir}/systemtap/tapset/qemu-kvm-simpletrace.stp
%{_datadir}/%{name}/systemtap/script.d/qemu_kvm.stp
%{_datadir}/%{name}/systemtap/conf.d/qemu_kvm.conf
%if 0%{have_kvm_setup}
%{_prefix}/lib/systemd/kvm-setup
%{_unitdir}/kvm-setup.service
@ -1145,11 +1040,8 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
%changelog
* Fri Apr 26 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-24.el8
- kvm-x86-host-phys-bits-limit-option.patch [bz#1688915]
- kvm-rhel-Set-host-phys-bits-limit-48-on-rhel-machine-typ.patch [bz#1688915]
- Resolves: bz#1688915
([Intel 8.0 Alpha] physical bits should <= 48 when host with 5level paging &EPT5 and qemu command with "-cpu qemu64" parameters.)
* Tue May 7 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 4.0.0-0.el8
- Rebase qemu-kvm to 4.0.0
* Tue Apr 23 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-23.el8
- kvm-device_tree-Fix-integer-overflowing-in-load_device_t.patch [bz#1693173]
@ -1259,7 +1151,6 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
(Local VM and migrated VM on the same host can run with same RAW file as visual disk source while without shareable configured or lock manager enabled)
* Fri Feb 08 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-12.el8
- Removing kvm-Fix-fsfreeze-hook-path-in-the-man-page.patch [bz#1644985]
- kvm-io-ensure-UNIX-client-doesn-t-unlink-server-socket.patch [bz#1665896]
- kvm-scsi-disk-Don-t-use-empty-string-as-device-id.patch [bz#1668248]
- kvm-scsi-disk-Add-device_id-property.patch [bz#1668248]
@ -1291,11 +1182,6 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
- Resolves: bz#1666601
([q35] dst qemu core dumped when do rdma migration with Mellanox IB QDR card)
* Mon Jan 28 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-8.el8
- kvm-migration-rdma-unregister-fd-handler.patch [bz#1666601]
- Resolves: bz#1666601
([q35] dst qemu core dumped when do rdma migration with Mellanox IB QDR card)
* Thu Jan 24 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-7.el8
- kvm-i386-kvm-expose-HV_CPUID_ENLIGHTMENT_INFO.EAX-and-HV.patch [bz#1653511]
- kvm-i386-kvm-add-a-comment-explaining-why-.feat_names-ar.patch [bz#1653511]
@ -1326,6 +1212,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
* Fri Jan 11 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-4.el8
- kvm-hw-s390x-s390-virtio-ccw-Add-machine-types-for-RHEL8.patch [bz#1656510]
- kvm-spapr-Add-H-Call-H_HOME_NODE_ASSOCIATIVITY.patch [bz#1661967]
- kvm-redhat-Fixing-.gitpublish-to-include-AV-information.patch []
- Resolves: bz#1656510
(Machine types for qemu-kvm based on rebase to qemu-3.1 (s390x))
- Resolves: bz#1661967

View File

@ -1 +1 @@
SHA512 (qemu-3.1.0.tar.xz) = 7e8dae823937cfac2f0c60406bd3bdcb89df40313dab2a4bed327d5198f7fcc68ac8b31e44692caa09299cc71256ee0b8c17e4f49f78ada8043d424f5daf82fe
SHA512 (qemu-4.0.0.tar.xz) = 952e94194ce9e64c15388c59035cb31fb9f761d30095c2fb9441012b609c18c9976285727b93bf37b95e15675802d73f8e1c4619ebecd23606675bb503646b13