From c3b4b21de2b5a2d521c075c690cd549c4a3365b3 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Thu, 9 Dec 2021 14:20:15 -0500 Subject: [PATCH 1/3] qemu: Optimize sleep We mistakenly have a timer run non-stop. Allow it to be disabled when idle. Signed-off-by: Jason Andryuk --- recipes-extended/qemu-dm/qemu-dm.inc | 3 +- .../0001-xen-hvm-Allow-disabling-buffer.patch | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 recipes-extended/qemu-dm/qemu-dm/0001-xen-hvm-Allow-disabling-buffer.patch diff --git a/recipes-extended/qemu-dm/qemu-dm.inc b/recipes-extended/qemu-dm/qemu-dm.inc index 207495086..8ce47da35 100644 --- a/recipes-extended/qemu-dm/qemu-dm.inc +++ b/recipes-extended/qemu-dm/qemu-dm.inc @@ -42,7 +42,8 @@ SRC_URI += "file://compile-time-stubdom-flag.patch \ file://net-Remove-unused-network-options.patch \ file://round-pci-region-sizes.patch \ file://ac97-compatibility.patch \ - file://0001-vnc-stubs-Allow-vnc-none.patch \ + file://0001-vnc-stubs-Allow-vnc-none.patch \ + file://0001-xen-hvm-Allow-disabling-buffer.patch \ " SRC_URI[md5sum] = "5862fc984bb955c4c24427d3bceddca5" diff --git a/recipes-extended/qemu-dm/qemu-dm/0001-xen-hvm-Allow-disabling-buffer.patch b/recipes-extended/qemu-dm/qemu-dm/0001-xen-hvm-Allow-disabling-buffer.patch new file mode 100644 index 000000000..b49dc49e2 --- /dev/null +++ b/recipes-extended/qemu-dm/qemu-dm/0001-xen-hvm-Allow-disabling-buffer.patch @@ -0,0 +1,54 @@ +From ff031d2eb2ff50a321f059418a93f80a78637999 Mon Sep 17 00:00:00 2001 +From: Jason Andryuk +Date: Thu, 9 Dec 2021 13:54:29 -0500 +Subject: [PATCH] xen-hvm: Allow disabling buffer + +commit f37f29d31488 "xen: slightly simplify bufioreq handling" hard +coded setting req.count = 1 during initial field setup before the main +loop. This missed a subtltey that an early exit from the loop when +there are no ioreqs to process, would have req.count == 0 for the return +value. Would handle_buffered_io() would then remove +state->buffered_io_timer. Instead handle_buffered_iopage() is basically +always returning true and handle_buffered_io() always re-setting the timer. + +Restore the disabling of the timer by introducing a new handled_ioreq +boolean and use as the return value. The named variable will more +clearly show the intent of the code. + +Signed-off-by: Jason Andryuk +--- + hw/i386/xen/xen-hvm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c +index 482be95415..da9d926919 100644 +--- a/hw/i386/xen/xen-hvm.c ++++ b/hw/i386/xen/xen-hvm.c +@@ -1087,10 +1087,11 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req) + } + } + +-static int handle_buffered_iopage(XenIOState *state) ++static bool handle_buffered_iopage(XenIOState *state) + { + buffered_iopage_t *buf_page = state->buffered_io_page; + buf_ioreq_t *buf_req = NULL; ++ bool handled_ioreq = false; + ioreq_t req; + int qw; + +@@ -1144,9 +1145,10 @@ static int handle_buffered_iopage(XenIOState *state) + assert(!req.data_is_ptr); + + atomic_add(&buf_page->read_pointer, qw + 1); ++ handled_ioreq = true; + } + +- return req.count; ++ return handled_ioreq; + } + + static void handle_buffered_io(void *opaque) +-- +2.33.1 + From fc0b262b67b804afb4d700e233ce91ebec5fa202 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Thu, 9 Dec 2021 14:23:32 -0500 Subject: [PATCH 2/3] qemu-dm: Remove trailing /* The trailing /* starts comment hightlighting and through off the rest of the file. Using the directory is file to package all the subcontents, so just do that. Signed-off-by: Jason Andryuk --- recipes-extended/qemu-dm/qemu-dm.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-extended/qemu-dm/qemu-dm.inc b/recipes-extended/qemu-dm/qemu-dm.inc index 8ce47da35..a36d8f3d4 100644 --- a/recipes-extended/qemu-dm/qemu-dm.inc +++ b/recipes-extended/qemu-dm/qemu-dm.inc @@ -64,7 +64,7 @@ FILES_${PN}-dbg += "/usr/lib/.debug/* /usr/libexec/.debug/*" FILES_${PN}-extra-keymaps = "/usr/share/qemu/keymaps/*" FILES_${PN}-extra-roms = "/usr/share/qemu/*" INSANE_SKIP_${PN}-extra-roms = "arch" -FILES_${PN}-utils = "/usr/libexec/* \ +FILES_${PN}-utils = "/usr/libexec \ /usr/bin/qemu-pr-helper \ " From d5fb0a2fe406fa46554189ef5a141be5d909d809 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Thu, 9 Dec 2021 14:24:46 -0500 Subject: [PATCH 3/3] qemu-dm: Package icons We get a big warning about all the unpackages icons, so just throw them in their own subpackage. Signed-off-by: Jason Andryuk --- recipes-extended/qemu-dm/qemu-dm.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-extended/qemu-dm/qemu-dm.inc b/recipes-extended/qemu-dm/qemu-dm.inc index a36d8f3d4..038d46a37 100644 --- a/recipes-extended/qemu-dm/qemu-dm.inc +++ b/recipes-extended/qemu-dm/qemu-dm.inc @@ -67,9 +67,11 @@ INSANE_SKIP_${PN}-extra-roms = "arch" FILES_${PN}-utils = "/usr/libexec \ /usr/bin/qemu-pr-helper \ " +FILES_${PN}-icons = "/usr/share/icons" PACKAGES += "${PN}-extra-keymaps ${PN}-extra-roms" PACKAGES =+ "${PN}-utils" +PACKAGES =+ "${PN}-icons" EXTRA_OECONF += " \ --target-list=i386-softmmu \