From 9ad53789975e7d2c66a335eeb8c0fb17ae0fe0ff Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 5 Nov 2024 09:43:52 +0000 Subject: [PATCH] import from CS git qemu-kvm-6.2.0-53.el8.2 --- .gitignore | 2 +- ...l-size-default-value-in-the-man-page.patch | 36 ++++++ ...e-bdrv_qiov_is_aligned-to-file-posix.patch | 104 ++++++++++++++++++ ...the-request-length-for-iov-alignment.patch | 48 ++++++++ SPECS/qemu-kvm.spec | 19 +++- 5 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 SOURCES/kvm-Fix-thread-pool-size-default-value-in-the-man-page.patch create mode 100644 SOURCES/kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch create mode 100644 SOURCES/kvm-block-use-the-request-length-for-iov-alignment.patch diff --git a/.gitignore b/.gitignore index 867245c..a03a982 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ 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 +SOURCES/tests_data_acpi_virt_SSDT.memhp \ No newline at end of file diff --git a/SOURCES/kvm-Fix-thread-pool-size-default-value-in-the-man-page.patch b/SOURCES/kvm-Fix-thread-pool-size-default-value-in-the-man-page.patch new file mode 100644 index 0000000..b8db080 --- /dev/null +++ b/SOURCES/kvm-Fix-thread-pool-size-default-value-in-the-man-page.patch @@ -0,0 +1,36 @@ +From a707eff49800045d07afbcd8a74617c50b960151 Mon Sep 17 00:00:00 2001 +From: German Maglione +Date: Thu, 10 Oct 2024 13:23:25 +0200 +Subject: [PATCH] Fix thread-pool-size default value in the man page + +RH-Author: German Maglione +RH-MergeRequest: 417: Fix thread-pool-size default value in the man page +RH-Jira: RHEL-26197 +RH-Acked-by: Hanna Czenczek +RH-Acked-by: Jon Maloy +RH-Commit: [1/1] bdf22ed4600ac7f02a4b08c54f162b1f89c44a99 + +The current --thread-pool-size default value is 0, let's reflect it +in the man page. + +Signed-off-by: German Maglione +--- + docs/tools/virtiofsd.rst | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst +index 07ac0be551..fb3d59c449 100644 +--- a/docs/tools/virtiofsd.rst ++++ b/docs/tools/virtiofsd.rst +@@ -120,7 +120,7 @@ Options + .. option:: --thread-pool-size=NUM + + Restrict the number of worker threads per request queue to NUM. The default +- is 64. ++ is 0. + + .. option:: --cache=none|auto|always + +-- +2.45.2 + diff --git a/SOURCES/kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch b/SOURCES/kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch new file mode 100644 index 0000000..a8531b4 --- /dev/null +++ b/SOURCES/kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch @@ -0,0 +1,104 @@ +From 636e32b4c570ddb20266b6672311174353644f0e Mon Sep 17 00:00:00 2001 +From: Keith Busch +Date: Thu, 29 Sep 2022 13:05:22 -0700 +Subject: [PATCH 1/2] block: move bdrv_qiov_is_aligned to file-posix + +RH-Author: Kevin Wolf +RH-MergeRequest: 411: block: Fix iov_len check in bdrv_qiov_is_aligned() +RH-Jira: RHEL-60553 +RH-Acked-by: Eric Blake +RH-Acked-by: Jon Maloy +RH-Commit: [1/2] 682c1b81b42959d9d91e0f68cd70e9753e53a279 + +There is only user of bdrv_qiov_is_aligned(), so move the alignment +function to there and make it static. + +Signed-off-by: Keith Busch +Message-Id: <20220929200523.3218710-2-kbusch@meta.com> +Reviewed-by: Kevin Wolf +Signed-off-by: Kevin Wolf +(cherry picked from commit a7c5f67a78569f8c275ea4ea9962e9c79b9d03cb) +Signed-off-by: Kevin Wolf +--- + block/file-posix.c | 20 ++++++++++++++++++++ + block/io.c | 20 -------------------- + include/block/block.h | 1 - + 3 files changed, 20 insertions(+), 21 deletions(-) + +diff --git a/block/file-posix.c b/block/file-posix.c +index b283093e5b..b404e1544f 100644 +--- a/block/file-posix.c ++++ b/block/file-posix.c +@@ -2051,6 +2051,26 @@ static int coroutine_fn raw_thread_pool_submit(BlockDriverState *bs, + return thread_pool_submit_co(pool, func, arg); + } + ++/* ++ * Check if all memory in this vector is sector aligned. ++ */ ++static bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov) ++{ ++ int i; ++ size_t alignment = bdrv_min_mem_align(bs); ++ ++ for (i = 0; i < qiov->niov; i++) { ++ if ((uintptr_t) qiov->iov[i].iov_base % alignment) { ++ return false; ++ } ++ if (qiov->iov[i].iov_len % alignment) { ++ return false; ++ } ++ } ++ ++ return true; ++} ++ + static int coroutine_fn raw_co_prw(BlockDriverState *bs, uint64_t offset, + uint64_t bytes, QEMUIOVector *qiov, int type) + { +diff --git a/block/io.c b/block/io.c +index 8ae57728a6..639e171eff 100644 +--- a/block/io.c ++++ b/block/io.c +@@ -3375,26 +3375,6 @@ void *qemu_try_blockalign0(BlockDriverState *bs, size_t size) + return mem; + } + +-/* +- * Check if all memory in this vector is sector aligned. +- */ +-bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov) +-{ +- int i; +- size_t alignment = bdrv_min_mem_align(bs); +- +- for (i = 0; i < qiov->niov; i++) { +- if ((uintptr_t) qiov->iov[i].iov_base % alignment) { +- return false; +- } +- if (qiov->iov[i].iov_len % alignment) { +- return false; +- } +- } +- +- return true; +-} +- + void bdrv_io_plug(BlockDriverState *bs) + { + BdrvChild *child; +diff --git a/include/block/block.h b/include/block/block.h +index f885f113ef..09b374b496 100644 +--- a/include/block/block.h ++++ b/include/block/block.h +@@ -622,7 +622,6 @@ void *qemu_blockalign(BlockDriverState *bs, size_t size); + void *qemu_blockalign0(BlockDriverState *bs, size_t size); + void *qemu_try_blockalign(BlockDriverState *bs, size_t size); + void *qemu_try_blockalign0(BlockDriverState *bs, size_t size); +-bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov); + + void bdrv_enable_copy_on_read(BlockDriverState *bs); + void bdrv_disable_copy_on_read(BlockDriverState *bs); +-- +2.45.2 + diff --git a/SOURCES/kvm-block-use-the-request-length-for-iov-alignment.patch b/SOURCES/kvm-block-use-the-request-length-for-iov-alignment.patch new file mode 100644 index 0000000..13b31ca --- /dev/null +++ b/SOURCES/kvm-block-use-the-request-length-for-iov-alignment.patch @@ -0,0 +1,48 @@ +From 9009b674a01dc0cd92c319c87714b5aca6e639f8 Mon Sep 17 00:00:00 2001 +From: Keith Busch +Date: Thu, 29 Sep 2022 13:05:23 -0700 +Subject: [PATCH 2/2] block: use the request length for iov alignment + +RH-Author: Kevin Wolf +RH-MergeRequest: 411: block: Fix iov_len check in bdrv_qiov_is_aligned() +RH-Jira: RHEL-60553 +RH-Acked-by: Eric Blake +RH-Acked-by: Jon Maloy +RH-Commit: [2/2] 0e01d51cfb21ca43283626c2367e5c5d0d531736 + +An iov length needs to be aligned to the logical block size, which may +be larger than the memory alignment. + +Tested-by: Jens Axboe +Signed-off-by: Keith Busch +Message-Id: <20220929200523.3218710-3-kbusch@meta.com> +Reviewed-by: Kevin Wolf +Signed-off-by: Kevin Wolf +(cherry picked from commit 25474d90aa50bd32e0de395a33d8de42dd6f2aef) +Signed-off-by: Kevin Wolf +--- + block/file-posix.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/block/file-posix.c b/block/file-posix.c +index b404e1544f..b84c5725cc 100644 +--- a/block/file-posix.c ++++ b/block/file-posix.c +@@ -2058,12 +2058,13 @@ static bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov) + { + int i; + size_t alignment = bdrv_min_mem_align(bs); ++ size_t len = bs->bl.request_alignment; + + for (i = 0; i < qiov->niov; i++) { + if ((uintptr_t) qiov->iov[i].iov_base % alignment) { + return false; + } +- if (qiov->iov[i].iov_len % alignment) { ++ if (qiov->iov[i].iov_len % len) { + return false; + } + } +-- +2.45.2 + diff --git a/SPECS/qemu-kvm.spec b/SPECS/qemu-kvm.spec index 1a2b05a..57297f6 100644 --- a/SPECS/qemu-kvm.spec +++ b/SPECS/qemu-kvm.spec @@ -83,7 +83,7 @@ Obsoletes: %1-rhev <= %{epoch}:%{version}-%{release} Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 6.2.0 -Release: 53%{?rcrel}%{?dist} +Release: 53%{?rcrel}%{?dist}.2 # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped Epoch: 15 License: GPLv2 and GPLv2+ and CC-BY @@ -885,6 +885,12 @@ Patch361: kvm-nbd-server-Favor-qemu_aio_context-over-iohandler-con.patch Patch362: kvm-iotests-test-NBD-TLS-iothread.patch # For RHEL-52611 - CVE-2024-7409 virt:rhel/qemu-kvm: Denial of Service via Improper Synchronization in QEMU NBD Server During Socket Closure [rhel-8.10.z] Patch363: kvm-nbd-server-CVE-2024-7409-Avoid-use-after-free-when-c.patch +# For RHEL-60553 - Frequent VM pauses on OpenShift Virtualization with Portworx storage +Patch364: kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch +# For RHEL-60553 - Frequent VM pauses on OpenShift Virtualization with Portworx storage +Patch365: kvm-block-use-the-request-length-for-iov-alignment.patch +# For RHEL-26197 - virtiofsd --help and manpage does not agree on --thread-pool-size default value +Patch366: kvm-Fix-thread-pool-size-default-value-in-the-man-page.patch BuildRequires: wget BuildRequires: rpm-build @@ -2054,6 +2060,17 @@ sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || : %changelog +* Tue Oct 15 2024 Jon Maloy - 6.2.0-53.el8.2 +- kvm-Fix-thread-pool-size-default-value-in-the-man-page.patch [RHEL-26197] +- Resolves: RHEL-26197 + (virtiofsd --help and manpage does not agree on --thread-pool-size default value) + +* Tue Oct 08 2024 Jon Maloy - 6.2.0-53.el8.1 +- kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch [RHEL-60553] +- kvm-block-use-the-request-length-for-iov-alignment.patch [RHEL-60553] +- Resolves: RHEL-60553 + (Frequent VM pauses on OpenShift Virtualization with Portworx storage) + * Thu Sep 05 2024 Miroslav Rezanina - 6.2.0-53.el8 - kvm-nbd-server-Favor-qemu_aio_context-over-iohandler-con.patch [RHEL-52611] - kvm-iotests-test-NBD-TLS-iothread.patch [RHEL-52611]