Compare commits
No commits in common. "imports/c9-beta/qemu-kvm-6.2.0-11.el9_0.2" and "c8-stream-rhel" have entirely different histories.
imports/c9
...
c8-stream-
|
@ -1 +1,5 @@
|
|||
SOURCES/qemu-6.2.0.tar.xz
|
||||
SOURCES/tests_data_acpi_pc_SSDT.dimmpxm
|
||||
SOURCES/tests_data_acpi_q35_FACP.slic
|
||||
SOURCES/tests_data_acpi_q35_SSDT.dimmpxm
|
||||
SOURCES/tests_data_acpi_virt_SSDT.memhp
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
68cd61a466170115b88817e2d52db2cd7a92f43a SOURCES/qemu-6.2.0.tar.xz
|
||||
c4b34092bc5af1ba7febfca1477320fb024e8acd SOURCES/tests_data_acpi_pc_SSDT.dimmpxm
|
||||
19349e3517143bd1af56a5444e927ba37a111f72 SOURCES/tests_data_acpi_q35_FACP.slic
|
||||
4632d10ae8cedad4d5d760ed211f83f0dc81005d SOURCES/tests_data_acpi_q35_SSDT.dimmpxm
|
||||
ef12eed43cc357fb134db6fa3c7ffc83e222a97d SOURCES/tests_data_acpi_virt_SSDT.memhp
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,49 +0,0 @@
|
|||
From cc2f3e2ce9e2a9ab9e52e8f44bee4876e69843da Mon Sep 17 00:00:00 2001
|
||||
From: John Snow <jsnow@redhat.com>
|
||||
Date: Wed, 17 Nov 2021 09:51:46 -0500
|
||||
Subject: ui/clipboard: Don't use g_autoptr just to free a variable
|
||||
|
||||
Clang doesn't recognize that the variable is being "used" and will emit
|
||||
a warning:
|
||||
|
||||
../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,-Wunused-but-set-variable]
|
||||
g_autoptr(QemuClipboardInfo) old = NULL;
|
||||
^
|
||||
1 error generated.
|
||||
|
||||
OK, fine. Just do things the old way.
|
||||
|
||||
Signed-off-by: John Snow <jsnow@redhat.com>
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
---
|
||||
|
||||
This is temporary commit from upstream submission necessary for build to pass.
|
||||
We expect proper fix included upstream later.
|
||||
---
|
||||
ui/clipboard.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ui/clipboard.c b/ui/clipboard.c
|
||||
index d7b008d62a..d53576b0f6 100644
|
||||
--- a/ui/clipboard.c
|
||||
+++ b/ui/clipboard.c
|
||||
@@ -44,13 +44,14 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
|
||||
|
||||
void qemu_clipboard_update(QemuClipboardInfo *info)
|
||||
{
|
||||
- g_autoptr(QemuClipboardInfo) old = NULL;
|
||||
+ QemuClipboardInfo *old = NULL;
|
||||
assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT);
|
||||
|
||||
notifier_list_notify(&clipboard_notifiers, info);
|
||||
|
||||
old = cbinfo[info->selection];
|
||||
cbinfo[info->selection] = qemu_clipboard_info_ref(info);
|
||||
+ g_free(old);
|
||||
}
|
||||
|
||||
QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection)
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,178 +1,228 @@
|
|||
From 3308eb892f03c7169f712fe88e74dacd6f05b1fe Mon Sep 17 00:00:00 2001
|
||||
From 19ce5ff93ddd6b8a998348f2a5f59f603c5e11b7 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Wed, 26 May 2021 10:56:02 +0200
|
||||
Date: Fri, 12 Oct 2018 07:31:11 +0200
|
||||
Subject: Initial redhat build
|
||||
|
||||
This patch introduces redhat build structure in redhat subdirectory. In addition,
|
||||
several issues are fixed in QEMU tree:
|
||||
|
||||
- Change of app name for sasl_server_init in VNC code from qemu to qemu-kvm
|
||||
- As we use qemu-kvm as name in all places, this is updated to be consistent
|
||||
- Man page renamed from qemu to qemu-kvm
|
||||
- man page is installed using make install so we have to fix it in qemu tree
|
||||
- Change of app name for sasl_server_init in VNC code from qemu to qemu-kvm
|
||||
- As we use qemu-kvm as name in all places, this is updated to be consistent
|
||||
- Man page renamed from qemu to qemu-kvm
|
||||
- man page is installed using make install so we have to fix it in qemu tree
|
||||
|
||||
We disable make check due to issues with some of the tests.
|
||||
This rebase includes changes up to qemu-kvm-6.1.0-5.el9
|
||||
|
||||
This rebase is based on qemu-kvm-6.1.0-8.el9
|
||||
Rebase notes (3.1.0):
|
||||
- added new configure options
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
--
|
||||
Rebase changes (6.1.0):
|
||||
- Move build to .distro
|
||||
- Move changes for support file to related commit
|
||||
- Added dependency for python3-sphinx-rtd_theme
|
||||
- Removed --disable-sheepdog configure option
|
||||
- Added new hw-display modules
|
||||
- SASL initialization moved to ui/vnc-auth-sasl.c
|
||||
- Add accel-qtest-<arch> and accel-tcg-x86_64 libraries
|
||||
- Added hw-usb-host module
|
||||
- Disable new configure options (bpf, nvmm, slirp-smbd)
|
||||
- Use -pie for ksmctl build (annocheck complain fix)
|
||||
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)
|
||||
|
||||
Rebase changes (6.2.0):
|
||||
Rebase notes (4.1.0):
|
||||
- Remove edk2 files generated by build
|
||||
- Switch to rhel-8.1-candidate build target
|
||||
- Remove specs documentation
|
||||
- Switched from libssh2 to libssh
|
||||
- Add rc0 tarball usage hacks
|
||||
- Added BuildRequires for wget, rpm-build and python3-sphinx
|
||||
- Removed new unpacked files
|
||||
- Update configure line to use new options
|
||||
|
||||
Rebase notes (4.2.0):
|
||||
- Disable iotest run during make check
|
||||
- README renamed to README.rst (upstream)
|
||||
- Removed ui-spice-app.so
|
||||
- Added relevant changes from "505f7f4 redhat: Adding slirp to the exploded tree"
|
||||
- Removed qemu-ga.8 install from spec file - installed by make
|
||||
- Removed spapr-rtas.bin (upstream)
|
||||
- Require newer SLOF (20191022)
|
||||
|
||||
Rebase notes (5.1.0):
|
||||
- Use python3 for virtio_seg_max_adjust.py test
|
||||
- Removed qemu-trace-stap shebang from spec file
|
||||
- Added virtiofsd.1 (upstream)
|
||||
- Use out-of-tree build
|
||||
- New documentation structure (upstream)
|
||||
- Update local build
|
||||
- Removing installed qemu-storage-daemon (added upstream)
|
||||
- Removing opensbi-riscv32-sifive_u-fw_jump.bin (added upstream)
|
||||
- Disable iotests (moved from Enable make check commit)
|
||||
- Added missing configure options
|
||||
- Reorder configure options
|
||||
- qemu-pr-helper moved to /usr/libexec/ (upstream)
|
||||
- Added submodules for usb-redir, smartcard-reader and qxl display (upstream)
|
||||
- Added setting rc version in Makefile for build
|
||||
- removed --disable-vxhs configure option (removed upstream)
|
||||
- bumped required libusbx-devel version to 1.0.23
|
||||
- bumped libfdt version to 1.6.0
|
||||
|
||||
Rebase notes (5.2.0 rc0):
|
||||
- Move libfdt dependency to qemu-kvm-core
|
||||
- Move manpage rename from Makefile to spec file
|
||||
- rename with-confsuffix configure option to with-suffix (upstream)
|
||||
- Bump libusbx Requires version to 1.0.234
|
||||
- Manual copy of keymaps in spec file (BZ 1875217)
|
||||
- Removed /usr/share/qemu-kvm/npcm7xx_bootrom.bin, considering it
|
||||
unpackaged for now.
|
||||
- Removed /usr/share/qemu-kvm/qboot.rom, considering unpackaged.
|
||||
- Added build dependency for meson and ninja-build
|
||||
- hw/s390/s390-pci-vfio.c hack - set NULL for g_autofree variables
|
||||
- Removed Chanelog (upstream)
|
||||
- Fix in directory used for docs (upstream add %name so we do not pass it in configure)
|
||||
- Package various .so as part of qemu-kvm-core package.
|
||||
|
||||
Rebase notes (5.2.0 rc2):
|
||||
- Added fix for dtrace build on RHEL 8.4.0
|
||||
|
||||
Rebase notes (5.2.0 rc3):
|
||||
- Added man page for qemu-pr-helper
|
||||
- Added new configure options
|
||||
- Update qemu-kiwi patches to v4
|
||||
|
||||
Rebase notes (6.0.0):
|
||||
- update tracetool usage in spec file
|
||||
- remove qemu-storage-daemon-qmp-ref man page
|
||||
- remove qemu-storage-daemon man page
|
||||
- Added devel documentation
|
||||
- do not package virtfs-proxy-helper files
|
||||
- Use --with-git-submodules instead of --(enable|disable)-git-update
|
||||
- Minor build fixes for sending upstream
|
||||
- g_autofree initialization fixed upstream
|
||||
- Updated rc information usage
|
||||
- do not package package hw-s390x-virtio-gpu-ccw.so
|
||||
- Disable new switch options
|
||||
|
||||
Rebase notes (6.1.0):
|
||||
- Fix warning issue in block.c
|
||||
- Download tarball from dist-git cache
|
||||
- Removed sheepdog driver
|
||||
- Added new display modules:
|
||||
- hw-display-virtio-gpu-gl.so
|
||||
- hw-display-virtio-gpu-pci-gl.so
|
||||
- hw-display-virtio-vga-gl.so
|
||||
- sasl fix moved from ui/vnc.c to ui/vnc-auth-sasl.c
|
||||
- Added accel-qtest-%{kvm_target} and accel-tcg-%{kvm_target}
|
||||
- Added about docs
|
||||
- Use -q option for setup
|
||||
- Added hw-usb-host.so
|
||||
- Disable new options (bpf, nvmm, slirp-smbd)
|
||||
|
||||
Rebase notes (6.2.0):
|
||||
- Using internal meson
|
||||
- removed --disable-jemalloc and --disable-tcmalloc configure options
|
||||
- added audio-oss.so
|
||||
- added fdt requirement for x86_64
|
||||
- tests/acceptance renamed to tests/avocado
|
||||
- added multiboot_dma.bin
|
||||
- Add -Wno-string-plus-int to extra flags
|
||||
- Removed conflict relics
|
||||
- Updated configure options
|
||||
|
||||
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)
|
||||
|
||||
Merged patches (4.1.0):
|
||||
- ebb6e97 redhat: Fix LOCALVERSION creation
|
||||
- b0ab0cc redhat: enable tpmdev passthrough (not disabling tests)
|
||||
- 7cb3c4a Enable libpmem to support nvdimm
|
||||
- 8943607 qemu-kvm.spec: bump libseccomp >= 2.4.0
|
||||
- 27b7c44 rh: set CONFIG_BOCHS_DISPLAY=y for x86 (partial)
|
||||
- e1fe9fe x86_64-rh-devices: enable TPM emulation (partial)
|
||||
|
||||
Merged patches (4.2.0):
|
||||
- 69e1fb2 enable virgla
|
||||
- d4f6115 enable virgl, for real this time ...
|
||||
|
||||
Merged patches (5.1.0):
|
||||
- 5edf6bd Add support for rh-brew-module
|
||||
- f77d52d redhat: ship virtiofsd vhost-user device backend
|
||||
- 63f12d4 redhat: Always use module build target for rh-brew (modified)
|
||||
- 9b1e140 redhat: updating the modular target
|
||||
- 44b8bd0 spec: Fix python shenigans for tests
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- 9238ce7 Add support for simpletrace
|
||||
- 5797cff Remove explicit glusterfs-api dependency
|
||||
- fd62478 disable virgl
|
||||
- 0205018 redhat: link /etc/qemu-ga/fsfreeze-hook to /etc/qemu-kvm/
|
||||
- 3645097 redhat: Make all generated so files executable (not only block-*)
|
||||
|
||||
Merged patches (5.2.0 rc2):
|
||||
- pjw 99657 redhat: introduces disable_everything macro into the configure call
|
||||
- pjw 99659 redhat: scripts/extract_build_cmd.py - Avoid listing empty lines
|
||||
- pjw 99658 redhat: Fixing rh-local build
|
||||
- pjw 99660 redhat: Add qemu-kiwi subpackage
|
||||
- d2e59ce redhat: add (un/pre)install systemd hooks for qemu-ga
|
||||
|
||||
Merged patches (5.2.0 rc3):
|
||||
- pjw 99887 - redhat: allow Makefile rh-prep builddep to fail
|
||||
- pjw 99885 - redhat: adding rh-rpm target
|
||||
|
||||
Merged patches (6.0.0):
|
||||
- 605758c902 Limit build on Power to qemu-img and qemu-ga only
|
||||
- 5ab9954a3b spec: find system python via meson
|
||||
- cd0f7db11f build-system: use b_staticpic=false
|
||||
- 80d2dec42c udev-kvm-check: remove the "exceeded subscription limit" message
|
||||
- 38959d51c0 redhat: Allow make to inherit params from parent make for rh-local
|
||||
- 1e0cfe458f redhat: moving all documentation files to qemu-kvm-docs
|
||||
- d7a594d02b redhat: makes qemu respect system's crypto profile
|
||||
- e2bbf1572b spec: Package qemu-storage-daemon
|
||||
- 92f10993ba spec: ui-spice sub-package
|
||||
- 8931e46069 spec: ui-opengl sub-package
|
||||
|
||||
Merged patches (6.1.0):
|
||||
- f04f91751f Use cached tarballs
|
||||
- 6581165c65 Remove message with running VM count
|
||||
- 03c3cac9fc spec-file: build qemu-kvm without SPICE and QXL
|
||||
- e0ae6c1f6c spec-file: Obsolete qemu-kvm-ui-spice
|
||||
- 9d2e9f9ecf spec: Do not build qemu-kvm-block-gluster
|
||||
- cf470b4234 spec: Do not link pcnet and ne2k_pci roms
|
||||
- e981284a6b redhat: Install the s390-netboot.img that we've built
|
||||
- 24ef557f33 spec: Remove usage of Group: tag
|
||||
- c40d69b4f4 spec: Drop %defattr usage
|
||||
- f8e98798ce spec: Clean up BuildRequires
|
||||
- 47246b43ee spec: Remove iasl BuildRequires
|
||||
- 170dc1cbe0 spec: Remove redundant 0 in conditionals
|
||||
- 8718f6fa11 spec: Add more have_XXX conditionals
|
||||
- a001269ce9 spec: Remove binutils versioned Requires
|
||||
- 34545ee641 spec: Remove diffutils BuildRequires
|
||||
- c2c82beac9 spec: Remove redundant Requires:
|
||||
- 9314c231f4 spec: Add XXX_version macros
|
||||
- c43db0bf0f spec: Add have_block_rbd
|
||||
- 3ecb0c0319 qga: drop StandardError=syslog
|
||||
- 018049dc80 Remove iscsi support
|
||||
- a2edf18777 redhat: Replace the kvm-setup.service with a /etc/modules-load.d config file
|
||||
- 387b5fbcfe redhat: Move qemu-kvm-docs dependency to qemu-kvm
|
||||
- 4ead693178 redhat: introducting qemu-kvm-hw-usbredir
|
||||
- 4dc6fc3035 redhat: use the standard vhost-user JSON path
|
||||
- 84757178b4 Fix local build
|
||||
- 8c394227dd spec: Restrict block drivers in tools
|
||||
- b6aa7c1fae Move tools to separate package
|
||||
- eafd82e509 Split qemu-pr-helper to separate package
|
||||
- 2c0182e2aa spec: RPM_BUILD_ROOT -> %{buildroot}
|
||||
- 91bd55ca13 spec: More use of %{name} instead of 'qemu-kvm'
|
||||
- 50ba299c61 spec: Use qemu-pr-helper.service from qemu.git (partial)
|
||||
- ee08d4e0a3 spec: Use %{_sourcedir} for referencing sources
|
||||
- 039e7f7d02 spec: Add tools_only
|
||||
- 884ba71617 spec: %build: Add run_configure helper
|
||||
- 8ebd864d65 spec: %build: Disable more bits with %{disable_everything} (partial)
|
||||
- f23fdb53f5 spec: %build: Add macros for some 'configure' parameters
|
||||
- fe951a8bd8 spec: %files: Move qemu-guest-agent and qemu-img earlier
|
||||
- 353b632e37 spec: %install: Remove redundant bits
|
||||
- 9d2015b752 spec: %install: Add %{modprobe_kvm_conf} macro
|
||||
- 6d05134e8c spec: %install: Remove qemu-guest-agent /etc/qemu-kvm usage
|
||||
- 985b226467 spec: %install: clean up qemu-ga section
|
||||
- dfaf9c600d spec: %install: Use a single %{tools_only} section
|
||||
- f6978ddb46 spec: Make tools_only not cross spec sections
|
||||
- 071c211098 spec: %install: Limit time spent in %{qemu_kvm_build}
|
||||
- 1b65c674be spec: misc syntactic merges with Fedora
|
||||
- 4da16294cf spec: Use Fedora's pattern for specifying rc version
|
||||
- d7ee259a79 spec: %files: don't use fine grained -docs file list
|
||||
- 64cad0c60f spec: %files: Add licenses to qemu-common too
|
||||
- c3de4f080a spec: %install: Drop python3 shebang fixup
|
||||
- 46fc216115 Update local build to work with spec file improvements
|
||||
- bab9531548 spec: Remove buildldflags
|
||||
- c8360ab6a9 spec: Use %make_build macro
|
||||
- f6966c66e9 spec: Drop make install sharedir and datadir usage
|
||||
- 86982421bc spec: use %make_install macro
|
||||
- 191c405d22 spec: parallelize `make check`
|
||||
- 251a1fb958 spec: Drop explicit --build-id
|
||||
- 44c7dda6c3 spec: use %{build_ldflags}
|
||||
- 0009a34354 Move virtiofsd to separate package
|
||||
- 34d1b200b3 Utilize --firmware configure option
|
||||
- 2800e1dd03 spec: Switch toolchain to Clang/LLVM (except process-patches.sh)
|
||||
- e8a70f500f spec: Use safe-stack for x86_64
|
||||
- e29445d50d spec: Reenable write support for VMDK etc. in tools
|
||||
- a4fe2a3e16 redhat: Disable LTO on non-x86 architectures
|
||||
- 7bb57541b3 redhat: Install the s390-netboot.img that we've built
|
||||
- b4a8531f41 redhat: Fix "unversioned Obsoletes" warning
|
||||
- 141a1693c7 redhat: Move qemu-kvm-docs dependency to qemu-kvm
|
||||
- d75f59c6f9 redhat: introducting qemu-kvm-hw-usbredir
|
||||
- a934d8bf44 redhat: use the standard vhost-user JSON path
|
||||
|
||||
Merged patches (6.2.0):
|
||||
- 333452440b remove sgabios dependency
|
||||
- 7d3633f184 enable pulseaudio
|
||||
- bd898709b0 spec: disable use of gcrypt for crypto backends in favour of gnutls
|
||||
- e4f0c6dee6 spec: Remove block-curl and block-ssh dependency
|
||||
- 4dc13bfe63 spec: Build the VDI block driver
|
||||
- d2f2ff3c74 spec: Explicitly include compress filter
|
||||
- a7d047f9c2 Move ksmtuned files to separate package
|
||||
|
||||
With rebase new configure options are introducesed. We use two steps
|
||||
configuration - first we disable all options and then enable supported
|
||||
options.
|
||||
|
||||
With 6.2.0, following changes are done:
|
||||
- disabled all audiodev and enable only pa
|
||||
- not use audio-drv-list anymore
|
||||
- disabling oss driver removes oss module (added during rebase to 6.2.0)
|
||||
- disable gettext
|
||||
- disable l2tpv3
|
||||
- enable selinux
|
||||
- enable spice-protocol
|
||||
- added needed BuildRequire
|
||||
- specify used capstone version
|
||||
- specify used fdt version
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
- 4f3f04bbb6 spec: Remove qemu-kiwi build
|
||||
---
|
||||
.distro/85-kvm.preset | 5 -
|
||||
.distro/Makefile | 100 +
|
||||
.distro/Makefile.common | 38 +
|
||||
.distro/README.tests | 39 +
|
||||
.distro/ksm.service | 13 -
|
||||
.distro/ksm.sysconfig | 4 -
|
||||
.distro/ksmctl.c | 77 -
|
||||
.distro/ksmtuned | 139 -
|
||||
.distro/ksmtuned.conf | 21 -
|
||||
.distro/ksmtuned.service | 12 -
|
||||
.distro/kvm-setup | 49 -
|
||||
.distro/kvm-setup.service | 14 -
|
||||
.distro/modules-load.conf | 4 +
|
||||
.distro/qemu-guest-agent.service | 1 -
|
||||
.distro/qemu-kvm.spec.template | 3817 +++++++++++++++++++++++
|
||||
.distro/scripts/extract_build_cmd.py | 12 +
|
||||
.gitignore | 1 +
|
||||
README.systemtap | 43 +
|
||||
meson.build | 4 +-
|
||||
scripts/qemu-guest-agent/fsfreeze-hook | 2 +-
|
||||
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +
|
||||
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
|
||||
tests/check-block.sh | 2 +
|
||||
ui/vnc-auth-sasl.c | 2 +-
|
||||
24 files changed, 4066 insertions(+), 338 deletions(-)
|
||||
delete mode 100644 .distro/85-kvm.preset
|
||||
create mode 100644 .distro/Makefile
|
||||
create mode 100644 .distro/Makefile.common
|
||||
create mode 100644 .distro/README.tests
|
||||
delete mode 100644 .distro/ksm.service
|
||||
delete mode 100644 .distro/ksm.sysconfig
|
||||
delete mode 100644 .distro/ksmctl.c
|
||||
delete mode 100644 .distro/ksmtuned
|
||||
delete mode 100644 .distro/ksmtuned.conf
|
||||
delete mode 100644 .distro/ksmtuned.service
|
||||
delete mode 100644 .distro/kvm-setup
|
||||
delete mode 100644 .distro/kvm-setup.service
|
||||
create mode 100644 .distro/modules-load.conf
|
||||
create mode 100644 .distro/qemu-kvm.spec.template
|
||||
.gitignore | 1 +
|
||||
.gitlab-ci.yml | 24 -
|
||||
.gitlab/issue_templates/bug.md | 64 -
|
||||
.gitlab/issue_templates/feature_request.md | 32 -
|
||||
README.systemtap | 43 +
|
||||
meson.build | 4 +-
|
||||
redhat/Makefile | 90 +
|
||||
redhat/Makefile.common | 48 +
|
||||
redhat/README.tests | 39 +
|
||||
redhat/qemu-kvm.spec.template | 3896 ++++++++++++++++++++
|
||||
redhat/scripts/extract_build_cmd.py | 5 +-
|
||||
redhat/scripts/process-patches.sh | 20 +-
|
||||
redhat/scripts/tarball_checksum.sh | 2 +-
|
||||
redhat/udev-kvm-check.c | 19 +-
|
||||
scripts/qemu-guest-agent/fsfreeze-hook | 2 +-
|
||||
scripts/systemtap/conf.d/qemu_kvm.conf | 4 +
|
||||
scripts/systemtap/script.d/qemu_kvm.stp | 1 +
|
||||
tests/check-block.sh | 2 +
|
||||
ui/vnc-auth-sasl.c | 2 +-
|
||||
19 files changed, 4142 insertions(+), 156 deletions(-)
|
||||
delete mode 100644 .gitlab-ci.yml
|
||||
delete mode 100644 .gitlab/issue_templates/bug.md
|
||||
delete mode 100644 .gitlab/issue_templates/feature_request.md
|
||||
create mode 100644 README.systemtap
|
||||
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
|
||||
create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf
|
||||
create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp
|
||||
|
||||
|
|
|
@ -1,41 +1,135 @@
|
|||
From af4c83ed637bfda003ae86133413d53cefda3654 Mon Sep 17 00:00:00 2001
|
||||
From 3d5a82d172345d17e300672909835262ff9dc917 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Thu, 15 Jul 2021 03:22:36 -0400
|
||||
Date: Wed, 2 Sep 2020 09:11:07 +0200
|
||||
Subject: Enable/disable devices for RHEL
|
||||
|
||||
This commit adds all changes related to changes in supported devices.
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
--
|
||||
Rebase notes (6.1.0):
|
||||
- Added CONFIG_TPM (except s390x)
|
||||
- default-configs moved to configs
|
||||
- Use --with-device-<ARCH> configure option to use rhel configs
|
||||
|
||||
Rebase notes (6.2.0 RC0):
|
||||
- Add CONFIG_ISA_FDC
|
||||
Rebase notes (qemu 3.1.0)
|
||||
- spapr_rng disabled in default_config
|
||||
- new hyperv.mak in default configs
|
||||
- Move changes from x86_64-softmmu.mak to i386-softmmu.mak
|
||||
- Added CONFIG_VIRTIO_MMIO to aarch64-softmmu.mak
|
||||
- Removed config_vga_isa.c changes as no longer needed
|
||||
- Removed new devices
|
||||
|
||||
Rebase notes (6.2.0 RC3):
|
||||
Rebase notes (4.0.0):
|
||||
- Added CONFIG_PCI_EXPRESS_GENERIC_BRIDGE for aarch64-softmmu.mak
|
||||
- Added CONFIG_ARM_VIRT for aarch64-softmmu.mak
|
||||
- Switch to KConfig (upstream)
|
||||
- Using device whitelist + without-defualt-devices option
|
||||
|
||||
Rebase notes (4.1.0):
|
||||
- Added CONFIG_USB_OHCI_PCI for ppc64
|
||||
- Added CONFIG_XIVE_KVM for ppc64
|
||||
- Added CONFIG_ACPI_PCI for x86_64
|
||||
- Added CONFIG_SEMIHOSTING for aarch64
|
||||
- Cleanup aarch64 devices
|
||||
- Do not build a15mpcore.c
|
||||
- Removed ide-isa.c stub file
|
||||
- Use CONFIG_USB_EHCI_PCI on x86_64 (new upstream)
|
||||
|
||||
Rebase notes (4.2.0-rc0):
|
||||
- Use conditional build for isa-superio.c (upstream change)
|
||||
- Rename PCI_PIIX to PCI_I440FX (upstream change)
|
||||
|
||||
Rebase notes (4.2.0-rc3):
|
||||
- Disabled ccid-card-emulated (patch 92566)
|
||||
- Disabled vfio-pci-igd-lpc-bridge (patch 92565)
|
||||
|
||||
Rebase notes (5.1.0):
|
||||
- added CONFIG_PCI_EXPRESS on ppc64 (due to upstream dependency)
|
||||
- Added CONFIG_NVDIMM
|
||||
- updated cortex-15 disabling to upstream code
|
||||
- Add CONFIG_ACPI_APEI for aarch64
|
||||
- removed obsolete hw/bt/Makefile.objs chunk
|
||||
- removed unnecessary changes in target/i386/cpu.c
|
||||
|
||||
Rebase notes (5.2.0 rc0):
|
||||
- Added CONFIG_USB_XHCI_PCI on aarch64 ppc64 and x86_64
|
||||
- remove vl.c hack for no hpet
|
||||
- Enable CONFIG_PTIMER for aarch64
|
||||
- Do not package hw-display-virtio-gpu.so on s390x
|
||||
|
||||
Rebase notes (5.2.0 rc1):
|
||||
- Added CONFIG_ARM_GIC for aarch64 (required for build)
|
||||
|
||||
Rebase notes (weekly-210113):
|
||||
- Removed XICS_KVM, XICS_SPAPR, XIVE_KVM and XIVE_SPAPR config (removed upstream)
|
||||
|
||||
Rebase notes (weekly-210120):
|
||||
- Add CONFIG_ARM_COMPATIBLE_SEMIHOSTING option
|
||||
|
||||
Rebase notes (weekly-210203):
|
||||
- Rename CONFIG_PVPANIC to CONFIG_PVPANIC_ISA
|
||||
|
||||
Rebase notes (weekly-210317):
|
||||
- Add new USB_STORAGE_CORE and USB_STORAGE_CLASSIC config for ppc64 and x86_64
|
||||
- Update disabling TCG cpus for AArch64
|
||||
|
||||
Rebase notes (weekly-210519):
|
||||
- Do not use CONFIG_SPICE and CONFIG_OPENGL in default configs
|
||||
|
||||
Rebase notes (weekly-210623):
|
||||
- Add CONFIG_TPM for archs with used TPM functionality
|
||||
|
||||
Rebase notes (weekly-210714):
|
||||
- default_configs moved to configs
|
||||
|
||||
Rebase notes (6.1.0 rc2):
|
||||
- Use --with-device-ARCH configure option to use redhat config files
|
||||
|
||||
Rebase notes (6.2.0 rc3):
|
||||
- Do not remove -no-hpet documentation
|
||||
Merged patches (qemu 3.1.0):
|
||||
- d51e082 Re-enable CONFIG_HYPERV_TESTDEV
|
||||
- 4b889f3 Declare cirrus-vga as deprecated
|
||||
- b579d32 Do not build bluetooth support
|
||||
- 3eef52a Disable CONFIG_IPMI and CONFIG_I2C for ppc64
|
||||
- 9caf292 Disable CONFIG_CAN_BUS and CONFIG_CAN_SJA1000
|
||||
|
||||
Merged patches (6.1.0):
|
||||
- c51bf45304 Remove SPICE and QXL from x86_64-rh-devices.mak
|
||||
- 02fc745601 aarch64-rh-devices: add CONFIG_PVPANIC_PCI
|
||||
- f2fe835153 aarch64-rh-devices: add CONFIG_PXB
|
||||
- b5431733ad disable CONFIG_USB_STORAGE_BOT
|
||||
- 478ba0cdf6 Disable TPM passthrough
|
||||
- 2504d68a7c aarch64: Add USB storage devices
|
||||
- 51c2a3253c disable ac97 audio
|
||||
Merged patches (4.1.0):
|
||||
- 20a51f6 fdc: Revert downstream disablement of device "floppy"
|
||||
- f869cc0 fdc: Restrict floppy controllers to RHEL-7 machine types
|
||||
- 5909721 aarch64: Compile out IOH3420
|
||||
- 27b7c44 rh: set CONFIG_BOCHS_DISPLAY=y for x86 (partial)
|
||||
- 495a27d x86_64-rh-devices: add missing TPM passthrough
|
||||
- e1fe9fe x86_64-rh-devices: enable TPM emulation (partial)
|
||||
|
||||
Merged patches (6.2.0 RC0):
|
||||
- 9f2f9fa2ba disable sga device
|
||||
Merged patches (4.2.0):
|
||||
- f7587dd RHEL: disable hostmem-memfd
|
||||
|
||||
Merged patches (5.1.0):
|
||||
- 4543a3c i386: Remove cpu64-rhel6 CPU model
|
||||
- 96533 aarch64: Remove tcg cpu types (pjw commit)
|
||||
- 559d589 Revert "RHEL: disable hostmem-memfd"
|
||||
- 441128e enable ramfb
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- f70eb50 RHEL-only: Enable vTPM for POWER in downstream configs
|
||||
- 69d8ae7 redhat: fix 5.0 rebase missing ISA TPM TIS
|
||||
- 8310f89 RHEL-only: Enable vTPM for ARM in downstream configs
|
||||
- 4a8ccfd Disable TPM passthrough backend on ARM
|
||||
|
||||
Merged patches (6.0.0):
|
||||
- ff817df9e3 config: enable VFIO_CCW
|
||||
- 70d3924521 redhat: Add some devices for exporting upstream machine types
|
||||
- without machine type chunks
|
||||
- efac91b2b4 default-configs: Enable vhost-user-blk
|
||||
|
||||
Merged patches (weekly-210630):
|
||||
- 59a178acff disable CONFIG_USB_STORAGE_BOT
|
||||
|
||||
Merged patches (6.1.0 rc2):
|
||||
- 86f0025f16 aarch64: Add USB storage devices
|
||||
---
|
||||
.distro/qemu-kvm.spec.template | 9 +-
|
||||
.../aarch64-softmmu/aarch64-rh-devices.mak | 33 ++++++
|
||||
.../ppc64-softmmu/ppc64-rh-devices.mak | 35 ++++++
|
||||
.../aarch64-softmmu/aarch64-rh-devices.mak | 31 ++++++
|
||||
.../ppc64-softmmu/ppc64-rh-devices.mak | 36 ++++++
|
||||
configs/devices/rh-virtio.mak | 10 ++
|
||||
.../s390x-softmmu/s390x-rh-devices.mak | 15 +++
|
||||
.../x86_64-softmmu/x86_64-rh-devices.mak | 102 ++++++++++++++++++
|
||||
.../s390x-softmmu/s390x-rh-devices.mak | 16 +++
|
||||
.../x86_64-softmmu/x86_64-rh-devices.mak | 104 ++++++++++++++++++
|
||||
.../x86_64-upstream-devices.mak | 4 +
|
||||
hw/acpi/ich9.c | 4 +-
|
||||
hw/arm/meson.build | 2 +-
|
||||
|
@ -49,11 +143,12 @@ Merged patches (6.2.0 RC0):
|
|||
hw/ppc/spapr_cpu_core.c | 2 +
|
||||
hw/timer/hpet.c | 8 ++
|
||||
hw/usb/meson.build | 2 +-
|
||||
redhat/qemu-kvm.spec.template | 9 +-
|
||||
target/arm/cpu_tcg.c | 10 ++
|
||||
target/ppc/cpu-models.c | 10 ++
|
||||
target/s390x/cpu_models_sysemu.c | 3 +
|
||||
target/s390x/kvm/kvm.c | 8 ++
|
||||
23 files changed, 283 insertions(+), 10 deletions(-)
|
||||
23 files changed, 286 insertions(+), 9 deletions(-)
|
||||
create mode 100644 configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
|
||||
create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
|
||||
create mode 100644 configs/devices/rh-virtio.mak
|
||||
|
@ -63,10 +158,10 @@ Merged patches (6.2.0 RC0):
|
|||
|
||||
diff --git a/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
|
||||
new file mode 100644
|
||||
index 0000000000..cd9c7c5127
|
||||
index 0000000000..0d4f9e6e4b
|
||||
--- /dev/null
|
||||
+++ b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak
|
||||
@@ -0,0 +1,33 @@
|
||||
@@ -0,0 +1,31 @@
|
||||
+include ../rh-virtio.mak
|
||||
+
|
||||
+CONFIG_ARM_GIC_KVM=y
|
||||
|
@ -98,14 +193,12 @@ index 0000000000..cd9c7c5127
|
|||
+CONFIG_TPM_TIS_SYSBUS=y
|
||||
+CONFIG_PTIMER=y
|
||||
+CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
|
||||
+CONFIG_PVPANIC_PCI=y
|
||||
+CONFIG_PXB=y
|
||||
diff --git a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
|
||||
new file mode 100644
|
||||
index 0000000000..6a3e3f0227
|
||||
index 0000000000..73e3ee0293
|
||||
--- /dev/null
|
||||
+++ b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak
|
||||
@@ -0,0 +1,35 @@
|
||||
@@ -0,0 +1,36 @@
|
||||
+include ../rh-virtio.mak
|
||||
+
|
||||
+CONFIG_DIMM=y
|
||||
|
@ -141,6 +234,7 @@ index 0000000000..6a3e3f0227
|
|||
+CONFIG_TPM=y
|
||||
+CONFIG_TPM_SPAPR=y
|
||||
+CONFIG_TPM_EMULATOR=y
|
||||
+CONFIG_TPM_PASSTHROUGH=y
|
||||
diff --git a/configs/devices/rh-virtio.mak b/configs/devices/rh-virtio.mak
|
||||
new file mode 100644
|
||||
index 0000000000..94ede1b5f6
|
||||
|
@ -159,10 +253,10 @@ index 0000000000..94ede1b5f6
|
|||
+CONFIG_VIRTIO_SERIAL=y
|
||||
diff --git a/configs/devices/s390x-softmmu/s390x-rh-devices.mak b/configs/devices/s390x-softmmu/s390x-rh-devices.mak
|
||||
new file mode 100644
|
||||
index 0000000000..d3b38312e1
|
||||
index 0000000000..165c082e87
|
||||
--- /dev/null
|
||||
+++ b/configs/devices/s390x-softmmu/s390x-rh-devices.mak
|
||||
@@ -0,0 +1,15 @@
|
||||
@@ -0,0 +1,16 @@
|
||||
+include ../rh-virtio.mak
|
||||
+
|
||||
+CONFIG_PCI=y
|
||||
|
@ -171,6 +265,7 @@ index 0000000000..d3b38312e1
|
|||
+CONFIG_S390_FLIC_KVM=y
|
||||
+CONFIG_SCLPCONSOLE=y
|
||||
+CONFIG_SCSI=y
|
||||
+CONFIG_TERMINAL3270=y
|
||||
+CONFIG_VFIO=y
|
||||
+CONFIG_VFIO_AP=y
|
||||
+CONFIG_VFIO_CCW=y
|
||||
|
@ -180,13 +275,14 @@ index 0000000000..d3b38312e1
|
|||
+CONFIG_WDT_DIAG288=y
|
||||
diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
new file mode 100644
|
||||
index 0000000000..1f7a9ab024
|
||||
index 0000000000..ddf036f042
|
||||
--- /dev/null
|
||||
+++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
@@ -0,0 +1,102 @@
|
||||
@@ -0,0 +1,104 @@
|
||||
+include ../rh-virtio.mak
|
||||
+include x86_64-upstream-devices.mak
|
||||
+
|
||||
+CONFIG_AC97=y
|
||||
+CONFIG_ACPI=y
|
||||
+CONFIG_ACPI_PCI=y
|
||||
+CONFIG_ACPI_CPU_HOTPLUG=y
|
||||
|
@ -206,7 +302,6 @@ index 0000000000..1f7a9ab024
|
|||
+CONFIG_EDU=y
|
||||
+CONFIG_FDC=y
|
||||
+CONFIG_FDC_SYSBUS=y
|
||||
+CONFIG_FDC_ISA=y
|
||||
+CONFIG_FW_CFG_DMA=y
|
||||
+CONFIG_HDA=y
|
||||
+CONFIG_HYPERV=y
|
||||
|
@ -230,7 +325,6 @@ index 0000000000..1f7a9ab024
|
|||
+CONFIG_MC146818RTC=y
|
||||
+CONFIG_MEM_DEVICE=y
|
||||
+CONFIG_NVDIMM=y
|
||||
+CONFIG_OPENGL=y
|
||||
+CONFIG_PAM=y
|
||||
+CONFIG_PC=y
|
||||
+CONFIG_PCI=y
|
||||
|
@ -248,12 +342,14 @@ index 0000000000..1f7a9ab024
|
|||
+CONFIG_PVPANIC_ISA=y
|
||||
+CONFIG_PXB=y
|
||||
+CONFIG_Q35=y
|
||||
+CONFIG_QXL=y
|
||||
+CONFIG_RTL8139_PCI=y
|
||||
+CONFIG_SCSI=y
|
||||
+CONFIG_SERIAL=y
|
||||
+CONFIG_SERIAL_ISA=y
|
||||
+CONFIG_SERIAL_PCI=y
|
||||
+CONFIG_SEV=y
|
||||
+CONFIG_SGA=y
|
||||
+CONFIG_SMBIOS=y
|
||||
+CONFIG_SMBUS_EEPROM=y
|
||||
+CONFIG_TEST_DEVICES=y
|
||||
|
@ -286,6 +382,7 @@ index 0000000000..1f7a9ab024
|
|||
+CONFIG_TPM_CRB=y
|
||||
+CONFIG_TPM_TIS_ISA=y
|
||||
+CONFIG_TPM_EMULATOR=y
|
||||
+CONFIG_TPM_PASSTHROUGH=y
|
||||
diff --git a/configs/devices/x86_64-softmmu/x86_64-upstream-devices.mak b/configs/devices/x86_64-softmmu/x86_64-upstream-devices.mak
|
||||
new file mode 100644
|
||||
index 0000000000..2cd20f54d2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From ef9b78c3f2810541eac453a3f8a8753763b1378d Mon Sep 17 00:00:00 2001
|
||||
From adca046d9db670637b9bf2b24f7a4349a9fe2628 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Fri, 11 Jan 2019 09:54:45 +0100
|
||||
Subject: Machine type related general changes
|
||||
|
@ -8,46 +8,119 @@ split to allow easier review. It contains changes not related to any
|
|||
architecture.
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
--
|
||||
Rebase notes (6.2.0 RC0):
|
||||
|
||||
Rebase changes (4.0.0):
|
||||
- Remove e1000 device duplication changes to reflect upstream solution
|
||||
- Rewrite machine compat properties to upstream solution
|
||||
|
||||
Rebase changes (4.1.0):
|
||||
- Removed optional flag for machine compat properties (upstream)
|
||||
- Remove c3e002cb chunk from hw/net/e1000.c
|
||||
- Reorder compat structures
|
||||
- Use one format for compat scructures
|
||||
- Added compat for virtio-balloon-pci.any_layout for rhel71
|
||||
|
||||
Rebase changes (weekly-210303):
|
||||
- Added rhel 8.4.0 compat based on 5.2 compat
|
||||
|
||||
Rebase changes (weekly-211103):
|
||||
- Do not duplicate minimal_version_id for piix4_pm
|
||||
- Remove empty line chunks in serial.c
|
||||
- Remove migration.h include in serial.c
|
||||
|
||||
Rebase notes (6.2.0 RC1):
|
||||
- Update hw_compat_rhel_8_5 (from MR 66)
|
||||
Merged patches (4.0.0):
|
||||
- d4c0957 compat: Generic HW_COMPAT_RHEL7_6
|
||||
- cbac773 virtio: Make disable-legacy/disable-modern compat properties optional
|
||||
|
||||
Merged patches (6.1.0):
|
||||
- f2fb42a3c6 redhat: add missing entries in hw_compat_rhel_8_4
|
||||
- 1949ec258e hw/arm/virt: Disable PL011 clock migration through hw_compat_rhel_8_3
|
||||
- a3995e2eff Remove RHEL 7.0.0 machine type (only generic changes)
|
||||
- ad3190a79b Remove RHEL 7.1.0 machine type (only generic changes)
|
||||
- 84bbe15d4e Remove RHEL 7.2.0 machine type (only generic changes)
|
||||
- 0215eb3356 Remove RHEL 7.3.0 machine types (only generic changes)
|
||||
- af69d1ca6e Remove RHEL 7.4.0 machine types (only generic changes)
|
||||
- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only generic changes)
|
||||
Merged patches (4.1.0):
|
||||
- 479ad30 redhat: fix cut'n'paste garbage in hw_compat comments
|
||||
- f19738e compat: Generic hw_compat_rhel_8_0
|
||||
|
||||
Merged patches (6.2.0 RC0):
|
||||
- d687ac13d2 redhat: Define hw_compat_rhel_8_5
|
||||
Merged patches (4.2.0):
|
||||
- 9f2bfaa machine types: Update hw_compat_rhel_8_0 from hw_compat_4_0
|
||||
- ca4a5e8 virtio: Make disable-legacy/disable-modern compat properties optional
|
||||
- compat: Generic hw_compat_rhel_8_1 (patch 93040/92956)
|
||||
|
||||
Merged patches (5.1.0):
|
||||
- e6c3fbf hw/smbios: set new default SMBIOS fields for Windows driver support (partialy)
|
||||
- 8f9f4d8 compat: disable 'edid' for virtio-gpu-ccw
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- 8348642 redhat: define hw_compat_8_2
|
||||
- 45b8402 redhat: define hw_compat_8_2
|
||||
- 4effa71 redhat: Update hw_compat_8_2
|
||||
- 0e84dff virtio: skip legacy support check on machine types less than 5.1 (partialy)
|
||||
|
||||
Merged patches (6.0.0):
|
||||
- fa0063ba67 redhat: Define hw_compat_8_3
|
||||
- d98e328c8d usb/hcd-xhci-pci: Fixup capabilities ordering (again)
|
||||
- b8a2578117 virtio: move 'use-disabled-flag' property to hw_compat_4_2
|
||||
- f7940b04c8 virtio-pci: compat page aligned ATS
|
||||
|
||||
Merged patches (weekly-210602):
|
||||
- 26f25108c1 redhat: add missing entries in hw_compat_rhel_8_4
|
||||
|
||||
Merged patches (weekly-211006):
|
||||
- 43c4b9bea6 redhat: Define hw_compat_rhel_8_5
|
||||
---
|
||||
hw/acpi/ich9.c | 15 ++
|
||||
hw/acpi/piix4.c | 6 +-
|
||||
hw/arm/virt.c | 2 +-
|
||||
hw/core/machine.c | 180 +++++++++++++++++++++++++++++++++++
|
||||
hw/char/serial.c | 16 +++
|
||||
hw/core/machine.c | 272 +++++++++++++++++++++++++++++++++++
|
||||
hw/display/vga-isa.c | 2 +-
|
||||
hw/i386/pc_piix.c | 2 +
|
||||
hw/i386/pc_q35.c | 2 +
|
||||
hw/net/e1000e.c | 22 +++
|
||||
hw/net/rtl8139.c | 4 +-
|
||||
hw/rtc/mc146818rtc.c | 2 +
|
||||
hw/smbios/smbios.c | 46 ++++++++-
|
||||
hw/rtc/mc146818rtc.c | 6 +
|
||||
hw/smbios/smbios.c | 46 +++++-
|
||||
hw/timer/i8254_common.c | 2 +-
|
||||
hw/usb/hcd-uhci.c | 4 +-
|
||||
hw/usb/hcd-xhci-pci.c | 59 +++++++++---
|
||||
hw/usb/hcd-xhci-pci.c | 59 ++++++--
|
||||
hw/usb/hcd-xhci-pci.h | 1 +
|
||||
include/hw/boards.h | 21 ++++
|
||||
hw/usb/hcd-xhci.c | 20 +++
|
||||
hw/usb/hcd-xhci.h | 2 +
|
||||
include/hw/acpi/ich9.h | 3 +
|
||||
include/hw/boards.h | 36 +++++
|
||||
include/hw/firmware/smbios.h | 5 +-
|
||||
include/hw/i386/pc.h | 3 +
|
||||
16 files changed, 315 insertions(+), 26 deletions(-)
|
||||
include/hw/usb.h | 3 +
|
||||
migration/migration.c | 2 +
|
||||
migration/migration.h | 5 +
|
||||
25 files changed, 514 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
|
||||
index 381ef2ddcf..82bd805b55 100644
|
||||
--- a/hw/acpi/ich9.c
|
||||
+++ b/hw/acpi/ich9.c
|
||||
@@ -433,6 +433,18 @@ static void ich9_pm_set_keep_pci_slot_hpc(Object *obj, bool value, Error **errp)
|
||||
s->pm.keep_pci_slot_hpc = value;
|
||||
}
|
||||
|
||||
+static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
|
||||
+{
|
||||
+ ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
|
||||
+ return s->pm.force_rev1_fadt;
|
||||
+}
|
||||
+
|
||||
+static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
|
||||
+{
|
||||
+ ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
|
||||
+ s->pm.force_rev1_fadt = value;
|
||||
+}
|
||||
+
|
||||
void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
|
||||
{
|
||||
static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
|
||||
@@ -457,6 +469,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
|
||||
object_property_add_bool(obj, "cpu-hotplug-legacy",
|
||||
ich9_pm_get_cpu_hotplug_legacy,
|
||||
ich9_pm_set_cpu_hotplug_legacy);
|
||||
+ object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
|
||||
+ ich9_pm_get_force_rev1_fadt,
|
||||
+ ich9_pm_set_force_rev1_fadt);
|
||||
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED,
|
||||
&pm->disable_s3, OBJ_PROP_FLAG_READWRITE);
|
||||
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
|
||||
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
|
||||
index f0b5fac44a..8d6011c0a3 100644
|
||||
--- a/hw/acpi/piix4.c
|
||||
|
@ -85,16 +158,71 @@ index 30da05dfe0..5de4d9d73b 100644
|
|||
|
||||
smbios_get_tables(MACHINE(vms), NULL, 0,
|
||||
&smbios_tables, &smbios_tables_len,
|
||||
diff --git a/hw/char/serial.c b/hw/char/serial.c
|
||||
index 7061aacbce..fe8d0afbb0 100644
|
||||
--- a/hw/char/serial.c
|
||||
+++ b/hw/char/serial.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "trace.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/qdev-properties-system.h"
|
||||
+#include "migration/migration.h"
|
||||
|
||||
#define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
|
||||
|
||||
@@ -689,6 +690,9 @@ static int serial_post_load(void *opaque, int version_id)
|
||||
static bool serial_thr_ipending_needed(void *opaque)
|
||||
{
|
||||
SerialState *s = opaque;
|
||||
+ if (migrate_pre_2_2) {
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
if (s->ier & UART_IER_THRI) {
|
||||
bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI);
|
||||
@@ -770,6 +774,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {
|
||||
static bool serial_fifo_timeout_timer_needed(void *opaque)
|
||||
{
|
||||
SerialState *s = (SerialState *)opaque;
|
||||
+ if (migrate_pre_2_2) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
return timer_pending(s->fifo_timeout_timer);
|
||||
}
|
||||
|
||||
@@ -787,6 +795,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {
|
||||
static bool serial_timeout_ipending_needed(void *opaque)
|
||||
{
|
||||
SerialState *s = (SerialState *)opaque;
|
||||
+ if (migrate_pre_2_2) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
return s->timeout_ipending != 0;
|
||||
}
|
||||
|
||||
@@ -804,6 +816,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {
|
||||
static bool serial_poll_needed(void *opaque)
|
||||
{
|
||||
SerialState *s = (SerialState *)opaque;
|
||||
+ if (migrate_pre_2_2) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
return s->poll_msl >= 0;
|
||||
}
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 53a99abc56..53a3caf4fb 100644
|
||||
index 53a99abc56..be4f9864cd 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -37,6 +37,186 @@
|
||||
@@ -37,6 +37,278 @@
|
||||
#include "hw/virtio/virtio.h"
|
||||
#include "hw/virtio/virtio-pci.h"
|
||||
|
||||
+/*
|
||||
+ * Mostly the same as hw_compat_6_0 and hw_compat_6_1
|
||||
+ * Mostly the same as hw_compat_6_0
|
||||
+ */
|
||||
+GlobalProperty hw_compat_rhel_8_5[] = {
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_0 */
|
||||
|
@ -107,10 +235,6 @@ index 53a99abc56..53a3caf4fb 100644
|
|||
+ { "e1000", "init-vet", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_0 */
|
||||
+ { "e1000e", "init-vet", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_0 */
|
||||
+ { "vhost-vsock-device", "seqpacket", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_1 */
|
||||
+ { "vhost-user-vsock-device", "seqpacket", "off" },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5);
|
||||
+
|
||||
|
@ -147,8 +271,6 @@ index 53a99abc56..53a3caf4fb 100644
|
|||
+ { "nvme", "use-intel-id", "on"},
|
||||
+ /* hw_compat_rhel_8_3 from hw_compat_5_1 */
|
||||
+ { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */
|
||||
+ /* hw_compat_rhel_8_3 from hw_compat_5_1 */
|
||||
+ { "pl011", "migrate-clk", "off" },
|
||||
+ /* hw_compat_rhel_8_3 bz 1912846 */
|
||||
+ { "pci-xhci", "x-rh-late-msi-cap", "off" },
|
||||
+ /* hw_compat_rhel_8_3 from hw_compat_5_1 */
|
||||
|
@ -272,6 +394,104 @@ index 53a99abc56..53a3caf4fb 100644
|
|||
+ { "qxl-vga", "global-vmstate", "true" },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6);
|
||||
+
|
||||
+/* The same as hw_compat_2_11 + hw_compat_2_10 */
|
||||
+GlobalProperty hw_compat_rhel_7_5[] = {
|
||||
+ /* hw_compat_rhel_7_5 from hw_compat_2_11 */
|
||||
+ { "hpet", "hpet-offset-saved", "false" },
|
||||
+ /* hw_compat_rhel_7_5 from hw_compat_2_11 */
|
||||
+ { "virtio-blk-pci", "vectors", "2" },
|
||||
+ /* hw_compat_rhel_7_5 from hw_compat_2_11 */
|
||||
+ { "vhost-user-blk-pci", "vectors", "2" },
|
||||
+ /* hw_compat_rhel_7_5 from hw_compat_2_11
|
||||
+ bz 1608778 modified for our naming */
|
||||
+ { "e1000-82540em", "migrate_tso_props", "off" },
|
||||
+ /* hw_compat_rhel_7_5 from hw_compat_2_10 */
|
||||
+ { "virtio-mouse-device", "wheel-axis", "false" },
|
||||
+ /* hw_compat_rhel_7_5 from hw_compat_2_10 */
|
||||
+ { "virtio-tablet-device", "wheel-axis", "false" },
|
||||
+ { "cirrus-vga", "vgamem_mb", "16" },
|
||||
+ { "migration", "decompress-error-check", "off" },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5);
|
||||
+
|
||||
+/* 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[] = {
|
||||
+ { "intel-iommu", "pt", "off" },
|
||||
+};
|
||||
+
|
||||
+const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4);
|
||||
+/* 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[] = {
|
||||
+ { "virtio-mmio", "format_transport_address", "off" },
|
||||
+ { "virtio-serial-device", "emergency-write", "off" },
|
||||
+ { "ioapic", "version", "0x11" },
|
||||
+ { "intel-iommu", "x-buggy-eim", "true" },
|
||||
+ { "virtio-pci", "x-ignore-backend-features", "on" },
|
||||
+ { "fw_cfg_mem", "x-file-slots", stringify(0x10) },
|
||||
+ { "fw_cfg_io", "x-file-slots", stringify(0x10) },
|
||||
+ { "pflash_cfi01", "old-multiple-chip-handling", "on" },
|
||||
+ { TYPE_PCI_DEVICE, "x-pcie-extcap-init", "off" },
|
||||
+ { "virtio-pci", "x-pcie-deverr-init", "off" },
|
||||
+ { "virtio-pci", "x-pcie-lnkctl-init", "off" },
|
||||
+ { "virtio-pci", "x-pcie-pm-init", "off" },
|
||||
+ { "virtio-net-device", "x-mtu-bypass-backend", "off" },
|
||||
+ { "e1000e", "__redhat_e1000e_7_3_intr_state", "on" },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_7_3_len = G_N_ELEMENTS(hw_compat_rhel_7_3);
|
||||
+
|
||||
+/* 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[] = {
|
||||
+ { "virtio-blk-device", "scsi", "true" },
|
||||
+ { "e1000-82540em", "extra_mac_registers", "off" },
|
||||
+ { "virtio-pci", "x-disable-pcie", "on" },
|
||||
+ { "virtio-pci", "migrate-extra", "off" },
|
||||
+ { "fw_cfg_mem", "dma_enabled", "off" },
|
||||
+ { "fw_cfg_io", "dma_enabled", "off" },
|
||||
+ { "isa-fdc", "fallback", "144" },
|
||||
+ /* Optional because not all virtio-pci devices support legacy mode */
|
||||
+ { "virtio-pci", "disable-modern", "on", .optional = true },
|
||||
+ { "virtio-pci", "disable-legacy", "off", .optional = true },
|
||||
+ { TYPE_PCI_DEVICE, "x-pcie-lnksta-dllla", "off" },
|
||||
+ { "virtio-pci", "page-per-vq", "on" },
|
||||
+ /* hw_compat_rhel_7_2 - introduced with 2.10.0 */
|
||||
+ { "migration", "send-section-footer", "off" },
|
||||
+ /* hw_compat_rhel_7_2 - introduced with 2.10.0 */
|
||||
+ { "migration", "store-global-state", "off",
|
||||
+ },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_7_2_len = G_N_ELEMENTS(hw_compat_rhel_7_2);
|
||||
+
|
||||
+/* 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[] = {
|
||||
+ { "intel-hda-generic", "old_msi_addr", "on" },
|
||||
+ { "VGA", "qemu-extended-regs", "off" },
|
||||
+ { "secondary-vga", "qemu-extended-regs", "off" },
|
||||
+ { "usb-mouse", "usb_version", stringify(1) },
|
||||
+ { "usb-kbd", "usb_version", stringify(1) },
|
||||
+ { "virtio-pci", "virtio-pci-bus-master-bug-migration", "on" },
|
||||
+ { "virtio-blk-pci", "any_layout", "off" },
|
||||
+ { "virtio-balloon-pci", "any_layout", "off" },
|
||||
+ { "virtio-serial-pci", "any_layout", "off" },
|
||||
+ { "virtio-9p-pci", "any_layout", "off" },
|
||||
+ { "virtio-rng-pci", "any_layout", "off" },
|
||||
+ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */
|
||||
+ { "migration", "send-configuration", "off" },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1);
|
||||
+
|
||||
GlobalProperty hw_compat_6_1[] = {
|
||||
{ "vhost-user-vsock-device", "seqpacket", "off" },
|
||||
|
@ -315,6 +535,81 @@ index e1e100316d..235054a643 100644
|
|||
SMBIOS_ENTRY_POINT_21);
|
||||
}
|
||||
|
||||
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
|
||||
index ac96f7665a..d35bc1f0b0 100644
|
||||
--- a/hw/net/e1000e.c
|
||||
+++ b/hw/net/e1000e.c
|
||||
@@ -81,6 +81,12 @@ struct E1000EState {
|
||||
|
||||
E1000ECore core;
|
||||
bool init_vet;
|
||||
+
|
||||
+ /* 7.3 had the intr_state field that was in the original e1000e code
|
||||
+ * but that was removed prior to 2.7's release
|
||||
+ */
|
||||
+ bool redhat_7_3_intr_state_enable;
|
||||
+ uint32_t redhat_7_3_intr_state;
|
||||
};
|
||||
|
||||
#define E1000E_MMIO_IDX 0
|
||||
@@ -96,6 +102,10 @@ struct E1000EState {
|
||||
#define E1000E_MSIX_TABLE (0x0000)
|
||||
#define E1000E_MSIX_PBA (0x2000)
|
||||
|
||||
+/* Values as in RHEL 7.3 build and original upstream */
|
||||
+#define RH_E1000E_USE_MSI BIT(0)
|
||||
+#define RH_E1000E_USE_MSIX BIT(1)
|
||||
+
|
||||
static uint64_t
|
||||
e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
|
||||
{
|
||||
@@ -307,6 +317,8 @@ e1000e_init_msix(E1000EState *s)
|
||||
} else {
|
||||
if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
|
||||
msix_uninit(d, &s->msix, &s->msix);
|
||||
+ } else {
|
||||
+ s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -478,6 +490,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)
|
||||
ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL);
|
||||
if (ret) {
|
||||
trace_e1000e_msi_init_fail(ret);
|
||||
+ } else {
|
||||
+ s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI;
|
||||
}
|
||||
|
||||
if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset,
|
||||
@@ -605,6 +619,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = {
|
||||
VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0, \
|
||||
e1000e_vmstate_intr_timer, E1000IntrDelayTimer)
|
||||
|
||||
+static bool rhel_7_3_check(void *opaque, int version_id)
|
||||
+{
|
||||
+ return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable;
|
||||
+}
|
||||
+
|
||||
static const VMStateDescription e1000e_vmstate = {
|
||||
.name = "e1000e",
|
||||
.version_id = 1,
|
||||
@@ -616,6 +635,7 @@ static const VMStateDescription e1000e_vmstate = {
|
||||
VMSTATE_MSIX(parent_obj, E1000EState),
|
||||
|
||||
VMSTATE_UINT32(ioaddr, E1000EState),
|
||||
+ VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check),
|
||||
VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
|
||||
VMSTATE_UINT8(core.rx_desc_len, E1000EState),
|
||||
VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
|
||||
@@ -664,6 +684,8 @@ static PropertyInfo e1000e_prop_disable_vnet,
|
||||
|
||||
static Property e1000e_properties[] = {
|
||||
DEFINE_NIC_PROPERTIES(E1000EState, conf),
|
||||
+ DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState,
|
||||
+ redhat_7_3_intr_state_enable, false),
|
||||
DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false,
|
||||
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 90b4fc63ce..3ffb9dd22c 100644
|
||||
--- a/hw/net/rtl8139.c
|
||||
|
@ -339,7 +634,7 @@ index 90b4fc63ce..3ffb9dd22c 100644
|
|||
VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State),
|
||||
|
||||
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
|
||||
index 4fbafddb22..6c42cc22cd 100644
|
||||
index 4fbafddb22..2f120c6e70 100644
|
||||
--- a/hw/rtc/mc146818rtc.c
|
||||
+++ b/hw/rtc/mc146818rtc.c
|
||||
@@ -43,6 +43,7 @@
|
||||
|
@ -350,10 +645,14 @@ index 4fbafddb22..6c42cc22cd 100644
|
|||
|
||||
#ifdef TARGET_I386
|
||||
#include "qapi/qapi-commands-misc-target.h"
|
||||
@@ -821,6 +822,7 @@ static int rtc_post_load(void *opaque, int version_id)
|
||||
@@ -821,6 +822,11 @@ static int rtc_post_load(void *opaque, int version_id)
|
||||
static bool rtc_irq_reinject_on_ack_count_needed(void *opaque)
|
||||
{
|
||||
RTCState *s = (RTCState *)opaque;
|
||||
+
|
||||
+ if (migrate_pre_2_2) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
return s->irq_reinject_on_ack_count != 0;
|
||||
}
|
||||
|
@ -583,11 +882,79 @@ index c193f79443..086a1feb1e 100644
|
|||
} XHCIPciState;
|
||||
|
||||
#endif
|
||||
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
||||
index e01700039b..d5ea13356c 100644
|
||||
--- a/hw/usb/hcd-xhci.c
|
||||
+++ b/hw/usb/hcd-xhci.c
|
||||
@@ -3494,9 +3494,27 @@ static const VMStateDescription vmstate_xhci_slot = {
|
||||
}
|
||||
};
|
||||
|
||||
+static int xhci_event_pre_save(void *opaque)
|
||||
+{
|
||||
+ XHCIEvent *s = opaque;
|
||||
+
|
||||
+ s->cve_2014_5263_a = ((uint8_t *)&s->type)[0];
|
||||
+ s->cve_2014_5263_b = ((uint8_t *)&s->type)[1];
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+bool migrate_cve_2014_5263_xhci_fields;
|
||||
+
|
||||
+static bool xhci_event_cve_2014_5263(void *opaque, int version_id)
|
||||
+{
|
||||
+ return migrate_cve_2014_5263_xhci_fields;
|
||||
+}
|
||||
+
|
||||
static const VMStateDescription vmstate_xhci_event = {
|
||||
.name = "xhci-event",
|
||||
.version_id = 1,
|
||||
+ .pre_save = xhci_event_pre_save,
|
||||
.fields = (VMStateField[]) {
|
||||
VMSTATE_UINT32(type, XHCIEvent),
|
||||
VMSTATE_UINT32(ccode, XHCIEvent),
|
||||
@@ -3505,6 +3523,8 @@ static const VMStateDescription vmstate_xhci_event = {
|
||||
VMSTATE_UINT32(flags, XHCIEvent),
|
||||
VMSTATE_UINT8(slotid, XHCIEvent),
|
||||
VMSTATE_UINT8(epid, XHCIEvent),
|
||||
+ VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263),
|
||||
+ VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
|
||||
index 98f598382a..50a7b6f6c4 100644
|
||||
--- a/hw/usb/hcd-xhci.h
|
||||
+++ b/hw/usb/hcd-xhci.h
|
||||
@@ -149,6 +149,8 @@ typedef struct XHCIEvent {
|
||||
uint32_t flags;
|
||||
uint8_t slotid;
|
||||
uint8_t epid;
|
||||
+ uint8_t cve_2014_5263_a;
|
||||
+ uint8_t cve_2014_5263_b;
|
||||
} XHCIEvent;
|
||||
|
||||
typedef struct XHCIInterrupter {
|
||||
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
|
||||
index 7ca92843c6..21abfd8447 100644
|
||||
--- a/include/hw/acpi/ich9.h
|
||||
+++ b/include/hw/acpi/ich9.h
|
||||
@@ -68,6 +68,9 @@ typedef struct ICH9LPCPMRegs {
|
||||
bool smm_compat;
|
||||
bool enable_tco;
|
||||
TCOIORegs tco_regs;
|
||||
+
|
||||
+ /* RH addition, see bz 1489800 */
|
||||
+ bool force_rev1_fadt;
|
||||
} ICH9LPCPMRegs;
|
||||
|
||||
#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
|
||||
diff --git a/include/hw/boards.h b/include/hw/boards.h
|
||||
index 9c1c190104..b0a6e05b48 100644
|
||||
index 9c1c190104..8bba96ef2b 100644
|
||||
--- a/include/hw/boards.h
|
||||
+++ b/include/hw/boards.h
|
||||
@@ -441,4 +441,25 @@ extern const size_t hw_compat_2_2_len;
|
||||
@@ -441,4 +441,40 @@ extern const size_t hw_compat_2_2_len;
|
||||
extern GlobalProperty hw_compat_2_1[];
|
||||
extern const size_t hw_compat_2_1_len;
|
||||
|
||||
|
@ -611,6 +978,21 @@ index 9c1c190104..b0a6e05b48 100644
|
|||
+
|
||||
+extern GlobalProperty hw_compat_rhel_7_6[];
|
||||
+extern const size_t hw_compat_rhel_7_6_len;
|
||||
+
|
||||
+extern GlobalProperty hw_compat_rhel_7_5[];
|
||||
+extern const size_t hw_compat_rhel_7_5_len;
|
||||
+
|
||||
+extern GlobalProperty hw_compat_rhel_7_4[];
|
||||
+extern const size_t hw_compat_rhel_7_4_len;
|
||||
+
|
||||
+extern GlobalProperty hw_compat_rhel_7_3[];
|
||||
+extern const size_t hw_compat_rhel_7_3_len;
|
||||
+
|
||||
+extern GlobalProperty hw_compat_rhel_7_2[];
|
||||
+extern const size_t hw_compat_rhel_7_2_len;
|
||||
+
|
||||
+extern GlobalProperty hw_compat_rhel_7_1[];
|
||||
+extern const size_t hw_compat_rhel_7_1_len;
|
||||
+
|
||||
#endif
|
||||
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
|
||||
|
@ -643,6 +1025,47 @@ index 9ab39e428f..7ccc9a1a07 100644
|
|||
|
||||
/* RAM / address space compat: */
|
||||
bool gigabyte_align;
|
||||
diff --git a/include/hw/usb.h b/include/hw/usb.h
|
||||
index 33668dd0a9..e6b2fe72da 100644
|
||||
--- a/include/hw/usb.h
|
||||
+++ b/include/hw/usb.h
|
||||
@@ -582,4 +582,7 @@ void usb_pcap_init(FILE *fp);
|
||||
void usb_pcap_ctrl(USBPacket *p, bool setup);
|
||||
void usb_pcap_data(USBPacket *p, bool setup);
|
||||
|
||||
+/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */
|
||||
+extern bool migrate_cve_2014_5263_xhci_fields;
|
||||
+
|
||||
#endif
|
||||
diff --git a/migration/migration.c b/migration/migration.c
|
||||
index abaf6f9e3d..a87ff01b81 100644
|
||||
--- a/migration/migration.c
|
||||
+++ b/migration/migration.c
|
||||
@@ -164,6 +164,8 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot,
|
||||
MIGRATION_CAPABILITY_X_COLO,
|
||||
MIGRATION_CAPABILITY_VALIDATE_UUID);
|
||||
|
||||
+bool migrate_pre_2_2;
|
||||
+
|
||||
/* When we add fault tolerance, we could have several
|
||||
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 8130b703eb..d016cedd9d 100644
|
||||
--- a/migration/migration.h
|
||||
+++ b/migration/migration.h
|
||||
@@ -381,6 +381,11 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm,
|
||||
void migrate_add_address(SocketAddress *address);
|
||||
|
||||
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.
|
||||
+ */
|
||||
+extern bool migrate_pre_2_2;
|
||||
|
||||
#define qemu_ram_foreach_block \
|
||||
#warning "Use foreach_not_ignored_block in migration code"
|
||||
--
|
||||
2.27.0
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 19d36c4519a1a560cce60b212e3afdf7eb026e45 Mon Sep 17 00:00:00 2001
|
||||
From 670e90f5cbd92189155e079b8c6e2aafdf82d162 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,23 +6,84 @@ Subject: Add aarch64 machine types
|
|||
Adding changes to add RHEL machine types for aarch64 architecture.
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
---
|
||||
Rebase notes (6.1.0):
|
||||
- Use CONFIG_TPM check when using TPM structures
|
||||
- Add support for default_bus_bypass_iommu
|
||||
- ea4c0b32d9 arm/virt: Register highmem and gic-version as class properties
|
||||
- 895e1fa86a hw/arm/virt: Add 8.5 and 9.0 machine types and remove older ones
|
||||
|
||||
Merged patches (6.2.0 RC0):
|
||||
- 9a3d4fde0e hw/arm/virt: Remove 9.0 machine type
|
||||
- f7d04d6695 hw: arm: virt: Add hw_compat_rhel_8_5 to 8.5 machine type
|
||||
Rebase notes (4.0.0):
|
||||
- Use upstream compat handling
|
||||
|
||||
Rebase notes (4.1.0-rc0):
|
||||
- Removed a15memmap (upstream)
|
||||
- Use virt_flash_create in rhel800_virt_instance_init
|
||||
|
||||
Rebase notes (4.2.0-rc0):
|
||||
- Set numa_mem_supported
|
||||
|
||||
Rebase notes (4.2.0-rc3):
|
||||
- aarch64: Add virt-rhel8.2.0 machine type for ARM (patch 92246)
|
||||
- aarch64: virt: Allow more than 1TB of RAM (patch 92249)
|
||||
- aarch64: virt: Allow PCDIMM instantiation (patch 92247)
|
||||
- aarch64: virt: Enhance the comment related to gic-version (patch 92248)
|
||||
|
||||
Rebase notes (5.0.0):
|
||||
- Set default_ram_id in rhel_machine_class_init
|
||||
- Added setting acpi properties
|
||||
|
||||
Rebase notes (5.1.0):
|
||||
- Added ras property
|
||||
- Added to virt_machine_device_unplug_cb to machine type (upstream)
|
||||
- added mte property (upstream)
|
||||
|
||||
Rebase notes (weekly-210210):
|
||||
- Added support for oem fields to machine type
|
||||
|
||||
Rebase notes (weekly-210303):
|
||||
- Use rhel-8.4.0 hw compat
|
||||
|
||||
Rebase notes (6.0.0-rc2):
|
||||
- renamed oem-id and oem-table-id to x-oem-id and x-oem-table-id
|
||||
|
||||
Rebase notes (210623):
|
||||
- Protect TPM functions by CONFIG_TPM ifdef
|
||||
|
||||
Rebase notes (6.1.0-rc0):
|
||||
- Add support for default_bus_bypass_iommu
|
||||
|
||||
Merged patches (4.0.0):
|
||||
- 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
|
||||
|
||||
Merged patches (4.1.0):
|
||||
- c3e39ef aarch64: Add virt-rhel8.1.0 machine type for ARM
|
||||
- 59a46d1 aarch64: Allow ARM VIRT iommu option in RHEL8.1 machine
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- 12990ad hw/arm: Changes to rhel820 machine
|
||||
- 46d5a79 hw/arm: Introduce rhel_virt_instance_init() helper
|
||||
- 098954a hw/arm: Add rhel830 machine type
|
||||
- ee8e99d arm: Set correct max_cpus value on virt-rhel* machine types
|
||||
- e5edd38 RHEL-only: arm/virt: Allow the TPM_TIS_SYSBUS device dynamic allocation in machvirt
|
||||
- 6d7ba66 machine types/numa: set numa_mem_supported on old machine types (partialy)
|
||||
- 25c5644 machine_types/numa: compatibility for auto_enable_numa_with_memdev (partialy)
|
||||
|
||||
Merged patches (6.0):
|
||||
- 078fadb5da AArch64 machine types cleanup
|
||||
- ea7b7425fa hw/arm/virt: Add 8.4 Machine type
|
||||
|
||||
Merged patches (weekly-210609):
|
||||
- 73b1578882 hw/arm/virt: Add 8.5 machine type
|
||||
- 5333038d11 hw/arm/virt: Disable PL011 clock migration through hw_compat_rhel_8_3
|
||||
- 63adb8ae86 arm/virt: Register highmem and gic-version as class properties
|
||||
|
||||
Merged patches (weekly-211027):
|
||||
- 86e3057c0a hw: arm: virt: Add hw_compat_rhel_8_5 to 8.5 machine type
|
||||
---
|
||||
hw/arm/virt.c | 205 +++++++++++++++++++++++++++++++++++++++++-
|
||||
hw/arm/virt.c | 226 +++++++++++++++++++++++++++++++++++++++++-
|
||||
hw/core/machine.c | 2 +
|
||||
include/hw/arm/virt.h | 8 ++
|
||||
2 files changed, 212 insertions(+), 1 deletion(-)
|
||||
3 files changed, 235 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
|
||||
index 5de4d9d73b..7d51824263 100644
|
||||
index 5de4d9d73b..c77d26ab13 100644
|
||||
--- a/hw/arm/virt.c
|
||||
+++ b/hw/arm/virt.c
|
||||
@@ -79,6 +79,7 @@
|
||||
|
@ -123,7 +184,7 @@ index 5de4d9d73b..7d51824263 100644
|
|||
static void virt_machine_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
MachineClass *mc = MACHINE_CLASS(oc);
|
||||
@@ -3031,3 +3078,159 @@ static void virt_machine_2_6_options(MachineClass *mc)
|
||||
@@ -3031,3 +3078,180 @@ static void virt_machine_2_6_options(MachineClass *mc)
|
||||
vmc->no_pmu = true;
|
||||
}
|
||||
DEFINE_VIRT_MACHINE(2, 6)
|
||||
|
@ -198,9 +259,6 @@ index 5de4d9d73b..7d51824263 100644
|
|||
+ object_class_property_add_bool(oc, "default_bus_bypass_iommu",
|
||||
+ virt_get_default_bus_bypass_iommu,
|
||||
+ virt_set_default_bus_bypass_iommu);
|
||||
+ object_class_property_set_description(oc, "default_bus_bypass_iommu",
|
||||
+ "Set on/off to enable/disable "
|
||||
+ "bypass_iommu for default root bus");
|
||||
+
|
||||
+}
|
||||
+
|
||||
|
@ -246,9 +304,7 @@ index 5de4d9d73b..7d51824263 100644
|
|||
+ /* MTE is disabled by default and non-configurable for RHEL */
|
||||
+ vms->mte = false;
|
||||
+
|
||||
+ /* The default root bus is attached to iommu by default */
|
||||
+ vms->default_bus_bypass_iommu = false;
|
||||
+
|
||||
+ vms->irqmap = a15irqmap;
|
||||
+
|
||||
+ virt_flash_create(vms);
|
||||
|
@ -283,6 +339,45 @@ index 5de4d9d73b..7d51824263 100644
|
|||
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_5, hw_compat_rhel_8_5_len);
|
||||
+}
|
||||
+DEFINE_RHEL_MACHINE_AS_LATEST(8, 5, 0)
|
||||
+
|
||||
+static void rhel840_virt_options(MachineClass *mc)
|
||||
+{
|
||||
+ rhel850_virt_options(mc);
|
||||
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_4, hw_compat_rhel_8_4_len);
|
||||
+}
|
||||
+DEFINE_RHEL_MACHINE(8, 4, 0)
|
||||
+
|
||||
+static void rhel830_virt_options(MachineClass *mc)
|
||||
+{
|
||||
+ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
|
||||
+
|
||||
+ rhel840_virt_options(mc);
|
||||
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_3, hw_compat_rhel_8_3_len);
|
||||
+ vmc->no_kvm_steal_time = true;
|
||||
+}
|
||||
+DEFINE_RHEL_MACHINE(8, 3, 0)
|
||||
+
|
||||
+static void rhel820_virt_options(MachineClass *mc)
|
||||
+{
|
||||
+ rhel830_virt_options(mc);
|
||||
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_2, hw_compat_rhel_8_2_len);
|
||||
+ mc->numa_mem_supported = true;
|
||||
+ mc->auto_enable_numa_with_memdev = false;
|
||||
+}
|
||||
+DEFINE_RHEL_MACHINE(8, 2, 0)
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index be4f9864cd..62febde5aa 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -87,6 +87,8 @@ GlobalProperty hw_compat_rhel_8_3[] = {
|
||||
{ "nvme", "use-intel-id", "on"},
|
||||
/* hw_compat_rhel_8_3 from hw_compat_5_1 */
|
||||
{ "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */
|
||||
+ /* hw_compat_rhel_8_3 from hw_compat_5_1 */
|
||||
+ { "pl011", "migrate-clk", "off" },
|
||||
/* hw_compat_rhel_8_3 bz 1912846 */
|
||||
{ "pci-xhci", "x-rh-late-msi-cap", "off" },
|
||||
/* hw_compat_rhel_8_3 from hw_compat_5_1 */
|
||||
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
|
||||
index dc6b66ffc8..9364628847 100644
|
||||
--- a/include/hw/arm/virt.h
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 2d595bc1744fc764ef506fd6ed6555f267d01ea4 Mon Sep 17 00:00:00 2001
|
||||
From 3c65320ce5b8ad3bb8c0d8fd13a88c464d5c5845 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
|
||||
|
@ -7,30 +7,63 @@ Adding changes to add RHEL machine types for ppc64 architecture.
|
|||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
Rebase notes (6.2.0 rc1):
|
||||
- Fixed rebase conflict relicts
|
||||
- Update machine type compat for 6.2 (from MR 66)
|
||||
Rebase changes (4.0.0):
|
||||
- remove instance options and use upstream solution
|
||||
- Use upstream compat handling
|
||||
- Replace SPAPR_PCI_2_7_MMIO_WIN_SIZE with value (changed upstream)
|
||||
- re-add handling of instance_options (removed upstream)
|
||||
- Use p8 as default for rhel machine types (p9 default upstream)
|
||||
- sPAPRMachineClass renamed to SpaprMachineClass (upstream)
|
||||
|
||||
Merged patches (6.1.0):
|
||||
- c438c25ac3 redhat: Define pseries-rhel8.5.0 machine type
|
||||
- a3995e2eff Remove RHEL 7.0.0 machine type (only ppc64 changes)
|
||||
- ad3190a79b Remove RHEL 7.1.0 machine type (only ppc64 changes)
|
||||
- 84bbe15d4e Remove RHEL 7.2.0 machine type (only ppc64 changes)
|
||||
- 0215eb3356 Remove RHEL 7.3.0 machine types (only ppc64 changes)
|
||||
- af69d1ca6e Remove RHEL 7.4.0 machine types (only ppc64 changes)
|
||||
- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only ppc64 changes)
|
||||
Rebase changes (4.1.0):
|
||||
- Update format for compat structures
|
||||
|
||||
Rebase notes (weekly-210303):
|
||||
- Use rhel-8.4.0 hw compat
|
||||
|
||||
Merged patches (4.0.0):
|
||||
- 467d59a redhat: define pseries-rhel8.0.0 machine type
|
||||
|
||||
Merged patches (4.1.0):
|
||||
- f21757edc target/ppc/spapr: Enable mitigations by default for pseries-4.0 machine type
|
||||
- 2511c63 redhat: sync pseries-rhel7.6.0 with rhel-av-8.0.1
|
||||
- 89f01da redhat: define pseries-rhel8.1.0 machine type
|
||||
|
||||
Merged patches (4.2.0):
|
||||
- bcba728 redhat: update pseries-rhel8.1.0 machine type
|
||||
- redhat: update pseries-rhel-7.6.0 machine type (patch 93039)
|
||||
- redhat: define pseries-rhel8.2.0 machine type (patch 93041)
|
||||
|
||||
Merged patches (5.1.0):
|
||||
- eb121ff spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine (partial)
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- 311a20f redhat: define pseries-rhel8.3.0 machine type
|
||||
- 1284167 ppc: Set correct max_cpus value on spapr-rhel* machine types
|
||||
- 1ab8783 redhat: update pseries-rhel8.2.0 machine type
|
||||
- b162af531a target/ppc: Add experimental option for enabling secure guests
|
||||
|
||||
Merged patches (weekly-201216):
|
||||
- 943c936df3 redhat: Add spapr_machine_rhel_default_class_options()
|
||||
- 030b5e6fba redhat: Define pseries-rhel8.4.0 machine type
|
||||
|
||||
Merged patches (weekly-210602):
|
||||
- b7128d8ef7 redhat: Define pseries-rhel8.5.0 machine type
|
||||
|
||||
Merged patches (weekly-211006):
|
||||
- c8f68b47e9 redhat: Update pseries-rhel8.5.0
|
||||
---
|
||||
hw/ppc/spapr.c | 243 ++++++++++++++++++++++++++++++++++++++++
|
||||
hw/ppc/spapr_cpu_core.c | 13 +++
|
||||
hw/ppc/spapr.c | 382 ++++++++++++++++++++++++++++++++++++++++
|
||||
hw/ppc/spapr_cpu_core.c | 13 ++
|
||||
include/hw/ppc/spapr.h | 4 +
|
||||
target/ppc/compat.c | 13 ++-
|
||||
target/ppc/compat.c | 13 +-
|
||||
target/ppc/cpu.h | 1 +
|
||||
target/ppc/kvm.c | 27 +++++
|
||||
target/ppc/kvm_ppc.h | 13 +++
|
||||
7 files changed, 313 insertions(+), 1 deletion(-)
|
||||
target/ppc/kvm.c | 27 +++
|
||||
target/ppc/kvm_ppc.h | 13 ++
|
||||
7 files changed, 452 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
|
||||
index 3b5fd749be..f4bb5f15f0 100644
|
||||
index 3b5fd749be..cace86028d 100644
|
||||
--- a/hw/ppc/spapr.c
|
||||
+++ b/hw/ppc/spapr.c
|
||||
@@ -1593,6 +1593,9 @@ static void spapr_machine_reset(MachineState *machine)
|
||||
|
@ -110,7 +143,23 @@ index 3b5fd749be..f4bb5f15f0 100644
|
|||
static void spapr_machine_4_0_class_options(MachineClass *mc)
|
||||
{
|
||||
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
@@ -5127,6 +5155,221 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
|
||||
@@ -4958,6 +4986,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
|
||||
/*
|
||||
* pseries-2.7
|
||||
*/
|
||||
+#endif
|
||||
|
||||
static bool phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
|
||||
uint64_t *buid, hwaddr *pio,
|
||||
@@ -5013,6 +5042,7 @@ static bool phb_placement_2_7(SpaprMachineState *spapr, uint32_t index,
|
||||
return true;
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
static void spapr_machine_2_7_class_options(MachineClass *mc)
|
||||
{
|
||||
SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
@@ -5127,6 +5157,358 @@ 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);
|
||||
|
@ -134,14 +183,10 @@ index 3b5fd749be..f4bb5f15f0 100644
|
|||
+
|
||||
+static void spapr_machine_rhel850_class_options(MachineClass *mc)
|
||||
+{
|
||||
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
+
|
||||
+ /* The default machine type must apply the RHEL specific defaults */
|
||||
+ spapr_machine_rhel_default_class_options(mc);
|
||||
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_5,
|
||||
+ hw_compat_rhel_8_5_len);
|
||||
+ smc->pre_6_2_numa_affinity = true;
|
||||
+ mc->smp_props.prefer_sockets = true;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel850, "rhel8.5.0", true);
|
||||
|
@ -329,6 +374,147 @@ index 3b5fd749be..f4bb5f15f0 100644
|
|||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel760sxxm, "rhel7.6.0-sxxm", false);
|
||||
+
|
||||
+static void spapr_machine_rhel750_class_options(MachineClass *mc)
|
||||
+{
|
||||
+ spapr_machine_rhel760_class_options(mc);
|
||||
+ 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);
|
||||
+
|
||||
+/*
|
||||
+ * pseries-rhel7.5.0-sxxm
|
||||
+ *
|
||||
+ * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default
|
||||
+ */
|
||||
+
|
||||
+static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc)
|
||||
+{
|
||||
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
+
|
||||
+ spapr_machine_rhel750_class_options(mc);
|
||||
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel750sxxm, "rhel7.5.0-sxxm", false);
|
||||
+
|
||||
+/*
|
||||
+ * pseries-rhel7.4.0
|
||||
+ * like spapr_compat_2_9
|
||||
+ */
|
||||
+GlobalProperty spapr_compat_rhel7_4[] = {
|
||||
+ { TYPE_POWERPC_CPU, "pre-2.10-migration", "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);
|
||||
+
|
||||
+ spapr_machine_rhel750_class_options(mc);
|
||||
+ 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);
|
||||
+ smc->has_power9_support = false;
|
||||
+ smc->pre_2_10_has_unused_icps = true;
|
||||
+ smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false);
|
||||
+
|
||||
+/*
|
||||
+ * pseries-rhel7.4.0-sxxm
|
||||
+ *
|
||||
+ * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default
|
||||
+ */
|
||||
+
|
||||
+static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc)
|
||||
+{
|
||||
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
+
|
||||
+ spapr_machine_rhel740_class_options(mc);
|
||||
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel740sxxm, "rhel7.4.0-sxxm", false);
|
||||
+
|
||||
+/*
|
||||
+ * pseries-rhel7.3.0
|
||||
+ * like spapr_compat_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3
|
||||
+ */
|
||||
+GlobalProperty spapr_compat_rhel7_3[] = {
|
||||
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0xf80000000" },
|
||||
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem64_win_size", "0" },
|
||||
+ { TYPE_POWERPC_CPU, "pre-2.8-migration", "on" },
|
||||
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-2.8-migration", "on" },
|
||||
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pcie-extended-configuration-space", "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);
|
||||
+
|
||||
+ spapr_machine_rhel740_class_options(mc);
|
||||
+ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.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;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false);
|
||||
+
|
||||
+/*
|
||||
+ * pseries-rhel7.3.0-sxxm
|
||||
+ *
|
||||
+ * pseries-rhel7.3.0 with speculative execution exploit mitigations enabled by default
|
||||
+ */
|
||||
+
|
||||
+static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc)
|
||||
+{
|
||||
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
+
|
||||
+ spapr_machine_rhel730_class_options(mc);
|
||||
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
|
||||
+ smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SPAPR_MACHINE(rhel730sxxm, "rhel7.3.0-sxxm", false);
|
||||
+
|
||||
+/*
|
||||
+ * pseries-rhel7.2.0
|
||||
+ */
|
||||
+/* 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.
|
||||
+ */
|
||||
+
|
||||
+GlobalProperty spapr_compat_rhel7_2[] = {
|
||||
+ { "spapr-vlan", "use-rx-buffer-pools", "off" },
|
||||
+ { TYPE_SPAPR_PCI_HOST_BRIDGE, "ddw", "off" },
|
||||
+};
|
||||
+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);
|
||||
+
|
||||
+ spapr_machine_rhel730_class_options(mc);
|
||||
+ smc->use_ohci_by_default = true;
|
||||
+ mc->has_hotpluggable_cpus = NULL;
|
||||
+ 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);
|
||||
|
||||
static void spapr_machine_register_types(void)
|
||||
{
|
||||
|
@ -371,7 +557,7 @@ index 8ba34f6a1d..78eca1c04a 100644
|
|||
qdev_unrealize(DEVICE(cpu));
|
||||
return false;
|
||||
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
|
||||
index ee7504b976..fcd5bf9302 100644
|
||||
index ee7504b976..37a014d59c 100644
|
||||
--- a/include/hw/ppc/spapr.h
|
||||
+++ b/include/hw/ppc/spapr.h
|
||||
@@ -154,6 +154,7 @@ struct SpaprMachineClass {
|
||||
|
@ -382,16 +568,16 @@ index ee7504b976..fcd5bf9302 100644
|
|||
bool (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
|
||||
uint64_t *buid, hwaddr *pio,
|
||||
hwaddr *mmio32, hwaddr *mmio64,
|
||||
@@ -238,6 +239,9 @@ struct SpaprMachineState {
|
||||
@@ -237,6 +238,9 @@ struct SpaprMachineState {
|
||||
|
||||
/* Set by -boot */
|
||||
char *boot_device;
|
||||
|
||||
+
|
||||
+ /* Secure Guest support via x-svm-allowed */
|
||||
+ bool svm_allowed;
|
||||
+
|
||||
|
||||
/*< public >*/
|
||||
char *kvm_type;
|
||||
char *host_model;
|
||||
diff --git a/target/ppc/compat.c b/target/ppc/compat.c
|
||||
index 7949a24f5a..f207a9ba01 100644
|
||||
--- a/target/ppc/compat.c
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From ea22b5ae0a89ef53f31f67bb6845fd6c45d4f412 Mon Sep 17 00:00:00 2001
|
||||
From 4ad9a0d0582eef78946b47563eb2c5b7ddf0cbb0 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
|
||||
|
@ -6,19 +6,38 @@ Subject: Add s390x machine types
|
|||
Adding changes to add RHEL machine types for s390x architecture.
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
--
|
||||
Merged patches (6.1.0):
|
||||
- 64a9a5c971 hw/s390x: Remove the RHEL7-only machine type
|
||||
- 395516d62b redhat: s390x: add rhel-8.5.0 compat machine
|
||||
|
||||
Merged patches (6.2.0 RC0):
|
||||
- 3bf66f4520 redhat: Add s390x machine type compatibility update for 6.1 rebase
|
||||
Rebase changes (weekly-4.1.0):
|
||||
- Use upstream compat handling
|
||||
|
||||
Rebase notes (weekly-210303):
|
||||
- Use rhel-8.4.0 hw compat
|
||||
|
||||
Merged patches (3.1.0):
|
||||
- 29df663 s390x/cpumodel: default enable bpb and ppa15 for z196 and later
|
||||
|
||||
Merged patches (4.1.0):
|
||||
- 6c200d665b hw/s390x/s390-virtio-ccw: Add machine types for RHEL8.0.0
|
||||
|
||||
Merged patches (4.2.0):
|
||||
- fb192e5 redhat: s390x: Rename s390-ccw-virtio-rhel8.0.0 to s390-ccw-virtio-rhel8.1.0
|
||||
- a9b22e8 redhat: s390x: Add proper compatibility options for the -rhel7.6.0 machine
|
||||
- hw/s390x: Add the s390-ccw-virtio-rhel8.2.0 machine types (patch 92954)
|
||||
|
||||
Merged patches (weekly-201216):
|
||||
- a6ae745cce redhat: s390x: add rhel-8.4.0 compat machine
|
||||
|
||||
Merged patches (weekly-210602):
|
||||
- 50835d3429 redhat: s390x: add rhel-8.5.0 compat machine
|
||||
|
||||
Merged patches (weekly-211006):
|
||||
- a3bcde27fe redhat: Add s390x machine type compatibility update for 6.1 rebase
|
||||
---
|
||||
hw/s390x/s390-virtio-ccw.c | 67 +++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 66 insertions(+), 1 deletion(-)
|
||||
hw/s390x/s390-virtio-ccw.c | 99 +++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 98 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
|
||||
index 653587ea62..4af14cb9ca 100644
|
||||
index 653587ea62..181856e6cf 100644
|
||||
--- a/hw/s390x/s390-virtio-ccw.c
|
||||
+++ b/hw/s390x/s390-virtio-ccw.c
|
||||
@@ -767,7 +767,7 @@ bool css_migration_enabled(void)
|
||||
|
@ -38,7 +57,7 @@ index 653587ea62..4af14cb9ca 100644
|
|||
static void ccw_machine_6_2_instance_options(MachineState *machine)
|
||||
{
|
||||
}
|
||||
@@ -1100,6 +1101,70 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
|
||||
@@ -1100,6 +1101,102 @@ static void ccw_machine_2_4_class_options(MachineClass *mc)
|
||||
compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
|
||||
}
|
||||
DEFINE_CCW_MACHINE(2_4, "2.4", false);
|
||||
|
@ -106,6 +125,38 @@ index 653587ea62..4af14cb9ca 100644
|
|||
+ compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len);
|
||||
+}
|
||||
+DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false);
|
||||
+
|
||||
+static void ccw_machine_rhel750_instance_options(MachineState *machine)
|
||||
+{
|
||||
+ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 };
|
||||
+ ccw_machine_rhel760_instance_options(machine);
|
||||
+
|
||||
+ /* before 2.12 we emulated the very first z900, and RHEL 7.5 is
|
||||
+ based on 2.10 */
|
||||
+ s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat);
|
||||
+
|
||||
+ /* bpb and ppa15 were only in the full model in RHEL 7.5 */
|
||||
+ s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15);
|
||||
+ s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB);
|
||||
+}
|
||||
+
|
||||
+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_rhel750_class_options(MachineClass *mc)
|
||||
+{
|
||||
+ ccw_machine_rhel760_class_options(mc);
|
||||
+ 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_CCW_MACHINE_CLASS(mc)->hpage_1m_allowed = false;
|
||||
+}
|
||||
+DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false);
|
||||
|
||||
static void ccw_machine_register_types(void)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From afe0cbc5cdb98998b37cf48e9a1c87a110d9fbb3 Mon Sep 17 00:00:00 2001
|
||||
From c2b3564ce466bc5069bf9f5b0694025c68b0858d Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Fri, 19 Oct 2018 13:10:31 +0200
|
||||
Subject: Add x86_64 machine types
|
||||
|
@ -7,34 +7,128 @@ Adding changes to add RHEL machine types for x86_64 architecture.
|
|||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
Rebase notes (6.1.0):
|
||||
- Update qemu64 cpu spec
|
||||
Rebase changes (qemu-4.0.0):
|
||||
- Use upstream compat handling
|
||||
|
||||
Merged patches (6.1.0):
|
||||
- 59c284ad3b x86: Add x86 rhel8.5 machine types
|
||||
- a8868b42fe redhat: x86: Enable 'kvm-asyncpf-int' by default
|
||||
- a3995e2eff Remove RHEL 7.0.0 machine type (only x86_64 changes)
|
||||
- ad3190a79b Remove RHEL 7.1.0 machine type (only x86_64 changes)
|
||||
- 84bbe15d4e Remove RHEL 7.2.0 machine type (only x86_64 changes)
|
||||
- 0215eb3356 Remove RHEL 7.3.0 machine types (only x86_64 changes)
|
||||
- af69d1ca6e Remove RHEL 7.4.0 machine types (only x86_64 changes)
|
||||
- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only x86_64 changes)
|
||||
Rebase notes (3.1.0):
|
||||
- Removed xsave changes
|
||||
|
||||
Rebase notes (4.1.0):
|
||||
- Updated format for compat structures
|
||||
|
||||
Rebase notes (4.2.0-rc2):
|
||||
- Use X86MachineClass for save_tsc_khz (upstream change)
|
||||
|
||||
Rebase notes (weekly-210303):
|
||||
- Use rhel-8.4.0 hw compat
|
||||
|
||||
Rebase notes (weekly-210519):
|
||||
- kvm_default_props moved to new file (upstream)
|
||||
|
||||
Rebase notes (6.2.0-rc0):
|
||||
- linuxboot_dma_enabled moved to X86MachineState
|
||||
|
||||
Merged patches (4.1.0):
|
||||
- f4dc802 pc: 7.5 compat entries
|
||||
- 456ed3e pc: PC_RHEL7_6_COMPAT
|
||||
- 04119ee pc: Add compat for pc-i440fx-rhel7.6.0 machine type
|
||||
- b3b3687 pc: Add pc-q35-8.0.0 machine type
|
||||
- 8d46fc6 pc: Add x-migrate-smi-count=off to PC_RHEL7_6_COMPAT
|
||||
- 1de7949 kvm: clear out KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT for older machine types
|
||||
- 18cf0d7 target/i386: Disable MPX support on named CPU models (partialy)
|
||||
- 2660667 rhel: Set host-phys-bits-limit=48 on rhel machine-types
|
||||
|
||||
Merged patches (4.2.0):
|
||||
- 7d5c2ef pc: Don't make die-id mandatory unless necessary
|
||||
- e42808c x86 machine types: pc_rhel_8_0_compat
|
||||
- 9de83a8 x86 machine types: q35: Fixup units_per_default_bus
|
||||
- 6df1559 x86 machine types: Fixup dynamic sysbus entries
|
||||
- 0784125 x86 machine types: add pc-q35-rhel8.1.0
|
||||
- machines/x86: Add rhel 8.2 machine type (patch 92959)
|
||||
|
||||
Merged patches (5.1.0):
|
||||
- 481357e RHEL: hw/i386: disable nested PERF_GLOBAL_CTRL MSR support
|
||||
- e6c3fbf hw/smbios: set new default SMBIOS fields for Windows driver support (partialy)
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- b02c9f5 x86: Add 8.3.0 x86_64 machine type
|
||||
- f2edc4f q35: Set max_cpus to 512
|
||||
- 6d7ba66 machine types/numa: set numa_mem_supported on old machine types (partialy)
|
||||
- 25c5644 machine_types/numa: compatibility for auto_enable_numa_with_memdev (partialy)
|
||||
- e2d3209 x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features (partialy)
|
||||
|
||||
Merged patches (weekly-210120):
|
||||
- d0afeaa0c4 RHEL: Switch pvpanic test to q35
|
||||
- e19cdad83c 8.4 x86 machine type
|
||||
|
||||
Merged patches (weekly-210203):
|
||||
- 96f8781bd6 q35: Increase max_cpus to 710 on pc-q35-rhel8* machine types
|
||||
|
||||
Merged patches (weekly-210224):
|
||||
- 70d3924521 redhat: Add some devices for exporting upstream machine types
|
||||
- machine type chunks only
|
||||
|
||||
Merged patches (6.0.0 rc0):
|
||||
- 031c690804 i386/acpi: restore device paths for pre-5.1 vms
|
||||
|
||||
Merged patches (weekly-210623):
|
||||
- 64c350696f x86: Add x86 rhel8.5 machine types
|
||||
- 1c8fe5e164 redhat: x86: Enable 'kvm-asyncpf-int' by default
|
||||
|
||||
Merged patches (weekly-210714):
|
||||
- 618e2424ed redhat: Expose upstream machines pc-4.2 and pc-2.11
|
||||
- c4d1aa8bf2 redhat: Enable FDC device for upstream machines too
|
||||
- 66882f9a32 redhat: Add hw_compat_4_2_extra and apply to upstream machines
|
||||
|
||||
Fix machine type
|
||||
---
|
||||
hw/i386/pc.c | 114 +++++++++++++++++++++++-
|
||||
hw/i386/pc_piix.c | 68 +++++++++++++-
|
||||
hw/i386/pc_q35.c | 177 ++++++++++++++++++++++++++++++++++++-
|
||||
hw/block/fdc.c | 5 +-
|
||||
hw/i386/acpi-build.c | 3 +
|
||||
hw/i386/pc.c | 298 ++++++++++++++++++++++++++++++++++++-
|
||||
hw/i386/pc_piix.c | 274 +++++++++++++++++++++++++++++++++-
|
||||
hw/i386/pc_q35.c | 234 ++++++++++++++++++++++++++++-
|
||||
include/hw/boards.h | 2 +
|
||||
include/hw/i386/pc.h | 21 +++++
|
||||
include/hw/i386/pc.h | 45 ++++++
|
||||
target/i386/kvm/kvm-cpu.c | 1 +
|
||||
target/i386/kvm/kvm.c | 4 +
|
||||
tests/qtest/pvpanic-test.c | 5 +-
|
||||
8 files changed, 385 insertions(+), 7 deletions(-)
|
||||
10 files changed, 862 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
|
||||
index 97fa6de423..63042ef030 100644
|
||||
--- a/hw/block/fdc.c
|
||||
+++ b/hw/block/fdc.c
|
||||
@@ -2341,7 +2341,10 @@ void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl, Error **errp)
|
||||
|
||||
/* Restricted for Red Hat Enterprise Linux: */
|
||||
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
- if (!strstr(mc->name, "-rhel7.")) {
|
||||
+ if (!strstr(mc->name, "-rhel7.") &&
|
||||
+ /* Exported two upstream machine types allows FDC too */
|
||||
+ strcmp(mc->name, "pc-i440fx-4.2") &&
|
||||
+ strcmp(mc->name, "pc-i440fx-2.11")) {
|
||||
error_setg(errp, "Device %s is not supported with machine type %s",
|
||||
object_get_typename(OBJECT(dev)), mc->name);
|
||||
return;
|
||||
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
|
||||
index a99c6e4fe3..447ea35275 100644
|
||||
--- a/hw/i386/acpi-build.c
|
||||
+++ b/hw/i386/acpi-build.c
|
||||
@@ -230,6 +230,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
|
||||
pm->fadt.reset_reg = r;
|
||||
pm->fadt.reset_val = 0xf;
|
||||
pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP;
|
||||
+ if (object_property_get_bool(lpc,
|
||||
+ "__com.redhat_force-rev1-fadt", NULL))
|
||||
+ pm->fadt.rev = 1;
|
||||
pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
|
||||
pm->smi_on_cpuhp =
|
||||
!!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT));
|
||||
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
|
||||
index a2ef40ecbc..b6d2db8d04 100644
|
||||
index a2ef40ecbc..e8109954ca 100644
|
||||
--- a/hw/i386/pc.c
|
||||
+++ b/hw/i386/pc.c
|
||||
@@ -371,6 +371,116 @@ GlobalProperty pc_compat_1_4[] = {
|
||||
@@ -371,6 +371,296 @@ GlobalProperty pc_compat_1_4[] = {
|
||||
};
|
||||
const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
|
||||
|
||||
|
@ -142,24 +236,215 @@ index a2ef40ecbc..b6d2db8d04 100644
|
|||
+};
|
||||
+const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat);
|
||||
+
|
||||
+/* 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
|
||||
+ */
|
||||
+GlobalProperty pc_rhel_7_5_compat[] = {
|
||||
+ /* pc_rhel_7_5_compat from pc_compat_2_11 */
|
||||
+ { "Skylake-Server" "-" TYPE_X86_CPU, "clflushopt", "off" },
|
||||
+ /* pc_rhel_7_5_compat from pc_compat_2_12 */
|
||||
+ { TYPE_X86_CPU, "legacy-cache", "on" },
|
||||
+ /* pc_rhel_7_5_compat from pc_compat_2_12 */
|
||||
+ { TYPE_X86_CPU, "topoext", "off" },
|
||||
+ /* pc_rhel_7_5_compat from pc_compat_2_12 */
|
||||
+ { "EPYC-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) },
|
||||
+ /* pc_rhel_7_5_compat from pc_compat_2_12 */
|
||||
+ { "EPYC-IBPB-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) },
|
||||
+};
|
||||
+const size_t pc_rhel_7_5_compat_len = G_N_ELEMENTS(pc_rhel_7_5_compat);
|
||||
+
|
||||
+GlobalProperty pc_rhel_7_4_compat[] = {
|
||||
+ /* pc_rhel_7_4_compat from pc_compat_2_9 */
|
||||
+ { "mch", "extended-tseg-mbytes", stringify(0) },
|
||||
+ /* bz 1489800 */
|
||||
+ { "ICH9-LPC", "__com.redhat_force-rev1-fadt", "on" },
|
||||
+ /* pc_rhel_7_4_compat from pc_compat_2_10 */
|
||||
+ { "i440FX-pcihost", "x-pci-hole64-fix", "off" },
|
||||
+ /* pc_rhel_7_4_compat from pc_compat_2_10 */
|
||||
+ { "q35-pcihost", "x-pci-hole64-fix", "off" },
|
||||
+ /* pc_rhel_7_4_compat from pc_compat_2_10 */
|
||||
+ { TYPE_X86_CPU, "x-hv-max-vps", "0x40" },
|
||||
+};
|
||||
+const size_t pc_rhel_7_4_compat_len = G_N_ELEMENTS(pc_rhel_7_4_compat);
|
||||
+
|
||||
+GlobalProperty pc_rhel_7_3_compat[] = {
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_8 */
|
||||
+ { "kvmclock", "x-mach-use-reliable-get-clock", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_7 */
|
||||
+ { TYPE_X86_CPU, "l3-cache", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_7 */
|
||||
+ { TYPE_X86_CPU, "full-cpuid-auto-level", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_7 */
|
||||
+ { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_7 */
|
||||
+ { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_7 */
|
||||
+ { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_7 */
|
||||
+ { "isa-pcspk", "migrate", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_6 */
|
||||
+ { TYPE_X86_CPU, "cpuid-0xb", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_8 */
|
||||
+ { "ICH9-LPC", "x-smi-broadcast", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_8 */
|
||||
+ { TYPE_X86_CPU, "vmware-cpuid-freq", "off" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_8 */
|
||||
+ { "Haswell-" TYPE_X86_CPU, "stepping", "1" },
|
||||
+ /* pc_rhel_7_3_compat from pc_compat_2_3 added in 2.9*/
|
||||
+ { TYPE_X86_CPU, "kvm-no-smi-migration", "on" },
|
||||
+};
|
||||
+const size_t pc_rhel_7_3_compat_len = G_N_ELEMENTS(pc_rhel_7_3_compat);
|
||||
+
|
||||
+GlobalProperty pc_rhel_7_2_compat[] = {
|
||||
+ { "phenom" "-" TYPE_X86_CPU, "rdtscp", "off"},
|
||||
+ { "qemu64" "-" TYPE_X86_CPU, "sse4a", "on" },
|
||||
+ { "qemu64" "-" TYPE_X86_CPU, "abm", "on" },
|
||||
+ { "Haswell-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Haswell-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Haswell-noTSX-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Haswell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Broadwell-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Broadwell-noTSX-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "Broadwell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" },
|
||||
+ { "host" "-" TYPE_X86_CPU, "host-cache-info", "on" },
|
||||
+ { TYPE_X86_CPU, "check", "off" },
|
||||
+ { "qemu32" "-" TYPE_X86_CPU, "popcnt", "on" },
|
||||
+ { TYPE_X86_CPU, "arat", "off" },
|
||||
+ { "usb-redir", "streams", "off" },
|
||||
+ { TYPE_X86_CPU, "fill-mtrr-mask", "off" },
|
||||
+ { "apic-common", "legacy-instance-id", "on" },
|
||||
+};
|
||||
+const size_t pc_rhel_7_2_compat_len = G_N_ELEMENTS(pc_rhel_7_2_compat);
|
||||
+
|
||||
+GlobalProperty pc_rhel_7_1_compat[] = {
|
||||
+ { "kvm64" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "kvm32" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Conroe" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Penryn" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Nehalem" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Nehalem-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Westmere" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Westmere-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "SandyBridge" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "SandyBridge-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Haswell" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Haswell-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Broadwell" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Opteron_G1" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Opteron_G2" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Opteron_G3" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Opteron_G4" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Opteron_G5" "-" TYPE_X86_CPU, "vme", "off" },
|
||||
+ { "Haswell" "-" TYPE_X86_CPU, "f16c", "off" },
|
||||
+ { "Haswell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" },
|
||||
+ { "Haswell" "-" TYPE_X86_CPU, "rdrand", "off" },
|
||||
+ { "Haswell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" },
|
||||
+ { "Broadwell" "-" TYPE_X86_CPU, "f16c", "off" },
|
||||
+ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" },
|
||||
+ { "Broadwell" "-" TYPE_X86_CPU, "rdrand", "off" },
|
||||
+ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" },
|
||||
+ { "coreduo" "-" TYPE_X86_CPU, "vmx", "on" },
|
||||
+ { "core2duo" "-" TYPE_X86_CPU, "vmx", "on" },
|
||||
+ { "qemu64" "-" TYPE_X86_CPU, "min-level", stringify(4) },
|
||||
+ { "kvm64" "-" TYPE_X86_CPU, "min-level", stringify(5) },
|
||||
+ { "pentium3" "-" TYPE_X86_CPU, "min-level", stringify(2) },
|
||||
+ { "n270" "-" TYPE_X86_CPU, "min-level", stringify(5) },
|
||||
+ { "Conroe" "-" TYPE_X86_CPU, "min-level", stringify(4) },
|
||||
+ { "Penryn" "-" TYPE_X86_CPU, "min-level", stringify(4) },
|
||||
+ { "Nehalem" "-" TYPE_X86_CPU, "min-level", stringify(4) },
|
||||
+ { "n270" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Penryn" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Conroe" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Nehalem" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Westmere" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "SandyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "IvyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Haswell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Haswell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Broadwell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+ { "Broadwell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) },
|
||||
+};
|
||||
+const size_t pc_rhel_7_1_compat_len = G_N_ELEMENTS(pc_rhel_7_1_compat);
|
||||
+
|
||||
+/*
|
||||
+ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine
|
||||
+ * types as the PC_COMPAT_* do for upstream types.
|
||||
+ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types.
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_*
|
||||
+ * between our base and 1.5, less stuff backported to RHEL-7.0
|
||||
+ * (usb-device.msos-desc), less stuff for devices we changed
|
||||
+ * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x,
|
||||
+ * pci-serial-4x) in 7.0.
|
||||
+ */
|
||||
+GlobalProperty pc_rhel_7_0_compat[] = {
|
||||
+ { "virtio-scsi-pci", "any_layout", "off" },
|
||||
+ { "PIIX4_PM", "memory-hotplug-support", "off" },
|
||||
+ { "apic", "version", stringify(0x11) },
|
||||
+ { "nec-usb-xhci", "superspeed-ports-first", "off" },
|
||||
+ { "nec-usb-xhci", "force-pcie-endcap", "on" },
|
||||
+ { "pci-serial", "prog_if", stringify(0) },
|
||||
+ { "virtio-net-pci", "guest_announce", "off" },
|
||||
+ { "ICH9-LPC", "memory-hotplug-support", "off" },
|
||||
+ { "xio3130-downstream", COMPAT_PROP_PCP, "off" },
|
||||
+ { "ioh3420", COMPAT_PROP_PCP, "off" },
|
||||
+ { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" },
|
||||
+ { "e1000", "mitigation", "off" },
|
||||
+ { "virtio-net-pci", "ctrl_guest_offloads", "off" },
|
||||
+ { "Conroe" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Penryn" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Nehalem" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Nehalem-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Westmere" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Westmere-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Opteron_G1" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Opteron_G2" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Opteron_G3" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Opteron_G4" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+ { "Opteron_G5" "-" TYPE_X86_CPU, "x2apic", "on" },
|
||||
+};
|
||||
+const size_t pc_rhel_7_0_compat_len = G_N_ELEMENTS(pc_rhel_7_0_compat);
|
||||
+
|
||||
+/*
|
||||
+ * RHEL: These properties only apply to the RHEL exported machine types
|
||||
+ * pc-4.2/2.11 for the purpose to have a limited upstream machines support
|
||||
+ * which can be migrated to RHEL. Let's avoid touching hw_compat_4_2 directly
|
||||
+ * so that we can have some isolation against the upstream code.
|
||||
+ */
|
||||
+GlobalProperty hw_compat_4_2_extra[] = {
|
||||
+ /* By default enlarge the default virtio-net-pci ROM to 512KB. */
|
||||
+ { "virtio-net-pci", "romsize", "0x80000" },
|
||||
+};
|
||||
+const size_t hw_compat_4_2_extra_len = G_N_ELEMENTS(hw_compat_4_2_extra);
|
||||
+
|
||||
GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
|
||||
{
|
||||
GSIState *s;
|
||||
@@ -1694,6 +1804,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
@@ -904,7 +1194,8 @@ void pc_memory_init(PCMachineState *pcms,
|
||||
option_rom_mr = g_malloc(sizeof(*option_rom_mr));
|
||||
memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
|
||||
&error_fatal);
|
||||
- if (pcmc->pci_enabled) {
|
||||
+ /* RH difference: See bz 1489800, explicitly make ROM ro */
|
||||
+ if (pcmc->pc_rom_ro) {
|
||||
memory_region_set_readonly(option_rom_mr, true);
|
||||
}
|
||||
memory_region_add_subregion_overlap(rom_memory,
|
||||
@@ -1694,6 +1985,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
pcmc->pvh_enabled = true;
|
||||
pcmc->kvmclock_create_always = true;
|
||||
assert(!mc->get_hotplug_handler);
|
||||
+ pcmc->pc_rom_ro = true;
|
||||
+ mc->async_pf_vmexit_disable = false;
|
||||
mc->get_hotplug_handler = pc_get_hotplug_handler;
|
||||
mc->hotplug_allowed = pc_hotplug_allowed;
|
||||
mc->cpu_index_to_instance_props = x86_cpu_index_to_props;
|
||||
@@ -1704,7 +1815,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
@@ -1704,7 +1997,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
|
||||
mc->has_hotpluggable_cpus = true;
|
||||
mc->default_boot_order = "cad";
|
||||
mc->block_default_type = IF_IDE;
|
||||
|
@ -170,7 +455,7 @@ index a2ef40ecbc..b6d2db8d04 100644
|
|||
mc->wakeup = pc_machine_wakeup;
|
||||
hc->pre_plug = pc_machine_device_pre_plug_cb;
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index dda3f64f19..dabc6c1933 100644
|
||||
index dda3f64f19..2885edffe9 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -50,6 +50,7 @@
|
||||
|
@ -192,15 +477,187 @@ index dda3f64f19..dabc6c1933 100644
|
|||
pcmc->smbios_uuid_encoded,
|
||||
pcmc->smbios_stream_product,
|
||||
pcmc->smbios_stream_version,
|
||||
@@ -314,6 +315,7 @@ static void pc_init1(MachineState *machine,
|
||||
@@ -314,6 +315,15 @@ static void pc_init1(MachineState *machine,
|
||||
* hw_compat_*, pc_compat_*, or * pc_*_machine_options().
|
||||
*/
|
||||
|
||||
+/*
|
||||
+ * NOTE! Not all the upstream machine types are disabled for RHEL. For
|
||||
+ * providing a very limited support for upstream machine types, pc machines
|
||||
+ * 2.11 and 4.2 are exposed explicitly. This will make the below "#if" macros
|
||||
+ * a bit messed up, but please read this comment first so that we can have a
|
||||
+ * rough understanding of what we're going to do.
|
||||
+ */
|
||||
+
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
static void pc_compat_2_3_fn(MachineState *machine)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(machine);
|
||||
@@ -951,3 +953,65 @@ static void xenfv_3_1_machine_options(MachineClass *m)
|
||||
@@ -389,6 +399,8 @@ static void pc_xen_hvm_init(MachineState *machine)
|
||||
}
|
||||
#endif
|
||||
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
+
|
||||
#define DEFINE_I440FX_MACHINE(suffix, name, compatfn, optionfn) \
|
||||
static void pc_init_##suffix(MachineState *machine) \
|
||||
{ \
|
||||
@@ -424,8 +436,10 @@ static void pc_i440fx_6_2_machine_options(MachineClass *m)
|
||||
pcmc->default_cpu_version = 1;
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v6_2, "pc-i440fx-6.2", NULL,
|
||||
pc_i440fx_6_2_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_6_1_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -437,8 +451,10 @@ static void pc_i440fx_6_1_machine_options(MachineClass *m)
|
||||
m->smp_props.prefer_sockets = true;
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v6_1, "pc-i440fx-6.1", NULL,
|
||||
pc_i440fx_6_1_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_6_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -449,8 +465,10 @@ static void pc_i440fx_6_0_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_6_0, pc_compat_6_0_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL,
|
||||
pc_i440fx_6_0_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_5_2_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -461,8 +479,10 @@ static void pc_i440fx_5_2_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v5_2, "pc-i440fx-5.2", NULL,
|
||||
pc_i440fx_5_2_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_5_1_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -477,8 +497,10 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m)
|
||||
pcmc->pci_root_uid = 1;
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v5_1, "pc-i440fx-5.1", NULL,
|
||||
pc_i440fx_5_1_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_5_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -491,8 +513,10 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
|
||||
m->auto_enable_numa_with_memdev = false;
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v5_0, "pc-i440fx-5.0", NULL,
|
||||
pc_i440fx_5_0_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_4_2_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -501,8 +525,21 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
|
||||
m->is_default = false;
|
||||
compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
|
||||
compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
|
||||
+
|
||||
+ /*
|
||||
+ * RHEL: Mark all upstream machines as deprecated because they're not
|
||||
+ * supported by RHEL, even if exported.
|
||||
+ */
|
||||
+ m->deprecation_reason = "Not supported by RHEL";
|
||||
+ /*
|
||||
+ * RHEL: Specific compat properties to have limited support for upstream
|
||||
+ * machines exported.
|
||||
+ */
|
||||
+ compat_props_add(m->compat_props, hw_compat_4_2_extra,
|
||||
+ hw_compat_4_2_extra_len);
|
||||
}
|
||||
|
||||
+/* RHEL: Export pc-4.2 */
|
||||
DEFINE_I440FX_MACHINE(v4_2, "pc-i440fx-4.2", NULL,
|
||||
pc_i440fx_4_2_machine_options);
|
||||
|
||||
@@ -515,8 +552,10 @@ static void pc_i440fx_4_1_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v4_1, "pc-i440fx-4.1", NULL,
|
||||
pc_i440fx_4_1_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_4_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -529,8 +568,10 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,
|
||||
pc_i440fx_4_0_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_3_1_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -546,8 +587,10 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,
|
||||
pc_i440fx_3_1_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_3_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -556,8 +599,10 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_3_0, pc_compat_3_0_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
|
||||
pc_i440fx_3_0_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_2_12_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -566,8 +611,10 @@ static void pc_i440fx_2_12_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_2_12, pc_compat_2_12_len);
|
||||
}
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL,
|
||||
pc_i440fx_2_12_machine_options);
|
||||
+#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_2_11_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -576,9 +623,11 @@ static void pc_i440fx_2_11_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_2_11, pc_compat_2_11_len);
|
||||
}
|
||||
|
||||
+/* RHEL: Export pc-2.11 */
|
||||
DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL,
|
||||
pc_i440fx_2_11_machine_options);
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
static void pc_i440fx_2_10_machine_options(MachineClass *m)
|
||||
{
|
||||
pc_i440fx_2_11_machine_options(m);
|
||||
@@ -951,3 +1000,224 @@ static void xenfv_3_1_machine_options(MachineClass *m)
|
||||
DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
|
||||
xenfv_3_1_machine_options);
|
||||
#endif
|
||||
|
@ -266,8 +723,167 @@ index dda3f64f19..dabc6c1933 100644
|
|||
+
|
||||
+DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760,
|
||||
+ pc_machine_rhel760_options);
|
||||
+
|
||||
+static void pc_init_rhel750(MachineState *machine)
|
||||
+{
|
||||
+ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
|
||||
+ TYPE_I440FX_PCI_DEVICE);
|
||||
+}
|
||||
+
|
||||
+static void pc_machine_rhel750_options(MachineClass *m)
|
||||
+{
|
||||
+ pc_machine_rhel760_options(m);
|
||||
+ m->alias = NULL;
|
||||
+ m->is_default = 0;
|
||||
+ m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)";
|
||||
+ m->auto_enable_numa_with_memhp = false;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750,
|
||||
+ pc_machine_rhel750_options);
|
||||
+
|
||||
+static void pc_init_rhel740(MachineState *machine)
|
||||
+{
|
||||
+ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
|
||||
+ TYPE_I440FX_PCI_DEVICE);
|
||||
+}
|
||||
+
|
||||
+static void pc_machine_rhel740_options(MachineClass *m)
|
||||
+{
|
||||
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
+ pc_machine_rhel750_options(m);
|
||||
+ m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)";
|
||||
+ pcmc->pc_rom_ro = false;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740,
|
||||
+ pc_machine_rhel740_options);
|
||||
+
|
||||
+static void pc_init_rhel730(MachineState *machine)
|
||||
+{
|
||||
+ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
|
||||
+ TYPE_I440FX_PCI_DEVICE);
|
||||
+}
|
||||
+
|
||||
+static void pc_machine_rhel730_options(MachineClass *m)
|
||||
+{
|
||||
+ X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
|
||||
+ pc_machine_rhel740_options(m);
|
||||
+ m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)";
|
||||
+ x86mc->fwcfg_dma_enabled = false;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730,
|
||||
+ pc_machine_rhel730_options);
|
||||
+
|
||||
+
|
||||
+static void pc_init_rhel720(MachineState *machine)
|
||||
+{
|
||||
+ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
|
||||
+ TYPE_I440FX_PCI_DEVICE);
|
||||
+}
|
||||
+
|
||||
+static void pc_machine_rhel720_options(MachineClass *m)
|
||||
+{
|
||||
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
+ X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
|
||||
+ pc_machine_rhel730_options(m);
|
||||
+ m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)";
|
||||
+ /* From pc_i440fx_2_5_machine_options */
|
||||
+ x86mc->save_tsc_khz = false;
|
||||
+ m->legacy_fw_cfg_order = 1;
|
||||
+ /* Note: broken_reserved_end was already in 7.2 */
|
||||
+ /* From pc_i440fx_2_6_machine_options */
|
||||
+ pcmc->legacy_cpu_hotplug = true;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_2_compat, pc_rhel_7_2_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720,
|
||||
+ pc_machine_rhel720_options);
|
||||
+
|
||||
+static void pc_compat_rhel710(MachineState *machine)
|
||||
+{
|
||||
+ PCMachineState *pcms = PC_MACHINE(machine);
|
||||
+ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
|
||||
+
|
||||
+ /* From pc_compat_2_2 */
|
||||
+ pcmc->rsdp_in_ram = false;
|
||||
+ machine->suppress_vmdesc = true;
|
||||
+
|
||||
+ /* From pc_compat_2_1 */
|
||||
+ pcmc->smbios_uuid_encoded = false;
|
||||
+ x86_cpu_change_kvm_default("svm", NULL);
|
||||
+ pcmc->enforce_aligned_dimm = false;
|
||||
+
|
||||
+ /* Disable all the extra subsections that were added in 2.2 */
|
||||
+ migrate_pre_2_2 = true;
|
||||
+
|
||||
+ /* From pc_i440fx_2_4_machine_options */
|
||||
+ pcmc->broken_reserved_end = true;
|
||||
+}
|
||||
+
|
||||
+static void pc_init_rhel710(MachineState *machine)
|
||||
+{
|
||||
+ pc_compat_rhel710(machine);
|
||||
+ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
|
||||
+ TYPE_I440FX_PCI_DEVICE);
|
||||
+}
|
||||
+
|
||||
+static void pc_machine_rhel710_options(MachineClass *m)
|
||||
+{
|
||||
+ pc_machine_rhel720_options(m);
|
||||
+ m->family = "pc_piix_Y";
|
||||
+ m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)";
|
||||
+ m->default_display = "cirrus";
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_1, hw_compat_rhel_7_1_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_1_compat, pc_rhel_7_1_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710,
|
||||
+ pc_machine_rhel710_options);
|
||||
+
|
||||
+static void pc_compat_rhel700(MachineState *machine)
|
||||
+{
|
||||
+ PCMachineState *pcms = PC_MACHINE(machine);
|
||||
+ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
|
||||
+
|
||||
+ pc_compat_rhel710(machine);
|
||||
+
|
||||
+ /* Upstream enables it for everyone, we're a little more selective */
|
||||
+ x86_cpu_change_kvm_default("x2apic", NULL);
|
||||
+ x86_cpu_change_kvm_default("svm", NULL);
|
||||
+ pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */
|
||||
+ pcmc->smbios_legacy_mode = true;
|
||||
+ pcmc->has_reserved_memory = false;
|
||||
+ migrate_cve_2014_5263_xhci_fields = true;
|
||||
+}
|
||||
+
|
||||
+static void pc_init_rhel700(MachineState *machine)
|
||||
+{
|
||||
+ pc_compat_rhel700(machine);
|
||||
+ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
|
||||
+ TYPE_I440FX_PCI_DEVICE);
|
||||
+}
|
||||
+
|
||||
+static void pc_machine_rhel700_options(MachineClass *m)
|
||||
+{
|
||||
+ pc_machine_rhel710_options(m);
|
||||
+ m->family = "pc_piix_Y";
|
||||
+ m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)";
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_0_compat, pc_rhel_7_0_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700,
|
||||
+ pc_machine_rhel700_options);
|
||||
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
|
||||
index 235054a643..04c911da18 100644
|
||||
index 235054a643..c67418b6a9 100644
|
||||
--- a/hw/i386/pc_q35.c
|
||||
+++ b/hw/i386/pc_q35.c
|
||||
@@ -197,8 +197,8 @@ static void pc_q35_init(MachineState *machine)
|
||||
|
@ -289,7 +905,7 @@ index 235054a643..04c911da18 100644
|
|||
static void pc_q35_machine_options(MachineClass *m)
|
||||
{
|
||||
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
@@ -620,3 +621,175 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
|
||||
@@ -620,3 +621,232 @@ static void pc_q35_2_4_machine_options(MachineClass *m)
|
||||
|
||||
DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
|
||||
pc_q35_2_4_machine_options);
|
||||
|
@ -465,8 +1081,65 @@ index 235054a643..04c911da18 100644
|
|||
+
|
||||
+DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760,
|
||||
+ pc_q35_machine_rhel760_options);
|
||||
+
|
||||
+static void pc_q35_init_rhel750(MachineState *machine)
|
||||
+{
|
||||
+ pc_q35_init(machine);
|
||||
+}
|
||||
+
|
||||
+static void pc_q35_machine_rhel750_options(MachineClass *m)
|
||||
+{
|
||||
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
+ pc_q35_machine_rhel760_options(m);
|
||||
+ m->alias = NULL;
|
||||
+ m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)";
|
||||
+ m->auto_enable_numa_with_memhp = false;
|
||||
+ pcmc->default_nic_model = "e1000";
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750,
|
||||
+ pc_q35_machine_rhel750_options);
|
||||
+
|
||||
+static void pc_q35_init_rhel740(MachineState *machine)
|
||||
+{
|
||||
+ pc_q35_init(machine);
|
||||
+}
|
||||
+
|
||||
+static void pc_q35_machine_rhel740_options(MachineClass *m)
|
||||
+{
|
||||
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
+ pc_q35_machine_rhel750_options(m);
|
||||
+ m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)";
|
||||
+ pcmc->pc_rom_ro = false;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740,
|
||||
+ pc_q35_machine_rhel740_options);
|
||||
+
|
||||
+static void pc_q35_init_rhel730(MachineState *machine)
|
||||
+{
|
||||
+ pc_q35_init(machine);
|
||||
+}
|
||||
+
|
||||
+static void pc_q35_machine_rhel730_options(MachineClass *m)
|
||||
+{
|
||||
+ X86MachineClass *x86mc = X86_MACHINE_CLASS(m);
|
||||
+ pc_q35_machine_rhel740_options(m);
|
||||
+ m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)";
|
||||
+ m->max_cpus = 255;
|
||||
+ x86mc->fwcfg_dma_enabled = false;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len);
|
||||
+ compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len);
|
||||
+}
|
||||
+
|
||||
+DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730,
|
||||
+ pc_q35_machine_rhel730_options);
|
||||
diff --git a/include/hw/boards.h b/include/hw/boards.h
|
||||
index b0a6e05b48..3c3d2ad450 100644
|
||||
index 8bba96ef2b..04e8759815 100644
|
||||
--- a/include/hw/boards.h
|
||||
+++ b/include/hw/boards.h
|
||||
@@ -263,6 +263,8 @@ struct MachineClass {
|
||||
|
@ -479,10 +1152,20 @@ index b0a6e05b48..3c3d2ad450 100644
|
|||
bool smbus_no_migration_support;
|
||||
bool nvdimm_supported;
|
||||
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
|
||||
index 7ccc9a1a07..9689a58b14 100644
|
||||
index 7ccc9a1a07..d0544ee119 100644
|
||||
--- a/include/hw/i386/pc.h
|
||||
+++ b/include/hw/i386/pc.h
|
||||
@@ -280,6 +280,27 @@ extern const size_t pc_compat_1_5_len;
|
||||
@@ -125,6 +125,9 @@ struct PCMachineClass {
|
||||
|
||||
/* create kvmclock device even when KVM PV features are not exposed */
|
||||
bool kvmclock_create_always;
|
||||
+
|
||||
+ /* RH only, see bz 1489800 */
|
||||
+ bool pc_rom_ro;
|
||||
};
|
||||
|
||||
#define TYPE_PC_MACHINE "generic-pc-machine"
|
||||
@@ -280,6 +283,48 @@ extern const size_t pc_compat_1_5_len;
|
||||
extern GlobalProperty pc_compat_1_4[];
|
||||
extern const size_t pc_compat_1_4_len;
|
||||
|
||||
|
@ -506,6 +1189,27 @@ index 7ccc9a1a07..9689a58b14 100644
|
|||
+
|
||||
+extern GlobalProperty pc_rhel_7_6_compat[];
|
||||
+extern const size_t pc_rhel_7_6_compat_len;
|
||||
+
|
||||
+extern GlobalProperty pc_rhel_7_5_compat[];
|
||||
+extern const size_t pc_rhel_7_5_compat_len;
|
||||
+
|
||||
+extern GlobalProperty pc_rhel_7_4_compat[];
|
||||
+extern const size_t pc_rhel_7_4_compat_len;
|
||||
+
|
||||
+extern GlobalProperty pc_rhel_7_3_compat[];
|
||||
+extern const size_t pc_rhel_7_3_compat_len;
|
||||
+
|
||||
+extern GlobalProperty pc_rhel_7_2_compat[];
|
||||
+extern const size_t pc_rhel_7_2_compat_len;
|
||||
+
|
||||
+extern GlobalProperty pc_rhel_7_1_compat[];
|
||||
+extern const size_t pc_rhel_7_1_compat_len;
|
||||
+
|
||||
+extern GlobalProperty pc_rhel_7_0_compat[];
|
||||
+extern const size_t pc_rhel_7_0_compat_len;
|
||||
+
|
||||
+extern GlobalProperty hw_compat_4_2_extra[];
|
||||
+extern const size_t hw_compat_4_2_extra_len;
|
||||
+
|
||||
/* Helper for setting model-id for CPU models that changed model-id
|
||||
* depending on QEMU versions up to QEMU 2.4.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From b071f3eaa77dde1567d70b43d0b2975efe380da2 Mon Sep 17 00:00:00 2001
|
||||
From 740a2dd943a2e0fcd41a9cd8eb94a136f8f49fa2 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Wed, 2 Sep 2020 09:39:41 +0200
|
||||
Subject: Enable make check
|
||||
|
@ -7,19 +7,51 @@ 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
|
||||
|
||||
Rebase changes (4.1.0-rc0):
|
||||
- removed iotests 068
|
||||
|
||||
Rebase changes (4.1.0-rc1):
|
||||
- remove all 205 tests (unstable)
|
||||
|
||||
Rebase changes (4.2.0-rc0):
|
||||
- partially disable hd-geo-test (requires lsi53c895a)
|
||||
|
||||
Rebase changes (5.1.0-rc1):
|
||||
- Disable qtest/q35-test (uses upstream machine types)
|
||||
- Do not run iotests on make checka
|
||||
- Enabled iotests 071 and 099
|
||||
|
||||
Rebase changes (5.2.0 rc0):
|
||||
- Disable cdrom tests (unsupported devices) on x86_64
|
||||
- disable fuzz test
|
||||
|
||||
Rebase changes (6.0.0):
|
||||
- Disabled xlnx-can-test
|
||||
- Disable pxb-pcie subtest for bios-table-test
|
||||
- Replace qtest usage of upstream q35 machine type with pc-q35-rhel8.4.0
|
||||
- Not run cdrom-test on aarch64
|
||||
|
||||
Rebase changes (6.1.0):
|
||||
- removed unnecessary test changes
|
||||
- Remove unnecessary test disabling changes
|
||||
|
||||
Rebase changes (6.2.0 RC0):
|
||||
- new way of disabling bios-table-test
|
||||
Rebase changes (weekly-211006):
|
||||
- New handling for bios-table-test (disabled downstream)
|
||||
|
||||
Merged patches (6.1.0):
|
||||
- 2f129df7d3 redhat: Enable the 'test-block-iothread' test again
|
||||
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
|
||||
|
||||
Merged patches (4.1.0-rc0):
|
||||
- 41288ff redhat: Remove raw iotest 205
|
||||
---
|
||||
.distro/qemu-kvm.spec.template | 5 ++---
|
||||
redhat/qemu-kvm.spec.template | 2 +-
|
||||
tests/qemu-iotests/051 | 8 ++++----
|
||||
tests/qtest/bios-tables-test.c | 6 +++---
|
||||
tests/qtest/bios-tables-test.c | 5 ++++-
|
||||
tests/qtest/boot-serial-test.c | 6 +++++-
|
||||
tests/qtest/cdrom-test.c | 4 ++++
|
||||
tests/qtest/cpu-plug-test.c | 4 ++--
|
||||
|
@ -31,7 +63,7 @@ Merged patches (6.1.0):
|
|||
tests/qtest/prom-env-test.c | 4 ++++
|
||||
tests/qtest/test-x86-cpuid-compat.c | 2 ++
|
||||
tests/qtest/usb-hcd-xhci-test.c | 4 ++++
|
||||
14 files changed, 41 insertions(+), 25 deletions(-)
|
||||
14 files changed, 41 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
|
||||
index 1d2fa93a11..c8a2815f54 100755
|
||||
|
@ -62,33 +94,32 @@ index 1d2fa93a11..c8a2815f54 100755
|
|||
*)
|
||||
;;
|
||||
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
|
||||
index 258874167e..62745181a8 100644
|
||||
index 258874167e..16d8304cde 100644
|
||||
--- a/tests/qtest/bios-tables-test.c
|
||||
+++ b/tests/qtest/bios-tables-test.c
|
||||
@@ -1371,7 +1371,7 @@ static void test_acpi_virt_tcg_numamem(void)
|
||||
free_test_data(&data);
|
||||
@@ -1372,6 +1372,7 @@ static void test_acpi_virt_tcg_numamem(void)
|
||||
|
||||
}
|
||||
-
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
+#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
static void test_acpi_virt_tcg_pxb(void)
|
||||
{
|
||||
test_data data = {
|
||||
@@ -1403,7 +1403,7 @@ static void test_acpi_virt_tcg_pxb(void)
|
||||
@@ -1403,6 +1404,7 @@ static void test_acpi_virt_tcg_pxb(void)
|
||||
|
||||
free_test_data(&data);
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
|
||||
static void test_acpi_tcg_acpi_hmat(const char *machine)
|
||||
{
|
||||
test_data data;
|
||||
@@ -1644,7 +1644,7 @@ int main(int argc, char *argv[])
|
||||
@@ -1644,7 +1646,8 @@ int main(int argc, char *argv[])
|
||||
qtest_add_func("acpi/virt", test_acpi_virt_tcg);
|
||||
qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
|
||||
qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
|
||||
- qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
|
||||
+/* qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); */
|
||||
+ /* Disabled for Red Hat Enterprise Linux
|
||||
+ qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); */
|
||||
qtest_add_func("acpi/virt/oem-fields", test_acpi_oem_fields_virt);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 55dcef9d806aa530f10e3ca42eb24d52f850d674 Mon Sep 17 00:00:00 2001
|
||||
From e9ebc159a9acf108e1ec6f622be3f256cf14aba7 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
|
||||
|
@ -22,10 +22,16 @@ for other uses. Stepping down a bit, the number 32 arbitrarily
|
|||
matches the number of slots on a PCI bus and is also a nice power
|
||||
of two.
|
||||
|
||||
Count of slots increased to 509 later so we could increase limit
|
||||
to 64 as some usecases require more than 32 devices.
|
||||
|
||||
Signed-off-by: Bandan Das <bsd@redhat.com>
|
||||
|
||||
Rebase notes (2.8.0):
|
||||
- removed return value for vfio_realize (commit 1a22aca)
|
||||
|
||||
Merged patches (2.9.0):
|
||||
- 17eb774 vfio: Use error_setg when reporting max assigned device overshoot
|
||||
|
||||
Merged patches (4.1.0-rc3):
|
||||
- 2b89558 vfio: increase the cap on number of assigned devices to 64
|
||||
---
|
||||
hw/vfio/pci.c | 29 ++++++++++++++++++++++++++++-
|
||||
hw/vfio/pci.h | 1 +
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From fcccb5c061b8bbae29de59637c5ad4cf4416281b Mon Sep 17 00:00:00 2001
|
||||
From b736b0c41dd62ed6f874a7b33ca1d4f9ceab4573 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 354c9ce982e566ddb3c724a57252986dcb7c36db Mon Sep 17 00:00:00 2001
|
||||
From 9a7621819821ee88d2f99d6b629fd87aa9a07758 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
|
||||
|
@ -13,6 +13,26 @@ default and minimize the ppc hack in kvm-all.c.
|
|||
Signed-off-by: David Hildenbrand <david@redhat.com>
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Signed-off-by: Danilo Cesar Lemes de Paula <ddepaula@redhat.com>
|
||||
|
||||
Rebase notes (2.11.0):
|
||||
- Removed CONFIG_RHV reference
|
||||
- Update commit log
|
||||
|
||||
Merged patches (2.11.0):
|
||||
- 92fef14623 redhat: remove manual max_cpus limitations for ppc
|
||||
- bb722e9eff redhat: globally limit the maximum number of CPUs
|
||||
- fdeef3c1c7 RHEL: Set vcpus hard limit to 240 for Power
|
||||
- 0584216921 Match POWER max cpus to x86
|
||||
|
||||
Signed-off-by: Andrew Jones <drjones@redhat.com>
|
||||
|
||||
Merged patches (5.1.0):
|
||||
- redhat: globally limit the maximum number of CPUs
|
||||
- redhat: remove manual max_cpus limitations for ppc
|
||||
- use recommended max vcpu count
|
||||
|
||||
Merged patches (5.2.0 rc0):
|
||||
- f8a4123 vl: Remove downstream-only MAX_RHEL_CPUS code
|
||||
---
|
||||
accel/kvm/kvm-all.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From b057b4ebec0f87f21ba4a15adbb2a1bde7240ed5 Mon Sep 17 00:00:00 2001
|
||||
From 0d3fc0b4c5773c6cabb0a58c064475f76eb6ac1e Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Wed, 8 Jul 2020 08:35:50 +0200
|
||||
Subject: Use qemu-kvm in documentation instead of qemu-system-<arch>
|
||||
|
@ -16,6 +16,12 @@ 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>
|
||||
|
||||
Rebase notes (5.1.0 rc0):
|
||||
- qemu-block-drivers.texi converted to qemu-block-drivers.rst (upstream)
|
||||
|
||||
Rebase notes (5.2.0 rc0):
|
||||
- rewrite patch to new docs structure
|
||||
---
|
||||
docs/defs.rst.inc | 4 ++--
|
||||
docs/tools/qemu-trace-stap.rst | 14 +++++++-------
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 41fe05330d095f69f12973b0540466439e030047 Mon Sep 17 00:00:00 2001
|
||||
From d95768c039a2bf6b68422f83a8d55dad41bd3181 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]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 295ee942608d48ab167aa76adabf3697c28e6910 Mon Sep 17 00:00:00 2001
|
||||
From 92bb62c47eab021f8dabecd09b5fbc1706e6a29c Mon Sep 17 00:00:00 2001
|
||||
From: David Gibson <dgibson@redhat.com>
|
||||
Date: Wed, 6 Feb 2019 03:58:56 +0000
|
||||
Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
From a9b5da617c29f48199cbea08d6a1c083877dce10 Mon Sep 17 00:00:00 2001
|
||||
From: Laurent Vivier <lvivier@redhat.com>
|
||||
Date: Mon, 15 Nov 2021 14:22:29 +0100
|
||||
Subject: compat: Update hw_compat_rhel_8_5
|
||||
|
||||
RH-Author: Laurent Vivier <lvivier@redhat.com>
|
||||
RH-MergeRequest: 66: redhat: Update pseries-rhel8.5.0 machine type
|
||||
RH-Commit: [1/2] 232f2ad2b29d250fbdb8fcea9d814704c575ba2b
|
||||
RH-Bugzilla: 2022608
|
||||
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
|
||||
|
||||
Add properties from hw_compat_6_1 as it already includes the ones from
|
||||
hw_compat_6_0. Add a lately added property from 6.0 too.
|
||||
|
||||
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
||||
--
|
||||
Rebase notes (6.2.0 rc3):
|
||||
- Included compatc changes introduced in RC2
|
||||
---
|
||||
hw/core/machine.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 62febde5aa..736c765c30 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "hw/virtio/virtio-pci.h"
|
||||
|
||||
/*
|
||||
- * Mostly the same as hw_compat_6_0
|
||||
+ * Mostly the same as hw_compat_6_0 and hw_compat_6_1
|
||||
*/
|
||||
GlobalProperty hw_compat_rhel_8_5[] = {
|
||||
/* hw_compat_rhel_8_5 from hw_compat_6_0 */
|
||||
@@ -51,6 +51,12 @@ GlobalProperty hw_compat_rhel_8_5[] = {
|
||||
{ "e1000", "init-vet", "off" },
|
||||
/* hw_compat_rhel_8_5 from hw_compat_6_0 */
|
||||
{ "e1000e", "init-vet", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_0 */
|
||||
+ { "vhost-vsock-device", "seqpacket", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_1 */
|
||||
+ { "vhost-user-vsock-device", "seqpacket", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_1 */
|
||||
+ { "nvme-ns", "shared", "off" },
|
||||
};
|
||||
const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5);
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
From a3bb2330bbf68faabc57b768cdf3ae2f4f4d86f3 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Wolf <kwolf@redhat.com>
|
||||
Date: Fri, 20 Aug 2021 18:25:12 +0200
|
||||
Subject: qcow2: Deprecation warning when opening v2 images rw
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-MergeRequest: 37: qcow2: Deprecation warning when opening v2 images rw
|
||||
RH-Commit: [1/1] f450d0ae32d35063b28c72c4f2d2ebb9e6d8db3e (kmwolf/centos-qemu-kvm)
|
||||
RH-Bugzilla: 1951814
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
|
||||
qcow2 v3 has been around for a long time (since QEMU 1.1/RHEL 7), so
|
||||
there is no real reason any more to use it. People still using it might
|
||||
do so unintentionally. Warn about it and suggest upgrading during the
|
||||
RHEL 9 timeframe so that the code can possibly be disabled in RHEL 10.
|
||||
|
||||
The warning is restricted to read-write mode and the system emulator.
|
||||
The primary motivation for not having it in qemu-img is that 'qemu-img
|
||||
amend' for upgrades would warn otherwise. It also avoids having to make
|
||||
too many changes to the test suite.
|
||||
|
||||
bdrv_uses_whitelist() is used as a proxy for deciding whether we are
|
||||
running in a tool or the system emulator. This is not entirely clean,
|
||||
but it's what is available and the same function qcow2_do_open() already
|
||||
uses it this way for another warning.
|
||||
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
|
||||
patch_name: kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch
|
||||
present_in_specfile: true
|
||||
location_in_specfile: 116
|
||||
---
|
||||
Rebase notes (6.1.0):
|
||||
- Replace bs->read_only with bdrv_is_read_only
|
||||
---
|
||||
block/qcow2.c | 6 ++++++
|
||||
tests/qemu-iotests/common.filter | 1 +
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/block/qcow2.c b/block/qcow2.c
|
||||
index d509016756..37d1c26a71 100644
|
||||
--- a/block/qcow2.c
|
||||
+++ b/block/qcow2.c
|
||||
@@ -1336,6 +1336,12 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
|
||||
ret = -ENOTSUP;
|
||||
goto fail;
|
||||
}
|
||||
+ if (header.version < 3 && !bdrv_is_read_only(bs) && bdrv_uses_whitelist()) {
|
||||
+ warn_report_once("qcow2 v2 images are deprecated and may not be "
|
||||
+ "supported in future versions. Please consider "
|
||||
+ "upgrading the image with 'qemu-img amend "
|
||||
+ "-o compat=v3'.");
|
||||
+ }
|
||||
|
||||
s->qcow_version = header.version;
|
||||
|
||||
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
|
||||
index 2b2b53946c..c5c2dc39bd 100644
|
||||
--- a/tests/qemu-iotests/common.filter
|
||||
+++ b/tests/qemu-iotests/common.filter
|
||||
@@ -82,6 +82,7 @@ _filter_qemu()
|
||||
{
|
||||
$SED -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \
|
||||
-e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
|
||||
+ -e "/qcow2 v2 images are deprecated/d" \
|
||||
-e $'s#\r##' # QEMU monitor uses \r\n line endings
|
||||
}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
From 82358c35f04f026820b3907069a6c19cd95b654d Mon Sep 17 00:00:00 2001
|
||||
From: Laurent Vivier <lvivier@redhat.com>
|
||||
Date: Mon, 15 Nov 2021 14:25:33 +0100
|
||||
Subject: redhat: Update pseries-rhel8.5.0 machine type
|
||||
|
||||
RH-Author: Laurent Vivier <lvivier@redhat.com>
|
||||
RH-MergeRequest: 66: redhat: Update pseries-rhel8.5.0 machine type
|
||||
RH-Commit: [2/2] 36f7ad1ea56baaaecb139875ad0a90a6470196be
|
||||
RH-Bugzilla: 2022608
|
||||
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Greg Kurz <gkurz@redhat.com>
|
||||
`
|
||||
We don't introduce a new machine type for rhel8.6.0 but we need
|
||||
to keep compatibility with rhel8.5.0 machine type.
|
||||
|
||||
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
||||
---
|
||||
hw/ppc/spapr.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
|
||||
index cace86028d..2f27888d8a 100644
|
||||
--- a/hw/ppc/spapr.c
|
||||
+++ b/hw/ppc/spapr.c
|
||||
@@ -5177,10 +5177,14 @@ static void spapr_machine_rhel_default_class_options(MachineClass *mc)
|
||||
|
||||
static void spapr_machine_rhel850_class_options(MachineClass *mc)
|
||||
{
|
||||
+ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
|
||||
+
|
||||
/* The default machine type must apply the RHEL specific defaults */
|
||||
spapr_machine_rhel_default_class_options(mc);
|
||||
compat_props_add(mc->compat_props, hw_compat_rhel_8_5,
|
||||
hw_compat_rhel_8_5_len);
|
||||
+ smc->pre_6_2_numa_affinity = true;
|
||||
+ mc->smp_props.prefer_sockets = true;
|
||||
}
|
||||
|
||||
DEFINE_SPAPR_MACHINE(rhel850, "rhel8.5.0", true);
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 3b82be3dd3d5254baedf82ba2a6cf0412e84a991 Mon Sep 17 00:00:00 2001
|
||||
From ce73e939b993cc6be170cdb5d3f2068270593f2b Mon Sep 17 00:00:00 2001
|
||||
From: Eric Auger <eric.auger@redhat.com>
|
||||
Date: Tue, 16 Nov 2021 17:03:07 +0100
|
||||
Subject: redhat: virt-rhel8.5.0: Update machine type compatibility for QEMU
|
||||
|
@ -29,10 +29,10 @@ Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
|
||||
index 7d51824263..6ba9a2c2e1 100644
|
||||
index c77d26ab13..e8941afd01 100644
|
||||
--- a/hw/arm/virt.c
|
||||
+++ b/hw/arm/virt.c
|
||||
@@ -3230,7 +3230,12 @@ type_init(rhel_machine_init);
|
||||
@@ -3225,8 +3225,13 @@ type_init(rhel_machine_init);
|
||||
|
||||
static void rhel850_virt_options(MachineClass *mc)
|
||||
{
|
||||
|
@ -45,6 +45,7 @@ index 7d51824263..6ba9a2c2e1 100644
|
|||
+ vmc->no_tcg_its = true;
|
||||
}
|
||||
DEFINE_RHEL_MACHINE_AS_LATEST(8, 5, 0)
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,15 +1,13 @@
|
|||
From ef5afcc86dc44d1c9d3030a8ceca2018df86c6ec Mon Sep 17 00:00:00 2001
|
||||
From f9643b6934657292aae0b830627b1e5f9b8cbaa1 Mon Sep 17 00:00:00 2001
|
||||
From: Eduardo Habkost <ehabkost@redhat.com>
|
||||
Date: Tue, 19 Oct 2021 13:17:06 -0400
|
||||
Subject: Fix virtio-net-pci* "vectors" compat
|
||||
|
||||
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-MergeRequest: 76: 9.0/6.2.0-rc1 x86 machine type fixes
|
||||
RH-Commit: [20/22] ebb570f053f96d3558bac49962dc7dc88296c207
|
||||
RH-Bugzilla: 2025468
|
||||
RH-Acked-by: quintela1 <quintela@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-MergeRequest: 77: 8.6/6.2 mt fixes
|
||||
RH-Commit: [21/23] 8ad581932275d2698a99f31bec40b14f1dbd3d2e
|
||||
RH-Bugzilla: 2026443
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
hw_compat_rhel_8_4 has an issue: it affects only "virtio-net-pci"
|
||||
but not "virtio-net-pci-transitional" and
|
||||
|
@ -20,15 +18,16 @@ An equivalent fix will be submitted for hw_compat_5_2 upstream.
|
|||
|
||||
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
||||
(cherry picked from commit d45823ab0d0138b2fbaf2ed1e1896d2052f3ccb3)
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
---
|
||||
hw/core/machine.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 53a3caf4fb..448a8dd127 100644
|
||||
index 736c765c30..024b025fc2 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -69,7 +69,11 @@ GlobalProperty hw_compat_rhel_8_4[] = {
|
||||
@@ -71,7 +71,11 @@ GlobalProperty hw_compat_rhel_8_4[] = {
|
||||
/* hw_compat_rhel_8_4 from hw_compat_5_2 */
|
||||
{ "virtio-blk-device", "report-discard-granularity", "off" },
|
||||
/* hw_compat_rhel_8_4 from hw_compat_5_2 */
|
|
@ -1,15 +1,13 @@
|
|||
From eae7d8dd3c3b9aa859a619933f52a4759a42bf66 Mon Sep 17 00:00:00 2001
|
||||
From 7ad8814e583dcc7dc23e3e8398570243b8f176a1 Mon Sep 17 00:00:00 2001
|
||||
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
||||
Date: Tue, 23 Nov 2021 17:57:42 +0000
|
||||
Subject: x86/rhel machine types: Add pc_rhel_8_5_compat
|
||||
|
||||
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-MergeRequest: 76: 9.0/6.2.0-rc1 x86 machine type fixes
|
||||
RH-Commit: [21/22] dd23060695bc0ad892bbfa51d93afe31f5d745c7
|
||||
RH-Bugzilla: 2025468
|
||||
RH-Acked-by: quintela1 <quintela@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-MergeRequest: 77: 8.6/6.2 mt fixes
|
||||
RH-Commit: [22/23] 8bf555c5d78f344b97ffd5c888c7a7bed592d9d0
|
||||
RH-Bugzilla: 2026443
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
Add pc_rhel_8_5_compat as the merge of pc_compat_6_1 and pc_compat_6_0
|
||||
(since 8.5 was based on 6.0).
|
||||
|
@ -25,7 +23,7 @@ Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|||
2 files changed, 24 insertions(+)
|
||||
|
||||
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
|
||||
index b6d2db8d04..4661473d2a 100644
|
||||
index e8109954ca..4c08a1971c 100644
|
||||
--- a/hw/i386/pc.c
|
||||
+++ b/hw/i386/pc.c
|
||||
@@ -387,6 +387,27 @@ GlobalProperty pc_rhel_compat[] = {
|
||||
|
@ -57,10 +55,10 @@ index b6d2db8d04..4661473d2a 100644
|
|||
/* pc_rhel_8_4_compat from pc_compat_5_2 */
|
||||
{ "ICH9-LPC", "x-smi-cpu-hotunplug", "off" },
|
||||
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
|
||||
index 9689a58b14..afb570ba14 100644
|
||||
index d0544ee119..9e8bfb69f8 100644
|
||||
--- a/include/hw/i386/pc.h
|
||||
+++ b/include/hw/i386/pc.h
|
||||
@@ -283,6 +283,9 @@ extern const size_t pc_compat_1_4_len;
|
||||
@@ -286,6 +286,9 @@ extern const size_t pc_compat_1_4_len;
|
||||
extern GlobalProperty pc_rhel_compat[];
|
||||
extern const size_t pc_rhel_compat_len;
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
From 6762f5646943c759ece5972f08eb88364cf0a8ad Mon Sep 17 00:00:00 2001
|
||||
From 7bd99eebadfdbea6a76585b526e7cab1ee8b1fde Mon Sep 17 00:00:00 2001
|
||||
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
||||
Date: Tue, 23 Nov 2021 18:07:49 +0000
|
||||
Subject: x86/rhel machine types: Wire compat into q35 and i440fx
|
||||
|
||||
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-MergeRequest: 76: 9.0/6.2.0-rc1 x86 machine type fixes
|
||||
RH-Commit: [22/22] e2767df0d920773057cb52d346e0106a76cb0a28
|
||||
RH-Bugzilla: 2025468
|
||||
RH-Acked-by: quintela1 <quintela@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-MergeRequest: 77: 8.6/6.2 mt fixes
|
||||
RH-Commit: [23/23] fc3861aeccc943b434231193ef45ffbc0b3cf6c6
|
||||
RH-Bugzilla: 2026443
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
Wire the pc_rhel_8_5 compat data into both piix and q35
|
||||
to keep the existing machine types compatible.
|
||||
|
||||
|
@ -21,10 +20,10 @@ Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index dabc6c1933..183b5d5464 100644
|
||||
index 2885edffe9..37fab00733 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -993,6 +993,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
|
||||
@@ -1040,6 +1040,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
|
||||
pcmc->kvmclock_create_always = false;
|
||||
/* From pc_i440fx_5_1_machine_options() */
|
||||
pcmc->pci_root_uid = 1;
|
||||
|
@ -36,7 +35,7 @@ index dabc6c1933..183b5d5464 100644
|
|||
hw_compat_rhel_8_4_len);
|
||||
compat_props_add(m->compat_props, pc_rhel_8_4_compat,
|
||||
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
|
||||
index 04c911da18..0e7e885e78 100644
|
||||
index c67418b6a9..78876e1101 100644
|
||||
--- a/hw/i386/pc_q35.c
|
||||
+++ b/hw/i386/pc_q35.c
|
||||
@@ -658,6 +658,10 @@ static void pc_q35_machine_rhel850_options(MachineClass *m)
|
|
@ -1,31 +0,0 @@
|
|||
From 168f0d56e3a37a7d5fcc59483e2b1181824a23d2 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Wed, 24 Nov 2021 23:51:52 -0500
|
||||
Subject: compat: Update hw_compat_rhel_8_5 with 6.2.0 RC2 changes
|
||||
|
||||
In RC2 nvme-ns 'shared' default was changed (commit 916b0f0b52).
|
||||
|
||||
Adding compat record for RHEL 8.5.0 so we keep it off for downstream
|
||||
machinetypes.
|
||||
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
---
|
||||
hw/core/machine.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 448a8dd127..669d3d8b91 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -55,6 +55,8 @@ GlobalProperty hw_compat_rhel_8_5[] = {
|
||||
{ "vhost-vsock-device", "seqpacket", "off" },
|
||||
/* hw_compat_rhel_8_5 from hw_compat_6_1 */
|
||||
{ "vhost-user-vsock-device", "seqpacket", "off" },
|
||||
+ /* hw_compat_rhel_8_5 from hw_compat_6_1 */
|
||||
+ { "nvme-ns", "shared", "off" },
|
||||
};
|
||||
const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5);
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From e6ff4de4f7036f88ee63adad6de5ee5dd74f1d99 Mon Sep 17 00:00:00 2001
|
||||
From 265a57f2955b7f0b65e3f57f89aa1ff2541d3f73 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Huth <thuth@redhat.com>
|
||||
Date: Fri, 26 Nov 2021 09:37:11 +0100
|
||||
Subject: redhat: Add s390x machine type compatibility handling for the rebase
|
||||
|
@ -28,7 +28,7 @@ Signed-off-by: Thomas Huth <thuth@redhat.com>
|
|||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
|
||||
index 4af14cb9ca..c654045964 100644
|
||||
index 181856e6cf..cf13c457d6 100644
|
||||
--- a/hw/s390x/s390-virtio-ccw.c
|
||||
+++ b/hw/s390x/s390-virtio-ccw.c
|
||||
@@ -1105,11 +1105,21 @@ DEFINE_CCW_MACHINE(2_4, "2.4", false);
|
|
@ -0,0 +1 @@
|
|||
DEVPATH=="*/kvm", ACTION=="change", RUN+="/lib/udev/udev-kvm-check $env{COUNT} $env{EVENT}"
|
|
@ -0,0 +1,5 @@
|
|||
# Enable kvm-setup by default. This can have odd side effects on
|
||||
# PowerNV systems that aren't intended as KVM hosts, but at present we
|
||||
# only support RHEL on PowerNV for the purpose of being a RHEV host.
|
||||
|
||||
enable kvm-setup.service
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Kernel Samepage Merging
|
||||
ConditionPathExists=/sys/kernel/mm/ksm
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/sysconfig/ksm
|
||||
ExecStart=/usr/libexec/ksmctl start
|
||||
ExecStop=/usr/libexec/ksmctl stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,4 @@
|
|||
# The maximum number of unswappable kernel pages
|
||||
# which may be allocated by ksm (0 for unlimited)
|
||||
# If unset, defaults to half of total memory
|
||||
# KSM_MAX_KERNEL_PAGES=
|
|
@ -0,0 +1,77 @@
|
|||
/* Start/stop KSM, for systemd.
|
||||
* Copyright (C) 2009, 2011 Red Hat, Inc.
|
||||
* Written by Paolo Bonzini <pbonzini@redhat.com>.
|
||||
* Based on the original sysvinit script by Dan Kenigsberg <danken@redhat.com>
|
||||
* This file is distributed under the GNU General Public License, version 2
|
||||
* or later. */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define KSM_MAX_KERNEL_PAGES_FILE "/sys/kernel/mm/ksm/max_kernel_pages"
|
||||
#define KSM_RUN_FILE "/sys/kernel/mm/ksm/run"
|
||||
|
||||
char *program_name;
|
||||
|
||||
int usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s {start|stop}\n", program_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int write_value(uint64_t value, char *filename)
|
||||
{
|
||||
FILE *fp;
|
||||
if (!(fp = fopen(filename, "w")) ||
|
||||
fprintf(fp, "%llu\n", (unsigned long long) value) == EOF ||
|
||||
fflush(fp) == EOF ||
|
||||
fclose(fp) == EOF)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t ksm_max_kernel_pages()
|
||||
{
|
||||
char *var = getenv("KSM_MAX_KERNEL_PAGES");
|
||||
char *endptr;
|
||||
uint64_t value;
|
||||
if (var && *var) {
|
||||
value = strtoll(var, &endptr, 0);
|
||||
if (value < LLONG_MAX && !*endptr)
|
||||
return value;
|
||||
}
|
||||
/* Unless KSM_MAX_KERNEL_PAGES is set, let KSM munch up to half of
|
||||
* total memory. */
|
||||
return sysconf(_SC_PHYS_PAGES) / 2;
|
||||
}
|
||||
|
||||
int start(void)
|
||||
{
|
||||
if (access(KSM_MAX_KERNEL_PAGES_FILE, R_OK) >= 0)
|
||||
write_value(ksm_max_kernel_pages(), KSM_MAX_KERNEL_PAGES_FILE);
|
||||
return write_value(1, KSM_RUN_FILE);
|
||||
}
|
||||
|
||||
int stop(void)
|
||||
{
|
||||
return write_value(0, KSM_RUN_FILE);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
program_name = argv[0];
|
||||
if (argc < 2) {
|
||||
return usage();
|
||||
} else if (!strcmp(argv[1], "start")) {
|
||||
return start();
|
||||
} else if (!strcmp(argv[1], "stop")) {
|
||||
return stop();
|
||||
} else {
|
||||
return usage();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2009 Red Hat, Inc. and/or its affiliates.
|
||||
# Released under the GPL
|
||||
#
|
||||
# Author: Dan Kenigsberg <danken@redhat.com>
|
||||
#
|
||||
# ksmtuned - a simple script that controls whether (and with what vigor) ksm
|
||||
# should search for duplicated pages.
|
||||
#
|
||||
# starts ksm when memory commited to qemu processes exceeds a threshold, and
|
||||
# make ksm work harder and harder untill memory load falls below that
|
||||
# threshold.
|
||||
#
|
||||
# send SIGUSR1 to this process right after a new qemu process is started, or
|
||||
# following its death, to retune ksm accordingly
|
||||
#
|
||||
# needs testing and ironing. contact danken@redhat.com if something breaks.
|
||||
|
||||
if [ -f /etc/ksmtuned.conf ]; then
|
||||
. /etc/ksmtuned.conf
|
||||
fi
|
||||
|
||||
debug() {
|
||||
if [ -n "$DEBUG" ]; then
|
||||
s="`/bin/date`: $*"
|
||||
[ -n "$LOGFILE" ] && echo "$s" >> "$LOGFILE" || echo "$s"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
KSM_MONITOR_INTERVAL=${KSM_MONITOR_INTERVAL:-60}
|
||||
KSM_NPAGES_BOOST=${KSM_NPAGES_BOOST:-300}
|
||||
KSM_NPAGES_DECAY=${KSM_NPAGES_DECAY:--50}
|
||||
|
||||
KSM_NPAGES_MIN=${KSM_NPAGES_MIN:-64}
|
||||
KSM_NPAGES_MAX=${KSM_NPAGES_MAX:-1250}
|
||||
# millisecond sleep between ksm scans for 16Gb server. Smaller servers sleep
|
||||
# more, bigger sleep less.
|
||||
KSM_SLEEP_MSEC=${KSM_SLEEP_MSEC:-10}
|
||||
|
||||
KSM_THRES_COEF=${KSM_THRES_COEF:-20}
|
||||
KSM_THRES_CONST=${KSM_THRES_CONST:-2048}
|
||||
|
||||
total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo`
|
||||
debug total $total
|
||||
|
||||
npages=0
|
||||
sleep=$[KSM_SLEEP_MSEC * 16 * 1024 * 1024 / total]
|
||||
[ $sleep -le 10 ] && sleep=10
|
||||
debug sleep $sleep
|
||||
thres=$[total * KSM_THRES_COEF / 100]
|
||||
if [ $KSM_THRES_CONST -gt $thres ]; then
|
||||
thres=$KSM_THRES_CONST
|
||||
fi
|
||||
debug thres $thres
|
||||
|
||||
KSMCTL () {
|
||||
case x$1 in
|
||||
xstop)
|
||||
echo 0 > /sys/kernel/mm/ksm/run
|
||||
;;
|
||||
xstart)
|
||||
echo $2 > /sys/kernel/mm/ksm/pages_to_scan
|
||||
echo $3 > /sys/kernel/mm/ksm/sleep_millisecs
|
||||
echo 1 > /sys/kernel/mm/ksm/run
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
committed_memory () {
|
||||
# calculate how much memory is committed to running qemu processes
|
||||
local pidlist
|
||||
pidlist=$(pgrep -d ' ' -- '^qemu(-(kvm|system-.+)|:.{1,11})$')
|
||||
if [ -n "$pidlist" ]; then
|
||||
ps -p "$pidlist" -o rsz=
|
||||
fi | awk '{ sum += $1 }; END { print 0+sum }'
|
||||
}
|
||||
|
||||
free_memory () {
|
||||
awk '/^(MemFree|Buffers|Cached):/ {free += $2}; END {print free}' \
|
||||
/proc/meminfo
|
||||
}
|
||||
|
||||
increase_npages() {
|
||||
local delta
|
||||
delta=${1:-0}
|
||||
npages=$[npages + delta]
|
||||
if [ $npages -lt $KSM_NPAGES_MIN ]; then
|
||||
npages=$KSM_NPAGES_MIN
|
||||
elif [ $npages -gt $KSM_NPAGES_MAX ]; then
|
||||
npages=$KSM_NPAGES_MAX
|
||||
fi
|
||||
echo $npages
|
||||
}
|
||||
|
||||
|
||||
adjust () {
|
||||
local free committed
|
||||
free=`free_memory`
|
||||
committed=`committed_memory`
|
||||
debug committed $committed free $free
|
||||
if [ $[committed + thres] -lt $total -a $free -gt $thres ]; then
|
||||
KSMCTL stop
|
||||
debug "$[committed + thres] < $total and free > $thres, stop ksm"
|
||||
return 1
|
||||
fi
|
||||
debug "$[committed + thres] > $total, start ksm"
|
||||
if [ $free -lt $thres ]; then
|
||||
npages=`increase_npages $KSM_NPAGES_BOOST`
|
||||
debug "$free < $thres, boost"
|
||||
else
|
||||
npages=`increase_npages $KSM_NPAGES_DECAY`
|
||||
debug "$free > $thres, decay"
|
||||
fi
|
||||
KSMCTL start $npages $sleep
|
||||
debug "KSMCTL start $npages $sleep"
|
||||
return 0
|
||||
}
|
||||
|
||||
function nothing () {
|
||||
:
|
||||
}
|
||||
|
||||
loop () {
|
||||
trap nothing SIGUSR1
|
||||
while true
|
||||
do
|
||||
sleep $KSM_MONITOR_INTERVAL &
|
||||
wait $!
|
||||
adjust
|
||||
done
|
||||
}
|
||||
|
||||
PIDFILE=${PIDFILE-/var/run/ksmtune.pid}
|
||||
if touch "$PIDFILE"; then
|
||||
loop &
|
||||
echo $! > "$PIDFILE"
|
||||
fi
|
|
@ -0,0 +1,21 @@
|
|||
# Configuration file for ksmtuned.
|
||||
|
||||
# How long ksmtuned should sleep between tuning adjustments
|
||||
# KSM_MONITOR_INTERVAL=60
|
||||
|
||||
# Millisecond sleep between ksm scans for 16Gb server.
|
||||
# Smaller servers sleep more, bigger sleep less.
|
||||
# KSM_SLEEP_MSEC=10
|
||||
|
||||
# KSM_NPAGES_BOOST=300
|
||||
# KSM_NPAGES_DECAY=-50
|
||||
# KSM_NPAGES_MIN=64
|
||||
# KSM_NPAGES_MAX=1250
|
||||
|
||||
# KSM_THRES_COEF=20
|
||||
# KSM_THRES_CONST=2048
|
||||
|
||||
# uncomment the following if you want ksmtuned debug info
|
||||
|
||||
# LOGFILE=/var/log/ksmtuned
|
||||
# DEBUG=1
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=Kernel Samepage Merging (KSM) Tuning Daemon
|
||||
After=ksm.service
|
||||
Requires=ksm.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/ksmtuned
|
||||
ExecReload=/bin/kill -USR1 $MAINPID
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,87 @@
|
|||
From cd49a32e9c9e33efc51652b68180a07683814b4d Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Mon, 11 Jul 2022 18:11:12 -0300
|
||||
Subject: [PATCH 4/9] Add dirty-sync-missed-zero-copy migration stat
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 201: Zero-copy-send fixes + improvements
|
||||
RH-Commit: [4/8] 56cce61cf95aafc8dafae7531b43c166084abfec
|
||||
RH-Bugzilla: 2110203
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Acked-by: Markus Armbruster <armbru@redhat.com>
|
||||
Acked-by: Peter Xu <peterx@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Message-Id: <20220711211112.18951-3-leobras@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
(cherry picked from commit cf20c897338067ab4b70a4596fdccaf90c7e29a1)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
migration/migration.c | 2 ++
|
||||
monitor/hmp-cmds.c | 5 +++++
|
||||
qapi/migration.json | 7 ++++++-
|
||||
3 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/migration/migration.c b/migration/migration.c
|
||||
index e100b30f00..952a26c5c2 100644
|
||||
--- a/migration/migration.c
|
||||
+++ b/migration/migration.c
|
||||
@@ -1012,6 +1012,8 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
|
||||
info->ram->normal_bytes = ram_counters.normal * page_size;
|
||||
info->ram->mbps = s->mbps;
|
||||
info->ram->dirty_sync_count = ram_counters.dirty_sync_count;
|
||||
+ info->ram->dirty_sync_missed_zero_copy =
|
||||
+ ram_counters.dirty_sync_missed_zero_copy;
|
||||
info->ram->postcopy_requests = ram_counters.postcopy_requests;
|
||||
info->ram->page_size = page_size;
|
||||
info->ram->multifd_bytes = ram_counters.multifd_bytes;
|
||||
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
|
||||
index 8c384dc1b2..f7216ab5d0 100644
|
||||
--- a/monitor/hmp-cmds.c
|
||||
+++ b/monitor/hmp-cmds.c
|
||||
@@ -305,6 +305,11 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
|
||||
monitor_printf(mon, "postcopy ram: %" PRIu64 " kbytes\n",
|
||||
info->ram->postcopy_bytes >> 10);
|
||||
}
|
||||
+ if (info->ram->dirty_sync_missed_zero_copy) {
|
||||
+ monitor_printf(mon,
|
||||
+ "Zero-copy-send fallbacks happened: %" PRIu64 " times\n",
|
||||
+ info->ram->dirty_sync_missed_zero_copy);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (info->has_disk) {
|
||||
diff --git a/qapi/migration.json b/qapi/migration.json
|
||||
index c8ec260ab0..94bc5c69db 100644
|
||||
--- a/qapi/migration.json
|
||||
+++ b/qapi/migration.json
|
||||
@@ -55,6 +55,10 @@
|
||||
# @postcopy-bytes: The number of bytes sent during the post-copy phase
|
||||
# (since 7.0).
|
||||
#
|
||||
+# @dirty-sync-missed-zero-copy: Number of times dirty RAM synchronization could
|
||||
+# not avoid copying dirty pages. This is between
|
||||
+# 0 and @dirty-sync-count * @multifd-channels.
|
||||
+# (since 7.1)
|
||||
# Since: 0.14
|
||||
##
|
||||
{ 'struct': 'MigrationStats',
|
||||
@@ -65,7 +69,8 @@
|
||||
'postcopy-requests' : 'int', 'page-size' : 'int',
|
||||
'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64',
|
||||
'precopy-bytes' : 'uint64', 'downtime-bytes' : 'uint64',
|
||||
- 'postcopy-bytes' : 'uint64' } }
|
||||
+ 'postcopy-bytes' : 'uint64',
|
||||
+ 'dirty-sync-missed-zero-copy' : 'uint64' } }
|
||||
|
||||
##
|
||||
# @XBZRLECacheStats:
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
From f4f7c62a4658a570d3ad694b64463665fa4b80a7 Mon Sep 17 00:00:00 2001
|
||||
From db6e042fe4fdc1a1bbf562a46b15d4d8e33e2fa6 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Lai <plai@redhat.com>
|
||||
Date: Fri, 21 Jan 2022 13:14:42 -0500
|
||||
Subject: [PATCH 04/12] Enable SGX -- RH Only
|
||||
Date: Tue, 25 Jan 2022 15:16:22 -0500
|
||||
Subject: [PATCH 4/7] Enable SGX -- RH Only
|
||||
|
||||
RH-Author: Paul Lai <plai@redhat.com>
|
||||
RH-MergeRequest: 65: Enable SGX and add SGX Numa support
|
||||
RH-Commit: [4/5] 2cd4ee4a429f5e7b1c32e83a10bf488503603795
|
||||
RH-Bugzilla: 2033708
|
||||
RH-Author: Paul Lai <None>
|
||||
RH-MergeRequest: 111: numa: Enable numa for SGX EPC sections
|
||||
RH-Commit: [4/5] cea874f29984897ef1232fb7749c13203c888034
|
||||
RH-Bugzilla: 1518984
|
||||
RH-Acked-by: Paolo Bonzini <None>
|
||||
RH-Acked-by: Bandan Das <None>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
|
@ -15,13 +15,13 @@ RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
|||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
index dc03fbb671..327b1bee62 100644
|
||||
index ddf036f042..fdbbdf9742 100644
|
||||
--- a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
+++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
@@ -101,3 +101,4 @@ CONFIG_TPM=y
|
||||
CONFIG_TPM_CRB=y
|
||||
@@ -102,3 +102,4 @@ CONFIG_TPM_CRB=y
|
||||
CONFIG_TPM_TIS_ISA=y
|
||||
CONFIG_TPM_EMULATOR=y
|
||||
CONFIG_TPM_PASSTHROUGH=y
|
||||
+CONFIG_SGX=y
|
||||
--
|
||||
2.27.0
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
From 9bacf8c4104ff3cff2e0e2c2179ec4fda633167f Mon Sep 17 00:00:00 2001
|
||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Mon, 16 Jan 2023 07:51:08 -0500
|
||||
Subject: [PATCH 05/11] KVM: keep track of running ioctls
|
||||
|
||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-MergeRequest: 247: accel: introduce accelerator blocker API
|
||||
RH-Bugzilla: 2161188
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [2/3] 357508389e2a0fd996206b406e9e235e50b5f0b6
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2161188
|
||||
|
||||
commit a27dd2de68f37ba96fe164a42121daa5f0750afc
|
||||
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Fri Nov 11 10:47:57 2022 -0500
|
||||
|
||||
KVM: keep track of running ioctls
|
||||
|
||||
Using the new accel-blocker API, mark where ioctls are being called
|
||||
in KVM. Next, we will implement the critical section that will take
|
||||
care of performing memslots modifications atomically, therefore
|
||||
preventing any new ioctl from running and allowing the running ones
|
||||
to finish.
|
||||
|
||||
Signed-off-by: David Hildenbrand <david@redhat.com>
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Message-Id: <20221111154758.1372674-3-eesposit@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
---
|
||||
accel/kvm/kvm-all.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
|
||||
index 8f2a53438f..221aadfda7 100644
|
||||
--- a/accel/kvm/kvm-all.c
|
||||
+++ b/accel/kvm/kvm-all.c
|
||||
@@ -2337,6 +2337,7 @@ static int kvm_init(MachineState *ms)
|
||||
assert(TARGET_PAGE_SIZE <= qemu_real_host_page_size);
|
||||
|
||||
s->sigmask_len = 8;
|
||||
+ accel_blocker_init();
|
||||
|
||||
#ifdef KVM_CAP_SET_GUEST_DEBUG
|
||||
QTAILQ_INIT(&s->kvm_sw_breakpoints);
|
||||
@@ -3018,7 +3019,9 @@ int kvm_vm_ioctl(KVMState *s, int type, ...)
|
||||
va_end(ap);
|
||||
|
||||
trace_kvm_vm_ioctl(type, arg);
|
||||
+ accel_ioctl_begin();
|
||||
ret = ioctl(s->vmfd, type, arg);
|
||||
+ accel_ioctl_end();
|
||||
if (ret == -1) {
|
||||
ret = -errno;
|
||||
}
|
||||
@@ -3036,7 +3039,9 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...)
|
||||
va_end(ap);
|
||||
|
||||
trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg);
|
||||
+ accel_cpu_ioctl_begin(cpu);
|
||||
ret = ioctl(cpu->kvm_fd, type, arg);
|
||||
+ accel_cpu_ioctl_end(cpu);
|
||||
if (ret == -1) {
|
||||
ret = -errno;
|
||||
}
|
||||
@@ -3054,7 +3059,9 @@ int kvm_device_ioctl(int fd, int type, ...)
|
||||
va_end(ap);
|
||||
|
||||
trace_kvm_device_ioctl(fd, type, arg);
|
||||
+ accel_ioctl_begin();
|
||||
ret = ioctl(fd, type, arg);
|
||||
+ accel_ioctl_end();
|
||||
if (ret == -1) {
|
||||
ret = -errno;
|
||||
}
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
From ea5299b5dde7d0b6b2f93cb646e6a24c9f105466 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Date: Wed, 23 Mar 2022 12:33:25 +0100
|
||||
Subject: [PATCH 13/24] KVM: x86: workaround invalid CPUID[0xD,9] info on some
|
||||
AMD processors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Paul Lai <plai@redhat.com>
|
||||
RH-MergeRequest: 176: Enable KVM AMX support
|
||||
RH-Commit: [13/13] 38f147c911258e84e01336271ebd23a1c24371fc
|
||||
RH-Bugzilla: 1916415
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Some AMD processors expose the PKRU extended save state even if they do not have
|
||||
the related PKU feature in CPUID. Worse, when they do they report a size of
|
||||
64, whereas the expected size of the PKRU extended save state is 8, therefore
|
||||
the esa->size == eax assertion does not hold.
|
||||
|
||||
The state is already ignored by KVM_GET_SUPPORTED_CPUID because it
|
||||
was not enabled in the host XCR0. However, QEMU kvm_cpu_xsave_init()
|
||||
runs before QEMU invokes arch_prctl() to enable dynamically-enabled
|
||||
save states such as XTILEDATA, and KVM_GET_SUPPORTED_CPUID hides save
|
||||
states that have yet to be enabled. Therefore, kvm_cpu_xsave_init()
|
||||
needs to consult the host CPUID instead of KVM_GET_SUPPORTED_CPUID,
|
||||
and dies with an assertion failure.
|
||||
|
||||
When setting up the ExtSaveArea array to match the host, ignore features that
|
||||
KVM does not report as supported. This will cause QEMU to skip the incorrect
|
||||
CPUID leaf instead of tripping the assertion.
|
||||
|
||||
Closes: https://gitlab.com/qemu-project/qemu/-/issues/916
|
||||
Reported-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Analyzed-by: Yang Zhong <yang.zhong@intel.com>
|
||||
Reported-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
(cherry picked from commit 58f7db26f21c690cf9a669c314cfd7371506084a)
|
||||
Signed-off-by: Paul Lai <plai@redhat.com>
|
||||
---
|
||||
target/i386/cpu.c | 4 ++--
|
||||
target/i386/cpu.h | 2 ++
|
||||
target/i386/kvm/kvm-cpu.c | 19 ++++++++++++-------
|
||||
3 files changed, 16 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
|
||||
index 09e08f7f38..0543b846ff 100644
|
||||
--- a/target/i386/cpu.c
|
||||
+++ b/target/i386/cpu.c
|
||||
@@ -4980,8 +4980,8 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
|
||||
return cpu_list;
|
||||
}
|
||||
|
||||
-static uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
|
||||
- bool migratable_only)
|
||||
+uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
|
||||
+ bool migratable_only)
|
||||
{
|
||||
FeatureWordInfo *wi = &feature_word_info[w];
|
||||
uint64_t r = 0;
|
||||
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
|
||||
index 8ab2a4042a..006b735fe4 100644
|
||||
--- a/target/i386/cpu.h
|
||||
+++ b/target/i386/cpu.h
|
||||
@@ -604,6 +604,8 @@ typedef enum FeatureWord {
|
||||
} FeatureWord;
|
||||
|
||||
typedef uint64_t FeatureWordArray[FEATURE_WORDS];
|
||||
+uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
|
||||
+ bool migratable_only);
|
||||
|
||||
/* cpuid_features bits */
|
||||
#define CPUID_FP87 (1U << 0)
|
||||
diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c
|
||||
index bdc967c484..74c1396a93 100644
|
||||
--- a/target/i386/kvm/kvm-cpu.c
|
||||
+++ b/target/i386/kvm/kvm-cpu.c
|
||||
@@ -99,13 +99,18 @@ static void kvm_cpu_xsave_init(void)
|
||||
for (i = XSTATE_SSE_BIT + 1; i < XSAVE_STATE_AREA_COUNT; i++) {
|
||||
ExtSaveArea *esa = &x86_ext_save_areas[i];
|
||||
|
||||
- if (esa->size) {
|
||||
- host_cpuid(0xd, i, &eax, &ebx, &ecx, &edx);
|
||||
- if (eax != 0) {
|
||||
- assert(esa->size == eax);
|
||||
- esa->offset = ebx;
|
||||
- esa->ecx = ecx;
|
||||
- }
|
||||
+ if (!esa->size) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if ((x86_cpu_get_supported_feature_word(esa->feature, false) & esa->bits)
|
||||
+ != esa->bits) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ host_cpuid(0xd, i, &eax, &ebx, &ecx, &edx);
|
||||
+ if (eax != 0) {
|
||||
+ assert(esa->size == eax);
|
||||
+ esa->offset = ebx;
|
||||
+ esa->ecx = ecx;
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
From 440ee491240f2f02f9a6082d8aad98d88c1039dd Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Huth <thuth@redhat.com>
|
||||
Date: Mon, 15 Jan 2024 14:00:04 +0100
|
||||
Subject: [PATCH 1/5] MAINTAINERS: split out s390x sections
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Thomas Huth <thuth@redhat.com>
|
||||
RH-MergeRequest: 348: s390x: Provide some more useful information if decryption of a PV image fails
|
||||
RH-Jira: RHEL-18214
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Acked-by: Cédric Le Goater <clg@redhat.com>
|
||||
RH-Commit: [1/5] a71a3c11922481f97c36570e361088d17474e481
|
||||
|
||||
JIRA: https://issues.redhat.com/browse/RHEL-18214
|
||||
|
||||
commit 56e34834029c7c6862cb0095d95ad83c50485f88
|
||||
Author: Cornelia Huck <cohuck@redhat.com>
|
||||
Date: Wed Dec 22 11:55:48 2021 +0100
|
||||
|
||||
MAINTAINERS: split out s390x sections
|
||||
|
||||
Split out some more specialized devices etc., so that we can build
|
||||
smarter lists of people to be put on cc: in the future.
|
||||
|
||||
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Acked-by: David Hildenbrand <david@redhat.com>
|
||||
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
|
||||
Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
Acked-by: Halil Pasic <pasic@linux.ibm.com>
|
||||
Acked-by: Eric Farman <farman@linux.ibm.com>
|
||||
Message-Id: <20211222105548.356852-1-cohuck@redhat.com>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
---
|
||||
MAINTAINERS | 85 ++++++++++++++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 74 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/MAINTAINERS b/MAINTAINERS
|
||||
index 7543eb4d59..b893206fc3 100644
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -297,7 +297,6 @@ M: David Hildenbrand <david@redhat.com>
|
||||
S: Maintained
|
||||
F: target/s390x/
|
||||
F: target/s390x/tcg
|
||||
-F: target/s390x/cpu_models_*.[ch]
|
||||
F: hw/s390x/
|
||||
F: disas/s390.c
|
||||
F: tests/tcg/s390x/
|
||||
@@ -396,16 +395,10 @@ M: Halil Pasic <pasic@linux.ibm.com>
|
||||
M: Christian Borntraeger <borntraeger@de.ibm.com>
|
||||
S: Supported
|
||||
F: target/s390x/kvm/
|
||||
-F: target/s390x/ioinst.[ch]
|
||||
F: target/s390x/machine.c
|
||||
F: target/s390x/sigp.c
|
||||
-F: target/s390x/cpu_features*.[ch]
|
||||
-F: target/s390x/cpu_models.[ch]
|
||||
F: hw/s390x/pv.c
|
||||
F: include/hw/s390x/pv.h
|
||||
-F: hw/intc/s390_flic.c
|
||||
-F: hw/intc/s390_flic_kvm.c
|
||||
-F: include/hw/s390x/s390_flic.h
|
||||
F: gdb-xml/s390*.xml
|
||||
T: git https://github.com/borntraeger/qemu.git s390-next
|
||||
L: qemu-s390x@nongnu.org
|
||||
@@ -1529,12 +1522,8 @@ S390 Virtio-ccw
|
||||
M: Halil Pasic <pasic@linux.ibm.com>
|
||||
M: Christian Borntraeger <borntraeger@de.ibm.com>
|
||||
S: Supported
|
||||
-F: hw/char/sclp*.[hc]
|
||||
-F: hw/char/terminal3270.c
|
||||
F: hw/s390x/
|
||||
F: include/hw/s390x/
|
||||
-F: hw/watchdog/wdt_diag288.c
|
||||
-F: include/hw/watchdog/wdt_diag288.h
|
||||
F: configs/devices/s390x-softmmu/default.mak
|
||||
F: tests/avocado/machine_s390_ccw_virtio.py
|
||||
T: git https://github.com/borntraeger/qemu.git s390-next
|
||||
@@ -1559,6 +1548,37 @@ F: hw/s390x/s390-pci*
|
||||
F: include/hw/s390x/s390-pci*
|
||||
L: qemu-s390x@nongnu.org
|
||||
|
||||
+S390 channel subsystem
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+S: Supported
|
||||
+F: hw/s390x/ccw-device.[ch]
|
||||
+F: hw/s390x/css.c
|
||||
+F: hw/s390x/css-bridge.c
|
||||
+F: include/hw/s390x/css.h
|
||||
+F: include/hw/s390x/css-bridge.h
|
||||
+F: include/hw/s390x/ioinst.h
|
||||
+F: target/s390x/ioinst.c
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
+S390 CPU models
|
||||
+M: David Hildenbrand <david@redhat.com>
|
||||
+S: Maintained
|
||||
+F: target/s390x/cpu_features*.[ch]
|
||||
+F: target/s390x/cpu_models.[ch]
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
+S390 SCLP-backed devices
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+S: Supported
|
||||
+F: include/hw/s390x/event-facility.h
|
||||
+F: include/hw/s390x/sclp.h
|
||||
+F: hw/char/sclp*.[hc]
|
||||
+F: hw/s390x/event-facility.c
|
||||
+F: hw/s390x/sclp*.c
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
X86 Machines
|
||||
------------
|
||||
PC
|
||||
@@ -1956,6 +1976,7 @@ M: Halil Pasic <pasic@linux.ibm.com>
|
||||
S: Supported
|
||||
F: hw/s390x/virtio-ccw*.[hc]
|
||||
F: hw/s390x/vhost-vsock-ccw.c
|
||||
+F: hw/s390x/vhost-user-fs-ccw.c
|
||||
T: git https://gitlab.com/cohuck/qemu.git s390-next
|
||||
T: git https://github.com/borntraeger/qemu.git s390-next
|
||||
L: qemu-s390x@nongnu.org
|
||||
@@ -2294,6 +2315,48 @@ F: hw/timer/mips_gictimer.c
|
||||
F: include/hw/intc/mips_gic.h
|
||||
F: include/hw/timer/mips_gictimer.h
|
||||
|
||||
+S390 3270 device
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+S: Odd fixes
|
||||
+F: include/hw/s390x/3270-ccw.h
|
||||
+F: hw/char/terminal3270.c
|
||||
+F: hw/s390x/3270-ccw.c
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
+S390 diag 288 watchdog
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+S: Supported
|
||||
+F: hw/watchdog/wdt_diag288.c
|
||||
+F: include/hw/watchdog/wdt_diag288.h
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
+S390 storage key device
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+S: Supported
|
||||
+F: hw/s390x/storage-keys.h
|
||||
+F: hw/390x/s390-skeys*.c
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
+S390 storage attribute device
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+S: Supported
|
||||
+F: hw/s390x/storage-attributes.h
|
||||
+F: hw/s390/s390-stattrib*.c
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
+S390 floating interrupt controller
|
||||
+M: Halil Pasic <pasic@linux.ibm.com>
|
||||
+M: Christian Borntraeger <borntraeger@linux.ibm.com>
|
||||
+M: David Hildenbrand <david@redhat.com>
|
||||
+S: Supported
|
||||
+F: hw/intc/s390_flic*.c
|
||||
+F: include/hw/s390x/s390_flic.h
|
||||
+L: qemu-s390x@nongnu.org
|
||||
+
|
||||
Subsystems
|
||||
----------
|
||||
Overall Audio backends
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -0,0 +1,420 @@
|
|||
From 7eeec7c008e947bc3e1fed682791092b408852c6 Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Wed, 18 May 2022 02:52:24 -0300
|
||||
Subject: [PATCH 17/37] QIOChannel: Add flags on io_writev and introduce
|
||||
io_flush callback
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 191: MSG_ZEROCOPY + Multifd @ rhel8.7
|
||||
RH-Commit: [17/26] 7bde4e79fd3f76a6cc84d9cacf50420584ddd35c
|
||||
RH-Bugzilla: 2072049
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
Add flags to io_writev and introduce io_flush as optional callback to
|
||||
QIOChannelClass, allowing the implementation of zero copy writes by
|
||||
subclasses.
|
||||
|
||||
How to use them:
|
||||
- Write data using qio_channel_writev*(...,QIO_CHANNEL_WRITE_FLAG_ZERO_COPY),
|
||||
- Wait write completion with qio_channel_flush().
|
||||
|
||||
Notes:
|
||||
As some zero copy write implementations work asynchronously, it's
|
||||
recommended to keep the write buffer untouched until the return of
|
||||
qio_channel_flush(), to avoid the risk of sending an updated buffer
|
||||
instead of the buffer state during write.
|
||||
|
||||
As io_flush callback is optional, if a subclass does not implement it, then:
|
||||
- io_flush will return 0 without changing anything.
|
||||
|
||||
Also, some functions like qio_channel_writev_full_all() were adapted to
|
||||
receive a flag parameter. That allows shared code between zero copy and
|
||||
non-zero copy writev, and also an easier implementation on new flags.
|
||||
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Reviewed-by: Peter Xu <peterx@redhat.com>
|
||||
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
||||
Message-Id: <20220513062836.965425-3-leobras@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
(cherry picked from commit b88651cb4d4fa416fdbb6afaf5b26ec8c035eaad)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
chardev/char-io.c | 2 +-
|
||||
hw/remote/mpqemu-link.c | 2 +-
|
||||
include/io/channel.h | 38 +++++++++++++++++++++-
|
||||
io/channel-buffer.c | 1 +
|
||||
io/channel-command.c | 1 +
|
||||
io/channel-file.c | 1 +
|
||||
io/channel-socket.c | 2 ++
|
||||
io/channel-tls.c | 1 +
|
||||
io/channel-websock.c | 1 +
|
||||
io/channel.c | 49 +++++++++++++++++++++++------
|
||||
migration/rdma.c | 1 +
|
||||
scsi/pr-manager-helper.c | 2 +-
|
||||
tests/unit/test-io-channel-socket.c | 1 +
|
||||
13 files changed, 88 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/chardev/char-io.c b/chardev/char-io.c
|
||||
index 8ced184160..4451128cba 100644
|
||||
--- a/chardev/char-io.c
|
||||
+++ b/chardev/char-io.c
|
||||
@@ -122,7 +122,7 @@ int io_channel_send_full(QIOChannel *ioc,
|
||||
|
||||
ret = qio_channel_writev_full(
|
||||
ioc, &iov, 1,
|
||||
- fds, nfds, NULL);
|
||||
+ fds, nfds, 0, NULL);
|
||||
if (ret == QIO_CHANNEL_ERR_BLOCK) {
|
||||
if (offset) {
|
||||
return offset;
|
||||
diff --git a/hw/remote/mpqemu-link.c b/hw/remote/mpqemu-link.c
|
||||
index 7e841820e5..e8f556bd27 100644
|
||||
--- a/hw/remote/mpqemu-link.c
|
||||
+++ b/hw/remote/mpqemu-link.c
|
||||
@@ -69,7 +69,7 @@ bool mpqemu_msg_send(MPQemuMsg *msg, QIOChannel *ioc, Error **errp)
|
||||
}
|
||||
|
||||
if (!qio_channel_writev_full_all(ioc, send, G_N_ELEMENTS(send),
|
||||
- fds, nfds, errp)) {
|
||||
+ fds, nfds, 0, errp)) {
|
||||
ret = true;
|
||||
} else {
|
||||
trace_mpqemu_send_io_error(msg->cmd, msg->size, nfds);
|
||||
diff --git a/include/io/channel.h b/include/io/channel.h
|
||||
index 88988979f8..c680ee7480 100644
|
||||
--- a/include/io/channel.h
|
||||
+++ b/include/io/channel.h
|
||||
@@ -32,12 +32,15 @@ OBJECT_DECLARE_TYPE(QIOChannel, QIOChannelClass,
|
||||
|
||||
#define QIO_CHANNEL_ERR_BLOCK -2
|
||||
|
||||
+#define QIO_CHANNEL_WRITE_FLAG_ZERO_COPY 0x1
|
||||
+
|
||||
typedef enum QIOChannelFeature QIOChannelFeature;
|
||||
|
||||
enum QIOChannelFeature {
|
||||
QIO_CHANNEL_FEATURE_FD_PASS,
|
||||
QIO_CHANNEL_FEATURE_SHUTDOWN,
|
||||
QIO_CHANNEL_FEATURE_LISTEN,
|
||||
+ QIO_CHANNEL_FEATURE_WRITE_ZERO_COPY,
|
||||
};
|
||||
|
||||
|
||||
@@ -104,6 +107,7 @@ struct QIOChannelClass {
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp);
|
||||
ssize_t (*io_readv)(QIOChannel *ioc,
|
||||
const struct iovec *iov,
|
||||
@@ -136,6 +140,8 @@ struct QIOChannelClass {
|
||||
IOHandler *io_read,
|
||||
IOHandler *io_write,
|
||||
void *opaque);
|
||||
+ int (*io_flush)(QIOChannel *ioc,
|
||||
+ Error **errp);
|
||||
};
|
||||
|
||||
/* General I/O handling functions */
|
||||
@@ -228,6 +234,7 @@ ssize_t qio_channel_readv_full(QIOChannel *ioc,
|
||||
* @niov: the length of the @iov array
|
||||
* @fds: an array of file handles to send
|
||||
* @nfds: number of file handles in @fds
|
||||
+ * @flags: write flags (QIO_CHANNEL_WRITE_FLAG_*)
|
||||
* @errp: pointer to a NULL-initialized error object
|
||||
*
|
||||
* Write data to the IO channel, reading it from the
|
||||
@@ -260,6 +267,7 @@ ssize_t qio_channel_writev_full(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp);
|
||||
|
||||
/**
|
||||
@@ -837,6 +845,7 @@ int qio_channel_readv_full_all(QIOChannel *ioc,
|
||||
* @niov: the length of the @iov array
|
||||
* @fds: an array of file handles to send
|
||||
* @nfds: number of file handles in @fds
|
||||
+ * @flags: write flags (QIO_CHANNEL_WRITE_FLAG_*)
|
||||
* @errp: pointer to a NULL-initialized error object
|
||||
*
|
||||
*
|
||||
@@ -846,6 +855,14 @@ int qio_channel_readv_full_all(QIOChannel *ioc,
|
||||
* to be written, yielding from the current coroutine
|
||||
* if required.
|
||||
*
|
||||
+ * If QIO_CHANNEL_WRITE_FLAG_ZERO_COPY is passed in flags,
|
||||
+ * instead of waiting for all requested data to be written,
|
||||
+ * this function will wait until it's all queued for writing.
|
||||
+ * In this case, if the buffer gets changed between queueing and
|
||||
+ * sending, the updated buffer will be sent. If this is not a
|
||||
+ * desired behavior, it's suggested to call qio_channel_flush()
|
||||
+ * before reusing the buffer.
|
||||
+ *
|
||||
* Returns: 0 if all bytes were written, or -1 on error
|
||||
*/
|
||||
|
||||
@@ -853,6 +870,25 @@ int qio_channel_writev_full_all(QIOChannel *ioc,
|
||||
const struct iovec *iov,
|
||||
size_t niov,
|
||||
int *fds, size_t nfds,
|
||||
- Error **errp);
|
||||
+ int flags, Error **errp);
|
||||
+
|
||||
+/**
|
||||
+ * qio_channel_flush:
|
||||
+ * @ioc: the channel object
|
||||
+ * @errp: pointer to a NULL-initialized error object
|
||||
+ *
|
||||
+ * Will block until every packet queued with
|
||||
+ * qio_channel_writev_full() + QIO_CHANNEL_WRITE_FLAG_ZERO_COPY
|
||||
+ * is sent, or return in case of any error.
|
||||
+ *
|
||||
+ * If not implemented, acts as a no-op, and returns 0.
|
||||
+ *
|
||||
+ * Returns -1 if any error is found,
|
||||
+ * 1 if every send failed to use zero copy.
|
||||
+ * 0 otherwise.
|
||||
+ */
|
||||
+
|
||||
+int qio_channel_flush(QIOChannel *ioc,
|
||||
+ Error **errp);
|
||||
|
||||
#endif /* QIO_CHANNEL_H */
|
||||
diff --git a/io/channel-buffer.c b/io/channel-buffer.c
|
||||
index baa4e2b089..bf52011be2 100644
|
||||
--- a/io/channel-buffer.c
|
||||
+++ b/io/channel-buffer.c
|
||||
@@ -81,6 +81,7 @@ static ssize_t qio_channel_buffer_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelBuffer *bioc = QIO_CHANNEL_BUFFER(ioc);
|
||||
diff --git a/io/channel-command.c b/io/channel-command.c
|
||||
index b2a9e27138..5ff1691bad 100644
|
||||
--- a/io/channel-command.c
|
||||
+++ b/io/channel-command.c
|
||||
@@ -258,6 +258,7 @@ static ssize_t qio_channel_command_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelCommand *cioc = QIO_CHANNEL_COMMAND(ioc);
|
||||
diff --git a/io/channel-file.c b/io/channel-file.c
|
||||
index c4bf799a80..348a48545e 100644
|
||||
--- a/io/channel-file.c
|
||||
+++ b/io/channel-file.c
|
||||
@@ -114,6 +114,7 @@ static ssize_t qio_channel_file_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelFile *fioc = QIO_CHANNEL_FILE(ioc);
|
||||
diff --git a/io/channel-socket.c b/io/channel-socket.c
|
||||
index 606ec97cf7..bfbd64787e 100644
|
||||
--- a/io/channel-socket.c
|
||||
+++ b/io/channel-socket.c
|
||||
@@ -525,6 +525,7 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(ioc);
|
||||
@@ -620,6 +621,7 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(ioc);
|
||||
diff --git a/io/channel-tls.c b/io/channel-tls.c
|
||||
index 2ae1b92fc0..4ce890a538 100644
|
||||
--- a/io/channel-tls.c
|
||||
+++ b/io/channel-tls.c
|
||||
@@ -301,6 +301,7 @@ static ssize_t qio_channel_tls_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelTLS *tioc = QIO_CHANNEL_TLS(ioc);
|
||||
diff --git a/io/channel-websock.c b/io/channel-websock.c
|
||||
index 70889bb54d..035dd6075b 100644
|
||||
--- a/io/channel-websock.c
|
||||
+++ b/io/channel-websock.c
|
||||
@@ -1127,6 +1127,7 @@ static ssize_t qio_channel_websock_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelWebsock *wioc = QIO_CHANNEL_WEBSOCK(ioc);
|
||||
diff --git a/io/channel.c b/io/channel.c
|
||||
index e8b019dc36..0640941ac5 100644
|
||||
--- a/io/channel.c
|
||||
+++ b/io/channel.c
|
||||
@@ -72,18 +72,32 @@ ssize_t qio_channel_writev_full(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelClass *klass = QIO_CHANNEL_GET_CLASS(ioc);
|
||||
|
||||
- if ((fds || nfds) &&
|
||||
- !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
|
||||
+ if (fds || nfds) {
|
||||
+ if (!qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
|
||||
+ error_setg_errno(errp, EINVAL,
|
||||
+ "Channel does not support file descriptor passing");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) {
|
||||
+ error_setg_errno(errp, EINVAL,
|
||||
+ "Zero Copy does not support file descriptor passing");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ((flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) &&
|
||||
+ !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_WRITE_ZERO_COPY)) {
|
||||
error_setg_errno(errp, EINVAL,
|
||||
- "Channel does not support file descriptor passing");
|
||||
+ "Requested Zero Copy feature is not available");
|
||||
return -1;
|
||||
}
|
||||
|
||||
- return klass->io_writev(ioc, iov, niov, fds, nfds, errp);
|
||||
+ return klass->io_writev(ioc, iov, niov, fds, nfds, flags, errp);
|
||||
}
|
||||
|
||||
|
||||
@@ -217,14 +231,14 @@ int qio_channel_writev_all(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
Error **errp)
|
||||
{
|
||||
- return qio_channel_writev_full_all(ioc, iov, niov, NULL, 0, errp);
|
||||
+ return qio_channel_writev_full_all(ioc, iov, niov, NULL, 0, 0, errp);
|
||||
}
|
||||
|
||||
int qio_channel_writev_full_all(QIOChannel *ioc,
|
||||
const struct iovec *iov,
|
||||
size_t niov,
|
||||
int *fds, size_t nfds,
|
||||
- Error **errp)
|
||||
+ int flags, Error **errp)
|
||||
{
|
||||
int ret = -1;
|
||||
struct iovec *local_iov = g_new(struct iovec, niov);
|
||||
@@ -237,8 +251,10 @@ int qio_channel_writev_full_all(QIOChannel *ioc,
|
||||
|
||||
while (nlocal_iov > 0) {
|
||||
ssize_t len;
|
||||
- len = qio_channel_writev_full(ioc, local_iov, nlocal_iov, fds, nfds,
|
||||
- errp);
|
||||
+
|
||||
+ len = qio_channel_writev_full(ioc, local_iov, nlocal_iov, fds,
|
||||
+ nfds, flags, errp);
|
||||
+
|
||||
if (len == QIO_CHANNEL_ERR_BLOCK) {
|
||||
if (qemu_in_coroutine()) {
|
||||
qio_channel_yield(ioc, G_IO_OUT);
|
||||
@@ -277,7 +293,7 @@ ssize_t qio_channel_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
Error **errp)
|
||||
{
|
||||
- return qio_channel_writev_full(ioc, iov, niov, NULL, 0, errp);
|
||||
+ return qio_channel_writev_full(ioc, iov, niov, NULL, 0, 0, errp);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +313,7 @@ ssize_t qio_channel_write(QIOChannel *ioc,
|
||||
Error **errp)
|
||||
{
|
||||
struct iovec iov = { .iov_base = (char *)buf, .iov_len = buflen };
|
||||
- return qio_channel_writev_full(ioc, &iov, 1, NULL, 0, errp);
|
||||
+ return qio_channel_writev_full(ioc, &iov, 1, NULL, 0, 0, errp);
|
||||
}
|
||||
|
||||
|
||||
@@ -473,6 +489,19 @@ off_t qio_channel_io_seek(QIOChannel *ioc,
|
||||
return klass->io_seek(ioc, offset, whence, errp);
|
||||
}
|
||||
|
||||
+int qio_channel_flush(QIOChannel *ioc,
|
||||
+ Error **errp)
|
||||
+{
|
||||
+ QIOChannelClass *klass = QIO_CHANNEL_GET_CLASS(ioc);
|
||||
+
|
||||
+ if (!klass->io_flush ||
|
||||
+ !qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_WRITE_ZERO_COPY)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return klass->io_flush(ioc, errp);
|
||||
+}
|
||||
+
|
||||
|
||||
static void qio_channel_restart_read(void *opaque)
|
||||
{
|
||||
diff --git a/migration/rdma.c b/migration/rdma.c
|
||||
index f5d3bbe7e9..54acd2000e 100644
|
||||
--- a/migration/rdma.c
|
||||
+++ b/migration/rdma.c
|
||||
@@ -2833,6 +2833,7 @@ static ssize_t qio_channel_rdma_writev(QIOChannel *ioc,
|
||||
size_t niov,
|
||||
int *fds,
|
||||
size_t nfds,
|
||||
+ int flags,
|
||||
Error **errp)
|
||||
{
|
||||
QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(ioc);
|
||||
diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c
|
||||
index 451c7631b7..3be52a98d5 100644
|
||||
--- a/scsi/pr-manager-helper.c
|
||||
+++ b/scsi/pr-manager-helper.c
|
||||
@@ -77,7 +77,7 @@ static int pr_manager_helper_write(PRManagerHelper *pr_mgr,
|
||||
iov.iov_base = (void *)buf;
|
||||
iov.iov_len = sz;
|
||||
n_written = qio_channel_writev_full(QIO_CHANNEL(pr_mgr->ioc), &iov, 1,
|
||||
- nfds ? &fd : NULL, nfds, errp);
|
||||
+ nfds ? &fd : NULL, nfds, 0, errp);
|
||||
|
||||
if (n_written <= 0) {
|
||||
assert(n_written != QIO_CHANNEL_ERR_BLOCK);
|
||||
diff --git a/tests/unit/test-io-channel-socket.c b/tests/unit/test-io-channel-socket.c
|
||||
index c49eec1f03..6713886d02 100644
|
||||
--- a/tests/unit/test-io-channel-socket.c
|
||||
+++ b/tests/unit/test-io-channel-socket.c
|
||||
@@ -444,6 +444,7 @@ static void test_io_channel_unix_fd_pass(void)
|
||||
G_N_ELEMENTS(iosend),
|
||||
fdsend,
|
||||
G_N_ELEMENTS(fdsend),
|
||||
+ 0,
|
||||
&error_abort);
|
||||
|
||||
qio_channel_readv_full(dst,
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
From a6c4aed18a027ce8e107fdf9184e9ea43a86f843 Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Thu, 4 Aug 2022 04:10:43 -0300
|
||||
Subject: [PATCH 8/9] QIOChannelSocket: Add support for MSG_ZEROCOPY + IPV6
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 201: Zero-copy-send fixes + improvements
|
||||
RH-Commit: [8/8] 6e26ee7c9ebaedb07623313cb0678816867751dd
|
||||
RH-Bugzilla: 2110203
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
For using MSG_ZEROCOPY, there are two steps:
|
||||
1 - io_writev() the packet, which enqueues the packet for sending, and
|
||||
2 - io_flush(), which gets confirmation that all packets got correctly sent
|
||||
|
||||
Currently, if MSG_ZEROCOPY is used to send packets over IPV6, no error will
|
||||
be reported in (1), but it will fail in the first time (2) happens.
|
||||
|
||||
This happens because (2) currently checks for cmsg_level & cmsg_type
|
||||
associated with IPV4 only, before reporting any error.
|
||||
|
||||
Add checks for cmsg_level & cmsg_type associated with IPV6, and thus enable
|
||||
support for MSG_ZEROCOPY + IPV6
|
||||
|
||||
Fixes: 2bc58ffc29 ("QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX")
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
(cherry picked from commit 5258a7e2c0677d16e9e1d06845f60171adf0b290)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
io/channel-socket.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/io/channel-socket.c b/io/channel-socket.c
|
||||
index cf0d67c51b..6010ad7017 100644
|
||||
--- a/io/channel-socket.c
|
||||
+++ b/io/channel-socket.c
|
||||
@@ -747,8 +747,8 @@ static int qio_channel_socket_flush(QIOChannel *ioc,
|
||||
}
|
||||
|
||||
cm = CMSG_FIRSTHDR(&msg);
|
||||
- if (cm->cmsg_level != SOL_IP &&
|
||||
- cm->cmsg_type != IP_RECVERR) {
|
||||
+ if (cm->cmsg_level != SOL_IP && cm->cmsg_type != IP_RECVERR &&
|
||||
+ cm->cmsg_level != SOL_IPV6 && cm->cmsg_type != IPV6_RECVERR) {
|
||||
error_setg_errno(errp, EPROTOTYPE,
|
||||
"Wrong cmsg in errqueue");
|
||||
return -1;
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
From 905cc8032fc63619efb3f0a8c9754b7190bcc43a Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Mon, 11 Jul 2022 18:11:11 -0300
|
||||
Subject: [PATCH 3/9] QIOChannelSocket: Fix zero-copy flush returning code 1
|
||||
when nothing sent
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 201: Zero-copy-send fixes + improvements
|
||||
RH-Commit: [3/8] 1ad707702fa26cd4d0fa1870c21f5f26ae93ff97
|
||||
RH-Bugzilla: 2110203
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
If flush is called when no buffer was sent with MSG_ZEROCOPY, it currently
|
||||
returns 1. This return code should be used only when Linux fails to use
|
||||
MSG_ZEROCOPY on a lot of sendmsg().
|
||||
|
||||
Fix this by returning early from flush if no sendmsg(...,MSG_ZEROCOPY)
|
||||
was attempted.
|
||||
|
||||
Fixes: 2bc58ffc2926 ("QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX")
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
||||
Reviewed-by: Peter Xu <peterx@redhat.com>
|
||||
Message-Id: <20220711211112.18951-2-leobras@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
(cherry picked from commit 927f93e099c4f9184e60a1bc61624ac2d04d0223)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
io/channel-socket.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/io/channel-socket.c b/io/channel-socket.c
|
||||
index df858da924..cf0d67c51b 100644
|
||||
--- a/io/channel-socket.c
|
||||
+++ b/io/channel-socket.c
|
||||
@@ -717,12 +717,18 @@ static int qio_channel_socket_flush(QIOChannel *ioc,
|
||||
struct cmsghdr *cm;
|
||||
char control[CMSG_SPACE(sizeof(*serr))];
|
||||
int received;
|
||||
- int ret = 1;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (sioc->zero_copy_queued == sioc->zero_copy_sent) {
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
msg.msg_control = control;
|
||||
msg.msg_controllen = sizeof(control);
|
||||
memset(control, 0, sizeof(control));
|
||||
|
||||
+ ret = 1;
|
||||
+
|
||||
while (sioc->zero_copy_sent < sioc->zero_copy_queued) {
|
||||
received = recvmsg(sioc->fd, &msg, MSG_ERRQUEUE);
|
||||
if (received < 0) {
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From c1fd32d93ae42fcf3c1a25f4d56e669f251087d8 Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Mon, 20 Jun 2022 02:39:43 -0300
|
||||
Subject: [PATCH 25/37] QIOChannelSocket: Fix zero-copy send so socket flush
|
||||
works
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 191: MSG_ZEROCOPY + Multifd @ rhel8.7
|
||||
RH-Commit: [25/26] 3ede94f3269e21c3ace073ed1a6f24696315bcbb
|
||||
RH-Bugzilla: 2072049
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
Somewhere between v6 and v7 the of the zero-copy-send patchset a crucial
|
||||
part of the flushing mechanism got missing: incrementing zero_copy_queued.
|
||||
|
||||
Without that, the flushing interface becomes a no-op, and there is no
|
||||
guarantee the buffer is really sent.
|
||||
|
||||
This can go as bad as causing a corruption in RAM during migration.
|
||||
|
||||
Fixes: 2bc58ffc2926 ("QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX")
|
||||
Reported-by: 徐闯 <xuchuangxclwt@bytedance.com>
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Reviewed-by: Peter Xu <peterx@redhat.com>
|
||||
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
||||
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
(cherry picked from commit 4f5a09714c983a3471fd12e3c7f3196e95c650c1)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
io/channel-socket.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/io/channel-socket.c b/io/channel-socket.c
|
||||
index 7d37b39de7..df858da924 100644
|
||||
--- a/io/channel-socket.c
|
||||
+++ b/io/channel-socket.c
|
||||
@@ -612,6 +612,11 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
"Unable to write to socket");
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ if (flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) {
|
||||
+ sioc->zero_copy_queued++;
|
||||
+ }
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
#else /* WIN32 */
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
From 5fd7af93a06adaddbae719aabbaf912159f4fb28 Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Wed, 18 May 2022 02:52:25 -0300
|
||||
Subject: [PATCH 18/37] QIOChannelSocket: Implement io_writev zero copy flag &
|
||||
io_flush for CONFIG_LINUX
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 191: MSG_ZEROCOPY + Multifd @ rhel8.7
|
||||
RH-Commit: [18/26] 6f65c8c879a5df57213b541d58285b65178f8547
|
||||
RH-Bugzilla: 2072049
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
For CONFIG_LINUX, implement the new zero copy flag and the optional callback
|
||||
io_flush on QIOChannelSocket, but enables it only when MSG_ZEROCOPY
|
||||
feature is available in the host kernel, which is checked on
|
||||
qio_channel_socket_connect_sync()
|
||||
|
||||
qio_channel_socket_flush() was implemented by counting how many times
|
||||
sendmsg(...,MSG_ZEROCOPY) was successfully called, and then reading the
|
||||
socket's error queue, in order to find how many of them finished sending.
|
||||
Flush will loop until those counters are the same, or until some error occurs.
|
||||
|
||||
Notes on using writev() with QIO_CHANNEL_WRITE_FLAG_ZERO_COPY:
|
||||
1: Buffer
|
||||
- As MSG_ZEROCOPY tells the kernel to use the same user buffer to avoid copying,
|
||||
some caution is necessary to avoid overwriting any buffer before it's sent.
|
||||
If something like this happen, a newer version of the buffer may be sent instead.
|
||||
- If this is a problem, it's recommended to call qio_channel_flush() before freeing
|
||||
or re-using the buffer.
|
||||
|
||||
2: Locked memory
|
||||
- When using MSG_ZERCOCOPY, the buffer memory will be locked after queued, and
|
||||
unlocked after it's sent.
|
||||
- Depending on the size of each buffer, and how often it's sent, it may require
|
||||
a larger amount of locked memory than usually available to non-root user.
|
||||
- If the required amount of locked memory is not available, writev_zero_copy
|
||||
will return an error, which can abort an operation like migration,
|
||||
- Because of this, when an user code wants to add zero copy as a feature, it
|
||||
requires a mechanism to disable it, so it can still be accessible to less
|
||||
privileged users.
|
||||
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Reviewed-by: Peter Xu <peterx@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
||||
Message-Id: <20220513062836.965425-4-leobras@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
(cherry picked from commit 2bc58ffc2926a4efdd03edfb5909861fefc68c3d)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
include/io/channel-socket.h | 2 +
|
||||
io/channel-socket.c | 116 ++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 114 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/include/io/channel-socket.h b/include/io/channel-socket.h
|
||||
index e747e63514..513c428fe4 100644
|
||||
--- a/include/io/channel-socket.h
|
||||
+++ b/include/io/channel-socket.h
|
||||
@@ -47,6 +47,8 @@ struct QIOChannelSocket {
|
||||
socklen_t localAddrLen;
|
||||
struct sockaddr_storage remoteAddr;
|
||||
socklen_t remoteAddrLen;
|
||||
+ ssize_t zero_copy_queued;
|
||||
+ ssize_t zero_copy_sent;
|
||||
};
|
||||
|
||||
|
||||
diff --git a/io/channel-socket.c b/io/channel-socket.c
|
||||
index bfbd64787e..38a46ba213 100644
|
||||
--- a/io/channel-socket.c
|
||||
+++ b/io/channel-socket.c
|
||||
@@ -26,6 +26,14 @@
|
||||
#include "io/channel-watch.h"
|
||||
#include "trace.h"
|
||||
#include "qapi/clone-visitor.h"
|
||||
+#ifdef CONFIG_LINUX
|
||||
+#include <linux/errqueue.h>
|
||||
+#include <sys/socket.h>
|
||||
+
|
||||
+#if (defined(MSG_ZEROCOPY) && defined(SO_ZEROCOPY))
|
||||
+#define QEMU_MSG_ZEROCOPY
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
#define SOCKET_MAX_FDS 16
|
||||
|
||||
@@ -55,6 +63,8 @@ qio_channel_socket_new(void)
|
||||
|
||||
sioc = QIO_CHANNEL_SOCKET(object_new(TYPE_QIO_CHANNEL_SOCKET));
|
||||
sioc->fd = -1;
|
||||
+ sioc->zero_copy_queued = 0;
|
||||
+ sioc->zero_copy_sent = 0;
|
||||
|
||||
ioc = QIO_CHANNEL(sioc);
|
||||
qio_channel_set_feature(ioc, QIO_CHANNEL_FEATURE_SHUTDOWN);
|
||||
@@ -154,6 +164,16 @@ int qio_channel_socket_connect_sync(QIOChannelSocket *ioc,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#ifdef QEMU_MSG_ZEROCOPY
|
||||
+ int ret, v = 1;
|
||||
+ ret = setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &v, sizeof(v));
|
||||
+ if (ret == 0) {
|
||||
+ /* Zero copy available on host */
|
||||
+ qio_channel_set_feature(QIO_CHANNEL(ioc),
|
||||
+ QIO_CHANNEL_FEATURE_WRITE_ZERO_COPY);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -534,6 +554,7 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
char control[CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS)];
|
||||
size_t fdsize = sizeof(int) * nfds;
|
||||
struct cmsghdr *cmsg;
|
||||
+ int sflags = 0;
|
||||
|
||||
memset(control, 0, CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS));
|
||||
|
||||
@@ -558,15 +579,31 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
memcpy(CMSG_DATA(cmsg), fds, fdsize);
|
||||
}
|
||||
|
||||
+#ifdef QEMU_MSG_ZEROCOPY
|
||||
+ if (flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) {
|
||||
+ sflags = MSG_ZEROCOPY;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
retry:
|
||||
- ret = sendmsg(sioc->fd, &msg, 0);
|
||||
+ ret = sendmsg(sioc->fd, &msg, sflags);
|
||||
if (ret <= 0) {
|
||||
- if (errno == EAGAIN) {
|
||||
+ switch (errno) {
|
||||
+ case EAGAIN:
|
||||
return QIO_CHANNEL_ERR_BLOCK;
|
||||
- }
|
||||
- if (errno == EINTR) {
|
||||
+ case EINTR:
|
||||
goto retry;
|
||||
+#ifdef QEMU_MSG_ZEROCOPY
|
||||
+ case ENOBUFS:
|
||||
+ if (sflags & MSG_ZEROCOPY) {
|
||||
+ error_setg_errno(errp, errno,
|
||||
+ "Process can't lock enough memory for using MSG_ZEROCOPY");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ break;
|
||||
+#endif
|
||||
}
|
||||
+
|
||||
error_setg_errno(errp, errno,
|
||||
"Unable to write to socket");
|
||||
return -1;
|
||||
@@ -660,6 +697,74 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
||||
+
|
||||
+#ifdef QEMU_MSG_ZEROCOPY
|
||||
+static int qio_channel_socket_flush(QIOChannel *ioc,
|
||||
+ Error **errp)
|
||||
+{
|
||||
+ QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(ioc);
|
||||
+ struct msghdr msg = {};
|
||||
+ struct sock_extended_err *serr;
|
||||
+ struct cmsghdr *cm;
|
||||
+ char control[CMSG_SPACE(sizeof(*serr))];
|
||||
+ int received;
|
||||
+ int ret = 1;
|
||||
+
|
||||
+ msg.msg_control = control;
|
||||
+ msg.msg_controllen = sizeof(control);
|
||||
+ memset(control, 0, sizeof(control));
|
||||
+
|
||||
+ while (sioc->zero_copy_sent < sioc->zero_copy_queued) {
|
||||
+ received = recvmsg(sioc->fd, &msg, MSG_ERRQUEUE);
|
||||
+ if (received < 0) {
|
||||
+ switch (errno) {
|
||||
+ case EAGAIN:
|
||||
+ /* Nothing on errqueue, wait until something is available */
|
||||
+ qio_channel_wait(ioc, G_IO_ERR);
|
||||
+ continue;
|
||||
+ case EINTR:
|
||||
+ continue;
|
||||
+ default:
|
||||
+ error_setg_errno(errp, errno,
|
||||
+ "Unable to read errqueue");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ cm = CMSG_FIRSTHDR(&msg);
|
||||
+ if (cm->cmsg_level != SOL_IP &&
|
||||
+ cm->cmsg_type != IP_RECVERR) {
|
||||
+ error_setg_errno(errp, EPROTOTYPE,
|
||||
+ "Wrong cmsg in errqueue");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ serr = (void *) CMSG_DATA(cm);
|
||||
+ if (serr->ee_errno != SO_EE_ORIGIN_NONE) {
|
||||
+ error_setg_errno(errp, serr->ee_errno,
|
||||
+ "Error on socket");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (serr->ee_origin != SO_EE_ORIGIN_ZEROCOPY) {
|
||||
+ error_setg_errno(errp, serr->ee_origin,
|
||||
+ "Error not from zero copy");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* No errors, count successfully finished sendmsg()*/
|
||||
+ sioc->zero_copy_sent += serr->ee_data - serr->ee_info + 1;
|
||||
+
|
||||
+ /* If any sendmsg() succeeded using zero copy, return 0 at the end */
|
||||
+ if (serr->ee_code != SO_EE_CODE_ZEROCOPY_COPIED) {
|
||||
+ ret = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+#endif /* QEMU_MSG_ZEROCOPY */
|
||||
+
|
||||
static int
|
||||
qio_channel_socket_set_blocking(QIOChannel *ioc,
|
||||
bool enabled,
|
||||
@@ -789,6 +894,9 @@ static void qio_channel_socket_class_init(ObjectClass *klass,
|
||||
ioc_klass->io_set_delay = qio_channel_socket_set_delay;
|
||||
ioc_klass->io_create_watch = qio_channel_socket_create_watch;
|
||||
ioc_klass->io_set_aio_fd_handler = qio_channel_socket_set_aio_fd_handler;
|
||||
+#ifdef QEMU_MSG_ZEROCOPY
|
||||
+ ioc_klass->io_flush = qio_channel_socket_flush;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static const TypeInfo qio_channel_socket_info = {
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
From cbfaf86331c2b2e01a2083303b7554672bf991b7 Mon Sep 17 00:00:00 2001
|
||||
From: Leonardo Bras <leobras@redhat.com>
|
||||
Date: Mon, 20 Jun 2022 02:39:42 -0300
|
||||
Subject: [PATCH 24/37] QIOChannelSocket: Introduce assert and reduce ifdefs to
|
||||
improve readability
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Leonardo Brás <leobras@redhat.com>
|
||||
RH-MergeRequest: 191: MSG_ZEROCOPY + Multifd @ rhel8.7
|
||||
RH-Commit: [24/26] b50e2e65307149f247155a7f7a032dc99e57718d
|
||||
RH-Bugzilla: 2072049
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
During implementation of MSG_ZEROCOPY feature, a lot of #ifdefs were
|
||||
introduced, particularly at qio_channel_socket_writev().
|
||||
|
||||
Rewrite some of those changes so it's easier to read.
|
||||
|
||||
Also, introduce an assert to help detect incorrect zero-copy usage is when
|
||||
it's disabled on build.
|
||||
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
||||
Reviewed-by: Peter Xu <peterx@redhat.com>
|
||||
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
dgilbert: Fixed up thinko'd g_assert_unreachable->g_assert_not_reached
|
||||
(cherry picked from commit 803ca43e4c7fcf32f9f68c118301ccd0c83ece3f)
|
||||
Signed-off-by: Leonardo Bras <leobras@redhat.com>
|
||||
---
|
||||
io/channel-socket.c | 14 +++++++++-----
|
||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/io/channel-socket.c b/io/channel-socket.c
|
||||
index 38a46ba213..7d37b39de7 100644
|
||||
--- a/io/channel-socket.c
|
||||
+++ b/io/channel-socket.c
|
||||
@@ -579,11 +579,17 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
memcpy(CMSG_DATA(cmsg), fds, fdsize);
|
||||
}
|
||||
|
||||
-#ifdef QEMU_MSG_ZEROCOPY
|
||||
if (flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) {
|
||||
+#ifdef QEMU_MSG_ZEROCOPY
|
||||
sflags = MSG_ZEROCOPY;
|
||||
- }
|
||||
+#else
|
||||
+ /*
|
||||
+ * We expect QIOChannel class entry point to have
|
||||
+ * blocked this code path already
|
||||
+ */
|
||||
+ g_assert_not_reached();
|
||||
#endif
|
||||
+ }
|
||||
|
||||
retry:
|
||||
ret = sendmsg(sioc->fd, &msg, sflags);
|
||||
@@ -593,15 +599,13 @@ static ssize_t qio_channel_socket_writev(QIOChannel *ioc,
|
||||
return QIO_CHANNEL_ERR_BLOCK;
|
||||
case EINTR:
|
||||
goto retry;
|
||||
-#ifdef QEMU_MSG_ZEROCOPY
|
||||
case ENOBUFS:
|
||||
- if (sflags & MSG_ZEROCOPY) {
|
||||
+ if (flags & QIO_CHANNEL_WRITE_FLAG_ZERO_COPY) {
|
||||
error_setg_errno(errp, errno,
|
||||
"Process can't lock enough memory for using MSG_ZEROCOPY");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
-#endif
|
||||
}
|
||||
|
||||
error_setg_errno(errp, errno,
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
From f1480fe9a4054113ddacd218961e29f31c33d329 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Xu <peterx@redhat.com>
|
||||
Date: Wed, 6 Sep 2023 16:29:23 -0400
|
||||
Subject: [PATCH 2/3] RHEL: Enable "x-not-migrate-acpi-index" for all pre-RHEL8
|
||||
guests
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Peter Xu <peterx@redhat.com>
|
||||
RH-MergeRequest: 343: acpi: fix acpi_index migration
|
||||
RH-Jira: RHEL-20189
|
||||
RH-Acked-by: Leonardo Brás <leobras@redhat.com>
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-Acked-by: Prasad Pandit <None>
|
||||
RH-Commit: [2/2] 0a26a71236e68dd7feb5d2063254090e3852d6ba
|
||||
|
||||
The acpi index migration is simply broken before for all pre-RHEL8
|
||||
branches. Don't migrate it for all of them.
|
||||
|
||||
Signed-off-by: Peter Xu <peterx@redhat.com>
|
||||
---
|
||||
hw/core/machine.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 2724f6848a..6650a3d7b7 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -44,6 +44,10 @@ GlobalProperty hw_compat_rhel_8_6[] = {
|
||||
* we need do disable it downstream on the latest hw_compat_rhel_8.
|
||||
*/
|
||||
{ "vhost-vsock-device", "seqpacket", "off" },
|
||||
+ /*
|
||||
+ * RHEL-2186: all rhel8 machines should not migrate acpi index.
|
||||
+ */
|
||||
+ { "PIIX4_PM", "x-not-migrate-acpi-index", "on"},
|
||||
};
|
||||
const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6);
|
||||
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
From e0e4f01c6f4fb5881960f72ae4e80951b711131e Mon Sep 17 00:00:00 2001
|
||||
From: Stefano Garzarella <sgarzare@redhat.com>
|
||||
Date: Thu, 24 Mar 2022 16:04:57 +0100
|
||||
Subject: [PATCH 1/5] RHEL: disable "seqpacket" for "vhost-vsock-device" in
|
||||
rhel8.6.0
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-MergeRequest: 136: RHEL: disable "seqpacket" for "vhost-vsock-device" in rhel8.6.0 [rhel-8.7.0]
|
||||
RH-Commit: [1/1] d82ea09e123679521503689f7d9af1c03dc71bfc
|
||||
RH-Bugzilla: 2068202
|
||||
RH-Acked-by: Jason Wang <None>
|
||||
RH-Acked-by: Eugenio Pérez <None>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
|
||||
vhost-vsock device in RHEL 8 kernels doesn't support seqpacket.
|
||||
To avoid problems when migrating a VM from RHEL 9 host, we need to
|
||||
disable it in rhel8-* machine types.
|
||||
|
||||
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
||||
---
|
||||
hw/core/machine.c | 10 ++++++++++
|
||||
hw/i386/pc_piix.c | 2 ++
|
||||
hw/i386/pc_q35.c | 2 ++
|
||||
hw/s390x/s390-virtio-ccw.c | 1 +
|
||||
include/hw/boards.h | 3 +++
|
||||
5 files changed, 18 insertions(+)
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 024b025fc2..76fcabec7a 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -37,6 +37,16 @@
|
||||
#include "hw/virtio/virtio.h"
|
||||
#include "hw/virtio/virtio-pci.h"
|
||||
|
||||
+GlobalProperty hw_compat_rhel_8_6[] = {
|
||||
+ /* hw_compat_rhel_8_6 bz 2068202 */
|
||||
+ /*
|
||||
+ * vhost-vsock device in RHEL 8 kernels doesn't support seqpacket, so
|
||||
+ * we need do disable it downstream on the latest hw_compat_rhel_8.
|
||||
+ */
|
||||
+ { "vhost-vsock-device", "seqpacket", "off" },
|
||||
+};
|
||||
+const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6);
|
||||
+
|
||||
/*
|
||||
* Mostly the same as hw_compat_6_0 and hw_compat_6_1
|
||||
*/
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index f03a8f0db8..ab6d03e07a 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -998,6 +998,8 @@ static void pc_machine_rhel760_options(MachineClass *m)
|
||||
pcmc->kvmclock_create_always = false;
|
||||
/* From pc_i440fx_5_1_machine_options() */
|
||||
pcmc->pci_root_uid = 1;
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_8_6,
|
||||
+ hw_compat_rhel_8_6_len);
|
||||
compat_props_add(m->compat_props, hw_compat_rhel_8_5,
|
||||
hw_compat_rhel_8_5_len);
|
||||
compat_props_add(m->compat_props, pc_rhel_8_5_compat,
|
||||
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
|
||||
index 5559261d9e..882fe7a68d 100644
|
||||
--- a/hw/i386/pc_q35.c
|
||||
+++ b/hw/i386/pc_q35.c
|
||||
@@ -658,6 +658,8 @@ static void pc_q35_machine_rhel860_options(MachineClass *m)
|
||||
m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)";
|
||||
pcmc->smbios_stream_product = "RHEL-AV";
|
||||
pcmc->smbios_stream_version = "8.6.0";
|
||||
+ compat_props_add(m->compat_props, hw_compat_rhel_8_6,
|
||||
+ hw_compat_rhel_8_6_len);
|
||||
}
|
||||
|
||||
DEFINE_PC_MACHINE(q35_rhel860, "pc-q35-rhel8.6.0", pc_q35_init_rhel860,
|
||||
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
|
||||
index 9795eb9406..bec270598b 100644
|
||||
--- a/hw/s390x/s390-virtio-ccw.c
|
||||
+++ b/hw/s390x/s390-virtio-ccw.c
|
||||
@@ -1109,6 +1109,7 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
|
||||
|
||||
static void ccw_machine_rhel860_class_options(MachineClass *mc)
|
||||
{
|
||||
+ compat_props_add(mc->compat_props, hw_compat_rhel_8_6, hw_compat_rhel_8_6_len);
|
||||
}
|
||||
DEFINE_CCW_MACHINE(rhel860, "rhel8.6.0", true);
|
||||
|
||||
diff --git a/include/hw/boards.h b/include/hw/boards.h
|
||||
index 04e8759815..4ddb798144 100644
|
||||
--- a/include/hw/boards.h
|
||||
+++ b/include/hw/boards.h
|
||||
@@ -443,6 +443,9 @@ extern const size_t hw_compat_2_2_len;
|
||||
extern GlobalProperty hw_compat_2_1[];
|
||||
extern const size_t hw_compat_2_1_len;
|
||||
|
||||
+extern GlobalProperty hw_compat_rhel_8_6[];
|
||||
+extern const size_t hw_compat_rhel_8_6_len;
|
||||
+
|
||||
extern GlobalProperty hw_compat_rhel_8_5[];
|
||||
extern const size_t hw_compat_rhel_8_5_len;
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
From dcc64971bf25e5c2303d551fb2fef448a5e8f4fd Mon Sep 17 00:00:00 2001
|
||||
From: Cornelia Huck <cohuck@redhat.com>
|
||||
Date: Thu, 3 Mar 2022 10:57:37 +0100
|
||||
Subject: [PATCH 1/5] RHEL: mark old machine types as deprecated
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-MergeRequest: 119: RHEL: mark old machine types as deprecated
|
||||
RH-Commit: [1/1] 5d7531d23fac5dd67c3cc202f538b25f26393600 (cohuck/qemu-kvm)
|
||||
RH-Bugzilla: 2052050
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
|
||||
We want to make it obvious that we consider machine types for older
|
||||
RHEL major releases to be deprecated; we only carry them for
|
||||
compatibility purposes.
|
||||
|
||||
Let's mark all rhel-7.x and rhel-8.x machine type as deprecated via
|
||||
QEMU's existing deprecation mechanism; those machine types will
|
||||
continue to work as expected, but commands like 'virsh capabilities',
|
||||
'virsh dominfo', or the libvirt log will tag the machine as
|
||||
deprecated.
|
||||
|
||||
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
|
||||
---
|
||||
hw/core/machine.c | 6 ++++++
|
||||
hw/i386/pc_piix.c | 4 ++++
|
||||
hw/i386/pc_q35.c | 4 ++++
|
||||
hw/s390x/s390-virtio-ccw.c | 3 +++
|
||||
include/hw/boards.h | 2 ++
|
||||
5 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 669d3d8b91..5fae55d6cd 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -37,6 +37,12 @@
|
||||
#include "hw/virtio/virtio.h"
|
||||
#include "hw/virtio/virtio-pci.h"
|
||||
|
||||
+/*
|
||||
+ * RHEL only: machine types for previous major releases are deprecated
|
||||
+ */
|
||||
+const char *rhel_old_machine_deprecation =
|
||||
+ "machine types for previous major releases are deprecated";
|
||||
+
|
||||
/*
|
||||
* Mostly the same as hw_compat_6_0 and hw_compat_6_1
|
||||
*/
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index fccb7f5fc9..cf68d7498c 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -989,6 +989,10 @@ static void pc_machine_rhel760_options(MachineClass *m)
|
||||
m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)";
|
||||
m->async_pf_vmexit_disable = true;
|
||||
m->smbus_no_migration_support = true;
|
||||
+
|
||||
+ /* All RHEL machines for prior major releases are deprecated */
|
||||
+ m->deprecation_reason = rhel_old_machine_deprecation;
|
||||
+
|
||||
pcmc->pvh_enabled = false;
|
||||
pcmc->default_cpu_version = CPU_VERSION_LEGACY;
|
||||
pcmc->kvmclock_create_always = false;
|
||||
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
|
||||
index bf9ad32f0e..c8e06da084 100644
|
||||
--- a/hw/i386/pc_q35.c
|
||||
+++ b/hw/i386/pc_q35.c
|
||||
@@ -674,6 +674,10 @@ static void pc_q35_machine_rhel860_options(MachineClass *m)
|
||||
pc_q35_machine_rhel900_options(m);
|
||||
m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)";
|
||||
m->alias = NULL;
|
||||
+
|
||||
+ /* All RHEL machines for prior major releases are deprecated */
|
||||
+ m->deprecation_reason = rhel_old_machine_deprecation;
|
||||
+
|
||||
pcmc->smbios_stream_product = "RHEL-AV";
|
||||
pcmc->smbios_stream_version = "8.6.0";
|
||||
}
|
||||
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
|
||||
index 9da6e9b1d4..cc78a315e3 100644
|
||||
--- a/hw/s390x/s390-virtio-ccw.c
|
||||
+++ b/hw/s390x/s390-virtio-ccw.c
|
||||
@@ -1121,6 +1121,9 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
|
||||
static void ccw_machine_rhel860_class_options(MachineClass *mc)
|
||||
{
|
||||
ccw_machine_rhel900_class_options(mc);
|
||||
+
|
||||
+ /* All RHEL machines for prior major releases are deprecated */
|
||||
+ mc->deprecation_reason = rhel_old_machine_deprecation;
|
||||
}
|
||||
DEFINE_CCW_MACHINE(rhel860, "rhel8.6.0", false);
|
||||
|
||||
diff --git a/include/hw/boards.h b/include/hw/boards.h
|
||||
index 3c3d2ad450..21d8d5528e 100644
|
||||
--- a/include/hw/boards.h
|
||||
+++ b/include/hw/boards.h
|
||||
@@ -464,4 +464,6 @@ extern const size_t hw_compat_rhel_8_0_len;
|
||||
extern GlobalProperty hw_compat_rhel_7_6[];
|
||||
extern const size_t hw_compat_rhel_7_6_len;
|
||||
|
||||
+extern const char *rhel_old_machine_deprecation;
|
||||
+
|
||||
#endif
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
From e626dc16d130c724c400b99a93daad0a9abeae59 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 22 Mar 2022 19:23:36 -0400
|
||||
Subject: [PATCH 01/18] Revert "redhat: Add hw_compat_4_2_extra and apply to
|
||||
upstream machines"
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 131: Revert "redhat: Add hw_compat_4_2_extra and apply to upstream machines"
|
||||
RH-Commit: [1/3] 47b7d9e5062f5e215d5ed1a3ecdc1a87ac3fa630 (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2062613
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
BZ: https://bugzilla.redhat.com/2062613
|
||||
UPSTREAM: no
|
||||
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=44038000
|
||||
|
||||
commit dc2e9ec1e014950c7918e23a3e9b0096b34a4a92
|
||||
Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
Date: Wed Mar 9 10:31:53 2022 +0000
|
||||
|
||||
Revert "redhat: Add hw_compat_4_2_extra and apply to upstream machines"
|
||||
|
||||
This reverts commit 66882f9a3230246409f3918424aca26add5c034a.
|
||||
We no longer need these compat machines it was added for.
|
||||
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
(cherry picked from commit dc2e9ec1e014950c7918e23a3e9b0096b34a4a92)
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/i386/pc.c | 12 ------------
|
||||
hw/i386/pc_piix.c | 6 ------
|
||||
include/hw/i386/pc.h | 3 ---
|
||||
3 files changed, 21 deletions(-)
|
||||
|
||||
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
|
||||
index 4c08a1971c..357257349b 100644
|
||||
--- a/hw/i386/pc.c
|
||||
+++ b/hw/i386/pc.c
|
||||
@@ -670,18 +670,6 @@ GlobalProperty pc_rhel_7_0_compat[] = {
|
||||
};
|
||||
const size_t pc_rhel_7_0_compat_len = G_N_ELEMENTS(pc_rhel_7_0_compat);
|
||||
|
||||
-/*
|
||||
- * RHEL: These properties only apply to the RHEL exported machine types
|
||||
- * pc-4.2/2.11 for the purpose to have a limited upstream machines support
|
||||
- * which can be migrated to RHEL. Let's avoid touching hw_compat_4_2 directly
|
||||
- * so that we can have some isolation against the upstream code.
|
||||
- */
|
||||
-GlobalProperty hw_compat_4_2_extra[] = {
|
||||
- /* By default enlarge the default virtio-net-pci ROM to 512KB. */
|
||||
- { "virtio-net-pci", "romsize", "0x80000" },
|
||||
-};
|
||||
-const size_t hw_compat_4_2_extra_len = G_N_ELEMENTS(hw_compat_4_2_extra);
|
||||
-
|
||||
GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled)
|
||||
{
|
||||
GSIState *s;
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index c30057c443..7b7076cbc7 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -531,12 +531,6 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
|
||||
* supported by RHEL, even if exported.
|
||||
*/
|
||||
m->deprecation_reason = "Not supported by RHEL";
|
||||
- /*
|
||||
- * RHEL: Specific compat properties to have limited support for upstream
|
||||
- * machines exported.
|
||||
- */
|
||||
- compat_props_add(m->compat_props, hw_compat_4_2_extra,
|
||||
- hw_compat_4_2_extra_len);
|
||||
}
|
||||
|
||||
/* RHEL: Export pc-4.2 */
|
||||
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
|
||||
index 9e8bfb69f8..4a593acb50 100644
|
||||
--- a/include/hw/i386/pc.h
|
||||
+++ b/include/hw/i386/pc.h
|
||||
@@ -325,9 +325,6 @@ extern const size_t pc_rhel_7_1_compat_len;
|
||||
extern GlobalProperty pc_rhel_7_0_compat[];
|
||||
extern const size_t pc_rhel_7_0_compat_len;
|
||||
|
||||
-extern GlobalProperty hw_compat_4_2_extra[];
|
||||
-extern const size_t hw_compat_4_2_extra_len;
|
||||
-
|
||||
/* Helper for setting model-id for CPU models that changed model-id
|
||||
* depending on QEMU versions up to QEMU 2.4.
|
||||
*/
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
From 96edd15df257f1d1496397a6fac24b4316570d7e Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Thu, 14 Apr 2022 16:45:30 -0400
|
||||
Subject: [PATCH 1/3] Revert redhat: Add some devices for exporting upstream
|
||||
machine types
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 156: Revert redhat: Add some devices for exporting upstream machine types
|
||||
RH-Commit: [1/1] f25d0da3a181136917ead82f5a5c59efe3fa445a (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2065043
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2065043
|
||||
Upstream: no
|
||||
|
||||
Manual revert of commit 70d3924521c9bfd912bcf1a1fc76f49eb377de46, since
|
||||
the directory structure looks different from rhel-av-8.4.0.z where
|
||||
this commit is taken from. Besides, x86_64-softmmu.mak looks totally
|
||||
different and should not be affected by this reversal.
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
configs/devices/x86_64-softmmu/x86_64-rh-devices.mak | 1 -
|
||||
.../devices/x86_64-softmmu/x86_64-upstream-devices.mak | 4 ----
|
||||
hw/char/parallel.c | 9 ---------
|
||||
hw/i386/pc_piix.c | 2 +-
|
||||
hw/i386/pc_q35.c | 2 +-
|
||||
hw/timer/hpet.c | 8 --------
|
||||
6 files changed, 2 insertions(+), 24 deletions(-)
|
||||
delete mode 100644 configs/devices/x86_64-softmmu/x86_64-upstream-devices.mak
|
||||
|
||||
diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
index fdbbdf9742..31ce08edab 100644
|
||||
--- a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
+++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak
|
||||
@@ -1,5 +1,4 @@
|
||||
include ../rh-virtio.mak
|
||||
-include x86_64-upstream-devices.mak
|
||||
|
||||
CONFIG_AC97=y
|
||||
CONFIG_ACPI=y
|
||||
diff --git a/configs/devices/x86_64-softmmu/x86_64-upstream-devices.mak b/configs/devices/x86_64-softmmu/x86_64-upstream-devices.mak
|
||||
deleted file mode 100644
|
||||
index 2cd20f54d2..0000000000
|
||||
--- a/configs/devices/x86_64-softmmu/x86_64-upstream-devices.mak
|
||||
+++ /dev/null
|
||||
@@ -1,4 +0,0 @@
|
||||
-# We need "isa-parallel"
|
||||
-CONFIG_PARALLEL=y
|
||||
-# We need "hpet"
|
||||
-CONFIG_HPET=y
|
||||
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
|
||||
index e5f108211b..b45e67bfbb 100644
|
||||
--- a/hw/char/parallel.c
|
||||
+++ b/hw/char/parallel.c
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "chardev/char-parallel.h"
|
||||
#include "chardev/char-fe.h"
|
||||
#include "hw/acpi/aml-build.h"
|
||||
-#include "hw/boards.h"
|
||||
#include "hw/irq.h"
|
||||
#include "hw/isa/isa.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
@@ -535,14 +534,6 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
|
||||
int base;
|
||||
uint8_t dummy;
|
||||
|
||||
- /* Restricted for Red Hat Enterprise Linux */
|
||||
- MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
- if (strstr(mc->name, "rhel")) {
|
||||
- error_setg(errp, "Device %s is not supported with machine type %s",
|
||||
- object_get_typename(OBJECT(dev)), mc->name);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if (!qemu_chr_fe_backend_connected(&s->chr)) {
|
||||
error_setg(errp, "Can't create parallel device, empty char device");
|
||||
return;
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index ab6d03e07a..5f101c8748 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -966,7 +966,7 @@ static void pc_machine_rhel7_options(MachineClass *m)
|
||||
{
|
||||
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
m->family = "pc_piix_Y";
|
||||
- m->default_machine_opts = "firmware=bios-256k.bin,hpet=off";
|
||||
+ m->default_machine_opts = "firmware=bios-256k.bin";
|
||||
pcmc->default_nic_model = "e1000";
|
||||
pcmc->pci_root_uid = 0;
|
||||
m->default_display = "std";
|
||||
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
|
||||
index 882fe7a68d..73b0d0d317 100644
|
||||
--- a/hw/i386/pc_q35.c
|
||||
+++ b/hw/i386/pc_q35.c
|
||||
@@ -633,7 +633,7 @@ static void pc_q35_machine_rhel_options(MachineClass *m)
|
||||
pcmc->pci_root_uid = 0;
|
||||
m->family = "pc_q35_Z";
|
||||
m->units_per_default_bus = 1;
|
||||
- m->default_machine_opts = "firmware=bios-256k.bin,hpet=off";
|
||||
+ m->default_machine_opts = "firmware=bios-256k.bin";
|
||||
m->default_display = "std";
|
||||
m->no_floppy = 1;
|
||||
m->no_parallel = 1;
|
||||
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
|
||||
index 202e032524..9520471be2 100644
|
||||
--- a/hw/timer/hpet.c
|
||||
+++ b/hw/timer/hpet.c
|
||||
@@ -733,14 +733,6 @@ static void hpet_realize(DeviceState *dev, Error **errp)
|
||||
int i;
|
||||
HPETTimer *timer;
|
||||
|
||||
- /* Restricted for Red Hat Enterprise Linux */
|
||||
- MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
- if (strstr(mc->name, "rhel")) {
|
||||
- error_setg(errp, "Device %s is not supported with machine type %s",
|
||||
- object_get_typename(OBJECT(dev)), mc->name);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if (!s->intcap) {
|
||||
warn_report("Hpet's intcap not initialized");
|
||||
}
|
||||
--
|
||||
2.35.1
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
From 5bf8f1d69fea1225e927fbb3efe549a2a9d47d92 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 22 Mar 2022 19:23:36 -0400
|
||||
Subject: [PATCH 02/18] Revert "redhat: Enable FDC device for upstream machines
|
||||
too"
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 131: Revert "redhat: Add hw_compat_4_2_extra and apply to upstream machines"
|
||||
RH-Commit: [2/3] 4e3c945e3de9bb9d9a6d24115f0719168c9669fe (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2062613
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
BZ: https://bugzilla.redhat.com/2062613
|
||||
UPSTREAM: no
|
||||
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=44038000
|
||||
|
||||
commit 597cb6ca1da4a3eea77c1e4928f55203a1d5c70c
|
||||
Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
Date: Wed Mar 9 10:32:39 2022 +0000
|
||||
|
||||
Revert "redhat: Enable FDC device for upstream machines too"
|
||||
|
||||
This reverts commit c4d1aa8bf21fe98da94a9cff30b7c25bed12c17f.
|
||||
We no longer need these compat machines it was added for.
|
||||
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
(cherry picked from commit 597cb6ca1da4a3eea77c1e4928f55203a1d5c70c)
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/block/fdc.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
|
||||
index 63042ef030..97fa6de423 100644
|
||||
--- a/hw/block/fdc.c
|
||||
+++ b/hw/block/fdc.c
|
||||
@@ -2341,10 +2341,7 @@ void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl, Error **errp)
|
||||
|
||||
/* Restricted for Red Hat Enterprise Linux: */
|
||||
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
- if (!strstr(mc->name, "-rhel7.") &&
|
||||
- /* Exported two upstream machine types allows FDC too */
|
||||
- strcmp(mc->name, "pc-i440fx-4.2") &&
|
||||
- strcmp(mc->name, "pc-i440fx-2.11")) {
|
||||
+ 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;
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
From ee3cae3bb349469edcf725a1c5161521e95dcb9f Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 22 Mar 2022 19:23:36 -0400
|
||||
Subject: [PATCH 03/18] Revert "redhat: Expose upstream machines pc-4.2 and
|
||||
pc-2.11"
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 131: Revert "redhat: Add hw_compat_4_2_extra and apply to upstream machines"
|
||||
RH-Commit: [3/3] 35cee68034580f81b3aa916921eecd2fdfa7dd15 (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2062613
|
||||
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
||||
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
BZ: https://bugzilla.redhat.com/2062613
|
||||
UPSTREAM: no
|
||||
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=44038000
|
||||
|
||||
commit f3b50d6d4ae0be9e64aafe6a15f5423bab4899e9
|
||||
Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
Date: Wed Mar 9 10:34:58 2022 +0000
|
||||
|
||||
Revert "redhat: Expose upstream machines pc-4.2 and pc-2.11"
|
||||
This reverts commit 618e2424edba499d52cd26cf8363bc2dd85ef149.
|
||||
We no longer need these compat machines.
|
||||
|
||||
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
|
||||
(cherry picked from commit f3b50d6d4ae0be9e64aafe6a15f5423bab4899e9)
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/i386/pc_piix.c | 37 -------------------------------------
|
||||
1 file changed, 37 deletions(-)
|
||||
|
||||
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
||||
index 7b7076cbc7..f03a8f0db8 100644
|
||||
--- a/hw/i386/pc_piix.c
|
||||
+++ b/hw/i386/pc_piix.c
|
||||
@@ -315,14 +315,6 @@ static void pc_init1(MachineState *machine,
|
||||
* hw_compat_*, pc_compat_*, or * pc_*_machine_options().
|
||||
*/
|
||||
|
||||
-/*
|
||||
- * NOTE! Not all the upstream machine types are disabled for RHEL. For
|
||||
- * providing a very limited support for upstream machine types, pc machines
|
||||
- * 2.11 and 4.2 are exposed explicitly. This will make the below "#if" macros
|
||||
- * a bit messed up, but please read this comment first so that we can have a
|
||||
- * rough understanding of what we're going to do.
|
||||
- */
|
||||
-
|
||||
#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
static void pc_compat_2_3_fn(MachineState *machine)
|
||||
{
|
||||
@@ -399,8 +391,6 @@ static void pc_xen_hvm_init(MachineState *machine)
|
||||
}
|
||||
#endif
|
||||
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
-
|
||||
#define DEFINE_I440FX_MACHINE(suffix, name, compatfn, optionfn) \
|
||||
static void pc_init_##suffix(MachineState *machine) \
|
||||
{ \
|
||||
@@ -465,10 +455,8 @@ static void pc_i440fx_6_0_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_6_0, pc_compat_6_0_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", NULL,
|
||||
pc_i440fx_6_0_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_5_2_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -479,10 +467,8 @@ static void pc_i440fx_5_2_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v5_2, "pc-i440fx-5.2", NULL,
|
||||
pc_i440fx_5_2_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_5_1_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -497,10 +483,8 @@ static void pc_i440fx_5_1_machine_options(MachineClass *m)
|
||||
pcmc->pci_root_uid = 1;
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v5_1, "pc-i440fx-5.1", NULL,
|
||||
pc_i440fx_5_1_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_5_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -513,10 +497,8 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
|
||||
m->auto_enable_numa_with_memdev = false;
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v5_0, "pc-i440fx-5.0", NULL,
|
||||
pc_i440fx_5_0_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_4_2_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -525,15 +507,8 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
|
||||
m->is_default = false;
|
||||
compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
|
||||
compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
|
||||
-
|
||||
- /*
|
||||
- * RHEL: Mark all upstream machines as deprecated because they're not
|
||||
- * supported by RHEL, even if exported.
|
||||
- */
|
||||
- m->deprecation_reason = "Not supported by RHEL";
|
||||
}
|
||||
|
||||
-/* RHEL: Export pc-4.2 */
|
||||
DEFINE_I440FX_MACHINE(v4_2, "pc-i440fx-4.2", NULL,
|
||||
pc_i440fx_4_2_machine_options);
|
||||
|
||||
@@ -546,10 +521,8 @@ static void pc_i440fx_4_1_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v4_1, "pc-i440fx-4.1", NULL,
|
||||
pc_i440fx_4_1_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_4_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -562,10 +535,8 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,
|
||||
pc_i440fx_4_0_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_3_1_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -581,10 +552,8 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,
|
||||
pc_i440fx_3_1_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_3_0_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -593,10 +562,8 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_3_0, pc_compat_3_0_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
|
||||
pc_i440fx_3_0_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_2_12_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -605,10 +572,8 @@ static void pc_i440fx_2_12_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_2_12, pc_compat_2_12_len);
|
||||
}
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL,
|
||||
pc_i440fx_2_12_machine_options);
|
||||
-#endif /* Disabled for Red Hat Enterprise Linux */
|
||||
|
||||
static void pc_i440fx_2_11_machine_options(MachineClass *m)
|
||||
{
|
||||
@@ -617,11 +582,9 @@ static void pc_i440fx_2_11_machine_options(MachineClass *m)
|
||||
compat_props_add(m->compat_props, pc_compat_2_11, pc_compat_2_11_len);
|
||||
}
|
||||
|
||||
-/* RHEL: Export pc-2.11 */
|
||||
DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL,
|
||||
pc_i440fx_2_11_machine_options);
|
||||
|
||||
-#if 0 /* Disabled for Red Hat Enterprise Linux */
|
||||
static void pc_i440fx_2_10_machine_options(MachineClass *m)
|
||||
{
|
||||
pc_i440fx_2_11_machine_options(m);
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From 213d2c6d3138f3570bca36edaacfd1ee86b18967 Mon Sep 17 00:00:00 2001
|
||||
From: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Date: Fri, 4 Feb 2022 06:45:51 +0100
|
||||
Subject: [PATCH 1/6] Revert "ui/clipboard: Don't use g_autoptr just to free a
|
||||
variable"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
||||
RH-MergeRequest: 75: fix vnc cut+paste crash
|
||||
RH-Commit: [1/4] 0937d15054ad6e902bc22d1872231504f442ddcc (kraxel/centos-qemu-kvm)
|
||||
RH-Bugzilla: 2042820
|
||||
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
|
||||
This reverts commit 8df1ea81ee6c674522967d056daa8d3748fa3883.
|
||||
---
|
||||
ui/clipboard.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ui/clipboard.c b/ui/clipboard.c
|
||||
index d53576b0f6..d7b008d62a 100644
|
||||
--- a/ui/clipboard.c
|
||||
+++ b/ui/clipboard.c
|
||||
@@ -44,14 +44,13 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
|
||||
|
||||
void qemu_clipboard_update(QemuClipboardInfo *info)
|
||||
{
|
||||
- QemuClipboardInfo *old = NULL;
|
||||
+ g_autoptr(QemuClipboardInfo) old = NULL;
|
||||
assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT);
|
||||
|
||||
notifier_list_notify(&clipboard_notifiers, info);
|
||||
|
||||
old = cbinfo[info->selection];
|
||||
cbinfo[info->selection] = qemu_clipboard_info_ref(info);
|
||||
- g_free(old);
|
||||
}
|
||||
|
||||
QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection)
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
From 10fc28b61a6fba1e6dc44fd544cf31c7f313c622 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= <clg@redhat.com>
|
||||
Date: Fri, 28 Oct 2022 17:48:00 +0100
|
||||
Subject: [PATCH 05/42] Update linux headers to v6.0-rc4
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [5/41] ca55f497d1bf1e72179330f8f613781bf999d898
|
||||
|
||||
Based on upstream commit d525f73f9186a5bc641b8caf0b2c9bb94e5aa963
|
||||
("Update linux headers to v6.0-rc4"), but this is focusing only on the
|
||||
ZPCI and protected dump changes.
|
||||
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
linux-headers/linux/kvm.h | 87 +++++++++++++++++++++++++++++++++
|
||||
linux-headers/linux/vfio_zdev.h | 7 +++
|
||||
2 files changed, 94 insertions(+)
|
||||
|
||||
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
|
||||
index 0d05d02ee4..c65930288c 100644
|
||||
--- a/linux-headers/linux/kvm.h
|
||||
+++ b/linux-headers/linux/kvm.h
|
||||
@@ -1150,6 +1150,9 @@ struct kvm_ppc_resize_hpt {
|
||||
#define KVM_CAP_DISABLE_QUIRKS2 213
|
||||
/* #define KVM_CAP_VM_TSC_CONTROL 214 */
|
||||
#define KVM_CAP_SYSTEM_EVENT_DATA 215
|
||||
+#define KVM_CAP_S390_PROTECTED_DUMP 217
|
||||
+#define KVM_CAP_S390_ZPCI_OP 221
|
||||
+#define KVM_CAP_S390_CPU_TOPOLOGY 222
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
@@ -1651,6 +1654,55 @@ struct kvm_s390_pv_unp {
|
||||
__u64 tweak;
|
||||
};
|
||||
|
||||
+enum pv_cmd_dmp_id {
|
||||
+ KVM_PV_DUMP_INIT,
|
||||
+ KVM_PV_DUMP_CONFIG_STOR_STATE,
|
||||
+ KVM_PV_DUMP_COMPLETE,
|
||||
+ KVM_PV_DUMP_CPU,
|
||||
+};
|
||||
+
|
||||
+struct kvm_s390_pv_dmp {
|
||||
+ __u64 subcmd;
|
||||
+ __u64 buff_addr;
|
||||
+ __u64 buff_len;
|
||||
+ __u64 gaddr; /* For dump storage state */
|
||||
+ __u64 reserved[4];
|
||||
+};
|
||||
+
|
||||
+enum pv_cmd_info_id {
|
||||
+ KVM_PV_INFO_VM,
|
||||
+ KVM_PV_INFO_DUMP,
|
||||
+};
|
||||
+
|
||||
+struct kvm_s390_pv_info_dump {
|
||||
+ __u64 dump_cpu_buffer_len;
|
||||
+ __u64 dump_config_mem_buffer_per_1m;
|
||||
+ __u64 dump_config_finalize_len;
|
||||
+};
|
||||
+
|
||||
+struct kvm_s390_pv_info_vm {
|
||||
+ __u64 inst_calls_list[4];
|
||||
+ __u64 max_cpus;
|
||||
+ __u64 max_guests;
|
||||
+ __u64 max_guest_addr;
|
||||
+ __u64 feature_indication;
|
||||
+};
|
||||
+
|
||||
+struct kvm_s390_pv_info_header {
|
||||
+ __u32 id;
|
||||
+ __u32 len_max;
|
||||
+ __u32 len_written;
|
||||
+ __u32 reserved;
|
||||
+};
|
||||
+
|
||||
+struct kvm_s390_pv_info {
|
||||
+ struct kvm_s390_pv_info_header header;
|
||||
+ union {
|
||||
+ struct kvm_s390_pv_info_dump dump;
|
||||
+ struct kvm_s390_pv_info_vm vm;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
enum pv_cmd_id {
|
||||
KVM_PV_ENABLE,
|
||||
KVM_PV_DISABLE,
|
||||
@@ -1659,6 +1711,8 @@ enum pv_cmd_id {
|
||||
KVM_PV_VERIFY,
|
||||
KVM_PV_PREP_RESET,
|
||||
KVM_PV_UNSHARE_ALL,
|
||||
+ KVM_PV_INFO,
|
||||
+ KVM_PV_DUMP,
|
||||
};
|
||||
|
||||
struct kvm_pv_cmd {
|
||||
@@ -2066,4 +2120,37 @@ struct kvm_stats_desc {
|
||||
/* Available with KVM_CAP_XSAVE2 */
|
||||
#define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave)
|
||||
|
||||
+/* Available with KVM_CAP_S390_PROTECTED_DUMP */
|
||||
+#define KVM_S390_PV_CPU_COMMAND _IOWR(KVMIO, 0xd0, struct kvm_pv_cmd)
|
||||
+
|
||||
+/* Available with KVM_CAP_S390_ZPCI_OP */
|
||||
+#define KVM_S390_ZPCI_OP _IOW(KVMIO, 0xd1, struct kvm_s390_zpci_op)
|
||||
+
|
||||
+struct kvm_s390_zpci_op {
|
||||
+ /* in */
|
||||
+ __u32 fh; /* target device */
|
||||
+ __u8 op; /* operation to perform */
|
||||
+ __u8 pad[3];
|
||||
+ union {
|
||||
+ /* for KVM_S390_ZPCIOP_REG_AEN */
|
||||
+ struct {
|
||||
+ __u64 ibv; /* Guest addr of interrupt bit vector */
|
||||
+ __u64 sb; /* Guest addr of summary bit */
|
||||
+ __u32 flags;
|
||||
+ __u32 noi; /* Number of interrupts */
|
||||
+ __u8 isc; /* Guest interrupt subclass */
|
||||
+ __u8 sbo; /* Offset of guest summary bit vector */
|
||||
+ __u16 pad;
|
||||
+ } reg_aen;
|
||||
+ __u64 reserved[8];
|
||||
+ } u;
|
||||
+};
|
||||
+
|
||||
+/* types for kvm_s390_zpci_op->op */
|
||||
+#define KVM_S390_ZPCIOP_REG_AEN 0
|
||||
+#define KVM_S390_ZPCIOP_DEREG_AEN 1
|
||||
+
|
||||
+/* flags for kvm_s390_zpci_op->u.reg_aen.flags */
|
||||
+#define KVM_S390_ZPCIOP_REGAEN_HOST (1 << 0)
|
||||
+
|
||||
#endif /* __LINUX_KVM_H */
|
||||
diff --git a/linux-headers/linux/vfio_zdev.h b/linux-headers/linux/vfio_zdev.h
|
||||
index b4309397b6..77f2aff1f2 100644
|
||||
--- a/linux-headers/linux/vfio_zdev.h
|
||||
+++ b/linux-headers/linux/vfio_zdev.h
|
||||
@@ -29,6 +29,9 @@ struct vfio_device_info_cap_zpci_base {
|
||||
__u16 fmb_length; /* Measurement Block Length (in bytes) */
|
||||
__u8 pft; /* PCI Function Type */
|
||||
__u8 gid; /* PCI function group ID */
|
||||
+ /* End of version 1 */
|
||||
+ __u32 fh; /* PCI function handle */
|
||||
+ /* End of version 2 */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -47,6 +50,10 @@ struct vfio_device_info_cap_zpci_group {
|
||||
__u16 noi; /* Maximum number of MSIs */
|
||||
__u16 maxstbl; /* Maximum Store Block Length */
|
||||
__u8 version; /* Supported PCI Version */
|
||||
+ /* End of version 1 */
|
||||
+ __u8 reserved;
|
||||
+ __u16 imaxstbl; /* Maximum Interpreted Store Block Length */
|
||||
+ /* End of version 2 */
|
||||
};
|
||||
|
||||
/**
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,349 @@
|
|||
From a5e7bb1f7a88efb5574266a76e80fd7604d19921 Mon Sep 17 00:00:00 2001
|
||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Mon, 16 Jan 2023 07:49:59 -0500
|
||||
Subject: [PATCH 04/11] accel: introduce accelerator blocker API
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-MergeRequest: 247: accel: introduce accelerator blocker API
|
||||
RH-Bugzilla: 2161188
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [1/3] 9d3d7f9554974a79042c915763288cce07aef135
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2161188
|
||||
|
||||
commit bd688fc93120fb3e28aa70e3dfdf567ccc1e0bc1
|
||||
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Fri Nov 11 10:47:56 2022 -0500
|
||||
|
||||
accel: introduce accelerator blocker API
|
||||
|
||||
This API allows the accelerators to prevent vcpus from issuing
|
||||
new ioctls while execting a critical section marked with the
|
||||
accel_ioctl_inhibit_begin/end functions.
|
||||
|
||||
Note that all functions submitting ioctls must mark where the
|
||||
ioctl is being called with accel_{cpu_}ioctl_begin/end().
|
||||
|
||||
This API requires the caller to always hold the BQL.
|
||||
API documentation is in sysemu/accel-blocker.h
|
||||
|
||||
Internally, it uses a QemuLockCnt together with a per-CPU QemuLockCnt
|
||||
(to minimize cache line bouncing) to keep avoid that new ioctls
|
||||
run when the critical section starts, and a QemuEvent to wait
|
||||
that all running ioctls finish.
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||||
Message-Id: <20221111154758.1372674-2-eesposit@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Conflicts:
|
||||
util/meson.build: files are missing in rhel 8.8.0
|
||||
namely int128.c, memalign.c and interval-tree.c
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
---
|
||||
accel/accel-blocker.c | 154 +++++++++++++++++++++++++++++++++
|
||||
accel/meson.build | 2 +-
|
||||
hw/core/cpu-common.c | 2 +
|
||||
include/hw/core/cpu.h | 3 +
|
||||
include/sysemu/accel-blocker.h | 56 ++++++++++++
|
||||
util/meson.build | 2 +-
|
||||
6 files changed, 217 insertions(+), 2 deletions(-)
|
||||
create mode 100644 accel/accel-blocker.c
|
||||
create mode 100644 include/sysemu/accel-blocker.h
|
||||
|
||||
diff --git a/accel/accel-blocker.c b/accel/accel-blocker.c
|
||||
new file mode 100644
|
||||
index 0000000000..1e7f423462
|
||||
--- /dev/null
|
||||
+++ b/accel/accel-blocker.c
|
||||
@@ -0,0 +1,154 @@
|
||||
+/*
|
||||
+ * Lock to inhibit accelerator ioctls
|
||||
+ *
|
||||
+ * Copyright (c) 2022 Red Hat Inc.
|
||||
+ *
|
||||
+ * Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this software and associated documentation files (the "Software"), to deal
|
||||
+ * in the Software without restriction, including without limitation the rights
|
||||
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
+ * copies of the Software, and to permit persons to whom the Software is
|
||||
+ * furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
+ * THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include "qemu/osdep.h"
|
||||
+#include "qemu/thread.h"
|
||||
+#include "qemu/main-loop.h"
|
||||
+#include "hw/core/cpu.h"
|
||||
+#include "sysemu/accel-blocker.h"
|
||||
+
|
||||
+static QemuLockCnt accel_in_ioctl_lock;
|
||||
+static QemuEvent accel_in_ioctl_event;
|
||||
+
|
||||
+void accel_blocker_init(void)
|
||||
+{
|
||||
+ qemu_lockcnt_init(&accel_in_ioctl_lock);
|
||||
+ qemu_event_init(&accel_in_ioctl_event, false);
|
||||
+}
|
||||
+
|
||||
+void accel_ioctl_begin(void)
|
||||
+{
|
||||
+ if (likely(qemu_mutex_iothread_locked())) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* block if lock is taken in kvm_ioctl_inhibit_begin() */
|
||||
+ qemu_lockcnt_inc(&accel_in_ioctl_lock);
|
||||
+}
|
||||
+
|
||||
+void accel_ioctl_end(void)
|
||||
+{
|
||||
+ if (likely(qemu_mutex_iothread_locked())) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ qemu_lockcnt_dec(&accel_in_ioctl_lock);
|
||||
+ /* change event to SET. If event was BUSY, wake up all waiters */
|
||||
+ qemu_event_set(&accel_in_ioctl_event);
|
||||
+}
|
||||
+
|
||||
+void accel_cpu_ioctl_begin(CPUState *cpu)
|
||||
+{
|
||||
+ if (unlikely(qemu_mutex_iothread_locked())) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* block if lock is taken in kvm_ioctl_inhibit_begin() */
|
||||
+ qemu_lockcnt_inc(&cpu->in_ioctl_lock);
|
||||
+}
|
||||
+
|
||||
+void accel_cpu_ioctl_end(CPUState *cpu)
|
||||
+{
|
||||
+ if (unlikely(qemu_mutex_iothread_locked())) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ qemu_lockcnt_dec(&cpu->in_ioctl_lock);
|
||||
+ /* change event to SET. If event was BUSY, wake up all waiters */
|
||||
+ qemu_event_set(&accel_in_ioctl_event);
|
||||
+}
|
||||
+
|
||||
+static bool accel_has_to_wait(void)
|
||||
+{
|
||||
+ CPUState *cpu;
|
||||
+ bool needs_to_wait = false;
|
||||
+
|
||||
+ CPU_FOREACH(cpu) {
|
||||
+ if (qemu_lockcnt_count(&cpu->in_ioctl_lock)) {
|
||||
+ /* exit the ioctl, if vcpu is running it */
|
||||
+ qemu_cpu_kick(cpu);
|
||||
+ needs_to_wait = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return needs_to_wait || qemu_lockcnt_count(&accel_in_ioctl_lock);
|
||||
+}
|
||||
+
|
||||
+void accel_ioctl_inhibit_begin(void)
|
||||
+{
|
||||
+ CPUState *cpu;
|
||||
+
|
||||
+ /*
|
||||
+ * We allow to inhibit only when holding the BQL, so we can identify
|
||||
+ * when an inhibitor wants to issue an ioctl easily.
|
||||
+ */
|
||||
+ g_assert(qemu_mutex_iothread_locked());
|
||||
+
|
||||
+ /* Block further invocations of the ioctls outside the BQL. */
|
||||
+ CPU_FOREACH(cpu) {
|
||||
+ qemu_lockcnt_lock(&cpu->in_ioctl_lock);
|
||||
+ }
|
||||
+ qemu_lockcnt_lock(&accel_in_ioctl_lock);
|
||||
+
|
||||
+ /* Keep waiting until there are running ioctls */
|
||||
+ while (true) {
|
||||
+
|
||||
+ /* Reset event to FREE. */
|
||||
+ qemu_event_reset(&accel_in_ioctl_event);
|
||||
+
|
||||
+ if (accel_has_to_wait()) {
|
||||
+ /*
|
||||
+ * If event is still FREE, and there are ioctls still in progress,
|
||||
+ * wait.
|
||||
+ *
|
||||
+ * If an ioctl finishes before qemu_event_wait(), it will change
|
||||
+ * the event state to SET. This will prevent qemu_event_wait() from
|
||||
+ * blocking, but it's not a problem because if other ioctls are
|
||||
+ * still running the loop will iterate once more and reset the event
|
||||
+ * status to FREE so that it can wait properly.
|
||||
+ *
|
||||
+ * If an ioctls finishes while qemu_event_wait() is blocking, then
|
||||
+ * it will be waken up, but also here the while loop makes sure
|
||||
+ * to re-enter the wait if there are other running ioctls.
|
||||
+ */
|
||||
+ qemu_event_wait(&accel_in_ioctl_event);
|
||||
+ } else {
|
||||
+ /* No ioctl is running */
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void accel_ioctl_inhibit_end(void)
|
||||
+{
|
||||
+ CPUState *cpu;
|
||||
+
|
||||
+ qemu_lockcnt_unlock(&accel_in_ioctl_lock);
|
||||
+ CPU_FOREACH(cpu) {
|
||||
+ qemu_lockcnt_unlock(&cpu->in_ioctl_lock);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
diff --git a/accel/meson.build b/accel/meson.build
|
||||
index dfd808d2c8..801b4d44e8 100644
|
||||
--- a/accel/meson.build
|
||||
+++ b/accel/meson.build
|
||||
@@ -1,4 +1,4 @@
|
||||
-specific_ss.add(files('accel-common.c'))
|
||||
+specific_ss.add(files('accel-common.c', 'accel-blocker.c'))
|
||||
softmmu_ss.add(files('accel-softmmu.c'))
|
||||
user_ss.add(files('accel-user.c'))
|
||||
|
||||
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
|
||||
index 9e3241b430..b6e83acf0a 100644
|
||||
--- a/hw/core/cpu-common.c
|
||||
+++ b/hw/core/cpu-common.c
|
||||
@@ -238,6 +238,7 @@ static void cpu_common_initfn(Object *obj)
|
||||
cpu->nr_threads = 1;
|
||||
|
||||
qemu_mutex_init(&cpu->work_mutex);
|
||||
+ qemu_lockcnt_init(&cpu->in_ioctl_lock);
|
||||
QSIMPLEQ_INIT(&cpu->work_list);
|
||||
QTAILQ_INIT(&cpu->breakpoints);
|
||||
QTAILQ_INIT(&cpu->watchpoints);
|
||||
@@ -249,6 +250,7 @@ static void cpu_common_finalize(Object *obj)
|
||||
{
|
||||
CPUState *cpu = CPU(obj);
|
||||
|
||||
+ qemu_lockcnt_destroy(&cpu->in_ioctl_lock);
|
||||
qemu_mutex_destroy(&cpu->work_mutex);
|
||||
}
|
||||
|
||||
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
|
||||
index e948e81f1a..49d9c73f97 100644
|
||||
--- a/include/hw/core/cpu.h
|
||||
+++ b/include/hw/core/cpu.h
|
||||
@@ -383,6 +383,9 @@ struct CPUState {
|
||||
uint32_t kvm_fetch_index;
|
||||
uint64_t dirty_pages;
|
||||
|
||||
+ /* Use by accel-block: CPU is executing an ioctl() */
|
||||
+ QemuLockCnt in_ioctl_lock;
|
||||
+
|
||||
/* Used for events with 'vcpu' and *without* the 'disabled' properties */
|
||||
DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS);
|
||||
DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS);
|
||||
diff --git a/include/sysemu/accel-blocker.h b/include/sysemu/accel-blocker.h
|
||||
new file mode 100644
|
||||
index 0000000000..72020529ef
|
||||
--- /dev/null
|
||||
+++ b/include/sysemu/accel-blocker.h
|
||||
@@ -0,0 +1,56 @@
|
||||
+/*
|
||||
+ * Accelerator blocking API, to prevent new ioctls from starting and wait the
|
||||
+ * running ones finish.
|
||||
+ * This mechanism differs from pause/resume_all_vcpus() in that it does not
|
||||
+ * release the BQL.
|
||||
+ *
|
||||
+ * Copyright (c) 2022 Red Hat Inc.
|
||||
+ *
|
||||
+ * Author: Emanuele Giuseppe Esposito <eesposit@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.
|
||||
+ */
|
||||
+#ifndef ACCEL_BLOCKER_H
|
||||
+#define ACCEL_BLOCKER_H
|
||||
+
|
||||
+#include "qemu/osdep.h"
|
||||
+#include "sysemu/cpus.h"
|
||||
+
|
||||
+extern void accel_blocker_init(void);
|
||||
+
|
||||
+/*
|
||||
+ * accel_{cpu_}ioctl_begin/end:
|
||||
+ * Mark when ioctl is about to run or just finished.
|
||||
+ *
|
||||
+ * accel_{cpu_}ioctl_begin will block after accel_ioctl_inhibit_begin() is
|
||||
+ * called, preventing new ioctls to run. They will continue only after
|
||||
+ * accel_ioctl_inibith_end().
|
||||
+ */
|
||||
+extern void accel_ioctl_begin(void);
|
||||
+extern void accel_ioctl_end(void);
|
||||
+extern void accel_cpu_ioctl_begin(CPUState *cpu);
|
||||
+extern void accel_cpu_ioctl_end(CPUState *cpu);
|
||||
+
|
||||
+/*
|
||||
+ * accel_ioctl_inhibit_begin: start critical section
|
||||
+ *
|
||||
+ * This function makes sure that:
|
||||
+ * 1) incoming accel_{cpu_}ioctl_begin() calls block
|
||||
+ * 2) wait that all ioctls that were already running reach
|
||||
+ * accel_{cpu_}ioctl_end(), kicking vcpus if necessary.
|
||||
+ *
|
||||
+ * This allows the caller to access shared data or perform operations without
|
||||
+ * worrying of concurrent vcpus accesses.
|
||||
+ */
|
||||
+extern void accel_ioctl_inhibit_begin(void);
|
||||
+
|
||||
+/*
|
||||
+ * accel_ioctl_inhibit_end: end critical section started by
|
||||
+ * accel_ioctl_inhibit_begin()
|
||||
+ *
|
||||
+ * This function allows blocked accel_{cpu_}ioctl_begin() to continue.
|
||||
+ */
|
||||
+extern void accel_ioctl_inhibit_end(void);
|
||||
+
|
||||
+#endif /* ACCEL_BLOCKER_H */
|
||||
diff --git a/util/meson.build b/util/meson.build
|
||||
index 05b593055a..b5f153b0e8 100644
|
||||
--- a/util/meson.build
|
||||
+++ b/util/meson.build
|
||||
@@ -48,6 +48,7 @@ util_ss.add(files('transactions.c'))
|
||||
util_ss.add(when: 'CONFIG_POSIX', if_true: files('drm.c'))
|
||||
util_ss.add(files('guest-random.c'))
|
||||
util_ss.add(files('yank.c'))
|
||||
+util_ss.add(files('lockcnt.c'))
|
||||
|
||||
if have_user
|
||||
util_ss.add(files('selfmap.c'))
|
||||
@@ -69,7 +70,6 @@ if have_block
|
||||
util_ss.add(files('hexdump.c'))
|
||||
util_ss.add(files('iova-tree.c'))
|
||||
util_ss.add(files('iov.c', 'qemu-sockets.c', 'uri.c'))
|
||||
- util_ss.add(files('lockcnt.c'))
|
||||
util_ss.add(files('main-loop.c'))
|
||||
util_ss.add(files('nvdimm-utils.c'))
|
||||
util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c'))
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -1,50 +1,58 @@
|
|||
From 473b05bbdad50dc3877ab6da4ac52b5a4fc7d5e1 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Mammedov <imammedo@redhat.com>
|
||||
Date: Wed, 12 Jan 2022 08:03:31 -0500
|
||||
Subject: [PATCH 11/14] acpi: fix OEM ID/OEM Table ID padding
|
||||
From af082f3499de265d123157d097b5c84981e0aa63 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Wed, 30 Mar 2022 14:52:34 -0400
|
||||
Subject: [PATCH 15/18] acpi: fix OEM ID/OEM Table ID padding
|
||||
|
||||
RH-Author: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-MergeRequest: 130: acpi: fix QEMU crash when started with SLIC table
|
||||
RH-Commit: [7/10] 276af1aa7650e79f146c75ef4ec19f792e7e163c
|
||||
RH-Bugzilla: 2043531
|
||||
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: MST <None>
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 141: acpi: fix QEMU crash when started with SLIC table
|
||||
RH-Commit: [7/10] 51ea859cbe12b5a902d529ab589d18757d98f71d (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2062611
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
|
||||
Commit [2] broke original '\0' padding of OEM ID and OEM Table ID
|
||||
fields in headers of ACPI tables. While it doesn't have impact on
|
||||
default values since QEMU uses 6 and 8 characters long values
|
||||
respectively, it broke usecase where IDs are provided on QEMU CLI.
|
||||
It shouldn't affect guest (but may cause licensing verification
|
||||
issues in guest OS).
|
||||
One of the broken usecases is user supplied SLIC table with IDs
|
||||
shorter than max possible length, where [2] mangles IDs with extra
|
||||
spaces in RSDT and FADT tables whereas guest OS expects those to
|
||||
mirror the respective values of the used SLIC table.
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062611
|
||||
Upstream: Merged
|
||||
|
||||
Fix it by replacing whitespace padding with '\0' padding in
|
||||
accordance with [1] and expectations of guest OS
|
||||
commit 748c030f360a940fe0c9382c8ca1649096c3a80d
|
||||
Author: Igor Mammedov <imammedo@redhat.com>
|
||||
Date: Wed Jan 12 08:03:31 2022 -0500
|
||||
|
||||
1) ACPI spec, v2.0b
|
||||
17.2 AML Grammar Definition
|
||||
...
|
||||
//OEM ID of up to 6 characters. If the OEM ID is
|
||||
//shorter than 6 characters, it can be terminated
|
||||
//with a NULL character.
|
||||
acpi: fix OEM ID/OEM Table ID padding
|
||||
|
||||
Commit [2] broke original '\0' padding of OEM ID and OEM Table ID
|
||||
fields in headers of ACPI tables. While it doesn't have impact on
|
||||
default values since QEMU uses 6 and 8 characters long values
|
||||
respectively, it broke usecase where IDs are provided on QEMU CLI.
|
||||
It shouldn't affect guest (but may cause licensing verification
|
||||
issues in guest OS).
|
||||
One of the broken usecases is user supplied SLIC table with IDs
|
||||
shorter than max possible length, where [2] mangles IDs with extra
|
||||
spaces in RSDT and FADT tables whereas guest OS expects those to
|
||||
mirror the respective values of the used SLIC table.
|
||||
|
||||
Fix it by replacing whitespace padding with '\0' padding in
|
||||
accordance with [1] and expectations of guest OS
|
||||
|
||||
1) ACPI spec, v2.0b
|
||||
17.2 AML Grammar Definition
|
||||
...
|
||||
//OEM ID of up to 6 characters. If the OEM ID is
|
||||
//shorter than 6 characters, it can be terminated
|
||||
//with a NULL character.
|
||||
|
||||
2)
|
||||
Fixes: 602b458201 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/707
|
||||
Reported-by: Dmitry V. Orekhov <dima.orekhov@gmail.com>
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Message-Id: <20220112130332.1648664-4-imammedo@redhat.com>
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Reviewed-by: Ani Sinha <ani@anisinha.ca>
|
||||
Tested-by: Dmitry V. Orekhov dima.orekhov@gmail.com
|
||||
|
||||
2)
|
||||
Fixes: 602b458201 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/707
|
||||
Reported-by: Dmitry V. Orekhov <dima.orekhov@gmail.com>
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Message-Id: <20220112130332.1648664-4-imammedo@redhat.com>
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Reviewed-by: Ani Sinha <ani@anisinha.ca>
|
||||
Tested-by: Dmitry V. Orekhov dima.orekhov@gmail.com
|
||||
(cherry picked from commit 748c030f360a940fe0c9382c8ca1649096c3a80d)
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/acpi/aml-build.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
@ -66,5 +74,5 @@ index b3b3310df3..65148d5b9d 100644
|
|||
g_array_append_vals(array, ACPI_BUILD_APPNAME8, 4); /* Creator ID */
|
||||
build_append_int_noprefix(array, 1, 4); /* Creator Revision */
|
||||
--
|
||||
2.31.1
|
||||
2.27.0
|
||||
|
||||
|
|
|
@ -1,67 +1,75 @@
|
|||
From 636a09dbe361517ac2b8d810166676b5006a6ca2 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Mammedov <imammedo@redhat.com>
|
||||
Date: Mon, 27 Dec 2021 14:31:17 -0500
|
||||
Subject: [PATCH 05/14] acpi: fix QEMU crash when started with SLIC table
|
||||
From 4e8fb957a349558648d5cddb80a89460bc97439e Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Wed, 30 Mar 2022 14:52:34 -0400
|
||||
Subject: [PATCH 09/18] acpi: fix QEMU crash when started with SLIC table
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-MergeRequest: 130: acpi: fix QEMU crash when started with SLIC table
|
||||
RH-Commit: [1/10] 67c1d1d2358d0ba746f260dfc3c1cfc165357fd1
|
||||
RH-Bugzilla: 2043531
|
||||
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: MST <None>
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 141: acpi: fix QEMU crash when started with SLIC table
|
||||
RH-Commit: [1/10] 0c34e80346c33da4f220d9c486b120c35005144e (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2062611
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
|
||||
if QEMU is started with used provided SLIC table blob,
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062611
|
||||
Upstream: Merged
|
||||
|
||||
-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id="ME",oem_rev=00002210,asl_compiler_id="",asl_compiler_rev=00000000,data=/dev/null
|
||||
it will assert with:
|
||||
commit 8cdb99af45365727ac17f45239a9b8c1d5155c6d)
|
||||
Author: Igor Mammedov <imammedo@redhat.com>
|
||||
Date: Mon Dec 27 14:31:17 2021 -0500
|
||||
|
||||
hw/acpi/aml-build.c:61:build_append_padded_str: assertion failed: (len <= maxlen)
|
||||
acpi: fix QEMU crash when started with SLIC table
|
||||
|
||||
and following backtrace:
|
||||
if QEMU is started with used provided SLIC table blob,
|
||||
|
||||
...
|
||||
build_append_padded_str (array=0x555556afe320, str=0x555556afdb2e "CRASH ME", maxlen=0x6, pad=0x20) at hw/acpi/aml-build.c:61
|
||||
acpi_table_begin (desc=0x7fffffffd1b0, array=0x555556afe320) at hw/acpi/aml-build.c:1727
|
||||
build_fadt (tbl=0x555556afe320, linker=0x555557ca3830, f=0x7fffffffd318, oem_id=0x555556afdb2e "CRASH ME", oem_table_id=0x555556afdb34 "ME") at hw/acpi/aml-build.c:2064
|
||||
...
|
||||
-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id="ME",oem_rev=00002210,asl_compiler_id="",asl_compiler_rev=00000000,data=/dev/null
|
||||
it will assert with:
|
||||
|
||||
which happens due to acpi_table_begin() expecting NULL terminated
|
||||
oem_id and oem_table_id strings, which is normally the case, but
|
||||
in case of user provided SLIC table, oem_id points to table's blob
|
||||
directly and as result oem_id became longer than expected.
|
||||
hw/acpi/aml-build.c:61:build_append_padded_str: assertion failed: (len <= maxlen)
|
||||
|
||||
Fix issue by handling oem_id consistently and make acpi_get_slic_oem()
|
||||
return NULL terminated strings.
|
||||
and following backtrace:
|
||||
|
||||
PS:
|
||||
After [1] refactoring, oem_id semantics became inconsistent, where
|
||||
NULL terminated string was coming from machine and old way pointer
|
||||
into byte array coming from -acpitable option. That used to work
|
||||
since build_header() wasn't expecting NULL terminated string and
|
||||
blindly copied the 1st 6 bytes only.
|
||||
...
|
||||
build_append_padded_str (array=0x555556afe320, str=0x555556afdb2e "CRASH ME", maxlen=0x6, pad=0x20) at hw/acpi/aml-build.c:61
|
||||
acpi_table_begin (desc=0x7fffffffd1b0, array=0x555556afe320) at hw/acpi/aml-build.c:1727
|
||||
build_fadt (tbl=0x555556afe320, linker=0x555557ca3830, f=0x7fffffffd318, oem_id=0x555556afdb2e "CRASH ME", oem_table_id=0x555556afdb34 "ME") at hw/acpi/aml-build.c:2064
|
||||
...
|
||||
|
||||
However commit [2] broke that by replacing build_header() with
|
||||
acpi_table_begin(), which was expecting NULL terminated string
|
||||
and was checking oem_id size.
|
||||
which happens due to acpi_table_begin() expecting NULL terminated
|
||||
oem_id and oem_table_id strings, which is normally the case, but
|
||||
in case of user provided SLIC table, oem_id points to table's blob
|
||||
directly and as result oem_id became longer than expected.
|
||||
|
||||
Fix issue by handling oem_id consistently and make acpi_get_slic_oem()
|
||||
return NULL terminated strings.
|
||||
|
||||
PS:
|
||||
After [1] refactoring, oem_id semantics became inconsistent, where
|
||||
NULL terminated string was coming from machine and old way pointer
|
||||
into byte array coming from -acpitable option. That used to work
|
||||
since build_header() wasn't expecting NULL terminated string and
|
||||
blindly copied the 1st 6 bytes only.
|
||||
|
||||
However commit [2] broke that by replacing build_header() with
|
||||
acpi_table_begin(), which was expecting NULL terminated string
|
||||
and was checking oem_id size.
|
||||
|
||||
1) 602b45820 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
|
||||
2)
|
||||
Fixes: 4b56e1e4eb08 ("acpi: build_fadt: use acpi_table_begin()/acpi_table_end() instead of build_header()")
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/786
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Message-Id: <20211227193120.1084176-2-imammedo@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Tested-by: Denis Lisov <dennis.lissov@gmail.com>
|
||||
Tested-by: Alexander Tsoy <alexander@tsoy.me>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
|
||||
1) 602b45820 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
|
||||
2)
|
||||
Fixes: 4b56e1e4eb08 ("acpi: build_fadt: use acpi_table_begin()/acpi_table_end() instead of build_header()")
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/786
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Message-Id: <20211227193120.1084176-2-imammedo@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Tested-by: Denis Lisov <dennis.lissov@gmail.com>
|
||||
Tested-by: Alexander Tsoy <alexander@tsoy.me>
|
||||
Cc: qemu-stable@nongnu.org
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
(cherry picked from commit 8cdb99af45365727ac17f45239a9b8c1d5155c6d)
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/acpi/core.c | 4 ++--
|
||||
hw/i386/acpi-build.c | 2 ++
|
||||
|
@ -83,10 +91,10 @@ index 1e004d0078..3e811bf03c 100644
|
|||
}
|
||||
}
|
||||
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
|
||||
index 8383b83ee3..0234fe7588 100644
|
||||
index a4478e77b7..acc4869db0 100644
|
||||
--- a/hw/i386/acpi-build.c
|
||||
+++ b/hw/i386/acpi-build.c
|
||||
@@ -2723,6 +2723,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
|
||||
@@ -2726,6 +2726,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
|
||||
|
||||
/* Cleanup memory that's no longer used. */
|
||||
g_array_free(table_offsets, true);
|
||||
|
@ -96,5 +104,5 @@ index 8383b83ee3..0234fe7588 100644
|
|||
|
||||
static void acpi_ram_update(MemoryRegion *mr, GArray *data)
|
||||
--
|
||||
2.31.1
|
||||
2.27.0
|
||||
|
||||
|
|
|
@ -0,0 +1,165 @@
|
|||
From 3deffc03c2e9b0053eec5aeb5b5d633dfe29f499 Mon Sep 17 00:00:00 2001
|
||||
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
||||
Date: Wed, 6 Apr 2022 14:58:12 -0400
|
||||
Subject: [PATCH 1/3] acpi: fix acpi_index migration
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Peter Xu <peterx@redhat.com>
|
||||
RH-MergeRequest: 343: acpi: fix acpi_index migration
|
||||
RH-Jira: RHEL-20189
|
||||
RH-Acked-by: Leonardo Brás <leobras@redhat.com>
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-Acked-by: Prasad Pandit <None>
|
||||
RH-Commit: [1/2] c5b9cdf5791cd856207b7df7e2ef5df360ec8de4
|
||||
|
||||
vmstate_acpi_pcihp_use_acpi_index() was expecting AcpiPciHpState
|
||||
as state but it actually received PIIX4PMState, because
|
||||
VMSTATE_PCI_HOTPLUG is a macro and not another struct.
|
||||
So it ended up accessing random pointer, which resulted
|
||||
in 'false' return value and acpi_index field wasn't ever
|
||||
sent.
|
||||
|
||||
However in 7.0 that pointer de-references to value > 0, and
|
||||
destination QEMU starts to expect the field which isn't
|
||||
sent in migratioon stream from older QEMU (6.2 and older).
|
||||
As result migration fails with:
|
||||
qemu-system-x86_64: Missing section footer for 0000:00:01.3/piix4_pm
|
||||
qemu-system-x86_64: load of migration failed: Invalid argument
|
||||
|
||||
In addition with QEMU-6.2, destination due to not expected
|
||||
state, also never expects the acpi_index field in migration
|
||||
stream.
|
||||
|
||||
Q35 is not affected as it always sends/expects the field as
|
||||
long as acpi based PCI hotplug is enabled.
|
||||
|
||||
Fix issue by introducing compat knob to never send/expect
|
||||
acpi_index in migration stream for 6.2 and older PC machine
|
||||
types and always send it for 7.0 and newer PC machine types.
|
||||
|
||||
Diagnosed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
Fixes: b32bd76 ("pci: introduce acpi-index property for PCI device")
|
||||
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/932
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||||
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
(cherry picked from commit a83c2844903c45aa7d32cdd17305f23ce2c56ab9)
|
||||
Signed-off-by: Peter Xu <peterx@redhat.com>
|
||||
---
|
||||
hw/acpi/acpi-pci-hotplug-stub.c | 4 ----
|
||||
hw/acpi/pcihp.c | 6 ------
|
||||
hw/acpi/piix4.c | 15 ++++++++++++++-
|
||||
hw/core/machine.c | 5 +++++
|
||||
include/hw/acpi/pcihp.h | 2 --
|
||||
5 files changed, 19 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/hw/acpi/acpi-pci-hotplug-stub.c b/hw/acpi/acpi-pci-hotplug-stub.c
|
||||
index 734e4c5986..a43f6dafc9 100644
|
||||
--- a/hw/acpi/acpi-pci-hotplug-stub.c
|
||||
+++ b/hw/acpi/acpi-pci-hotplug-stub.c
|
||||
@@ -41,7 +41,3 @@ void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off)
|
||||
return;
|
||||
}
|
||||
|
||||
-bool vmstate_acpi_pcihp_use_acpi_index(void *opaque, int version_id)
|
||||
-{
|
||||
- return false;
|
||||
-}
|
||||
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
|
||||
index be0e846b34..ec861661c3 100644
|
||||
--- a/hw/acpi/pcihp.c
|
||||
+++ b/hw/acpi/pcihp.c
|
||||
@@ -559,12 +559,6 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
|
||||
OBJ_PROP_FLAG_READ);
|
||||
}
|
||||
|
||||
-bool vmstate_acpi_pcihp_use_acpi_index(void *opaque, int version_id)
|
||||
-{
|
||||
- AcpiPciHpState *s = opaque;
|
||||
- return s->acpi_index;
|
||||
-}
|
||||
-
|
||||
const VMStateDescription vmstate_acpi_pcihp_pci_status = {
|
||||
.name = "acpi_pcihp_pci_status",
|
||||
.version_id = 1,
|
||||
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
|
||||
index 8d6011c0a3..033e75ce5b 100644
|
||||
--- a/hw/acpi/piix4.c
|
||||
+++ b/hw/acpi/piix4.c
|
||||
@@ -82,6 +82,7 @@ struct PIIX4PMState {
|
||||
AcpiPciHpState acpi_pci_hotplug;
|
||||
bool use_acpi_hotplug_bridge;
|
||||
bool use_acpi_root_pci_hotplug;
|
||||
+ bool not_migrate_acpi_index;
|
||||
|
||||
uint8_t disable_s3;
|
||||
uint8_t disable_s4;
|
||||
@@ -269,6 +270,16 @@ static bool piix4_vmstate_need_smbus(void *opaque, int version_id)
|
||||
return pm_smbus_vmstate_needed();
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * This is a fudge to turn off the acpi_index field,
|
||||
+ * whose test was always broken on piix4 with 6.2 and older machine types.
|
||||
+ */
|
||||
+static bool vmstate_test_migrate_acpi_index(void *opaque, int version_id)
|
||||
+{
|
||||
+ PIIX4PMState *s = PIIX4_PM(opaque);
|
||||
+ return s->use_acpi_hotplug_bridge && !s->not_migrate_acpi_index;
|
||||
+}
|
||||
+
|
||||
/* qemu-kvm 1.2 uses version 3 but advertised as 2
|
||||
* To support incoming qemu-kvm 1.2 migration, change version_id
|
||||
* and minimum_version_id to 2 below (which breaks migration from
|
||||
@@ -299,7 +310,7 @@ static const VMStateDescription vmstate_acpi = {
|
||||
struct AcpiPciHpPciStatus),
|
||||
VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug, PIIX4PMState,
|
||||
vmstate_test_use_acpi_hotplug_bridge,
|
||||
- vmstate_acpi_pcihp_use_acpi_index),
|
||||
+ vmstate_test_migrate_acpi_index),
|
||||
VMSTATE_END_OF_LIST()
|
||||
},
|
||||
.subsections = (const VMStateDescription*[]) {
|
||||
@@ -654,6 +665,8 @@ static Property piix4_pm_properties[] = {
|
||||
DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState,
|
||||
acpi_memory_hotplug.is_enabled, true),
|
||||
DEFINE_PROP_BOOL("smm-compat", PIIX4PMState, smm_compat, false),
|
||||
+ DEFINE_PROP_BOOL("x-not-migrate-acpi-index", PIIX4PMState,
|
||||
+ not_migrate_acpi_index, false),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
diff --git a/hw/core/machine.c b/hw/core/machine.c
|
||||
index 76fcabec7a..2724f6848a 100644
|
||||
--- a/hw/core/machine.c
|
||||
+++ b/hw/core/machine.c
|
||||
@@ -331,6 +331,11 @@ GlobalProperty hw_compat_rhel_7_1[] = {
|
||||
};
|
||||
const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1);
|
||||
|
||||
+GlobalProperty hw_compat_6_2[] = {
|
||||
+ { "PIIX4_PM", "x-not-migrate-acpi-index", "on"},
|
||||
+};
|
||||
+const size_t hw_compat_6_2_len = G_N_ELEMENTS(hw_compat_6_2);
|
||||
+
|
||||
GlobalProperty hw_compat_6_1[] = {
|
||||
{ "vhost-user-vsock-device", "seqpacket", "off" },
|
||||
{ "nvme-ns", "shared", "off" },
|
||||
diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h
|
||||
index af1a169fc3..7e268c2c9c 100644
|
||||
--- a/include/hw/acpi/pcihp.h
|
||||
+++ b/include/hw/acpi/pcihp.h
|
||||
@@ -73,8 +73,6 @@ void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off);
|
||||
|
||||
extern const VMStateDescription vmstate_acpi_pcihp_pci_status;
|
||||
|
||||
-bool vmstate_acpi_pcihp_use_acpi_index(void *opaque, int version_id);
|
||||
-
|
||||
#define VMSTATE_PCI_HOTPLUG(pcihp, state, test_pcihp, test_acpi_index) \
|
||||
VMSTATE_UINT32_TEST(pcihp.hotplug_select, state, \
|
||||
test_pcihp), \
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -1,53 +1,63 @@
|
|||
From a3a4fd1733e71d029e38136366e73ace8e78298b Mon Sep 17 00:00:00 2001
|
||||
From: Igor Mammedov <imammedo@redhat.com>
|
||||
Date: Tue, 1 Mar 2022 10:11:59 -0500
|
||||
Subject: [PATCH 02/14] acpi: pcihp: pcie: set power on cap on parent slot
|
||||
From c9ceb175667cdeead59384a97a812367ae19c570 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Wed, 23 Mar 2022 13:21:40 -0400
|
||||
Subject: [PATCH 06/18] acpi: pcihp: pcie: set power on cap on parent slot
|
||||
|
||||
RH-Author: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-MergeRequest: 124: RHEL-9.0 Fix broken PCIe device after migration
|
||||
RH-Commit: [2/2] 135602421e5fed803f7d71121380306633d490d8
|
||||
RH-Bugzilla: 2053584
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
RH-Acked-by: MST <None>
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 134: pci: expose TYPE_XIO3130_DOWNSTREAM name
|
||||
RH-Commit: [2/2] d883872647a6e90ec573140b2c171f3f53b600ab (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2062610
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
on creation a PCIDevice has power turned on at the end of pci_qdev_realize()
|
||||
however later on if PCIe slot isn't populated with any children
|
||||
it's power is turned off. It's fine if native hotplug is used
|
||||
as plug callback will power slot on among other things.
|
||||
However when ACPI hotplug is enabled it replaces native PCIe plug
|
||||
callbacks with ACPI specific ones (acpi_pcihp_device_*plug_cb) and
|
||||
as result slot stays powered off. It works fine as ACPI hotplug
|
||||
on guest side takes care of enumerating/initializing hotplugged
|
||||
device. But when later guest is migrated, call chain introduced by]
|
||||
commit d5daff7d312 (pcie: implement slot power control for pcie root ports)
|
||||
BZ: https://bugzilla.redhat.com/2062610
|
||||
UPSTREAM: merged
|
||||
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=44038138
|
||||
|
||||
pcie_cap_slot_post_load()
|
||||
-> pcie_cap_update_power()
|
||||
-> pcie_set_power_device()
|
||||
-> pci_set_power()
|
||||
-> pci_update_mappings()
|
||||
commit 6b0969f1ec825984cd74619f0730be421b0c46fb
|
||||
Author: Igor Mammedov <imammedo@redhat.com>
|
||||
Date: Tue Mar 1 10:11:59 2022 -0500
|
||||
|
||||
will disable earlier initialized BARs for the hotplugged device
|
||||
in powered off slot due to commit 23786d13441 (pci: implement power state)
|
||||
which disables BARs if power is off.
|
||||
acpi: pcihp: pcie: set power on cap on parent slot
|
||||
|
||||
Fix it by setting PCI_EXP_SLTCTL_PCC to PCI_EXP_SLTCTL_PWR_ON
|
||||
on slot (root port/downstream port) at the time a device
|
||||
hotplugged into it. As result PCI_EXP_SLTCTL_PWR_ON is migrated
|
||||
to target and above call chain keeps device plugged into it
|
||||
powered on.
|
||||
on creation a PCIDevice has power turned on at the end of pci_qdev_realize()
|
||||
however later on if PCIe slot isn't populated with any children
|
||||
it's power is turned off. It's fine if native hotplug is used
|
||||
as plug callback will power slot on among other things.
|
||||
However when ACPI hotplug is enabled it replaces native PCIe plug
|
||||
callbacks with ACPI specific ones (acpi_pcihp_device_*plug_cb) and
|
||||
as result slot stays powered off. It works fine as ACPI hotplug
|
||||
on guest side takes care of enumerating/initializing hotplugged
|
||||
device. But when later guest is migrated, call chain introduced by]
|
||||
commit d5daff7d312 (pcie: implement slot power control for pcie root ports)
|
||||
|
||||
pcie_cap_slot_post_load()
|
||||
-> pcie_cap_update_power()
|
||||
-> pcie_set_power_device()
|
||||
-> pci_set_power()
|
||||
-> pci_update_mappings()
|
||||
|
||||
will disable earlier initialized BARs for the hotplugged device
|
||||
in powered off slot due to commit 23786d13441 (pci: implement power state)
|
||||
which disables BARs if power is off.
|
||||
|
||||
Fix it by setting PCI_EXP_SLTCTL_PCC to PCI_EXP_SLTCTL_PWR_ON
|
||||
on slot (root port/downstream port) at the time a device
|
||||
hotplugged into it. As result PCI_EXP_SLTCTL_PWR_ON is migrated
|
||||
to target and above call chain keeps device plugged into it
|
||||
powered on.
|
||||
|
||||
Fixes: d5daff7d312 ("pcie: implement slot power control for pcie root ports")
|
||||
Fixes: 23786d13441 ("pci: implement power state")
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2053584
|
||||
Suggested-by: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Message-Id: <20220301151200.3507298-3-imammedo@redhat.com>
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
|
||||
Fixes: d5daff7d312 ("pcie: implement slot power control for pcie root ports")
|
||||
Fixes: 23786d13441 ("pci: implement power state")
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2053584
|
||||
Suggested-by: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Message-Id: <20220301151200.3507298-3-imammedo@redhat.com>
|
||||
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
(cherry picked from commit 6b0969f1ec825984cd74619f0730be421b0c46fb)
|
||||
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/acpi/pcihp.c | 12 +++++++++++-
|
||||
hw/pci/pcie.c | 11 +++++++++++
|
||||
|
@ -55,7 +65,7 @@ Signed-off-by: Igor Mammedov <imammedo@redhat.com>
|
|||
3 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
|
||||
index 30405b5113..3d5610e02d 100644
|
||||
index a5e182dd3a..be0e846b34 100644
|
||||
--- a/hw/acpi/pcihp.c
|
||||
+++ b/hw/acpi/pcihp.c
|
||||
@@ -32,6 +32,7 @@
|
||||
|
@ -126,5 +136,5 @@ index 6063bee0ec..c27368d077 100644
|
|||
void pcie_cap_root_init(PCIDevice *dev);
|
||||
void pcie_cap_root_reset(PCIDevice *dev);
|
||||
--
|
||||
2.31.1
|
||||
2.27.0
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
From 529a5d908f5d16714b8ae0a51eaaaa84994dfae8 Mon Sep 17 00:00:00 2001
|
||||
From: "Michael S. Tsirkin" <mst@redhat.com>
|
||||
Date: Tue, 21 Dec 2021 09:45:44 -0500
|
||||
Subject: [PATCH 1/2] acpi: validate hotplug selector on access
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 97: acpi: validate hotplug selector on access
|
||||
RH-Commit: [1/1] 79bcfb0df0091e2b716d2e1c545f047b3409c26c (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2036580
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
||||
|
||||
When bus is looked up on a pci write, we didn't
|
||||
validate that the lookup succeeded.
|
||||
Fuzzers thus can trigger QEMU crash by dereferencing the NULL
|
||||
bus pointer.
|
||||
|
||||
Fixes: b32bd763a1 ("pci: introduce acpi-index property for PCI device")
|
||||
Fixes: CVE-2021-4158
|
||||
Cc: "Igor Mammedov" <imammedo@redhat.com>
|
||||
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Reviewed-by: Ani Sinha <ani@anisinha.ca>
|
||||
(cherry picked from commit 9bd6565ccee68f72d5012e24646e12a1c662827e)
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/acpi/pcihp.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
|
||||
index 30405b5113..a5e182dd3a 100644
|
||||
--- a/hw/acpi/pcihp.c
|
||||
+++ b/hw/acpi/pcihp.c
|
||||
@@ -491,6 +491,9 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t data,
|
||||
}
|
||||
|
||||
bus = acpi_pcihp_find_hotplug_bus(s, s->hotplug_select);
|
||||
+ if (!bus) {
|
||||
+ break;
|
||||
+ }
|
||||
QTAILQ_FOREACH_SAFE(kid, &bus->qbus.children, sibling, next) {
|
||||
Object *o = OBJECT(kid->child);
|
||||
PCIDevice *dev = PCI_DEVICE(o);
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
From 953c5c0982b61b0a3f8f03452844b5487eb22fc7 Mon Sep 17 00:00:00 2001
|
||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Thu, 9 Mar 2023 08:13:17 -0500
|
||||
Subject: [PATCH 06/13] aio-wait: switch to smp_mb__after_rmw()
|
||||
|
||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-MergeRequest: 263: qatomic: add smp_mb__before/after_rmw()
|
||||
RH-Bugzilla: 2168472
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
||||
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Commit: [6/10] 9f30f97754139ffd18d36b2350f9ed4e59ac496e
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168472
|
||||
|
||||
commit b532526a07ef3b903ead2e055fe6cc87b41057a3
|
||||
Author: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Date: Fri Mar 3 11:03:52 2023 +0100
|
||||
|
||||
aio-wait: switch to smp_mb__after_rmw()
|
||||
|
||||
The barrier comes after an atomic increment, so it is enough to use
|
||||
smp_mb__after_rmw(); this avoids a double barrier on x86 systems.
|
||||
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Reviewed-by: David Hildenbrand <david@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
---
|
||||
include/block/aio-wait.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/block/aio-wait.h b/include/block/aio-wait.h
|
||||
index 54840f8622..03b6394c78 100644
|
||||
--- a/include/block/aio-wait.h
|
||||
+++ b/include/block/aio-wait.h
|
||||
@@ -82,7 +82,7 @@ extern AioWait global_aio_wait;
|
||||
/* Increment wait_->num_waiters before evaluating cond. */ \
|
||||
qatomic_inc(&wait_->num_waiters); \
|
||||
/* Paired with smp_mb in aio_wait_kick(). */ \
|
||||
- smp_mb(); \
|
||||
+ smp_mb__after_rmw(); \
|
||||
if (ctx_ && in_aio_context_home_thread(ctx_)) { \
|
||||
while ((cond)) { \
|
||||
aio_poll(ctx_, true); \
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
From d7eae0ff4c7f7f7bf10f10272adf7c6971c0db9b Mon Sep 17 00:00:00 2001
|
||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Thu, 9 Mar 2023 09:26:35 -0500
|
||||
Subject: [PATCH 01/13] aio_wait_kick: add missing memory barrier
|
||||
|
||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-MergeRequest: 263: qatomic: add smp_mb__before/after_rmw()
|
||||
RH-Bugzilla: 2168472
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
||||
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Commit: [1/10] eb774aee79864052e14e706d931e52e7bd1162c8
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168472
|
||||
|
||||
commit 7455ff1aa01564cc175db5b2373e610503ad4411
|
||||
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Tue May 24 13:30:54 2022 -0400
|
||||
|
||||
aio_wait_kick: add missing memory barrier
|
||||
|
||||
It seems that aio_wait_kick always required a memory barrier
|
||||
or atomic operation in the caller, but nobody actually
|
||||
took care of doing it.
|
||||
|
||||
Let's put the barrier in the function instead, and pair it
|
||||
with another one in AIO_WAIT_WHILE. Read aio_wait_kick()
|
||||
comment for further explanation.
|
||||
|
||||
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Message-Id: <20220524173054.12651-1-eesposit@redhat.com>
|
||||
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||||
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
---
|
||||
include/block/aio-wait.h | 2 ++
|
||||
util/aio-wait.c | 16 +++++++++++++++-
|
||||
2 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/block/aio-wait.h b/include/block/aio-wait.h
|
||||
index b39eefb38d..54840f8622 100644
|
||||
--- a/include/block/aio-wait.h
|
||||
+++ b/include/block/aio-wait.h
|
||||
@@ -81,6 +81,8 @@ extern AioWait global_aio_wait;
|
||||
AioContext *ctx_ = (ctx); \
|
||||
/* Increment wait_->num_waiters before evaluating cond. */ \
|
||||
qatomic_inc(&wait_->num_waiters); \
|
||||
+ /* Paired with smp_mb in aio_wait_kick(). */ \
|
||||
+ smp_mb(); \
|
||||
if (ctx_ && in_aio_context_home_thread(ctx_)) { \
|
||||
while ((cond)) { \
|
||||
aio_poll(ctx_, true); \
|
||||
diff --git a/util/aio-wait.c b/util/aio-wait.c
|
||||
index bdb3d3af22..98c5accd29 100644
|
||||
--- a/util/aio-wait.c
|
||||
+++ b/util/aio-wait.c
|
||||
@@ -35,7 +35,21 @@ static void dummy_bh_cb(void *opaque)
|
||||
|
||||
void aio_wait_kick(void)
|
||||
{
|
||||
- /* The barrier (or an atomic op) is in the caller. */
|
||||
+ /*
|
||||
+ * Paired with smp_mb in AIO_WAIT_WHILE. Here we have:
|
||||
+ * write(condition);
|
||||
+ * aio_wait_kick() {
|
||||
+ * smp_mb();
|
||||
+ * read(num_waiters);
|
||||
+ * }
|
||||
+ *
|
||||
+ * And in AIO_WAIT_WHILE:
|
||||
+ * write(num_waiters);
|
||||
+ * smp_mb();
|
||||
+ * read(condition);
|
||||
+ */
|
||||
+ smp_mb();
|
||||
+
|
||||
if (qatomic_read(&global_aio_wait.num_waiters)) {
|
||||
aio_bh_schedule_oneshot(qemu_get_aio_context(), dummy_bh_cb, NULL);
|
||||
}
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
From 47d027147694fde94dd73305ee53b6a136cbeced Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 9 May 2023 10:29:03 -0400
|
||||
Subject: [PATCH 08/15] apic: disable reentrancy detection for apic-msi
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 277: memory: prevent dma-reentracy issues
|
||||
RH-Bugzilla: 1999236
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [8/12] 25c3cf99b00cd9adc10d6e7afa9c3e3b7da08de2 (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1999236
|
||||
Upstream: Merged
|
||||
CVE: CVE-2021-3750
|
||||
|
||||
commit 50795ee051a342c681a9b45671c552fbd6274db8
|
||||
Author: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Thu Apr 27 17:10:13 2023 -0400
|
||||
|
||||
apic: disable reentrancy detection for apic-msi
|
||||
|
||||
As the code is designed for re-entrant calls to apic-msi, mark apic-msi
|
||||
as reentrancy-safe.
|
||||
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
|
||||
Message-Id: <20230427211013.2994127-9-alxndr@bu.edu>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/intc/apic.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
|
||||
index 3df11c34d6..a7c2b301a8 100644
|
||||
--- a/hw/intc/apic.c
|
||||
+++ b/hw/intc/apic.c
|
||||
@@ -883,6 +883,13 @@ static void apic_realize(DeviceState *dev, Error **errp)
|
||||
memory_region_init_io(&s->io_memory, OBJECT(s), &apic_io_ops, s, "apic-msi",
|
||||
APIC_SPACE_SIZE);
|
||||
|
||||
+ /*
|
||||
+ * apic-msi's apic_mem_write can call into ioapic_eoi_broadcast, which can
|
||||
+ * write back to apic-msi. As such mark the apic-msi region re-entrancy
|
||||
+ * safe.
|
||||
+ */
|
||||
+ s->io_memory.disable_reentrancy_guard = true;
|
||||
+
|
||||
s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, apic_timer, s);
|
||||
local_apics[s->id] = s;
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,235 @@
|
|||
From 8996ac4369de7e0cb6f911db6f47c3e4ae88c8aa Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 9 May 2023 10:29:03 -0400
|
||||
Subject: [PATCH 02/15] async: Add an optional reentrancy guard to the BH API
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 277: memory: prevent dma-reentracy issues
|
||||
RH-Bugzilla: 1999236
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [2/12] b03f247e242a6cdb3eebec36477234ac77dcd20c (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1999236
|
||||
Upstream: Merged
|
||||
CVE: CVE-2021-3750
|
||||
Conflict: The file block/graph-lock.h, inluded from include/block/aio.h,
|
||||
doesn't exist in this code version. The code compiles without
|
||||
issues if this include is just omitted, so we do that.
|
||||
|
||||
commit 9c86c97f12c060bf7484dd931f38634e166a81f0
|
||||
Author: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Thu Apr 27 17:10:07 2023 -0400
|
||||
|
||||
async: Add an optional reentrancy guard to the BH API
|
||||
|
||||
Devices can pass their MemoryReentrancyGuard (from their DeviceState),
|
||||
when creating new BHes. Then, the async API will toggle the guard
|
||||
before/after calling the BH call-back. This prevents bh->mmio reentrancy
|
||||
issues.
|
||||
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
|
||||
Message-Id: <20230427211013.2994127-3-alxndr@bu.edu>
|
||||
[thuth: Fix "line over 90 characters" checkpatch.pl error]
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
docs/devel/multiple-iothreads.txt | 7 +++++++
|
||||
include/block/aio.h | 18 ++++++++++++++++--
|
||||
include/qemu/main-loop.h | 7 +++++--
|
||||
tests/unit/ptimer-test-stubs.c | 3 ++-
|
||||
util/async.c | 18 +++++++++++++++++-
|
||||
util/main-loop.c | 6 ++++--
|
||||
util/trace-events | 1 +
|
||||
7 files changed, 52 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/docs/devel/multiple-iothreads.txt b/docs/devel/multiple-iothreads.txt
|
||||
index aeb997bed5..a11576bc74 100644
|
||||
--- a/docs/devel/multiple-iothreads.txt
|
||||
+++ b/docs/devel/multiple-iothreads.txt
|
||||
@@ -61,6 +61,7 @@ There are several old APIs that use the main loop AioContext:
|
||||
* LEGACY qemu_aio_set_event_notifier() - monitor an event notifier
|
||||
* LEGACY timer_new_ms() - create a timer
|
||||
* LEGACY qemu_bh_new() - create a BH
|
||||
+ * LEGACY qemu_bh_new_guarded() - create a BH with a device re-entrancy guard
|
||||
* LEGACY qemu_aio_wait() - run an event loop iteration
|
||||
|
||||
Since they implicitly work on the main loop they cannot be used in code that
|
||||
@@ -72,8 +73,14 @@ Instead, use the AioContext functions directly (see include/block/aio.h):
|
||||
* aio_set_event_notifier() - monitor an event notifier
|
||||
* aio_timer_new() - create a timer
|
||||
* aio_bh_new() - create a BH
|
||||
+ * aio_bh_new_guarded() - create a BH with a device re-entrancy guard
|
||||
* aio_poll() - run an event loop iteration
|
||||
|
||||
+The qemu_bh_new_guarded/aio_bh_new_guarded APIs accept a "MemReentrancyGuard"
|
||||
+argument, which is used to check for and prevent re-entrancy problems. For
|
||||
+BHs associated with devices, the reentrancy-guard is contained in the
|
||||
+corresponding DeviceState and named "mem_reentrancy_guard".
|
||||
+
|
||||
The AioContext can be obtained from the IOThread using
|
||||
iothread_get_aio_context() or for the main loop using qemu_get_aio_context().
|
||||
Code that takes an AioContext argument works both in IOThreads or the main
|
||||
diff --git a/include/block/aio.h b/include/block/aio.h
|
||||
index 47fbe9d81f..c7da152985 100644
|
||||
--- a/include/block/aio.h
|
||||
+++ b/include/block/aio.h
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "qemu/event_notifier.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "qemu/timer.h"
|
||||
+#include "hw/qdev-core.h"
|
||||
+
|
||||
|
||||
typedef struct BlockAIOCB BlockAIOCB;
|
||||
typedef void BlockCompletionFunc(void *opaque, int ret);
|
||||
@@ -321,9 +323,11 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque,
|
||||
* is opaque and must be allocated prior to its use.
|
||||
*
|
||||
* @name: A human-readable identifier for debugging purposes.
|
||||
+ * @reentrancy_guard: A guard set when entering a cb to prevent
|
||||
+ * device-reentrancy issues
|
||||
*/
|
||||
QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque,
|
||||
- const char *name);
|
||||
+ const char *name, MemReentrancyGuard *reentrancy_guard);
|
||||
|
||||
/**
|
||||
* aio_bh_new: Allocate a new bottom half structure
|
||||
@@ -332,7 +336,17 @@ QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque,
|
||||
* string.
|
||||
*/
|
||||
#define aio_bh_new(ctx, cb, opaque) \
|
||||
- aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb)))
|
||||
+ aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb)), NULL)
|
||||
+
|
||||
+/**
|
||||
+ * aio_bh_new_guarded: Allocate a new bottom half structure with a
|
||||
+ * reentrancy_guard
|
||||
+ *
|
||||
+ * A convenience wrapper for aio_bh_new_full() that uses the cb as the name
|
||||
+ * string.
|
||||
+ */
|
||||
+#define aio_bh_new_guarded(ctx, cb, opaque, guard) \
|
||||
+ aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb)), guard)
|
||||
|
||||
/**
|
||||
* aio_notify: Force processing of pending events.
|
||||
diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
|
||||
index 8dbc6fcb89..85dd5ada9e 100644
|
||||
--- a/include/qemu/main-loop.h
|
||||
+++ b/include/qemu/main-loop.h
|
||||
@@ -294,9 +294,12 @@ void qemu_cond_timedwait_iothread(QemuCond *cond, int ms);
|
||||
|
||||
void qemu_fd_register(int fd);
|
||||
|
||||
+#define qemu_bh_new_guarded(cb, opaque, guard) \
|
||||
+ qemu_bh_new_full((cb), (opaque), (stringify(cb)), guard)
|
||||
#define qemu_bh_new(cb, opaque) \
|
||||
- qemu_bh_new_full((cb), (opaque), (stringify(cb)))
|
||||
-QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name);
|
||||
+ qemu_bh_new_full((cb), (opaque), (stringify(cb)), NULL)
|
||||
+QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name,
|
||||
+ MemReentrancyGuard *reentrancy_guard);
|
||||
void qemu_bh_schedule_idle(QEMUBH *bh);
|
||||
|
||||
enum {
|
||||
diff --git a/tests/unit/ptimer-test-stubs.c b/tests/unit/ptimer-test-stubs.c
|
||||
index 2a3ef58799..a7a2d08e7e 100644
|
||||
--- a/tests/unit/ptimer-test-stubs.c
|
||||
+++ b/tests/unit/ptimer-test-stubs.c
|
||||
@@ -108,7 +108,8 @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type, int attr_mask)
|
||||
return deadline;
|
||||
}
|
||||
|
||||
-QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name)
|
||||
+QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name,
|
||||
+ MemReentrancyGuard *reentrancy_guard)
|
||||
{
|
||||
QEMUBH *bh = g_new(QEMUBH, 1);
|
||||
|
||||
diff --git a/util/async.c b/util/async.c
|
||||
index 2a63bf90f2..1fff02e7fc 100644
|
||||
--- a/util/async.c
|
||||
+++ b/util/async.c
|
||||
@@ -62,6 +62,7 @@ struct QEMUBH {
|
||||
void *opaque;
|
||||
QSLIST_ENTRY(QEMUBH) next;
|
||||
unsigned flags;
|
||||
+ MemReentrancyGuard *reentrancy_guard;
|
||||
};
|
||||
|
||||
/* Called concurrently from any thread */
|
||||
@@ -127,7 +128,7 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb,
|
||||
}
|
||||
|
||||
QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque,
|
||||
- const char *name)
|
||||
+ const char *name, MemReentrancyGuard *reentrancy_guard)
|
||||
{
|
||||
QEMUBH *bh;
|
||||
bh = g_new(QEMUBH, 1);
|
||||
@@ -136,13 +137,28 @@ QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque,
|
||||
.cb = cb,
|
||||
.opaque = opaque,
|
||||
.name = name,
|
||||
+ .reentrancy_guard = reentrancy_guard,
|
||||
};
|
||||
return bh;
|
||||
}
|
||||
|
||||
void aio_bh_call(QEMUBH *bh)
|
||||
{
|
||||
+ bool last_engaged_in_io = false;
|
||||
+
|
||||
+ if (bh->reentrancy_guard) {
|
||||
+ last_engaged_in_io = bh->reentrancy_guard->engaged_in_io;
|
||||
+ if (bh->reentrancy_guard->engaged_in_io) {
|
||||
+ trace_reentrant_aio(bh->ctx, bh->name);
|
||||
+ }
|
||||
+ bh->reentrancy_guard->engaged_in_io = true;
|
||||
+ }
|
||||
+
|
||||
bh->cb(bh->opaque);
|
||||
+
|
||||
+ if (bh->reentrancy_guard) {
|
||||
+ bh->reentrancy_guard->engaged_in_io = last_engaged_in_io;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Multiple occurrences of aio_bh_poll cannot be called concurrently. */
|
||||
diff --git a/util/main-loop.c b/util/main-loop.c
|
||||
index 06b18b195c..1eacf04691 100644
|
||||
--- a/util/main-loop.c
|
||||
+++ b/util/main-loop.c
|
||||
@@ -544,9 +544,11 @@ void main_loop_wait(int nonblocking)
|
||||
|
||||
/* Functions to operate on the main QEMU AioContext. */
|
||||
|
||||
-QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name)
|
||||
+QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name,
|
||||
+ MemReentrancyGuard *reentrancy_guard)
|
||||
{
|
||||
- return aio_bh_new_full(qemu_aio_context, cb, opaque, name);
|
||||
+ return aio_bh_new_full(qemu_aio_context, cb, opaque, name,
|
||||
+ reentrancy_guard);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/util/trace-events b/util/trace-events
|
||||
index c8f53d7d9f..dc3b1eb3bf 100644
|
||||
--- a/util/trace-events
|
||||
+++ b/util/trace-events
|
||||
@@ -11,6 +11,7 @@ poll_remove(void *ctx, void *node, int fd) "ctx %p node %p fd %d"
|
||||
# async.c
|
||||
aio_co_schedule(void *ctx, void *co) "ctx %p co %p"
|
||||
aio_co_schedule_bh_cb(void *ctx, void *co) "ctx %p co %p"
|
||||
+reentrant_aio(void *ctx, const char *name) "ctx %p name %s"
|
||||
|
||||
# thread-pool.c
|
||||
thread_pool_submit(void *pool, void *req, void *opaque) "pool %p req %p opaque %p"
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
From d754050d260e2ad890cecd975df6e163c531b40e Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 9 May 2023 10:29:03 -0400
|
||||
Subject: [PATCH 09/15] async: avoid use-after-free on re-entrancy guard
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 277: memory: prevent dma-reentracy issues
|
||||
RH-Bugzilla: 1999236
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [9/12] d357650e581c3921bbfe3e2fde5e3f55853b5fab (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1999236
|
||||
Upstream: Merged
|
||||
CVE: CVE-2021-3750
|
||||
|
||||
commit 7915bd06f25e1803778081161bf6fa10c42dc7cd
|
||||
Author: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Mon May 1 10:19:56 2023 -0400
|
||||
|
||||
async: avoid use-after-free on re-entrancy guard
|
||||
|
||||
A BH callback can free the BH, causing a use-after-free in aio_bh_call.
|
||||
Fix that by keeping a local copy of the re-entrancy guard pointer.
|
||||
|
||||
Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58513
|
||||
Fixes: 9c86c97f12 ("async: Add an optional reentrancy guard to the BH API")
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Message-Id: <20230501141956.3444868-1-alxndr@bu.edu>
|
||||
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
util/async.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/util/async.c b/util/async.c
|
||||
index 1fff02e7fc..ffe0541c3b 100644
|
||||
--- a/util/async.c
|
||||
+++ b/util/async.c
|
||||
@@ -146,18 +146,20 @@ void aio_bh_call(QEMUBH *bh)
|
||||
{
|
||||
bool last_engaged_in_io = false;
|
||||
|
||||
- if (bh->reentrancy_guard) {
|
||||
- last_engaged_in_io = bh->reentrancy_guard->engaged_in_io;
|
||||
- if (bh->reentrancy_guard->engaged_in_io) {
|
||||
+ /* Make a copy of the guard-pointer as cb may free the bh */
|
||||
+ MemReentrancyGuard *reentrancy_guard = bh->reentrancy_guard;
|
||||
+ if (reentrancy_guard) {
|
||||
+ last_engaged_in_io = reentrancy_guard->engaged_in_io;
|
||||
+ if (reentrancy_guard->engaged_in_io) {
|
||||
trace_reentrant_aio(bh->ctx, bh->name);
|
||||
}
|
||||
- bh->reentrancy_guard->engaged_in_io = true;
|
||||
+ reentrancy_guard->engaged_in_io = true;
|
||||
}
|
||||
|
||||
bh->cb(bh->opaque);
|
||||
|
||||
- if (bh->reentrancy_guard) {
|
||||
- bh->reentrancy_guard->engaged_in_io = last_engaged_in_io;
|
||||
+ if (reentrancy_guard) {
|
||||
+ reentrancy_guard->engaged_in_io = last_engaged_in_io;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
From 187eb7a418af93375e42298d06e231e2bec3cf00 Mon Sep 17 00:00:00 2001
|
||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Thu, 9 Mar 2023 08:15:42 -0500
|
||||
Subject: [PATCH 10/13] async: clarify usage of barriers in the polling case
|
||||
|
||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-MergeRequest: 263: qatomic: add smp_mb__before/after_rmw()
|
||||
RH-Bugzilla: 2168472
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
||||
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Commit: [10/10] 3be07ccc6137a0336becfe63a818d9cbadb38e9c
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168472
|
||||
|
||||
commit 6229438cca037d42f44a96d38feb15cb102a444f
|
||||
Author: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Date: Mon Mar 6 10:43:52 2023 +0100
|
||||
|
||||
async: clarify usage of barriers in the polling case
|
||||
|
||||
Explain that aio_context_notifier_poll() relies on
|
||||
aio_notify_accept() to catch all the memory writes that were
|
||||
done before ctx->notified was set to true.
|
||||
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
---
|
||||
util/async.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/util/async.c b/util/async.c
|
||||
index 795fe699b6..2a63bf90f2 100644
|
||||
--- a/util/async.c
|
||||
+++ b/util/async.c
|
||||
@@ -463,8 +463,9 @@ void aio_notify_accept(AioContext *ctx)
|
||||
qatomic_set(&ctx->notified, false);
|
||||
|
||||
/*
|
||||
- * Write ctx->notified before reading e.g. bh->flags. Pairs with smp_wmb
|
||||
- * in aio_notify.
|
||||
+ * Order reads of ctx->notified (in aio_context_notifier_poll()) and the
|
||||
+ * above clearing of ctx->notified before reads of e.g. bh->flags. Pairs
|
||||
+ * with smp_wmb() in aio_notify.
|
||||
*/
|
||||
smp_mb();
|
||||
}
|
||||
@@ -487,6 +488,11 @@ static bool aio_context_notifier_poll(void *opaque)
|
||||
EventNotifier *e = opaque;
|
||||
AioContext *ctx = container_of(e, AioContext, notifier);
|
||||
|
||||
+ /*
|
||||
+ * No need for load-acquire because we just want to kick the
|
||||
+ * event loop. aio_notify_accept() takes care of synchronizing
|
||||
+ * the event loop with the producers.
|
||||
+ */
|
||||
return qatomic_read(&ctx->notified);
|
||||
}
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
From ea3856bb545d19499602830cdc3076d83a981e7a Mon Sep 17 00:00:00 2001
|
||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
Date: Thu, 9 Mar 2023 08:15:36 -0500
|
||||
Subject: [PATCH 09/13] async: update documentation of the memory barriers
|
||||
|
||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-MergeRequest: 263: qatomic: add smp_mb__before/after_rmw()
|
||||
RH-Bugzilla: 2168472
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
||||
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Commit: [9/10] d471da2acf7a107cf75f3327c5e8d7456307160e
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168472
|
||||
|
||||
commit 8dd48650b43dfde4ebea34191ac267e474bcc29e
|
||||
Author: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Date: Mon Mar 6 10:15:06 2023 +0100
|
||||
|
||||
async: update documentation of the memory barriers
|
||||
|
||||
Ever since commit 8c6b0356b539 ("util/async: make bh_aio_poll() O(1)",
|
||||
2020-02-22), synchronization between qemu_bh_schedule() and aio_bh_poll()
|
||||
is happening when the bottom half is enqueued in the bh_list; not
|
||||
when the flags are set. Update the documentation to match.
|
||||
|
||||
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
---
|
||||
util/async.c | 33 +++++++++++++++++++--------------
|
||||
1 file changed, 19 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/util/async.c b/util/async.c
|
||||
index 6f6717a34b..795fe699b6 100644
|
||||
--- a/util/async.c
|
||||
+++ b/util/async.c
|
||||
@@ -71,14 +71,21 @@ static void aio_bh_enqueue(QEMUBH *bh, unsigned new_flags)
|
||||
unsigned old_flags;
|
||||
|
||||
/*
|
||||
- * The memory barrier implicit in qatomic_fetch_or makes sure that:
|
||||
- * 1. idle & any writes needed by the callback are done before the
|
||||
- * locations are read in the aio_bh_poll.
|
||||
- * 2. ctx is loaded before the callback has a chance to execute and bh
|
||||
- * could be freed.
|
||||
+ * Synchronizes with atomic_fetch_and() in aio_bh_dequeue(), ensuring that
|
||||
+ * insertion starts after BH_PENDING is set.
|
||||
*/
|
||||
old_flags = qatomic_fetch_or(&bh->flags, BH_PENDING | new_flags);
|
||||
+
|
||||
if (!(old_flags & BH_PENDING)) {
|
||||
+ /*
|
||||
+ * At this point the bottom half becomes visible to aio_bh_poll().
|
||||
+ * This insertion thus synchronizes with QSLIST_MOVE_ATOMIC in
|
||||
+ * aio_bh_poll(), ensuring that:
|
||||
+ * 1. any writes needed by the callback are visible from the callback
|
||||
+ * after aio_bh_dequeue() returns bh.
|
||||
+ * 2. ctx is loaded before the callback has a chance to execute and bh
|
||||
+ * could be freed.
|
||||
+ */
|
||||
QSLIST_INSERT_HEAD_ATOMIC(&ctx->bh_list, bh, next);
|
||||
}
|
||||
|
||||
@@ -97,11 +104,8 @@ static QEMUBH *aio_bh_dequeue(BHList *head, unsigned *flags)
|
||||
QSLIST_REMOVE_HEAD(head, next);
|
||||
|
||||
/*
|
||||
- * The qatomic_and is paired with aio_bh_enqueue(). The implicit memory
|
||||
- * barrier ensures that the callback sees all writes done by the scheduling
|
||||
- * thread. It also ensures that the scheduling thread sees the cleared
|
||||
- * flag before bh->cb has run, and thus will call aio_notify again if
|
||||
- * necessary.
|
||||
+ * Synchronizes with qatomic_fetch_or() in aio_bh_enqueue(), ensuring that
|
||||
+ * the removal finishes before BH_PENDING is reset.
|
||||
*/
|
||||
*flags = qatomic_fetch_and(&bh->flags,
|
||||
~(BH_PENDING | BH_SCHEDULED | BH_IDLE));
|
||||
@@ -148,6 +152,7 @@ int aio_bh_poll(AioContext *ctx)
|
||||
BHListSlice *s;
|
||||
int ret = 0;
|
||||
|
||||
+ /* Synchronizes with QSLIST_INSERT_HEAD_ATOMIC in aio_bh_enqueue(). */
|
||||
QSLIST_MOVE_ATOMIC(&slice.bh_list, &ctx->bh_list);
|
||||
QSIMPLEQ_INSERT_TAIL(&ctx->bh_slice_list, &slice, next);
|
||||
|
||||
@@ -437,15 +442,15 @@ LuringState *aio_get_linux_io_uring(AioContext *ctx)
|
||||
void aio_notify(AioContext *ctx)
|
||||
{
|
||||
/*
|
||||
- * Write e.g. bh->flags before writing ctx->notified. Pairs with smp_mb in
|
||||
- * aio_notify_accept.
|
||||
+ * Write e.g. ctx->bh_list before writing ctx->notified. Pairs with
|
||||
+ * smp_mb() in aio_notify_accept().
|
||||
*/
|
||||
smp_wmb();
|
||||
qatomic_set(&ctx->notified, true);
|
||||
|
||||
/*
|
||||
- * Write ctx->notified before reading ctx->notify_me. Pairs
|
||||
- * with smp_mb in aio_ctx_prepare or aio_poll.
|
||||
+ * Write ctx->notified (and also ctx->bh_list) before reading ctx->notify_me.
|
||||
+ * Pairs with smp_mb() in aio_ctx_prepare or aio_poll.
|
||||
*/
|
||||
smp_mb();
|
||||
if (qatomic_read(&ctx->notify_me)) {
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
From 60da56e3685969493ae483c3cc2c66af13d00baf Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Huth <thuth@redhat.com>
|
||||
Date: Wed, 10 Aug 2022 14:57:18 +0200
|
||||
Subject: [PATCH 1/3] backends/hostmem: Fix support of memory-backend-memfd in
|
||||
qemu_maxrampagesize()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <None>
|
||||
RH-MergeRequest: 221: backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize()
|
||||
RH-Bugzilla: 2117149
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Commit: [1/1] b5a1047750af32c0a261b8385ea0e819eb16681a
|
||||
|
||||
It is currently not possible yet to use "memory-backend-memfd" on s390x
|
||||
with hugepages enabled. This problem is caused by qemu_maxrampagesize()
|
||||
not taking memory-backend-memfd objects into account yet, so the code
|
||||
in s390_memory_init() fails to enable the huge page support there via
|
||||
s390_set_max_pagesize(). Fix it by generalizing the code, so that it
|
||||
looks at qemu_ram_pagesize(memdev->mr.ram_block) instead of re-trying
|
||||
to get the information from the filesystem.
|
||||
|
||||
Suggested-by: David Hildenbrand <david@redhat.com>
|
||||
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2116496
|
||||
Message-Id: <20220810125720.3849835-2-thuth@redhat.com>
|
||||
Reviewed-by: David Hildenbrand <david@redhat.com>
|
||||
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
(cherry picked from commit 8be934b70e923104da883b990dee18f02552d40e)
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2117149
|
||||
[clg: Resolved conflict on qemu_real_host_page_size() ]
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
backends/hostmem.c | 14 ++------------
|
||||
1 file changed, 2 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/backends/hostmem.c b/backends/hostmem.c
|
||||
index 4c05862ed5..0c4654ea85 100644
|
||||
--- a/backends/hostmem.c
|
||||
+++ b/backends/hostmem.c
|
||||
@@ -305,22 +305,12 @@ bool host_memory_backend_is_mapped(HostMemoryBackend *backend)
|
||||
return backend->is_mapped;
|
||||
}
|
||||
|
||||
-#ifdef __linux__
|
||||
size_t host_memory_backend_pagesize(HostMemoryBackend *memdev)
|
||||
{
|
||||
- Object *obj = OBJECT(memdev);
|
||||
- char *path = object_property_get_str(obj, "mem-path", NULL);
|
||||
- size_t pagesize = qemu_mempath_getpagesize(path);
|
||||
-
|
||||
- g_free(path);
|
||||
+ size_t pagesize = qemu_ram_pagesize(memdev->mr.ram_block);
|
||||
+ g_assert(pagesize >= qemu_real_host_page_size);
|
||||
return pagesize;
|
||||
}
|
||||
-#else
|
||||
-size_t host_memory_backend_pagesize(HostMemoryBackend *memdev)
|
||||
-{
|
||||
- return qemu_real_host_page_size;
|
||||
-}
|
||||
-#endif
|
||||
|
||||
static void
|
||||
host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From 7715635d018351e0a5c4c25aec2c71a2fe3b9e69 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 9 May 2023 10:29:03 -0400
|
||||
Subject: [PATCH 06/15] bcm2835_property: disable reentrancy detection for
|
||||
iomem
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 277: memory: prevent dma-reentracy issues
|
||||
RH-Bugzilla: 1999236
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [6/12] 4d6187430ca1c4309a36824c0c6815d2a763db1a (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1999236
|
||||
Upstream: Merged
|
||||
CVE: CVE-2021-3750
|
||||
|
||||
commit 985c4a4e547afb9573b6bd6843d20eb2c3d1d1cd
|
||||
Author: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Thu Apr 27 17:10:11 2023 -0400
|
||||
|
||||
bcm2835_property: disable reentrancy detection for iomem
|
||||
|
||||
As the code is designed for re-entrant calls from bcm2835_property to
|
||||
bcm2835_mbox and back into bcm2835_property, mark iomem as
|
||||
reentrancy-safe.
|
||||
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
||||
Message-Id: <20230427211013.2994127-7-alxndr@bu.edu>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/misc/bcm2835_property.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
|
||||
index 73941bdae9..022b5a849c 100644
|
||||
--- a/hw/misc/bcm2835_property.c
|
||||
+++ b/hw/misc/bcm2835_property.c
|
||||
@@ -377,6 +377,13 @@ static void bcm2835_property_init(Object *obj)
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &bcm2835_property_ops, s,
|
||||
TYPE_BCM2835_PROPERTY, 0x10);
|
||||
+
|
||||
+ /*
|
||||
+ * bcm2835_property_ops call into bcm2835_mbox, which in-turn reads from
|
||||
+ * iomem. As such, mark iomem as re-entracy safe.
|
||||
+ */
|
||||
+ s->iomem.disable_reentrancy_guard = true;
|
||||
+
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem);
|
||||
sysbus_init_irq(SYS_BUS_DEVICE(s), &s->mbox_irq);
|
||||
}
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,359 @@
|
|||
From 1f7520baa6f0bf02ccba2ebfe7d1d5bf6520f95a Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Czenczek <hreitz@redhat.com>
|
||||
Date: Tue, 11 Apr 2023 19:34:16 +0200
|
||||
Subject: [PATCH 2/5] block: Collapse padded I/O vecs exceeding IOV_MAX
|
||||
|
||||
RH-Author: Hanna Czenczek <hreitz@redhat.com>
|
||||
RH-MergeRequest: 291: block: Split padded I/O vectors exceeding IOV_MAX
|
||||
RH-Bugzilla: 2141964
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Commit: [2/5] 1d86ce8398e4ab66e308a686f9855c963e52b0a9
|
||||
|
||||
When processing vectored guest requests that are not aligned to the
|
||||
storage request alignment, we pad them by adding head and/or tail
|
||||
buffers for a read-modify-write cycle.
|
||||
|
||||
The guest can submit I/O vectors up to IOV_MAX (1024) in length, but
|
||||
with this padding, the vector can exceed that limit. As of
|
||||
4c002cef0e9abe7135d7916c51abce47f7fc1ee2 ("util/iov: make
|
||||
qemu_iovec_init_extended() honest"), we refuse to pad vectors beyond the
|
||||
limit, instead returning an error to the guest.
|
||||
|
||||
To the guest, this appears as a random I/O error. We should not return
|
||||
an I/O error to the guest when it issued a perfectly valid request.
|
||||
|
||||
Before 4c002cef0e9abe7135d7916c51abce47f7fc1ee2, we just made the vector
|
||||
longer than IOV_MAX, which generally seems to work (because the guest
|
||||
assumes a smaller alignment than we really have, file-posix's
|
||||
raw_co_prw() will generally see bdrv_qiov_is_aligned() return false, and
|
||||
so emulate the request, so that the IOV_MAX does not matter). However,
|
||||
that does not seem exactly great.
|
||||
|
||||
I see two ways to fix this problem:
|
||||
1. We split such long requests into two requests.
|
||||
2. We join some elements of the vector into new buffers to make it
|
||||
shorter.
|
||||
|
||||
I am wary of (1), because it seems like it may have unintended side
|
||||
effects.
|
||||
|
||||
(2) on the other hand seems relatively simple to implement, with
|
||||
hopefully few side effects, so this patch does that.
|
||||
|
||||
To do this, the use of qemu_iovec_init_extended() in bdrv_pad_request()
|
||||
is effectively replaced by the new function bdrv_create_padded_qiov(),
|
||||
which not only wraps the request IOV with padding head/tail, but also
|
||||
ensures that the resulting vector will not have more than IOV_MAX
|
||||
elements. Putting that functionality into qemu_iovec_init_extended() is
|
||||
infeasible because it requires allocating a bounce buffer; doing so
|
||||
would require many more parameters (buffer alignment, how to initialize
|
||||
the buffer, and out parameters like the buffer, its length, and the
|
||||
original elements), which is not reasonable.
|
||||
|
||||
Conversely, it is not difficult to move qemu_iovec_init_extended()'s
|
||||
functionality into bdrv_create_padded_qiov() by using public
|
||||
qemu_iovec_* functions, so that is what this patch does.
|
||||
|
||||
Because bdrv_pad_request() was the only "serious" user of
|
||||
qemu_iovec_init_extended(), the next patch will remove the latter
|
||||
function, so the functionality is not implemented twice.
|
||||
|
||||
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2141964
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
Message-Id: <20230411173418.19549-3-hreitz@redhat.com>
|
||||
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||||
(cherry picked from commit 18743311b829cafc1737a5f20bc3248d5f91ee2a)
|
||||
|
||||
Conflicts:
|
||||
block/io.c: Downstream bdrv_pad_request() has no @flags
|
||||
parameter.
|
||||
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
---
|
||||
block/io.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 151 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/block/io.c b/block/io.c
|
||||
index c3e7301613..0fe8f0dd40 100644
|
||||
--- a/block/io.c
|
||||
+++ b/block/io.c
|
||||
@@ -1624,6 +1624,14 @@ out:
|
||||
* @merge_reads is true for small requests,
|
||||
* if @buf_len == @head + bytes + @tail. In this case it is possible that both
|
||||
* head and tail exist but @buf_len == align and @tail_buf == @buf.
|
||||
+ *
|
||||
+ * @write is true for write requests, false for read requests.
|
||||
+ *
|
||||
+ * If padding makes the vector too long (exceeding IOV_MAX), then we need to
|
||||
+ * merge existing vector elements into a single one. @collapse_bounce_buf acts
|
||||
+ * as the bounce buffer in such cases. @pre_collapse_qiov has the pre-collapse
|
||||
+ * I/O vector elements so for read requests, the data can be copied back after
|
||||
+ * the read is done.
|
||||
*/
|
||||
typedef struct BdrvRequestPadding {
|
||||
uint8_t *buf;
|
||||
@@ -1632,11 +1640,17 @@ typedef struct BdrvRequestPadding {
|
||||
size_t head;
|
||||
size_t tail;
|
||||
bool merge_reads;
|
||||
+ bool write;
|
||||
QEMUIOVector local_qiov;
|
||||
+
|
||||
+ uint8_t *collapse_bounce_buf;
|
||||
+ size_t collapse_len;
|
||||
+ QEMUIOVector pre_collapse_qiov;
|
||||
} BdrvRequestPadding;
|
||||
|
||||
static bool bdrv_init_padding(BlockDriverState *bs,
|
||||
int64_t offset, int64_t bytes,
|
||||
+ bool write,
|
||||
BdrvRequestPadding *pad)
|
||||
{
|
||||
int64_t align = bs->bl.request_alignment;
|
||||
@@ -1668,6 +1682,8 @@ static bool bdrv_init_padding(BlockDriverState *bs,
|
||||
pad->tail_buf = pad->buf + pad->buf_len - align;
|
||||
}
|
||||
|
||||
+ pad->write = write;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1733,8 +1749,23 @@ zero_mem:
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void bdrv_padding_destroy(BdrvRequestPadding *pad)
|
||||
+/**
|
||||
+ * Free *pad's associated buffers, and perform any necessary finalization steps.
|
||||
+ */
|
||||
+static void bdrv_padding_finalize(BdrvRequestPadding *pad)
|
||||
{
|
||||
+ if (pad->collapse_bounce_buf) {
|
||||
+ if (!pad->write) {
|
||||
+ /*
|
||||
+ * If padding required elements in the vector to be collapsed into a
|
||||
+ * bounce buffer, copy the bounce buffer content back
|
||||
+ */
|
||||
+ qemu_iovec_from_buf(&pad->pre_collapse_qiov, 0,
|
||||
+ pad->collapse_bounce_buf, pad->collapse_len);
|
||||
+ }
|
||||
+ qemu_vfree(pad->collapse_bounce_buf);
|
||||
+ qemu_iovec_destroy(&pad->pre_collapse_qiov);
|
||||
+ }
|
||||
if (pad->buf) {
|
||||
qemu_vfree(pad->buf);
|
||||
qemu_iovec_destroy(&pad->local_qiov);
|
||||
@@ -1742,6 +1773,101 @@ static void bdrv_padding_destroy(BdrvRequestPadding *pad)
|
||||
memset(pad, 0, sizeof(*pad));
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Create pad->local_qiov by wrapping @iov in the padding head and tail, while
|
||||
+ * ensuring that the resulting vector will not exceed IOV_MAX elements.
|
||||
+ *
|
||||
+ * To ensure this, when necessary, the first two or three elements of @iov are
|
||||
+ * merged into pad->collapse_bounce_buf and replaced by a reference to that
|
||||
+ * bounce buffer in pad->local_qiov.
|
||||
+ *
|
||||
+ * After performing a read request, the data from the bounce buffer must be
|
||||
+ * copied back into pad->pre_collapse_qiov (e.g. by bdrv_padding_finalize()).
|
||||
+ */
|
||||
+static int bdrv_create_padded_qiov(BlockDriverState *bs,
|
||||
+ BdrvRequestPadding *pad,
|
||||
+ struct iovec *iov, int niov,
|
||||
+ size_t iov_offset, size_t bytes)
|
||||
+{
|
||||
+ int padded_niov, surplus_count, collapse_count;
|
||||
+
|
||||
+ /* Assert this invariant */
|
||||
+ assert(niov <= IOV_MAX);
|
||||
+
|
||||
+ /*
|
||||
+ * Cannot pad if resulting length would exceed SIZE_MAX. Returning an error
|
||||
+ * to the guest is not ideal, but there is little else we can do. At least
|
||||
+ * this will practically never happen on 64-bit systems.
|
||||
+ */
|
||||
+ if (SIZE_MAX - pad->head < bytes ||
|
||||
+ SIZE_MAX - pad->head - bytes < pad->tail)
|
||||
+ {
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ /* Length of the resulting IOV if we just concatenated everything */
|
||||
+ padded_niov = !!pad->head + niov + !!pad->tail;
|
||||
+
|
||||
+ qemu_iovec_init(&pad->local_qiov, MIN(padded_niov, IOV_MAX));
|
||||
+
|
||||
+ if (pad->head) {
|
||||
+ qemu_iovec_add(&pad->local_qiov, pad->buf, pad->head);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If padded_niov > IOV_MAX, we cannot just concatenate everything.
|
||||
+ * Instead, merge the first two or three elements of @iov to reduce the
|
||||
+ * number of vector elements as necessary.
|
||||
+ */
|
||||
+ if (padded_niov > IOV_MAX) {
|
||||
+ /*
|
||||
+ * Only head and tail can have lead to the number of entries exceeding
|
||||
+ * IOV_MAX, so we can exceed it by the head and tail at most. We need
|
||||
+ * to reduce the number of elements by `surplus_count`, so we merge that
|
||||
+ * many elements plus one into one element.
|
||||
+ */
|
||||
+ surplus_count = padded_niov - IOV_MAX;
|
||||
+ assert(surplus_count <= !!pad->head + !!pad->tail);
|
||||
+ collapse_count = surplus_count + 1;
|
||||
+
|
||||
+ /*
|
||||
+ * Move the elements to collapse into `pad->pre_collapse_qiov`, then
|
||||
+ * advance `iov` (and associated variables) by those elements.
|
||||
+ */
|
||||
+ qemu_iovec_init(&pad->pre_collapse_qiov, collapse_count);
|
||||
+ qemu_iovec_concat_iov(&pad->pre_collapse_qiov, iov,
|
||||
+ collapse_count, iov_offset, SIZE_MAX);
|
||||
+ iov += collapse_count;
|
||||
+ iov_offset = 0;
|
||||
+ niov -= collapse_count;
|
||||
+ bytes -= pad->pre_collapse_qiov.size;
|
||||
+
|
||||
+ /*
|
||||
+ * Construct the bounce buffer to match the length of the to-collapse
|
||||
+ * vector elements, and for write requests, initialize it with the data
|
||||
+ * from those elements. Then add it to `pad->local_qiov`.
|
||||
+ */
|
||||
+ pad->collapse_len = pad->pre_collapse_qiov.size;
|
||||
+ pad->collapse_bounce_buf = qemu_blockalign(bs, pad->collapse_len);
|
||||
+ if (pad->write) {
|
||||
+ qemu_iovec_to_buf(&pad->pre_collapse_qiov, 0,
|
||||
+ pad->collapse_bounce_buf, pad->collapse_len);
|
||||
+ }
|
||||
+ qemu_iovec_add(&pad->local_qiov,
|
||||
+ pad->collapse_bounce_buf, pad->collapse_len);
|
||||
+ }
|
||||
+
|
||||
+ qemu_iovec_concat_iov(&pad->local_qiov, iov, niov, iov_offset, bytes);
|
||||
+
|
||||
+ if (pad->tail) {
|
||||
+ qemu_iovec_add(&pad->local_qiov,
|
||||
+ pad->buf + pad->buf_len - pad->tail, pad->tail);
|
||||
+ }
|
||||
+
|
||||
+ assert(pad->local_qiov.niov == MIN(padded_niov, IOV_MAX));
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* bdrv_pad_request
|
||||
*
|
||||
@@ -1749,6 +1875,8 @@ static void bdrv_padding_destroy(BdrvRequestPadding *pad)
|
||||
* read of padding, bdrv_padding_rmw_read() should be called separately if
|
||||
* needed.
|
||||
*
|
||||
+ * @write is true for write requests, false for read requests.
|
||||
+ *
|
||||
* Request parameters (@qiov, &qiov_offset, &offset, &bytes) are in-out:
|
||||
* - on function start they represent original request
|
||||
* - on failure or when padding is not needed they are unchanged
|
||||
@@ -1757,25 +1885,33 @@ static void bdrv_padding_destroy(BdrvRequestPadding *pad)
|
||||
static int bdrv_pad_request(BlockDriverState *bs,
|
||||
QEMUIOVector **qiov, size_t *qiov_offset,
|
||||
int64_t *offset, int64_t *bytes,
|
||||
+ bool write,
|
||||
BdrvRequestPadding *pad, bool *padded)
|
||||
{
|
||||
int ret;
|
||||
+ struct iovec *sliced_iov;
|
||||
+ int sliced_niov;
|
||||
+ size_t sliced_head, sliced_tail;
|
||||
|
||||
bdrv_check_qiov_request(*offset, *bytes, *qiov, *qiov_offset, &error_abort);
|
||||
|
||||
- if (!bdrv_init_padding(bs, *offset, *bytes, pad)) {
|
||||
+ if (!bdrv_init_padding(bs, *offset, *bytes, write, pad)) {
|
||||
if (padded) {
|
||||
*padded = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ret = qemu_iovec_init_extended(&pad->local_qiov, pad->buf, pad->head,
|
||||
- *qiov, *qiov_offset, *bytes,
|
||||
- pad->buf + pad->buf_len - pad->tail,
|
||||
- pad->tail);
|
||||
+ sliced_iov = qemu_iovec_slice(*qiov, *qiov_offset, *bytes,
|
||||
+ &sliced_head, &sliced_tail,
|
||||
+ &sliced_niov);
|
||||
+
|
||||
+ /* Guaranteed by bdrv_check_qiov_request() */
|
||||
+ assert(*bytes <= SIZE_MAX);
|
||||
+ ret = bdrv_create_padded_qiov(bs, pad, sliced_iov, sliced_niov,
|
||||
+ sliced_head, *bytes);
|
||||
if (ret < 0) {
|
||||
- bdrv_padding_destroy(pad);
|
||||
+ bdrv_padding_finalize(pad);
|
||||
return ret;
|
||||
}
|
||||
*bytes += pad->head + pad->tail;
|
||||
@@ -1836,8 +1972,8 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
|
||||
flags |= BDRV_REQ_COPY_ON_READ;
|
||||
}
|
||||
|
||||
- ret = bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, &pad,
|
||||
- NULL);
|
||||
+ ret = bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, false,
|
||||
+ &pad, NULL);
|
||||
if (ret < 0) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -1847,7 +1983,7 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
|
||||
bs->bl.request_alignment,
|
||||
qiov, qiov_offset, flags);
|
||||
tracked_request_end(&req);
|
||||
- bdrv_padding_destroy(&pad);
|
||||
+ bdrv_padding_finalize(&pad);
|
||||
|
||||
fail:
|
||||
bdrv_dec_in_flight(bs);
|
||||
@@ -2167,7 +2303,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
|
||||
bool padding;
|
||||
BdrvRequestPadding pad;
|
||||
|
||||
- padding = bdrv_init_padding(bs, offset, bytes, &pad);
|
||||
+ padding = bdrv_init_padding(bs, offset, bytes, true, &pad);
|
||||
if (padding) {
|
||||
bdrv_make_request_serialising(req, align);
|
||||
|
||||
@@ -2214,7 +2350,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child,
|
||||
}
|
||||
|
||||
out:
|
||||
- bdrv_padding_destroy(&pad);
|
||||
+ bdrv_padding_finalize(&pad);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2280,8 +2416,8 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
|
||||
* bdrv_co_do_zero_pwritev() does aligning by itself, so, we do
|
||||
* alignment only if there is no ZERO flag.
|
||||
*/
|
||||
- ret = bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, &pad,
|
||||
- &padded);
|
||||
+ ret = bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, true,
|
||||
+ &pad, &padded);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
@@ -2310,7 +2446,7 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
|
||||
ret = bdrv_aligned_pwritev(child, &req, offset, bytes, align,
|
||||
qiov, qiov_offset, flags);
|
||||
|
||||
- bdrv_padding_destroy(&pad);
|
||||
+ bdrv_padding_finalize(&pad);
|
||||
|
||||
out:
|
||||
tracked_request_end(&req);
|
||||
--
|
||||
2.39.3
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
From b9866279996ee065cb524bf30bc70e22efbab303 Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Czenczek <hreitz@redhat.com>
|
||||
Date: Fri, 14 Jul 2023 10:59:38 +0200
|
||||
Subject: [PATCH 5/5] block: Fix pad_request's request restriction
|
||||
|
||||
RH-Author: Hanna Czenczek <hreitz@redhat.com>
|
||||
RH-MergeRequest: 291: block: Split padded I/O vectors exceeding IOV_MAX
|
||||
RH-Bugzilla: 2141964
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Commit: [5/5] f9188bd089d6c67185ea1accde20d491a2ed3193
|
||||
|
||||
bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX,
|
||||
which bdrv_check_qiov_request() does not guarantee.
|
||||
|
||||
bdrv_check_request32() however will guarantee this, and both of
|
||||
bdrv_pad_request()'s callers (bdrv_co_preadv_part() and
|
||||
bdrv_co_pwritev_part()) already run it before calling
|
||||
bdrv_pad_request(). Therefore, bdrv_pad_request() can safely call
|
||||
bdrv_check_request32() without expecting error, too.
|
||||
|
||||
In effect, this patch will not change guest-visible behavior. It is a
|
||||
clean-up to tighten a condition to match what is guaranteed by our
|
||||
callers, and which exists purely to show clearly why the subsequent
|
||||
assertion (`assert(*bytes <= SIZE_MAX)`) is always true.
|
||||
|
||||
Note there is a difference between the interfaces of
|
||||
bdrv_check_qiov_request() and bdrv_check_request32(): The former takes
|
||||
an errp, the latter does not, so we can no longer just pass
|
||||
&error_abort. Instead, we need to check the returned value. While we
|
||||
do expect success (because the callers have already run this function),
|
||||
an assert(ret == 0) is not much simpler than just to return an error if
|
||||
it occurs, so let us handle errors by returning them up the stack now.
|
||||
|
||||
Reported-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
Message-id: 20230714085938.202730-1-hreitz@redhat.com
|
||||
Fixes: 18743311b829cafc1737a5f20bc3248d5f91ee2a
|
||||
("block: Collapse padded I/O vecs exceeding IOV_MAX")
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
---
|
||||
block/io.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/block/io.c b/block/io.c
|
||||
index 0fe8f0dd40..8ae57728a6 100644
|
||||
--- a/block/io.c
|
||||
+++ b/block/io.c
|
||||
@@ -1893,7 +1893,11 @@ static int bdrv_pad_request(BlockDriverState *bs,
|
||||
int sliced_niov;
|
||||
size_t sliced_head, sliced_tail;
|
||||
|
||||
- bdrv_check_qiov_request(*offset, *bytes, *qiov, *qiov_offset, &error_abort);
|
||||
+ /* Should have been checked by the caller already */
|
||||
+ ret = bdrv_check_request32(*offset, *bytes, *qiov, *qiov_offset);
|
||||
+ if (ret < 0) {
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
if (!bdrv_init_padding(bs, *offset, *bytes, write, pad)) {
|
||||
if (padded) {
|
||||
@@ -1906,7 +1910,7 @@ static int bdrv_pad_request(BlockDriverState *bs,
|
||||
&sliced_head, &sliced_tail,
|
||||
&sliced_niov);
|
||||
|
||||
- /* Guaranteed by bdrv_check_qiov_request() */
|
||||
+ /* Guaranteed by bdrv_check_request32() */
|
||||
assert(*bytes <= SIZE_MAX);
|
||||
ret = bdrv_create_padded_qiov(bs, pad, sliced_iov, sliced_niov,
|
||||
sliced_head, *bytes);
|
||||
--
|
||||
2.39.3
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
From 7b973b9cb7b890eaf9a31c99f5c272b513322ac1 Mon Sep 17 00:00:00 2001
|
||||
From b21fa5ecd9acf2b91839a2915fb4bb39dac4c803 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Wolf <kwolf@redhat.com>
|
||||
Date: Thu, 3 Feb 2022 15:05:33 +0100
|
||||
Subject: [PATCH 1/8] block: Lock AioContext for drain_end in blockdev-reopen
|
||||
Subject: [PATCH 2/5] block: Lock AioContext for drain_end in blockdev-reopen
|
||||
|
||||
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-MergeRequest: 73: block: Lock AioContext for drain_end in blockdev-reopen
|
||||
RH-Commit: [1/2] db25e999152b0e4f09decade1ac76b9f56cd9706 (kmwolf/centos-qemu-kvm)
|
||||
RH-Bugzilla: 2046659
|
||||
RH-Acked-by: Sergio Lopez <None>
|
||||
RH-MergeRequest: 142: block: Lock AioContext for drain_end in blockdev-reopen
|
||||
RH-Commit: [1/2] 98de3b5987f88ea6b4b503f623d6c4475574e037
|
||||
RH-Bugzilla: 2067118
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
||||
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
From 6348063b91b2370cc27153fd58fd11a6681631f6 Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Wed, 16 Feb 2022 11:53:53 +0100
|
||||
Subject: [PATCH 22/24] block: Make bdrv_refresh_limits() non-recursive
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-MergeRequest: 189: block: Make bdrv_refresh_limits() non-recursive
|
||||
RH-Commit: [1/3] 1a1fe37f8d8f0344dd8639d6cc9d884d1aff9096
|
||||
RH-Bugzilla: 2072932
|
||||
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
|
||||
bdrv_refresh_limits() recurses down to the node's children. That does
|
||||
not seem necessary: When we refresh limits on some node, and then
|
||||
recurse down and were to change one of its children's BlockLimits, then
|
||||
that would mean we noticed the changed limits by pure chance. The fact
|
||||
that we refresh the parent's limits has nothing to do with it, so the
|
||||
reason for the change probably happened before this point in time, and
|
||||
we should have refreshed the limits then.
|
||||
|
||||
Consequently, we should actually propagate block limits changes upwards,
|
||||
not downwards. That is a separate and pre-existing issue, though, and
|
||||
so will not be addressed in this patch.
|
||||
|
||||
The problem with recursing is that bdrv_refresh_limits() is not atomic.
|
||||
It begins with zeroing BDS.bl, and only then sets proper, valid limits.
|
||||
If we do not drain all nodes whose limits are refreshed, then concurrent
|
||||
I/O requests can encounter invalid request_alignment values and crash
|
||||
qemu. Therefore, a recursing bdrv_refresh_limits() requires the whole
|
||||
subtree to be drained, which is currently not ensured by most callers.
|
||||
|
||||
A non-recursive bdrv_refresh_limits() only requires the node in question
|
||||
to not receive I/O requests, and this is done by most callers in some
|
||||
way or another:
|
||||
- bdrv_open_driver() deals with a new node with no parents yet
|
||||
- bdrv_set_file_or_backing_noperm() acts on a drained node
|
||||
- bdrv_reopen_commit() acts only on drained nodes
|
||||
- bdrv_append() should in theory require the node to be drained; in
|
||||
practice most callers just lock the AioContext, which should at least
|
||||
be enough to prevent concurrent I/O requests from accessing invalid
|
||||
limits
|
||||
|
||||
So we can resolve the bug by making bdrv_refresh_limits() non-recursive.
|
||||
|
||||
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1879437
|
||||
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||||
Reviewed-by: Eric Blake <eblake@redhat.com>
|
||||
Message-Id: <20220216105355.30729-2-hreitz@redhat.com>
|
||||
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
(cherry picked from commit 4d378bbd831bdd2f6e6adcd4ea5b77b6effaa627)
|
||||
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||||
---
|
||||
block/io.c | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/block/io.c b/block/io.c
|
||||
index 4e4cb556c5..c3e7301613 100644
|
||||
--- a/block/io.c
|
||||
+++ b/block/io.c
|
||||
@@ -189,10 +189,6 @@ void bdrv_refresh_limits(BlockDriverState *bs, Transaction *tran, Error **errp)
|
||||
QLIST_FOREACH(c, &bs->children, next) {
|
||||
if (c->role & (BDRV_CHILD_DATA | BDRV_CHILD_FILTERED | BDRV_CHILD_COW))
|
||||
{
|
||||
- bdrv_refresh_limits(c->bs, tran, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
bdrv_merge_limits(&bs->bl, &c->bs->bl);
|
||||
have_limits = true;
|
||||
}
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
From 87f3b10dc600ac12272ee6cdc67571910ea722f6 Mon Sep 17 00:00:00 2001
|
||||
From bf4c15a3debbe68b6eb25c52174843470a9c014f Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Date: Tue, 11 Jan 2022 15:36:12 +0000
|
||||
Subject: [PATCH 10/12] block-backend: prevent dangling BDS pointers across
|
||||
Subject: [PATCH 3/6] block-backend: prevent dangling BDS pointers across
|
||||
aio_poll()
|
||||
|
||||
RH-Author: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-MergeRequest: 71: block-backend: prevent dangling BDS pointers across aio_poll()
|
||||
RH-Commit: [1/2] 1b4cab39bf8c933ab910293a29bfceaa9e821068 (hreitz/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2040123
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-MergeRequest: 109: block-backend: prevent dangling BDS pointers across aio_poll()
|
||||
RH-Commit: [1/2] da5a59eddff0dc10be7de8e291fa675143d11d73
|
||||
RH-Bugzilla: 2021778 2036178
|
||||
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
|
||||
The BlockBackend root child can change when aio_poll() is invoked. This
|
||||
happens when a temporary filter node is removed upon blockjob
|
||||
|
@ -37,7 +37,7 @@ Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|||
Message-Id: <20220111153613.25453-2-stefanha@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
(cherry picked from commit 1e3552dbd28359d35967b7c28dc86cde1bc29205)
|
||||
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
---
|
||||
block/block-backend.c | 19 +++++++++++++++++--
|
||||
1 file changed, 17 insertions(+), 2 deletions(-)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
From a6b472de71f6ebbe44025e1348c90e6f1f2b2326 Mon Sep 17 00:00:00 2001
|
||||
From 4c6eff78f4b31ec4bd7b42440396760d19fde63e Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Tue, 18 Jan 2022 17:59:59 +0100
|
||||
Subject: [PATCH 06/12] block/io: Update BSC only if want_zero is true
|
||||
Subject: [PATCH 6/7] block/io: Update BSC only if want_zero is true
|
||||
|
||||
RH-Author: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-MergeRequest: 69: block/io: Update BSC only if want_zero is true
|
||||
RH-Commit: [1/2] ad19ff86c3420cafe5a9e785ee210e482fbc8cd7 (hreitz/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2041461
|
||||
RH-MergeRequest: 112: block/io: Update BSC only if want_zero is true
|
||||
RH-Commit: [1/2] a202de1f52110d1e871c3b5b58f2d9e9b5d17570
|
||||
RH-Bugzilla: 2041480
|
||||
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
From 192f956f2b0761f270070555f8feb1f0544e5558 Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Wed, 9 Nov 2022 17:54:48 +0100
|
||||
Subject: [PATCH 01/11] block/mirror: Do not wait for active writes
|
||||
|
||||
RH-Author: Hanna Czenczek <hreitz@redhat.com>
|
||||
RH-MergeRequest: 246: block/mirror: Make active mirror progress even under full load
|
||||
RH-Bugzilla: 2125119
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Commit: [1/3] 652d1e55b954f13eaec2c86f58735d4942837e16
|
||||
|
||||
Waiting for all active writes to settle before daring to create a
|
||||
background copying operation means that we will never do background
|
||||
operations while the guest does anything (in write-blocking mode), and
|
||||
therefore cannot converge. Yes, we also will not diverge, but actually
|
||||
converging would be even nicer.
|
||||
|
||||
It is unclear why we did decide to wait for all active writes to settle
|
||||
before creating a background operation, but it just does not seem
|
||||
necessary. Active writes will put themselves into the in_flight bitmap
|
||||
and thus properly block actually conflicting background requests.
|
||||
|
||||
It is important for active requests to wait on overlapping background
|
||||
requests, which we do in active_write_prepare(). However, so far it was
|
||||
not documented why it is important. Add such documentation now, and
|
||||
also to the other call of mirror_wait_on_conflicts(), so that it becomes
|
||||
more clear why and when requests need to actively wait for other
|
||||
requests to settle.
|
||||
|
||||
Another thing to note is that of course we need to ensure that there are
|
||||
no active requests when the job completes, but that is done by virtue of
|
||||
the BDS being drained anyway, so there cannot be any active requests at
|
||||
that point.
|
||||
|
||||
With this change, we will need to explicitly keep track of how many
|
||||
bytes are in flight in active requests so that
|
||||
job_progress_set_remaining() in mirror_run() can set the correct number
|
||||
of remaining bytes.
|
||||
|
||||
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2123297
|
||||
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||||
Message-Id: <20221109165452.67927-2-hreitz@redhat.com>
|
||||
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
(cherry picked from commit d69a879bdf1aed586478eaa161ee064fe1b92f1a)
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
---
|
||||
block/mirror.c | 37 ++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 30 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/block/mirror.c b/block/mirror.c
|
||||
index efec2c7674..282f428cb7 100644
|
||||
--- a/block/mirror.c
|
||||
+++ b/block/mirror.c
|
||||
@@ -81,6 +81,7 @@ typedef struct MirrorBlockJob {
|
||||
int max_iov;
|
||||
bool initial_zeroing_ongoing;
|
||||
int in_active_write_counter;
|
||||
+ int64_t active_write_bytes_in_flight;
|
||||
bool prepared;
|
||||
bool in_drain;
|
||||
} MirrorBlockJob;
|
||||
@@ -493,6 +494,13 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
|
||||
}
|
||||
bdrv_dirty_bitmap_unlock(s->dirty_bitmap);
|
||||
|
||||
+ /*
|
||||
+ * Wait for concurrent requests to @offset. The next loop will limit the
|
||||
+ * copied area based on in_flight_bitmap so we only copy an area that does
|
||||
+ * not overlap with concurrent in-flight requests. Still, we would like to
|
||||
+ * copy something, so wait until there are at least no more requests to the
|
||||
+ * very beginning of the area.
|
||||
+ */
|
||||
mirror_wait_on_conflicts(NULL, s, offset, 1);
|
||||
|
||||
job_pause_point(&s->common.job);
|
||||
@@ -993,12 +1001,6 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
|
||||
int64_t cnt, delta;
|
||||
bool should_complete;
|
||||
|
||||
- /* Do not start passive operations while there are active
|
||||
- * writes in progress */
|
||||
- while (s->in_active_write_counter) {
|
||||
- mirror_wait_for_any_operation(s, true);
|
||||
- }
|
||||
-
|
||||
if (s->ret < 0) {
|
||||
ret = s->ret;
|
||||
goto immediate_exit;
|
||||
@@ -1015,7 +1017,9 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
|
||||
/* cnt is the number of dirty bytes remaining and s->bytes_in_flight is
|
||||
* the number of bytes currently being processed; together those are
|
||||
* the current remaining operation length */
|
||||
- job_progress_set_remaining(&s->common.job, s->bytes_in_flight + cnt);
|
||||
+ job_progress_set_remaining(&s->common.job,
|
||||
+ s->bytes_in_flight + cnt +
|
||||
+ s->active_write_bytes_in_flight);
|
||||
|
||||
/* Note that even when no rate limit is applied we need to yield
|
||||
* periodically with no pending I/O so that bdrv_drain_all() returns.
|
||||
@@ -1073,6 +1077,10 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
|
||||
|
||||
s->in_drain = true;
|
||||
bdrv_drained_begin(bs);
|
||||
+
|
||||
+ /* Must be zero because we are drained */
|
||||
+ assert(s->in_active_write_counter == 0);
|
||||
+
|
||||
cnt = bdrv_get_dirty_count(s->dirty_bitmap);
|
||||
if (cnt > 0 || mirror_flush(s) < 0) {
|
||||
bdrv_drained_end(bs);
|
||||
@@ -1306,6 +1314,7 @@ do_sync_target_write(MirrorBlockJob *job, MirrorMethod method,
|
||||
}
|
||||
|
||||
job_progress_increase_remaining(&job->common.job, bytes);
|
||||
+ job->active_write_bytes_in_flight += bytes;
|
||||
|
||||
switch (method) {
|
||||
case MIRROR_METHOD_COPY:
|
||||
@@ -1327,6 +1336,7 @@ do_sync_target_write(MirrorBlockJob *job, MirrorMethod method,
|
||||
abort();
|
||||
}
|
||||
|
||||
+ job->active_write_bytes_in_flight -= bytes;
|
||||
if (ret >= 0) {
|
||||
job_progress_update(&job->common.job, bytes);
|
||||
} else {
|
||||
@@ -1375,6 +1385,19 @@ static MirrorOp *coroutine_fn active_write_prepare(MirrorBlockJob *s,
|
||||
|
||||
s->in_active_write_counter++;
|
||||
|
||||
+ /*
|
||||
+ * Wait for concurrent requests affecting the area. If there are already
|
||||
+ * running requests that are copying off now-to-be stale data in the area,
|
||||
+ * we must wait for them to finish before we begin writing fresh data to the
|
||||
+ * target so that the write operations appear in the correct order.
|
||||
+ * Note that background requests (see mirror_iteration()) in contrast only
|
||||
+ * wait for conflicting requests at the start of the dirty area, and then
|
||||
+ * (based on the in_flight_bitmap) truncate the area to copy so it will not
|
||||
+ * conflict with any requests beyond that. For active writes, however, we
|
||||
+ * cannot truncate that area. The request from our parent must be blocked
|
||||
+ * until the area is copied in full. Therefore, we must wait for the whole
|
||||
+ * area to become free of concurrent requests.
|
||||
+ */
|
||||
mirror_wait_on_conflicts(op, s, offset, bytes);
|
||||
|
||||
bitmap_set(s->in_flight_bitmap, start_chunk, end_chunk - start_chunk);
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
From 57c79ed20cb73aa9aa4dd7487379b85ea3f936f6 Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Wed, 9 Nov 2022 17:54:49 +0100
|
||||
Subject: [PATCH 02/11] block/mirror: Drop mirror_wait_for_any_operation()
|
||||
|
||||
RH-Author: Hanna Czenczek <hreitz@redhat.com>
|
||||
RH-MergeRequest: 246: block/mirror: Make active mirror progress even under full load
|
||||
RH-Bugzilla: 2125119
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Commit: [2/3] dec37883bcc491441ae08d9592d1ec26a47765c0
|
||||
|
||||
mirror_wait_for_free_in_flight_slot() is the only remaining user of
|
||||
mirror_wait_for_any_operation(), so inline the latter into the former.
|
||||
|
||||
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||||
Message-Id: <20221109165452.67927-3-hreitz@redhat.com>
|
||||
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
(cherry picked from commit eb994912993077f178ccb43b20e422ecf9ae4ac7)
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
---
|
||||
block/mirror.c | 21 ++++++++-------------
|
||||
1 file changed, 8 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/block/mirror.c b/block/mirror.c
|
||||
index 282f428cb7..6b02555ad7 100644
|
||||
--- a/block/mirror.c
|
||||
+++ b/block/mirror.c
|
||||
@@ -304,19 +304,21 @@ static int mirror_cow_align(MirrorBlockJob *s, int64_t *offset,
|
||||
}
|
||||
|
||||
static inline void coroutine_fn
|
||||
-mirror_wait_for_any_operation(MirrorBlockJob *s, bool active)
|
||||
+mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s)
|
||||
{
|
||||
MirrorOp *op;
|
||||
|
||||
QTAILQ_FOREACH(op, &s->ops_in_flight, next) {
|
||||
- /* Do not wait on pseudo ops, because it may in turn wait on
|
||||
+ /*
|
||||
+ * Do not wait on pseudo ops, because it may in turn wait on
|
||||
* some other operation to start, which may in fact be the
|
||||
* caller of this function. Since there is only one pseudo op
|
||||
* at any given time, we will always find some real operation
|
||||
- * to wait on. */
|
||||
- if (!op->is_pseudo_op && op->is_in_flight &&
|
||||
- op->is_active_write == active)
|
||||
- {
|
||||
+ * to wait on.
|
||||
+ * Also, do not wait on active operations, because they do not
|
||||
+ * use up in-flight slots.
|
||||
+ */
|
||||
+ if (!op->is_pseudo_op && op->is_in_flight && !op->is_active_write) {
|
||||
qemu_co_queue_wait(&op->waiting_requests, NULL);
|
||||
return;
|
||||
}
|
||||
@@ -324,13 +326,6 @@ mirror_wait_for_any_operation(MirrorBlockJob *s, bool active)
|
||||
abort();
|
||||
}
|
||||
|
||||
-static inline void coroutine_fn
|
||||
-mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s)
|
||||
-{
|
||||
- /* Only non-active operations use up in-flight slots */
|
||||
- mirror_wait_for_any_operation(s, false);
|
||||
-}
|
||||
-
|
||||
/* Perform a mirror copy operation.
|
||||
*
|
||||
* *op->bytes_handled is set to the number of bytes copied after and
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
From b1f5aa5a342a25dc558ee9d435fed0643fe5155f Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Wed, 9 Nov 2022 17:54:50 +0100
|
||||
Subject: [PATCH 03/11] block/mirror: Fix NULL s->job in active writes
|
||||
|
||||
RH-Author: Hanna Czenczek <hreitz@redhat.com>
|
||||
RH-MergeRequest: 246: block/mirror: Make active mirror progress even under full load
|
||||
RH-Bugzilla: 2125119
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Commit: [3/3] 49d7ebd15667151a6e14228a8260cfdd0aa27a78
|
||||
|
||||
There is a small gap in mirror_start_job() before putting the mirror
|
||||
filter node into the block graph (bdrv_append() call) and the actual job
|
||||
being created. Before the job is created, MirrorBDSOpaque.job is NULL.
|
||||
|
||||
It is possible that requests come in when bdrv_drained_end() is called,
|
||||
and those requests would see MirrorBDSOpaque.job == NULL. Have our
|
||||
filter node handle that case gracefully.
|
||||
|
||||
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||||
Message-Id: <20221109165452.67927-4-hreitz@redhat.com>
|
||||
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
(cherry picked from commit da93d5c84e56e6b4e84aa8e98b6b984c9b6bb528)
|
||||
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
|
||||
---
|
||||
block/mirror.c | 20 ++++++++++++--------
|
||||
1 file changed, 12 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/block/mirror.c b/block/mirror.c
|
||||
index 6b02555ad7..50289fca49 100644
|
||||
--- a/block/mirror.c
|
||||
+++ b/block/mirror.c
|
||||
@@ -1438,11 +1438,13 @@ static int coroutine_fn bdrv_mirror_top_do_write(BlockDriverState *bs,
|
||||
MirrorOp *op = NULL;
|
||||
MirrorBDSOpaque *s = bs->opaque;
|
||||
int ret = 0;
|
||||
- bool copy_to_target;
|
||||
+ bool copy_to_target = false;
|
||||
|
||||
- copy_to_target = s->job->ret >= 0 &&
|
||||
- !job_is_cancelled(&s->job->common.job) &&
|
||||
- s->job->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING;
|
||||
+ if (s->job) {
|
||||
+ copy_to_target = s->job->ret >= 0 &&
|
||||
+ !job_is_cancelled(&s->job->common.job) &&
|
||||
+ s->job->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING;
|
||||
+ }
|
||||
|
||||
if (copy_to_target) {
|
||||
op = active_write_prepare(s->job, offset, bytes);
|
||||
@@ -1487,11 +1489,13 @@ static int coroutine_fn bdrv_mirror_top_pwritev(BlockDriverState *bs,
|
||||
QEMUIOVector bounce_qiov;
|
||||
void *bounce_buf;
|
||||
int ret = 0;
|
||||
- bool copy_to_target;
|
||||
+ bool copy_to_target = false;
|
||||
|
||||
- copy_to_target = s->job->ret >= 0 &&
|
||||
- !job_is_cancelled(&s->job->common.job) &&
|
||||
- s->job->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING;
|
||||
+ if (s->job) {
|
||||
+ copy_to_target = s->job->ret >= 0 &&
|
||||
+ !job_is_cancelled(&s->job->common.job) &&
|
||||
+ s->job->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING;
|
||||
+ }
|
||||
|
||||
if (copy_to_target) {
|
||||
/* The guest might concurrently modify the data to write; but
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
From 76b03619435d0b2f0125ee7aa5c94f2b889247de Mon Sep 17 00:00:00 2001
|
||||
From d5a85fcf996948d1154e88e9ee3b4e8c64ec2694 Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Fri, 4 Feb 2022 12:10:08 +0100
|
||||
Subject: [PATCH 4/8] block/nbd: Assert there are no timers when closed
|
||||
Subject: [PATCH 2/6] block/nbd: Assert there are no timers when closed
|
||||
|
||||
RH-Author: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-MergeRequest: 74: block/nbd: Handle AioContext changes
|
||||
RH-Commit: [2/6] 56903457ca35d9c596aeb6827a48f80e8eabd66a (hreitz/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2033626
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-MergeRequest: 117: block/nbd: Handle AioContext changes
|
||||
RH-Commit: [2/6] 995795ae9844a7d2b28cb1e57fd7fe81482d0205
|
||||
RH-Bugzilla: 2035185
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
From eeb4683ad8c40a03a4e91463ec1d1b651974b744 Mon Sep 17 00:00:00 2001
|
||||
From 8e23c0f208c6bd5bb64c4f6e4863b93fa6f4e9de Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Fri, 4 Feb 2022 12:10:06 +0100
|
||||
Subject: [PATCH 3/8] block/nbd: Delete reconnect delay timer when done
|
||||
Subject: [PATCH 1/6] block/nbd: Delete reconnect delay timer when done
|
||||
|
||||
RH-Author: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-MergeRequest: 74: block/nbd: Handle AioContext changes
|
||||
RH-Commit: [1/6] 34f92910b6ffd256d781109a2b39737fc6ab449c (hreitz/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2033626
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-MergeRequest: 117: block/nbd: Handle AioContext changes
|
||||
RH-Commit: [1/6] 70814602a8a43a7c14857d76266d82b1aa5174a9
|
||||
RH-Bugzilla: 2035185
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
From 6d9d86cc4e6149d4c0793e8ceb65dab7535a4561 Mon Sep 17 00:00:00 2001
|
||||
From c7f63e7bbc5119d92775e20d1ebbf8280c78b732 Mon Sep 17 00:00:00 2001
|
||||
From: Hanna Reitz <hreitz@redhat.com>
|
||||
Date: Fri, 4 Feb 2022 12:10:11 +0100
|
||||
Subject: [PATCH 7/8] block/nbd: Move s->ioc on AioContext change
|
||||
Subject: [PATCH 5/6] block/nbd: Move s->ioc on AioContext change
|
||||
|
||||
RH-Author: Hanna Reitz <hreitz@redhat.com>
|
||||
RH-MergeRequest: 74: block/nbd: Handle AioContext changes
|
||||
RH-Commit: [5/6] b3c1eb21ac70d64fdac6094468a72cfbe50a30a9 (hreitz/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2033626
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-MergeRequest: 117: block/nbd: Handle AioContext changes
|
||||
RH-Commit: [5/6] 107757b9fbadfb832c75521317108525daa4174e
|
||||
RH-Bugzilla: 2035185
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
From 6989be9d0aa08470f8b287c243dc4bf027d5fbcf Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Date: Wed, 8 Dec 2021 15:22:46 +0000
|
||||
Subject: [PATCH 1/2] block/nvme: fix infinite loop in nvme_free_req_queue_cb()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-MergeRequest: 58: block/nvme: fix infinite loop in nvme_free_req_queue_cb()
|
||||
RH-Commit: [1/1] 544b3f310d791a20c63b51947de0c6cbb60b0d5b (stefanha/centos-stream-qemu-kvm)
|
||||
RH-Bugzilla: 2024544
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
||||
|
||||
When the request free list is exhausted the coroutine waits on
|
||||
q->free_req_queue for the next free request. Whenever a request is
|
||||
completed a BH is scheduled to invoke nvme_free_req_queue_cb() and wake
|
||||
up waiting coroutines.
|
||||
|
||||
1. nvme_get_free_req() waits for a free request:
|
||||
|
||||
while (q->free_req_head == -1) {
|
||||
...
|
||||
trace_nvme_free_req_queue_wait(q->s, q->index);
|
||||
qemu_co_queue_wait(&q->free_req_queue, &q->lock);
|
||||
...
|
||||
}
|
||||
|
||||
2. nvme_free_req_queue_cb() wakes up the coroutine:
|
||||
|
||||
while (qemu_co_enter_next(&q->free_req_queue, &q->lock)) {
|
||||
^--- infinite loop when free_req_head == -1
|
||||
}
|
||||
|
||||
nvme_free_req_queue_cb() and the coroutine form an infinite loop when
|
||||
q->free_req_head == -1. Fix this by checking q->free_req_head in
|
||||
nvme_free_req_queue_cb(). If the free request list is exhausted, don't
|
||||
wake waiting coroutines. Eventually an in-flight request will complete
|
||||
and the BH will be scheduled again, guaranteeing forward progress.
|
||||
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
||||
Message-id: 20211208152246.244585-1-stefanha@redhat.com
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
(cherry picked from commit cf4fbc3030c974fff726756a7ceef8386cdf500b)
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
---
|
||||
block/nvme.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/block/nvme.c b/block/nvme.c
|
||||
index e4f336d79c..fa360b9b3c 100644
|
||||
--- a/block/nvme.c
|
||||
+++ b/block/nvme.c
|
||||
@@ -206,8 +206,9 @@ static void nvme_free_req_queue_cb(void *opaque)
|
||||
NVMeQueuePair *q = opaque;
|
||||
|
||||
qemu_mutex_lock(&q->lock);
|
||||
- while (qemu_co_enter_next(&q->free_req_queue, &q->lock)) {
|
||||
- /* Retry all pending requests */
|
||||
+ while (q->free_req_head != -1 &&
|
||||
+ qemu_co_enter_next(&q->free_req_queue, &q->lock)) {
|
||||
+ /* Retry waiting requests */
|
||||
}
|
||||
qemu_mutex_unlock(&q->lock);
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
From d374d5aa4485a0c62d6b48eec64491cae2fd0873 Mon Sep 17 00:00:00 2001
|
||||
From f4b7133d7aeb1d0b9115d01b5cff4df7f6b24e78 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Lieven <pl@kamp.de>
|
||||
Date: Thu, 13 Jan 2022 15:44:25 +0100
|
||||
Subject: [PATCH 4/5] block/rbd: fix handling of holes in .bdrv_co_block_status
|
||||
Subject: [PATCH 5/6] block/rbd: fix handling of holes in .bdrv_co_block_status
|
||||
|
||||
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-MergeRequest: 68: block/rbd: fix handling of holes in .bdrv_co_block_status
|
||||
RH-Commit: [1/2] 8ef178b01885e3c292f7844ccff865b1a8d4faf0 (sgarzarella/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2034791
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-MergeRequest: 110: block/rbd: fix handling of holes in .bdrv_co_block_status
|
||||
RH-Commit: [1/2] 352656a5c77cc7855b476c3559a10c6aa64a4f58
|
||||
RH-Bugzilla: 2037135
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
From f035b5250529eed8d12e0b93b1b6d6f2c50003f6 Mon Sep 17 00:00:00 2001
|
||||
From 8c50eedf03d8e62acd387b9aa9369dadcea9324c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Lieven <pl@kamp.de>
|
||||
Date: Thu, 13 Jan 2022 15:44:26 +0100
|
||||
Subject: [PATCH 5/5] block/rbd: workaround for ceph issue #53784
|
||||
Subject: [PATCH 6/6] block/rbd: workaround for ceph issue #53784
|
||||
|
||||
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-MergeRequest: 68: block/rbd: fix handling of holes in .bdrv_co_block_status
|
||||
RH-Commit: [2/2] 5feaa2e20a77886cc1a84cdf212ade3dcda28289 (sgarzarella/qemu-kvm-c-9-s)
|
||||
RH-Bugzilla: 2034791
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-MergeRequest: 110: block/rbd: fix handling of holes in .bdrv_co_block_status
|
||||
RH-Commit: [2/2] 1384557462e89bb539d0d25a1a471ad738fb9e89
|
||||
RH-Bugzilla: 2037135
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
||||
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
From 866a3b56f6a2d43f3cf7b3313fb41808bc5e6e1f Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@redhat.com>
|
||||
Date: Tue, 9 May 2023 10:29:03 -0400
|
||||
Subject: [PATCH 03/15] checkpatch: add qemu_bh_new/aio_bh_new checks
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 277: memory: prevent dma-reentracy issues
|
||||
RH-Bugzilla: 1999236
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Commit: [3/12] 620b480b0878c18223f3cc103450bc16aa6d7e21 (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1999236
|
||||
Upstream: Merged
|
||||
CVE: CVE-2021-3750
|
||||
|
||||
commit ef56ffbdd6b0605dc1e305611287b948c970e236
|
||||
Author: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Thu Apr 27 17:10:08 2023 -0400
|
||||
|
||||
checkpatch: add qemu_bh_new/aio_bh_new checks
|
||||
|
||||
Advise authors to use the _guarded versions of the APIs, instead.
|
||||
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
|
||||
Message-Id: <20230427211013.2994127-4-alxndr@bu.edu>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
scripts/checkpatch.pl | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
|
||||
index cb8eff233e..b2428e80cc 100755
|
||||
--- a/scripts/checkpatch.pl
|
||||
+++ b/scripts/checkpatch.pl
|
||||
@@ -2858,6 +2858,14 @@ sub process {
|
||||
if ($line =~ /\bsignal\s*\(/ && !($line =~ /SIG_(?:IGN|DFL)/)) {
|
||||
ERROR("use sigaction to establish signal handlers; signal is not portable\n" . $herecurr);
|
||||
}
|
||||
+# recommend qemu_bh_new_guarded instead of qemu_bh_new
|
||||
+ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\bqemu_bh_new\s*\(/) {
|
||||
+ ERROR("use qemu_bh_new_guarded() instead of qemu_bh_new() to avoid reentrancy problems\n" . $herecurr);
|
||||
+ }
|
||||
+# recommend aio_bh_new_guarded instead of aio_bh_new
|
||||
+ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\baio_bh_new\s*\(/) {
|
||||
+ ERROR("use aio_bh_new_guarded() instead of aio_bh_new() to avoid reentrancy problems\n" . $herecurr);
|
||||
+ }
|
||||
# check for module_init(), use category-specific init macros explicitly please
|
||||
if ($line =~ /^module_init\s*\(/) {
|
||||
ERROR("please use block_init(), type_init() etc. instead of module_init()\n" . $herecurr);
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From abd84f26e0fe0bc9952d91fbd35fb3a7253cfecf Mon Sep 17 00:00:00 2001
|
||||
From: Jon Maloy <jmaloy@rehat.com>
|
||||
Date: Wed, 13 Apr 2022 20:54:45 -0400
|
||||
Subject: [PATCH 1/2] display/qxl-render: fix race condition in qxl_cursor
|
||||
(CVE-2021-4207)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-MergeRequest: 152: display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
|
||||
RH-Commit: [1/1] f05b9a956f2e0ca522b5be127beff813d04b5588 (jmaloy/qemu-kvm)
|
||||
RH-Bugzilla: 2040738
|
||||
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
RH-Acked-by: Mauro Matteo Cascella <None>
|
||||
|
||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2040738
|
||||
Upstream: Merged
|
||||
CVE: CVE-2021-4207
|
||||
|
||||
commit 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895
|
||||
Author: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Date: Thu Apr 7 10:11:06 2022 +0200
|
||||
|
||||
display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
|
||||
|
||||
Avoid fetching 'width' and 'height' a second time to prevent possible
|
||||
race condition. Refer to security advisory
|
||||
https://starlabs.sg/advisories/22-4207/ for more information.
|
||||
|
||||
Fixes: CVE-2021-4207
|
||||
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220407081106.343235-1-mcascell@redhat.com>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
(cherry picked from commit 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895)
|
||||
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
||||
---
|
||||
hw/display/qxl-render.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
|
||||
index d28849b121..237ed293ba 100644
|
||||
--- a/hw/display/qxl-render.c
|
||||
+++ b/hw/display/qxl-render.c
|
||||
@@ -266,7 +266,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
|
||||
}
|
||||
break;
|
||||
case SPICE_CURSOR_TYPE_ALPHA:
|
||||
- size = sizeof(uint32_t) * cursor->header.width * cursor->header.height;
|
||||
+ size = sizeof(uint32_t) * c->width * c->height;
|
||||
qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id);
|
||||
if (qxl->debug > 2) {
|
||||
cursor_print_ascii_art(c, "qxl/alpha");
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
From 103608465b8bd2edf7f9aaef5c3c93309ccf9ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Date: Tue, 21 Feb 2023 16:22:17 -0500
|
||||
Subject: [PATCH 12/13] dma-helpers: prevent dma_blk_cb() vs dma_aio_cancel()
|
||||
race
|
||||
|
||||
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-MergeRequest: 264: scsi: protect req->aiocb with AioContext lock
|
||||
RH-Bugzilla: 2090990
|
||||
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Commit: [2/3] 14f5835093ba8c5111f3ada2fe87730371aca733
|
||||
|
||||
dma_blk_cb() only takes the AioContext lock around ->io_func(). That
|
||||
means the rest of dma_blk_cb() is not protected. In particular, the
|
||||
DMAAIOCB field accesses happen outside the lock.
|
||||
|
||||
There is a race when the main loop thread holds the AioContext lock and
|
||||
invokes scsi_device_purge_requests() -> bdrv_aio_cancel() ->
|
||||
dma_aio_cancel() while an IOThread executes dma_blk_cb(). The dbs->acb
|
||||
field determines how cancellation proceeds. If dma_aio_cancel() sees
|
||||
dbs->acb == NULL while dma_blk_cb() is still running, the request can be
|
||||
completed twice (-ECANCELED and the actual return value).
|
||||
|
||||
The following assertion can occur with virtio-scsi when an IOThread is
|
||||
used:
|
||||
|
||||
../hw/scsi/scsi-disk.c:368: scsi_dma_complete: Assertion `r->req.aiocb != NULL' failed.
|
||||
|
||||
Fix the race by holding the AioContext across dma_blk_cb(). Now
|
||||
dma_aio_cancel() under the AioContext lock will not see
|
||||
inconsistent/intermediate states.
|
||||
|
||||
Cc: Paolo Bonzini <pbonzini@redhat.com>
|
||||
Reviewed-by: Eric Blake <eblake@redhat.com>
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Message-Id: <20230221212218.1378734-3-stefanha@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
(cherry picked from commit abfcd2760b3e70727bbc0792221b8b98a733dc32)
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
---
|
||||
hw/scsi/scsi-disk.c | 4 +---
|
||||
softmmu/dma-helpers.c | 12 +++++++-----
|
||||
2 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
|
||||
index 179ce22c4a..c8109a673e 100644
|
||||
--- a/hw/scsi/scsi-disk.c
|
||||
+++ b/hw/scsi/scsi-disk.c
|
||||
@@ -351,13 +351,12 @@ done:
|
||||
scsi_req_unref(&r->req);
|
||||
}
|
||||
|
||||
+/* Called with AioContext lock held */
|
||||
static void scsi_dma_complete(void *opaque, int ret)
|
||||
{
|
||||
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
|
||||
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
|
||||
|
||||
- aio_context_acquire(blk_get_aio_context(s->qdev.conf.blk));
|
||||
-
|
||||
assert(r->req.aiocb != NULL);
|
||||
r->req.aiocb = NULL;
|
||||
|
||||
@@ -367,7 +366,6 @@ static void scsi_dma_complete(void *opaque, int ret)
|
||||
block_acct_done(blk_get_stats(s->qdev.conf.blk), &r->acct);
|
||||
}
|
||||
scsi_dma_complete_noio(r, ret);
|
||||
- aio_context_release(blk_get_aio_context(s->qdev.conf.blk));
|
||||
}
|
||||
|
||||
static void scsi_read_complete_noio(SCSIDiskReq *r, int ret)
|
||||
diff --git a/softmmu/dma-helpers.c b/softmmu/dma-helpers.c
|
||||
index 7d766a5e89..42af18719a 100644
|
||||
--- a/softmmu/dma-helpers.c
|
||||
+++ b/softmmu/dma-helpers.c
|
||||
@@ -127,17 +127,19 @@ static void dma_complete(DMAAIOCB *dbs, int ret)
|
||||
static void dma_blk_cb(void *opaque, int ret)
|
||||
{
|
||||
DMAAIOCB *dbs = (DMAAIOCB *)opaque;
|
||||
+ AioContext *ctx = dbs->ctx;
|
||||
dma_addr_t cur_addr, cur_len;
|
||||
void *mem;
|
||||
|
||||
trace_dma_blk_cb(dbs, ret);
|
||||
|
||||
+ aio_context_acquire(ctx);
|
||||
dbs->acb = NULL;
|
||||
dbs->offset += dbs->iov.size;
|
||||
|
||||
if (dbs->sg_cur_index == dbs->sg->nsg || ret < 0) {
|
||||
dma_complete(dbs, ret);
|
||||
- return;
|
||||
+ goto out;
|
||||
}
|
||||
dma_blk_unmap(dbs);
|
||||
|
||||
@@ -177,9 +179,9 @@ static void dma_blk_cb(void *opaque, int ret)
|
||||
|
||||
if (dbs->iov.size == 0) {
|
||||
trace_dma_map_wait(dbs);
|
||||
- dbs->bh = aio_bh_new(dbs->ctx, reschedule_dma, dbs);
|
||||
+ dbs->bh = aio_bh_new(ctx, reschedule_dma, dbs);
|
||||
cpu_register_map_client(dbs->bh);
|
||||
- return;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
if (!QEMU_IS_ALIGNED(dbs->iov.size, dbs->align)) {
|
||||
@@ -187,11 +189,11 @@ static void dma_blk_cb(void *opaque, int ret)
|
||||
QEMU_ALIGN_DOWN(dbs->iov.size, dbs->align));
|
||||
}
|
||||
|
||||
- aio_context_acquire(dbs->ctx);
|
||||
dbs->acb = dbs->io_func(dbs->offset, &dbs->iov,
|
||||
dma_blk_cb, dbs, dbs->io_func_opaque);
|
||||
- aio_context_release(dbs->ctx);
|
||||
assert(dbs->acb);
|
||||
+out:
|
||||
+ aio_context_release(ctx);
|
||||
}
|
||||
|
||||
static void dma_aio_cancel(BlockAIOCB *acb)
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
From eb88a12ab1ecfe77bcc0d0067c96fce27a3bde01 Mon Sep 17 00:00:00 2001
|
||||
From e8377e3f4d540e2594a50985523e87d1f3cabbc7 Mon Sep 17 00:00:00 2001
|
||||
From: Yang Zhong <yang.zhong@intel.com>
|
||||
Date: Mon, 1 Nov 2021 12:20:08 -0400
|
||||
Subject: [PATCH 03/12] doc: Add the SGX numa description
|
||||
Subject: [PATCH 3/7] doc: Add the SGX numa description
|
||||
|
||||
RH-Author: Paul Lai <plai@redhat.com>
|
||||
RH-MergeRequest: 65: Enable SGX and add SGX Numa support
|
||||
RH-Commit: [3/5] c27b3f6976cbe92cc3c0e1dab0191cdd25de596a
|
||||
RH-Bugzilla: 2033708
|
||||
RH-Author: Paul Lai <None>
|
||||
RH-MergeRequest: 111: numa: Enable numa for SGX EPC sections
|
||||
RH-Commit: [3/5] 41c74688c9662b966c243566a837135ff52341c4
|
||||
RH-Bugzilla: 1518984
|
||||
RH-Acked-by: Paolo Bonzini <None>
|
||||
RH-Acked-by: Bandan Das <None>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
From 407e23d7f0c9020404247afe7d4df98505222bbb Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Huth <thuth@redhat.com>
|
||||
Date: Mon, 14 Nov 2022 14:25:02 +0100
|
||||
Subject: [PATCH 1/3] docs/system/s390x: Document the "loadparm" machine
|
||||
property
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Thomas Huth <thuth@redhat.com>
|
||||
RH-MergeRequest: 233: s390x: Document the "loadparm" machine property
|
||||
RH-Bugzilla: 2128225
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Cédric Le Goater <clg@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [1/2] e9589ea32d2a8f82971476b644e1063fa14cf822
|
||||
|
||||
The "loadparm" machine property is useful for selecting alternative
|
||||
kernels on the disk of the guest, but so far we do not tell the users
|
||||
yet how to use it. Add some documentation to fill this gap.
|
||||
|
||||
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2128235
|
||||
Message-Id: <20221114132502.110213-1-thuth@redhat.com>
|
||||
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
(cherry picked from commit be5df2edb5d69ff3107c5616aa035a9ba8d0422e)
|
||||
---
|
||||
docs/system/s390x/bootdevices.rst | 26 ++++++++++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevices.rst
|
||||
index 9e591cb9dc..d4bf3b9f0b 100644
|
||||
--- a/docs/system/s390x/bootdevices.rst
|
||||
+++ b/docs/system/s390x/bootdevices.rst
|
||||
@@ -53,6 +53,32 @@ recommended to specify a CD-ROM device via ``-device scsi-cd`` (as mentioned
|
||||
above) instead.
|
||||
|
||||
|
||||
+Selecting kernels with the ``loadparm`` property
|
||||
+------------------------------------------------
|
||||
+
|
||||
+The ``s390-ccw-virtio`` machine supports the so-called ``loadparm`` parameter
|
||||
+which can be used to select the kernel on the disk of the guest that the
|
||||
+s390-ccw bios should boot. When starting QEMU, it can be specified like this::
|
||||
+
|
||||
+ qemu-system-s390x -machine s390-ccw-virtio,loadparm=<string>
|
||||
+
|
||||
+The first way to use this parameter is to use the word ``PROMPT`` as the
|
||||
+``<string>`` here. In that case the s390-ccw bios will show a list of
|
||||
+installed kernels on the disk of the guest and ask the user to enter a number
|
||||
+to chose which kernel should be booted -- similar to what can be achieved by
|
||||
+specifying the ``-boot menu=on`` option when starting QEMU. Note that the menu
|
||||
+list will only show the names of the installed kernels when using a DASD-like
|
||||
+disk image with 4k byte sectors. On normal SCSI-style disks with 512-byte
|
||||
+sectors, there is not enough space for the zipl loader on the disk to store
|
||||
+the kernel names, so you only get a list without names here.
|
||||
+
|
||||
+The second way to use this parameter is to use a number in the range from 0
|
||||
+to 31. The numbers that can be used here correspond to the numbers that are
|
||||
+shown when using the ``PROMPT`` option, and the s390-ccw bios will then try
|
||||
+to automatically boot the kernel that is associated with the given number.
|
||||
+Note that ``0`` can be used to boot the default entry.
|
||||
+
|
||||
+
|
||||
Booting from a network device
|
||||
-----------------------------
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
From 837e09b1a8a38b53488f59aad090fbe6bb94e257 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Huth <thuth@redhat.com>
|
||||
Date: Fri, 17 Nov 2023 11:32:37 +0100
|
||||
Subject: [PATCH 2/3] dump: Add arch cleanup function
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Thomas Huth <thuth@redhat.com>
|
||||
RH-MergeRequest: 323: Fix problem that secure execution guest might remain in "paused" state after failed dump
|
||||
RH-Jira: RHEL-16696
|
||||
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
RH-Acked-by: Cédric Le Goater <clg@redhat.com>
|
||||
RH-Commit: [2/3] b70f406dec88ffd4877f3d5d580fc8f821bdb252
|
||||
|
||||
JIRA: https://issues.redhat.com/browse/RHEL-16696
|
||||
|
||||
commit e72629e5149aba6f44122ea6d2a803ef136a0c6b
|
||||
Author: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Thu Nov 9 12:04:42 2023 +0000
|
||||
|
||||
dump: Add arch cleanup function
|
||||
|
||||
Some architectures (s390x) need to cleanup after a failed dump to be
|
||||
able to continue to run the vm. Add a cleanup function pointer and
|
||||
call it if it's set.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-ID: <20231109120443.185979-3-frankja@linux.ibm.com>
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
|
||||
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||||
---
|
||||
dump/dump.c | 4 ++++
|
||||
include/sysemu/dump-arch.h | 1 +
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 5dee060b73..93edb89547 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -100,6 +100,10 @@ uint64_t cpu_to_dump64(DumpState *s, uint64_t val)
|
||||
|
||||
static int dump_cleanup(DumpState *s)
|
||||
{
|
||||
+ if (s->dump_info.arch_cleanup_fn) {
|
||||
+ s->dump_info.arch_cleanup_fn(s);
|
||||
+ }
|
||||
+
|
||||
guest_phys_blocks_free(&s->guest_phys_blocks);
|
||||
memory_mapping_list_free(&s->list);
|
||||
close(s->fd);
|
||||
diff --git a/include/sysemu/dump-arch.h b/include/sysemu/dump-arch.h
|
||||
index 59bbc9be38..743916e46c 100644
|
||||
--- a/include/sysemu/dump-arch.h
|
||||
+++ b/include/sysemu/dump-arch.h
|
||||
@@ -24,6 +24,7 @@ typedef struct ArchDumpInfo {
|
||||
void (*arch_sections_add_fn)(DumpState *s);
|
||||
uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff);
|
||||
int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff);
|
||||
+ void (*arch_cleanup_fn)(DumpState *s);
|
||||
} ArchDumpInfo;
|
||||
|
||||
struct GuestPhysBlockList; /* memory_mapping.h */
|
||||
--
|
||||
2.39.3
|
||||
|
|
@ -0,0 +1,356 @@
|
|||
From f2f3efff83dddd38a97699cd2701f46f61a732e3 Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Mon, 17 Oct 2022 11:32:10 +0000
|
||||
Subject: [PATCH 36/42] dump: Add architecture section and section string table
|
||||
support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [36/41] 83b98ff185e93e62703f686b65546d60c783d783
|
||||
|
||||
Add hooks which architectures can use to add arbitrary data to custom
|
||||
sections.
|
||||
|
||||
Also add a section name string table in order to identify section
|
||||
contents
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20221017113210.41674-1-frankja@linux.ibm.com>
|
||||
(cherry picked from commit 9b72224f44612ddd5b434a1bccf79346946d11da)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 186 +++++++++++++++++++++++++++++++------
|
||||
include/sysemu/dump-arch.h | 3 +
|
||||
include/sysemu/dump.h | 3 +
|
||||
3 files changed, 166 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 7a42401790..4aa8fb64d2 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -104,6 +104,7 @@ static int dump_cleanup(DumpState *s)
|
||||
memory_mapping_list_free(&s->list);
|
||||
close(s->fd);
|
||||
g_free(s->guest_note);
|
||||
+ g_array_unref(s->string_table_buf);
|
||||
s->guest_note = NULL;
|
||||
if (s->resume) {
|
||||
if (s->detached) {
|
||||
@@ -153,11 +154,10 @@ static void prepare_elf64_header(DumpState *s, Elf64_Ehdr *elf_header)
|
||||
elf_header->e_phoff = cpu_to_dump64(s, s->phdr_offset);
|
||||
elf_header->e_phentsize = cpu_to_dump16(s, sizeof(Elf64_Phdr));
|
||||
elf_header->e_phnum = cpu_to_dump16(s, phnum);
|
||||
- if (s->shdr_num) {
|
||||
- elf_header->e_shoff = cpu_to_dump64(s, s->shdr_offset);
|
||||
- elf_header->e_shentsize = cpu_to_dump16(s, sizeof(Elf64_Shdr));
|
||||
- elf_header->e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
- }
|
||||
+ elf_header->e_shoff = cpu_to_dump64(s, s->shdr_offset);
|
||||
+ elf_header->e_shentsize = cpu_to_dump16(s, sizeof(Elf64_Shdr));
|
||||
+ elf_header->e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
+ elf_header->e_shstrndx = cpu_to_dump16(s, s->shdr_num - 1);
|
||||
}
|
||||
|
||||
static void prepare_elf32_header(DumpState *s, Elf32_Ehdr *elf_header)
|
||||
@@ -181,11 +181,10 @@ static void prepare_elf32_header(DumpState *s, Elf32_Ehdr *elf_header)
|
||||
elf_header->e_phoff = cpu_to_dump32(s, s->phdr_offset);
|
||||
elf_header->e_phentsize = cpu_to_dump16(s, sizeof(Elf32_Phdr));
|
||||
elf_header->e_phnum = cpu_to_dump16(s, phnum);
|
||||
- if (s->shdr_num) {
|
||||
- elf_header->e_shoff = cpu_to_dump32(s, s->shdr_offset);
|
||||
- elf_header->e_shentsize = cpu_to_dump16(s, sizeof(Elf32_Shdr));
|
||||
- elf_header->e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
- }
|
||||
+ elf_header->e_shoff = cpu_to_dump32(s, s->shdr_offset);
|
||||
+ elf_header->e_shentsize = cpu_to_dump16(s, sizeof(Elf32_Shdr));
|
||||
+ elf_header->e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
+ elf_header->e_shstrndx = cpu_to_dump16(s, s->shdr_num - 1);
|
||||
}
|
||||
|
||||
static void write_elf_header(DumpState *s, Error **errp)
|
||||
@@ -196,6 +195,8 @@ static void write_elf_header(DumpState *s, Error **errp)
|
||||
void *header_ptr;
|
||||
int ret;
|
||||
|
||||
+ /* The NULL header and the shstrtab are always defined */
|
||||
+ assert(s->shdr_num >= 2);
|
||||
if (dump_is_64bit(s)) {
|
||||
prepare_elf64_header(s, &elf64_header);
|
||||
header_size = sizeof(elf64_header);
|
||||
@@ -394,17 +395,49 @@ static void prepare_elf_section_hdr_zero(DumpState *s)
|
||||
}
|
||||
}
|
||||
|
||||
-static void prepare_elf_section_hdrs(DumpState *s)
|
||||
+static void prepare_elf_section_hdr_string(DumpState *s, void *buff)
|
||||
+{
|
||||
+ uint64_t index = s->string_table_buf->len;
|
||||
+ const char strtab[] = ".shstrtab";
|
||||
+ Elf32_Shdr shdr32 = {};
|
||||
+ Elf64_Shdr shdr64 = {};
|
||||
+ int shdr_size;
|
||||
+ void *shdr;
|
||||
+
|
||||
+ g_array_append_vals(s->string_table_buf, strtab, sizeof(strtab));
|
||||
+ if (dump_is_64bit(s)) {
|
||||
+ shdr_size = sizeof(Elf64_Shdr);
|
||||
+ shdr64.sh_type = SHT_STRTAB;
|
||||
+ shdr64.sh_offset = s->section_offset + s->elf_section_data_size;
|
||||
+ shdr64.sh_name = index;
|
||||
+ shdr64.sh_size = s->string_table_buf->len;
|
||||
+ shdr = &shdr64;
|
||||
+ } else {
|
||||
+ shdr_size = sizeof(Elf32_Shdr);
|
||||
+ shdr32.sh_type = SHT_STRTAB;
|
||||
+ shdr32.sh_offset = s->section_offset + s->elf_section_data_size;
|
||||
+ shdr32.sh_name = index;
|
||||
+ shdr32.sh_size = s->string_table_buf->len;
|
||||
+ shdr = &shdr32;
|
||||
+ }
|
||||
+ memcpy(buff, shdr, shdr_size);
|
||||
+}
|
||||
+
|
||||
+static bool prepare_elf_section_hdrs(DumpState *s, Error **errp)
|
||||
{
|
||||
size_t len, sizeof_shdr;
|
||||
+ void *buff_hdr;
|
||||
|
||||
/*
|
||||
* Section ordering:
|
||||
* - HDR zero
|
||||
+ * - Arch section hdrs
|
||||
+ * - String table hdr
|
||||
*/
|
||||
sizeof_shdr = dump_is_64bit(s) ? sizeof(Elf64_Shdr) : sizeof(Elf32_Shdr);
|
||||
len = sizeof_shdr * s->shdr_num;
|
||||
s->elf_section_hdrs = g_malloc0(len);
|
||||
+ buff_hdr = s->elf_section_hdrs;
|
||||
|
||||
/*
|
||||
* The first section header is ALWAYS a special initial section
|
||||
@@ -420,6 +453,26 @@ static void prepare_elf_section_hdrs(DumpState *s)
|
||||
if (s->phdr_num >= PN_XNUM) {
|
||||
prepare_elf_section_hdr_zero(s);
|
||||
}
|
||||
+ buff_hdr += sizeof_shdr;
|
||||
+
|
||||
+ /* Add architecture defined section headers */
|
||||
+ if (s->dump_info.arch_sections_write_hdr_fn
|
||||
+ && s->shdr_num > 2) {
|
||||
+ buff_hdr += s->dump_info.arch_sections_write_hdr_fn(s, buff_hdr);
|
||||
+
|
||||
+ if (s->shdr_num >= SHN_LORESERVE) {
|
||||
+ error_setg_errno(errp, EINVAL,
|
||||
+ "dump: too many architecture defined sections");
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * String table is the last section since strings are added via
|
||||
+ * arch_sections_write_hdr().
|
||||
+ */
|
||||
+ prepare_elf_section_hdr_string(s, buff_hdr);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
static void write_elf_section_headers(DumpState *s, Error **errp)
|
||||
@@ -427,7 +480,9 @@ static void write_elf_section_headers(DumpState *s, Error **errp)
|
||||
size_t sizeof_shdr = dump_is_64bit(s) ? sizeof(Elf64_Shdr) : sizeof(Elf32_Shdr);
|
||||
int ret;
|
||||
|
||||
- prepare_elf_section_hdrs(s);
|
||||
+ if (!prepare_elf_section_hdrs(s, errp)) {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
ret = fd_write_vmcore(s->elf_section_hdrs, s->shdr_num * sizeof_shdr, s);
|
||||
if (ret < 0) {
|
||||
@@ -437,6 +492,29 @@ static void write_elf_section_headers(DumpState *s, Error **errp)
|
||||
g_free(s->elf_section_hdrs);
|
||||
}
|
||||
|
||||
+static void write_elf_sections(DumpState *s, Error **errp)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ if (s->elf_section_data_size) {
|
||||
+ /* Write architecture section data */
|
||||
+ ret = fd_write_vmcore(s->elf_section_data,
|
||||
+ s->elf_section_data_size, s);
|
||||
+ if (ret < 0) {
|
||||
+ error_setg_errno(errp, -ret,
|
||||
+ "dump: failed to write architecture section data");
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Write string table */
|
||||
+ ret = fd_write_vmcore(s->string_table_buf->data,
|
||||
+ s->string_table_buf->len, s);
|
||||
+ if (ret < 0) {
|
||||
+ error_setg_errno(errp, -ret, "dump: failed to write string table data");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void write_data(DumpState *s, void *buf, int length, Error **errp)
|
||||
{
|
||||
int ret;
|
||||
@@ -693,6 +771,31 @@ static void dump_iterate(DumpState *s, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
+static void dump_end(DumpState *s, Error **errp)
|
||||
+{
|
||||
+ int rc;
|
||||
+ ERRP_GUARD();
|
||||
+
|
||||
+ if (s->elf_section_data_size) {
|
||||
+ s->elf_section_data = g_malloc0(s->elf_section_data_size);
|
||||
+ }
|
||||
+
|
||||
+ /* Adds the architecture defined section data to s->elf_section_data */
|
||||
+ if (s->dump_info.arch_sections_write_fn &&
|
||||
+ s->elf_section_data_size) {
|
||||
+ rc = s->dump_info.arch_sections_write_fn(s, s->elf_section_data);
|
||||
+ if (rc) {
|
||||
+ error_setg_errno(errp, rc,
|
||||
+ "dump: failed to get arch section data");
|
||||
+ g_free(s->elf_section_data);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* write sections to vmcore */
|
||||
+ write_elf_sections(s, errp);
|
||||
+}
|
||||
+
|
||||
static void create_vmcore(DumpState *s, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
@@ -702,7 +805,14 @@ static void create_vmcore(DumpState *s, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* Iterate over memory and dump it to file */
|
||||
dump_iterate(s, errp);
|
||||
+ if (*errp) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Write the section data */
|
||||
+ dump_end(s, errp);
|
||||
}
|
||||
|
||||
static int write_start_flat_header(int fd)
|
||||
@@ -1720,6 +1830,14 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
s->filter_area_begin = begin;
|
||||
s->filter_area_length = length;
|
||||
|
||||
+ /* First index is 0, it's the special null name */
|
||||
+ s->string_table_buf = g_array_new(FALSE, TRUE, 1);
|
||||
+ /*
|
||||
+ * Allocate the null name, due to the clearing option set to true
|
||||
+ * it will be 0.
|
||||
+ */
|
||||
+ g_array_set_size(s->string_table_buf, 1);
|
||||
+
|
||||
memory_mapping_list_init(&s->list);
|
||||
|
||||
guest_phys_blocks_init(&s->guest_phys_blocks);
|
||||
@@ -1856,26 +1974,42 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
}
|
||||
|
||||
/*
|
||||
- * calculate phdr_num
|
||||
+ * The first section header is always a special one in which most
|
||||
+ * fields are 0. The section header string table is also always
|
||||
+ * set.
|
||||
+ */
|
||||
+ s->shdr_num = 2;
|
||||
+
|
||||
+ /*
|
||||
+ * Adds the number of architecture sections to shdr_num and sets
|
||||
+ * elf_section_data_size so we know the offsets and sizes of all
|
||||
+ * parts.
|
||||
+ */
|
||||
+ if (s->dump_info.arch_sections_add_fn) {
|
||||
+ s->dump_info.arch_sections_add_fn(s);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * calculate shdr_num so we know the offsets and sizes of all
|
||||
+ * parts.
|
||||
+ * Calculate phdr_num
|
||||
*
|
||||
- * the type of ehdr->e_phnum is uint16_t, so we should avoid overflow
|
||||
+ * The absolute maximum amount of phdrs is UINT32_MAX - 1 as
|
||||
+ * sh_info is 32 bit. There's special handling once we go over
|
||||
+ * UINT16_MAX - 1 but that is handled in the ehdr and section
|
||||
+ * code.
|
||||
*/
|
||||
- s->phdr_num = 1; /* PT_NOTE */
|
||||
- if (s->list.num < UINT16_MAX - 2) {
|
||||
- s->shdr_num = 0;
|
||||
+ s->phdr_num = 1; /* Reserve PT_NOTE */
|
||||
+ if (s->list.num <= UINT32_MAX - 1) {
|
||||
s->phdr_num += s->list.num;
|
||||
} else {
|
||||
- /* sh_info of section 0 holds the real number of phdrs */
|
||||
- s->shdr_num = 1;
|
||||
-
|
||||
- /* the type of shdr->sh_info is uint32_t, so we should avoid overflow */
|
||||
- if (s->list.num <= UINT32_MAX - 1) {
|
||||
- s->phdr_num += s->list.num;
|
||||
- } else {
|
||||
- s->phdr_num = UINT32_MAX;
|
||||
- }
|
||||
+ s->phdr_num = UINT32_MAX;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Now that the number of section and program headers is known we
|
||||
+ * can calculate the offsets of the headers and data.
|
||||
+ */
|
||||
if (dump_is_64bit(s)) {
|
||||
s->shdr_offset = sizeof(Elf64_Ehdr);
|
||||
s->phdr_offset = s->shdr_offset + sizeof(Elf64_Shdr) * s->shdr_num;
|
||||
diff --git a/include/sysemu/dump-arch.h b/include/sysemu/dump-arch.h
|
||||
index e25b02e990..59bbc9be38 100644
|
||||
--- a/include/sysemu/dump-arch.h
|
||||
+++ b/include/sysemu/dump-arch.h
|
||||
@@ -21,6 +21,9 @@ typedef struct ArchDumpInfo {
|
||||
uint32_t page_size; /* The target's page size. If it's variable and
|
||||
* unknown, then this should be the maximum. */
|
||||
uint64_t phys_base; /* The target's physmem base. */
|
||||
+ void (*arch_sections_add_fn)(DumpState *s);
|
||||
+ uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff);
|
||||
+ int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff);
|
||||
} ArchDumpInfo;
|
||||
|
||||
struct GuestPhysBlockList; /* memory_mapping.h */
|
||||
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
|
||||
index 9ed811b313..38ccac7190 100644
|
||||
--- a/include/sysemu/dump.h
|
||||
+++ b/include/sysemu/dump.h
|
||||
@@ -180,6 +180,9 @@ typedef struct DumpState {
|
||||
hwaddr note_offset;
|
||||
|
||||
void *elf_section_hdrs; /* Pointer to section header buffer */
|
||||
+ void *elf_section_data; /* Pointer to section data buffer */
|
||||
+ uint64_t elf_section_data_size; /* Size of section data */
|
||||
+ GArray *string_table_buf; /* String table data buffer */
|
||||
|
||||
uint8_t *note_buf; /* buffer for notes */
|
||||
size_t note_buf_offset; /* the writing place in note_buf */
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
From bee31226b87d0b05faae84e88cce3af1b8dabbfd Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Wed, 30 Mar 2022 12:35:59 +0000
|
||||
Subject: [PATCH 17/42] dump: Add more offset variables
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [17/41] fbe629e1476e8a0e039f989af6e1f4707075ba01
|
||||
|
||||
Offset calculations are easy enough to get wrong. Let's add a few
|
||||
variables to make moving around elf headers and data sections easier.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Message-Id: <20220330123603.107120-6-frankja@linux.ibm.com>
|
||||
(cherry picked from commit e71d353360bb09a8e784e35d78370c691f6ea185)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 35 +++++++++++++++--------------------
|
||||
include/sysemu/dump.h | 4 ++++
|
||||
2 files changed, 19 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 5cc2322325..85a402b38c 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -142,13 +142,11 @@ static void write_elf64_header(DumpState *s, Error **errp)
|
||||
elf_header.e_machine = cpu_to_dump16(s, s->dump_info.d_machine);
|
||||
elf_header.e_version = cpu_to_dump32(s, EV_CURRENT);
|
||||
elf_header.e_ehsize = cpu_to_dump16(s, sizeof(elf_header));
|
||||
- elf_header.e_phoff = cpu_to_dump64(s, sizeof(Elf64_Ehdr));
|
||||
+ elf_header.e_phoff = cpu_to_dump64(s, s->phdr_offset);
|
||||
elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf64_Phdr));
|
||||
elf_header.e_phnum = cpu_to_dump16(s, phnum);
|
||||
if (s->shdr_num) {
|
||||
- uint64_t shoff = sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) * s->phdr_num;
|
||||
-
|
||||
- elf_header.e_shoff = cpu_to_dump64(s, shoff);
|
||||
+ elf_header.e_shoff = cpu_to_dump64(s, s->shdr_offset);
|
||||
elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf64_Shdr));
|
||||
elf_header.e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
}
|
||||
@@ -179,13 +177,11 @@ static void write_elf32_header(DumpState *s, Error **errp)
|
||||
elf_header.e_machine = cpu_to_dump16(s, s->dump_info.d_machine);
|
||||
elf_header.e_version = cpu_to_dump32(s, EV_CURRENT);
|
||||
elf_header.e_ehsize = cpu_to_dump16(s, sizeof(elf_header));
|
||||
- elf_header.e_phoff = cpu_to_dump32(s, sizeof(Elf32_Ehdr));
|
||||
+ elf_header.e_phoff = cpu_to_dump32(s, s->phdr_offset);
|
||||
elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf32_Phdr));
|
||||
elf_header.e_phnum = cpu_to_dump16(s, phnum);
|
||||
if (s->shdr_num) {
|
||||
- uint32_t shoff = sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr) * s->phdr_num;
|
||||
-
|
||||
- elf_header.e_shoff = cpu_to_dump32(s, shoff);
|
||||
+ elf_header.e_shoff = cpu_to_dump32(s, s->shdr_offset);
|
||||
elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf32_Shdr));
|
||||
elf_header.e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
}
|
||||
@@ -248,12 +244,11 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
|
||||
static void write_elf64_note(DumpState *s, Error **errp)
|
||||
{
|
||||
Elf64_Phdr phdr;
|
||||
- hwaddr begin = s->memory_offset - s->note_size;
|
||||
int ret;
|
||||
|
||||
memset(&phdr, 0, sizeof(Elf64_Phdr));
|
||||
phdr.p_type = cpu_to_dump32(s, PT_NOTE);
|
||||
- phdr.p_offset = cpu_to_dump64(s, begin);
|
||||
+ phdr.p_offset = cpu_to_dump64(s, s->note_offset);
|
||||
phdr.p_paddr = 0;
|
||||
phdr.p_filesz = cpu_to_dump64(s, s->note_size);
|
||||
phdr.p_memsz = cpu_to_dump64(s, s->note_size);
|
||||
@@ -313,13 +308,12 @@ static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
|
||||
|
||||
static void write_elf32_note(DumpState *s, Error **errp)
|
||||
{
|
||||
- hwaddr begin = s->memory_offset - s->note_size;
|
||||
Elf32_Phdr phdr;
|
||||
int ret;
|
||||
|
||||
memset(&phdr, 0, sizeof(Elf32_Phdr));
|
||||
phdr.p_type = cpu_to_dump32(s, PT_NOTE);
|
||||
- phdr.p_offset = cpu_to_dump32(s, begin);
|
||||
+ phdr.p_offset = cpu_to_dump32(s, s->note_offset);
|
||||
phdr.p_paddr = 0;
|
||||
phdr.p_filesz = cpu_to_dump32(s, s->note_size);
|
||||
phdr.p_memsz = cpu_to_dump32(s, s->note_size);
|
||||
@@ -1826,15 +1820,16 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
}
|
||||
|
||||
if (s->dump_info.d_class == ELFCLASS64) {
|
||||
- s->memory_offset = sizeof(Elf64_Ehdr) +
|
||||
- sizeof(Elf64_Phdr) * s->phdr_num +
|
||||
- sizeof(Elf64_Shdr) * s->shdr_num +
|
||||
- s->note_size;
|
||||
+ s->phdr_offset = sizeof(Elf64_Ehdr);
|
||||
+ s->shdr_offset = s->phdr_offset + sizeof(Elf64_Phdr) * s->phdr_num;
|
||||
+ s->note_offset = s->shdr_offset + sizeof(Elf64_Shdr) * s->shdr_num;
|
||||
+ s->memory_offset = s->note_offset + s->note_size;
|
||||
} else {
|
||||
- s->memory_offset = sizeof(Elf32_Ehdr) +
|
||||
- sizeof(Elf32_Phdr) * s->phdr_num +
|
||||
- sizeof(Elf32_Shdr) * s->shdr_num +
|
||||
- s->note_size;
|
||||
+
|
||||
+ s->phdr_offset = sizeof(Elf32_Ehdr);
|
||||
+ s->shdr_offset = s->phdr_offset + sizeof(Elf32_Phdr) * s->phdr_num;
|
||||
+ s->note_offset = s->shdr_offset + sizeof(Elf32_Shdr) * s->shdr_num;
|
||||
+ s->memory_offset = s->note_offset + s->note_size;
|
||||
}
|
||||
|
||||
return;
|
||||
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
|
||||
index 19458bffbd..ffc2ea1072 100644
|
||||
--- a/include/sysemu/dump.h
|
||||
+++ b/include/sysemu/dump.h
|
||||
@@ -159,6 +159,10 @@ typedef struct DumpState {
|
||||
bool resume;
|
||||
bool detached;
|
||||
ssize_t note_size;
|
||||
+ hwaddr shdr_offset;
|
||||
+ hwaddr phdr_offset;
|
||||
+ hwaddr section_offset;
|
||||
+ hwaddr note_offset;
|
||||
hwaddr memory_offset;
|
||||
int fd;
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
From cbb653d73e32513ccd46b293a52384eed6a5f84f Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Wed, 30 Mar 2022 12:36:02 +0000
|
||||
Subject: [PATCH 20/42] dump: Cleanup dump_begin write functions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [20/41] 18ea1457a3e54fd368e556d96c3be50c6ad0a6bd
|
||||
|
||||
There's no need to have a gigantic if in there let's move the elf
|
||||
32/64 bit logic into the section, segment or note code.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220330123603.107120-9-frankja@linux.ibm.com>
|
||||
(cherry picked from commit 5ff2e5a3e1e67930e523486e39549a33fcf97227)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 42 +++++++++++-------------------------------
|
||||
1 file changed, 11 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 823ca32883..88abde355a 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -565,46 +565,26 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (dump_is_64bit(s)) {
|
||||
- /* write all PT_LOAD to vmcore */
|
||||
- write_elf_loads(s, errp);
|
||||
+ /* write all PT_LOAD to vmcore */
|
||||
+ write_elf_loads(s, errp);
|
||||
+ if (*errp) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* write section to vmcore */
|
||||
+ if (s->shdr_num) {
|
||||
+ write_elf_section(s, 1, errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
+ }
|
||||
|
||||
- /* write section to vmcore */
|
||||
- if (s->shdr_num) {
|
||||
- write_elf_section(s, 1, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
+ if (dump_is_64bit(s)) {
|
||||
/* write notes to vmcore */
|
||||
write_elf64_notes(fd_write_vmcore, s, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
} else {
|
||||
- /* write all PT_LOAD to vmcore */
|
||||
- write_elf_loads(s, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* write section to vmcore */
|
||||
- if (s->shdr_num) {
|
||||
- write_elf_section(s, 0, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/* write notes to vmcore */
|
||||
write_elf32_notes(fd_write_vmcore, s, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
From 0547599cf507930f91943f22d5f917ebacf69484 Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Wed, 30 Mar 2022 12:36:03 +0000
|
||||
Subject: [PATCH 21/42] dump: Consolidate elf note function
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [21/41] 52298c098c116aea75ad15894731ff412c2c4e73
|
||||
|
||||
Just like with the other write functions let's move the 32/64 bit elf
|
||||
handling to a function to improve readability.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220330123603.107120-10-frankja@linux.ibm.com>
|
||||
(cherry picked from commit c68124738bc29017e4254c898bc40be7be477af7)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 18 +++++++++++-------
|
||||
1 file changed, 11 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 88abde355a..a451abc590 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -520,6 +520,15 @@ static void write_elf_loads(DumpState *s, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
+static void write_elf_notes(DumpState *s, Error **errp)
|
||||
+{
|
||||
+ if (dump_is_64bit(s)) {
|
||||
+ write_elf64_notes(fd_write_vmcore, s, errp);
|
||||
+ } else {
|
||||
+ write_elf32_notes(fd_write_vmcore, s, errp);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* write elf header, PT_NOTE and elf note to vmcore. */
|
||||
static void dump_begin(DumpState *s, Error **errp)
|
||||
{
|
||||
@@ -579,13 +588,8 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
- if (dump_is_64bit(s)) {
|
||||
- /* write notes to vmcore */
|
||||
- write_elf64_notes(fd_write_vmcore, s, errp);
|
||||
- } else {
|
||||
- /* write notes to vmcore */
|
||||
- write_elf32_notes(fd_write_vmcore, s, errp);
|
||||
- }
|
||||
+ /* write notes to vmcore */
|
||||
+ write_elf_notes(s, errp);
|
||||
}
|
||||
|
||||
static int get_next_block(DumpState *s, GuestPhysBlock *block)
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
From f87abe1ef14e80731249ebe9fe1bea569a68e9b4 Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Wed, 30 Mar 2022 12:36:01 +0000
|
||||
Subject: [PATCH 19/42] dump: Consolidate phdr note writes
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [19/41] 180c4c0ab4941a0bf366dc7f32ee035e03daa6c0
|
||||
|
||||
There's no need to have two write functions. Let's rather have two
|
||||
functions that set the data for elf 32/64 and then write it in a
|
||||
common function.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220330123603.107120-8-frankja@linux.ibm.com>
|
||||
(cherry picked from commit bc7d558017e6700f9a05c61b0b638a8994945f0d)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 94 +++++++++++++++++++++++++++--------------------------
|
||||
1 file changed, 48 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 6394e94023..823ca32883 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -246,24 +246,15 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
|
||||
}
|
||||
}
|
||||
|
||||
-static void write_elf64_note(DumpState *s, Error **errp)
|
||||
+static void write_elf64_phdr_note(DumpState *s, Elf64_Phdr *phdr)
|
||||
{
|
||||
- Elf64_Phdr phdr;
|
||||
- int ret;
|
||||
-
|
||||
- memset(&phdr, 0, sizeof(Elf64_Phdr));
|
||||
- phdr.p_type = cpu_to_dump32(s, PT_NOTE);
|
||||
- phdr.p_offset = cpu_to_dump64(s, s->note_offset);
|
||||
- phdr.p_paddr = 0;
|
||||
- phdr.p_filesz = cpu_to_dump64(s, s->note_size);
|
||||
- phdr.p_memsz = cpu_to_dump64(s, s->note_size);
|
||||
- phdr.p_vaddr = 0;
|
||||
-
|
||||
- ret = fd_write_vmcore(&phdr, sizeof(Elf64_Phdr), s);
|
||||
- if (ret < 0) {
|
||||
- error_setg_errno(errp, -ret,
|
||||
- "dump: failed to write program header table");
|
||||
- }
|
||||
+ memset(phdr, 0, sizeof(*phdr));
|
||||
+ phdr->p_type = cpu_to_dump32(s, PT_NOTE);
|
||||
+ phdr->p_offset = cpu_to_dump64(s, s->note_offset);
|
||||
+ phdr->p_paddr = 0;
|
||||
+ phdr->p_filesz = cpu_to_dump64(s, s->note_size);
|
||||
+ phdr->p_memsz = cpu_to_dump64(s, s->note_size);
|
||||
+ phdr->p_vaddr = 0;
|
||||
}
|
||||
|
||||
static inline int cpu_index(CPUState *cpu)
|
||||
@@ -311,24 +302,15 @@ static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
|
||||
write_guest_note(f, s, errp);
|
||||
}
|
||||
|
||||
-static void write_elf32_note(DumpState *s, Error **errp)
|
||||
+static void write_elf32_phdr_note(DumpState *s, Elf32_Phdr *phdr)
|
||||
{
|
||||
- Elf32_Phdr phdr;
|
||||
- int ret;
|
||||
-
|
||||
- memset(&phdr, 0, sizeof(Elf32_Phdr));
|
||||
- phdr.p_type = cpu_to_dump32(s, PT_NOTE);
|
||||
- phdr.p_offset = cpu_to_dump32(s, s->note_offset);
|
||||
- phdr.p_paddr = 0;
|
||||
- phdr.p_filesz = cpu_to_dump32(s, s->note_size);
|
||||
- phdr.p_memsz = cpu_to_dump32(s, s->note_size);
|
||||
- phdr.p_vaddr = 0;
|
||||
-
|
||||
- ret = fd_write_vmcore(&phdr, sizeof(Elf32_Phdr), s);
|
||||
- if (ret < 0) {
|
||||
- error_setg_errno(errp, -ret,
|
||||
- "dump: failed to write program header table");
|
||||
- }
|
||||
+ memset(phdr, 0, sizeof(*phdr));
|
||||
+ phdr->p_type = cpu_to_dump32(s, PT_NOTE);
|
||||
+ phdr->p_offset = cpu_to_dump32(s, s->note_offset);
|
||||
+ phdr->p_paddr = 0;
|
||||
+ phdr->p_filesz = cpu_to_dump32(s, s->note_size);
|
||||
+ phdr->p_memsz = cpu_to_dump32(s, s->note_size);
|
||||
+ phdr->p_vaddr = 0;
|
||||
}
|
||||
|
||||
static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
|
||||
@@ -358,6 +340,32 @@ static void write_elf32_notes(WriteCoreDumpFunction f, DumpState *s,
|
||||
write_guest_note(f, s, errp);
|
||||
}
|
||||
|
||||
+static void write_elf_phdr_note(DumpState *s, Error **errp)
|
||||
+{
|
||||
+ ERRP_GUARD();
|
||||
+ Elf32_Phdr phdr32;
|
||||
+ Elf64_Phdr phdr64;
|
||||
+ void *phdr;
|
||||
+ size_t size;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (dump_is_64bit(s)) {
|
||||
+ write_elf64_phdr_note(s, &phdr64);
|
||||
+ size = sizeof(phdr64);
|
||||
+ phdr = &phdr64;
|
||||
+ } else {
|
||||
+ write_elf32_phdr_note(s, &phdr32);
|
||||
+ size = sizeof(phdr32);
|
||||
+ phdr = &phdr32;
|
||||
+ }
|
||||
+
|
||||
+ ret = fd_write_vmcore(phdr, size, s);
|
||||
+ if (ret < 0) {
|
||||
+ error_setg_errno(errp, -ret,
|
||||
+ "dump: failed to write program header table");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void write_elf_section(DumpState *s, int type, Error **errp)
|
||||
{
|
||||
Elf32_Shdr shdr32;
|
||||
@@ -551,13 +559,13 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (dump_is_64bit(s)) {
|
||||
- /* write PT_NOTE to vmcore */
|
||||
- write_elf64_note(s, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
+ /* write PT_NOTE to vmcore */
|
||||
+ write_elf_phdr_note(s, errp);
|
||||
+ if (*errp) {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
+ if (dump_is_64bit(s)) {
|
||||
/* write all PT_LOAD to vmcore */
|
||||
write_elf_loads(s, errp);
|
||||
if (*errp) {
|
||||
@@ -578,12 +586,6 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
- /* write PT_NOTE to vmcore */
|
||||
- write_elf32_note(s, errp);
|
||||
- if (*errp) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
/* write all PT_LOAD to vmcore */
|
||||
write_elf_loads(s, errp);
|
||||
if (*errp) {
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
From c851676d202b5b76962529f3b6d433936becbd8a Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Wed, 30 Mar 2022 12:36:00 +0000
|
||||
Subject: [PATCH 18/42] dump: Introduce dump_is_64bit() helper function
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [18/41] a0fd2d1985c61b8e50d4a7ca26bc0ee6fcaa6196
|
||||
|
||||
Checking d_class in dump_info leads to lengthy conditionals so let's
|
||||
shorten things a bit by introducing a helper function.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220330123603.107120-7-frankja@linux.ibm.com>
|
||||
(cherry picked from commit 05bbaa5040ccb3419e8b93af8040485430e2db42)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 25 +++++++++++++++----------
|
||||
1 file changed, 15 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 85a402b38c..6394e94023 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -55,6 +55,11 @@ static Error *dump_migration_blocker;
|
||||
DIV_ROUND_UP((name_size), 4) + \
|
||||
DIV_ROUND_UP((desc_size), 4)) * 4)
|
||||
|
||||
+static inline bool dump_is_64bit(DumpState *s)
|
||||
+{
|
||||
+ return s->dump_info.d_class == ELFCLASS64;
|
||||
+}
|
||||
+
|
||||
uint16_t cpu_to_dump16(DumpState *s, uint16_t val)
|
||||
{
|
||||
if (s->dump_info.d_endian == ELFDATA2LSB) {
|
||||
@@ -489,7 +494,7 @@ static void write_elf_loads(DumpState *s, Error **errp)
|
||||
get_offset_range(memory_mapping->phys_addr,
|
||||
memory_mapping->length,
|
||||
s, &offset, &filesz);
|
||||
- if (s->dump_info.d_class == ELFCLASS64) {
|
||||
+ if (dump_is_64bit(s)) {
|
||||
write_elf64_load(s, memory_mapping, phdr_index++, offset,
|
||||
filesz, errp);
|
||||
} else {
|
||||
@@ -537,7 +542,7 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
*/
|
||||
|
||||
/* write elf header to vmcore */
|
||||
- if (s->dump_info.d_class == ELFCLASS64) {
|
||||
+ if (dump_is_64bit(s)) {
|
||||
write_elf64_header(s, errp);
|
||||
} else {
|
||||
write_elf32_header(s, errp);
|
||||
@@ -546,7 +551,7 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (s->dump_info.d_class == ELFCLASS64) {
|
||||
+ if (dump_is_64bit(s)) {
|
||||
/* write PT_NOTE to vmcore */
|
||||
write_elf64_note(s, errp);
|
||||
if (*errp) {
|
||||
@@ -757,7 +762,7 @@ static void get_note_sizes(DumpState *s, const void *note,
|
||||
uint64_t name_sz;
|
||||
uint64_t desc_sz;
|
||||
|
||||
- if (s->dump_info.d_class == ELFCLASS64) {
|
||||
+ if (dump_is_64bit(s)) {
|
||||
const Elf64_Nhdr *hdr = note;
|
||||
note_head_sz = sizeof(Elf64_Nhdr);
|
||||
name_sz = tswap64(hdr->n_namesz);
|
||||
@@ -1017,10 +1022,10 @@ out:
|
||||
|
||||
static void write_dump_header(DumpState *s, Error **errp)
|
||||
{
|
||||
- if (s->dump_info.d_class == ELFCLASS32) {
|
||||
- create_header32(s, errp);
|
||||
- } else {
|
||||
+ if (dump_is_64bit(s)) {
|
||||
create_header64(s, errp);
|
||||
+ } else {
|
||||
+ create_header32(s, errp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1715,8 +1720,8 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
uint32_t size;
|
||||
uint16_t format;
|
||||
|
||||
- note_head_size = s->dump_info.d_class == ELFCLASS32 ?
|
||||
- sizeof(Elf32_Nhdr) : sizeof(Elf64_Nhdr);
|
||||
+ note_head_size = dump_is_64bit(s) ?
|
||||
+ sizeof(Elf64_Nhdr) : sizeof(Elf32_Nhdr);
|
||||
|
||||
format = le16_to_cpu(vmci->vmcoreinfo.guest_format);
|
||||
size = le32_to_cpu(vmci->vmcoreinfo.size);
|
||||
@@ -1819,7 +1824,7 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
}
|
||||
}
|
||||
|
||||
- if (s->dump_info.d_class == ELFCLASS64) {
|
||||
+ if (dump_is_64bit(s)) {
|
||||
s->phdr_offset = sizeof(Elf64_Ehdr);
|
||||
s->shdr_offset = s->phdr_offset + sizeof(Elf64_Phdr) * s->phdr_num;
|
||||
s->note_offset = s->shdr_offset + sizeof(Elf64_Shdr) * s->shdr_num;
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
From 255722667a4fa4d522bb0b7e0825cbbe635abb8d Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Wed, 30 Mar 2022 12:35:57 +0000
|
||||
Subject: [PATCH 15/42] dump: Introduce shdr_num to decrease complexity
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [15/41] b0215ea5d381ef7f6abfe3f3bafea51ce933da56
|
||||
|
||||
Let's move from a boolean to a int variable which will later enable us
|
||||
to store the number of sections that are in the dump file.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220330123603.107120-4-frankja@linux.ibm.com>
|
||||
(cherry picked from commit 862a395858e5a302ed5921487777acdc95a3a31b)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 24 ++++++++++++------------
|
||||
include/sysemu/dump.h | 2 +-
|
||||
2 files changed, 13 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index 7236b167cc..972e28b089 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -145,12 +145,12 @@ static void write_elf64_header(DumpState *s, Error **errp)
|
||||
elf_header.e_phoff = cpu_to_dump64(s, sizeof(Elf64_Ehdr));
|
||||
elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf64_Phdr));
|
||||
elf_header.e_phnum = cpu_to_dump16(s, phnum);
|
||||
- if (s->have_section) {
|
||||
+ if (s->shdr_num) {
|
||||
uint64_t shoff = sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) * s->phdr_num;
|
||||
|
||||
elf_header.e_shoff = cpu_to_dump64(s, shoff);
|
||||
elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf64_Shdr));
|
||||
- elf_header.e_shnum = cpu_to_dump16(s, 1);
|
||||
+ elf_header.e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
}
|
||||
|
||||
ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
|
||||
@@ -182,12 +182,12 @@ static void write_elf32_header(DumpState *s, Error **errp)
|
||||
elf_header.e_phoff = cpu_to_dump32(s, sizeof(Elf32_Ehdr));
|
||||
elf_header.e_phentsize = cpu_to_dump16(s, sizeof(Elf32_Phdr));
|
||||
elf_header.e_phnum = cpu_to_dump16(s, phnum);
|
||||
- if (s->have_section) {
|
||||
+ if (s->shdr_num) {
|
||||
uint32_t shoff = sizeof(Elf32_Ehdr) + sizeof(Elf32_Phdr) * s->phdr_num;
|
||||
|
||||
elf_header.e_shoff = cpu_to_dump32(s, shoff);
|
||||
elf_header.e_shentsize = cpu_to_dump16(s, sizeof(Elf32_Shdr));
|
||||
- elf_header.e_shnum = cpu_to_dump16(s, 1);
|
||||
+ elf_header.e_shnum = cpu_to_dump16(s, s->shdr_num);
|
||||
}
|
||||
|
||||
ret = fd_write_vmcore(&elf_header, sizeof(elf_header), s);
|
||||
@@ -566,7 +566,7 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
}
|
||||
|
||||
/* write section to vmcore */
|
||||
- if (s->have_section) {
|
||||
+ if (s->shdr_num) {
|
||||
write_elf_section(s, 1, errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
@@ -592,7 +592,7 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
}
|
||||
|
||||
/* write section to vmcore */
|
||||
- if (s->have_section) {
|
||||
+ if (s->shdr_num) {
|
||||
write_elf_section(s, 0, errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
@@ -1811,11 +1811,11 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
*/
|
||||
s->phdr_num = 1; /* PT_NOTE */
|
||||
if (s->list.num < UINT16_MAX - 2) {
|
||||
+ s->shdr_num = 0;
|
||||
s->phdr_num += s->list.num;
|
||||
- s->have_section = false;
|
||||
} else {
|
||||
/* sh_info of section 0 holds the real number of phdrs */
|
||||
- s->have_section = true;
|
||||
+ s->shdr_num = 1;
|
||||
|
||||
/* the type of shdr->sh_info is uint32_t, so we should avoid overflow */
|
||||
if (s->list.num <= UINT32_MAX - 1) {
|
||||
@@ -1826,19 +1826,19 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
}
|
||||
|
||||
if (s->dump_info.d_class == ELFCLASS64) {
|
||||
- if (s->have_section) {
|
||||
+ if (s->shdr_num) {
|
||||
s->memory_offset = sizeof(Elf64_Ehdr) +
|
||||
sizeof(Elf64_Phdr) * s->phdr_num +
|
||||
- sizeof(Elf64_Shdr) + s->note_size;
|
||||
+ sizeof(Elf64_Shdr) * s->shdr_num + s->note_size;
|
||||
} else {
|
||||
s->memory_offset = sizeof(Elf64_Ehdr) +
|
||||
sizeof(Elf64_Phdr) * s->phdr_num + s->note_size;
|
||||
}
|
||||
} else {
|
||||
- if (s->have_section) {
|
||||
+ if (s->shdr_num) {
|
||||
s->memory_offset = sizeof(Elf32_Ehdr) +
|
||||
sizeof(Elf32_Phdr) * s->phdr_num +
|
||||
- sizeof(Elf32_Shdr) + s->note_size;
|
||||
+ sizeof(Elf32_Shdr) * s->shdr_num + s->note_size;
|
||||
} else {
|
||||
s->memory_offset = sizeof(Elf32_Ehdr) +
|
||||
sizeof(Elf32_Phdr) * s->phdr_num + s->note_size;
|
||||
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
|
||||
index b463fc9c02..19458bffbd 100644
|
||||
--- a/include/sysemu/dump.h
|
||||
+++ b/include/sysemu/dump.h
|
||||
@@ -155,7 +155,7 @@ typedef struct DumpState {
|
||||
ArchDumpInfo dump_info;
|
||||
MemoryMappingList list;
|
||||
uint32_t phdr_num;
|
||||
- bool have_section;
|
||||
+ uint32_t shdr_num;
|
||||
bool resume;
|
||||
bool detached;
|
||||
ssize_t note_size;
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
From a18ba2fbaf132724e81be92da42b36d8f365e66c Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Thu, 11 Aug 2022 12:10:56 +0000
|
||||
Subject: [PATCH 24/42] dump: Refactor dump_iterate and introduce
|
||||
dump_filter_memblock_*()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [24/41] 74ef470f24d9d98093c4d63730a99474587033fd
|
||||
|
||||
The iteration over the memblocks in dump_iterate() is hard to
|
||||
understand so it's about time to clean it up. Instead of manually
|
||||
grabbing the next memblock we can use QTAILQ_FOREACH to iterate over
|
||||
all memblocks.
|
||||
|
||||
Additionally we move the calculation of the offset and length out by
|
||||
introducing and using the dump_filter_memblock_*() functions. These
|
||||
functions will later be used to cleanup other parts of dump.c.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20220811121111.9878-4-frankja@linux.ibm.com>
|
||||
(cherry picked from commit 1e8113032f5b1efc5da66382470ce4809c76f8f2)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 74 ++++++++++++++++++++++++++++++-----------------------
|
||||
1 file changed, 42 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index fa787f379f..d981e843dd 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -592,31 +592,43 @@ static void dump_begin(DumpState *s, Error **errp)
|
||||
write_elf_notes(s, errp);
|
||||
}
|
||||
|
||||
-static int get_next_block(DumpState *s, GuestPhysBlock *block)
|
||||
+static int64_t dump_filtered_memblock_size(GuestPhysBlock *block,
|
||||
+ int64_t filter_area_start,
|
||||
+ int64_t filter_area_length)
|
||||
{
|
||||
- while (1) {
|
||||
- block = QTAILQ_NEXT(block, next);
|
||||
- if (!block) {
|
||||
- /* no more block */
|
||||
- return 1;
|
||||
- }
|
||||
+ int64_t size, left, right;
|
||||
|
||||
- s->start = 0;
|
||||
- s->next_block = block;
|
||||
- if (s->has_filter) {
|
||||
- if (block->target_start >= s->begin + s->length ||
|
||||
- block->target_end <= s->begin) {
|
||||
- /* This block is out of the range */
|
||||
- continue;
|
||||
- }
|
||||
+ /* No filter, return full size */
|
||||
+ if (!filter_area_length) {
|
||||
+ return block->target_end - block->target_start;
|
||||
+ }
|
||||
|
||||
- if (s->begin > block->target_start) {
|
||||
- s->start = s->begin - block->target_start;
|
||||
- }
|
||||
+ /* calculate the overlapped region. */
|
||||
+ left = MAX(filter_area_start, block->target_start);
|
||||
+ right = MIN(filter_area_start + filter_area_length, block->target_end);
|
||||
+ size = right - left;
|
||||
+ size = size > 0 ? size : 0;
|
||||
+
|
||||
+ return size;
|
||||
+}
|
||||
+
|
||||
+static int64_t dump_filtered_memblock_start(GuestPhysBlock *block,
|
||||
+ int64_t filter_area_start,
|
||||
+ int64_t filter_area_length)
|
||||
+{
|
||||
+ if (filter_area_length) {
|
||||
+ /* return -1 if the block is not within filter area */
|
||||
+ if (block->target_start >= filter_area_start + filter_area_length ||
|
||||
+ block->target_end <= filter_area_start) {
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ if (filter_area_start > block->target_start) {
|
||||
+ return filter_area_start - block->target_start;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/* write all memory to vmcore */
|
||||
@@ -624,24 +636,22 @@ static void dump_iterate(DumpState *s, Error **errp)
|
||||
{
|
||||
ERRP_GUARD();
|
||||
GuestPhysBlock *block;
|
||||
- int64_t size;
|
||||
-
|
||||
- do {
|
||||
- block = s->next_block;
|
||||
+ int64_t memblock_size, memblock_start;
|
||||
|
||||
- size = block->target_end - block->target_start;
|
||||
- if (s->has_filter) {
|
||||
- size -= s->start;
|
||||
- if (s->begin + s->length < block->target_end) {
|
||||
- size -= block->target_end - (s->begin + s->length);
|
||||
- }
|
||||
+ QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) {
|
||||
+ memblock_start = dump_filtered_memblock_start(block, s->begin, s->length);
|
||||
+ if (memblock_start == -1) {
|
||||
+ continue;
|
||||
}
|
||||
- write_memory(s, block, s->start, size, errp);
|
||||
+
|
||||
+ memblock_size = dump_filtered_memblock_size(block, s->begin, s->length);
|
||||
+
|
||||
+ /* Write the memory to file */
|
||||
+ write_memory(s, block, memblock_start, memblock_size, errp);
|
||||
if (*errp) {
|
||||
return;
|
||||
}
|
||||
-
|
||||
- } while (!get_next_block(s, block));
|
||||
+ }
|
||||
}
|
||||
|
||||
static void create_vmcore(DumpState *s, Error **errp)
|
||||
--
|
||||
2.37.3
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
From 6932fe3afbec443bbf6acff5b707536254e1bc37 Mon Sep 17 00:00:00 2001
|
||||
From: Janosch Frank <frankja@linux.ibm.com>
|
||||
Date: Mon, 17 Oct 2022 08:38:16 +0000
|
||||
Subject: [PATCH 35/42] dump: Reintroduce memory_offset and section_offset
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
RH-Author: Cédric Le Goater <clg@redhat.com>
|
||||
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
|
||||
RH-Bugzilla: 1664378 2043909
|
||||
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
||||
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
||||
RH-Commit: [35/41] e60c0d066aeeedb42e724712bc3aa7b7591c6c79
|
||||
|
||||
section_offset will later be used to store the offset to the section
|
||||
data which will be stored last. For now memory_offset is only needed
|
||||
to make section_offset look nicer.
|
||||
|
||||
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
||||
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Message-Id: <20221017083822.43118-5-frankja@linux.ibm.com>
|
||||
(cherry picked from commit 13fd417ddc81a1685c6a8f4e1c80bbfe7150f164)
|
||||
Signed-off-by: Cédric Le Goater <clg@redhat.com>
|
||||
---
|
||||
dump/dump.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/dump/dump.c b/dump/dump.c
|
||||
index d17537d4e9..7a42401790 100644
|
||||
--- a/dump/dump.c
|
||||
+++ b/dump/dump.c
|
||||
@@ -1885,6 +1885,8 @@ static void dump_init(DumpState *s, int fd, bool has_format,
|
||||
s->phdr_offset = s->shdr_offset + sizeof(Elf32_Shdr) * s->shdr_num;
|
||||
s->note_offset = s->phdr_offset + sizeof(Elf32_Phdr) * s->phdr_num;
|
||||
}
|
||||
+ s->memory_offset = s->note_offset + s->note_size;
|
||||
+ s->section_offset = s->memory_offset + s->total_size;
|
||||
|
||||
return;
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue