From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7A49C1FF183 for ; Wed, 24 Sep 2025 16:36:32 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DF38BAA5F; Wed, 24 Sep 2025 16:36:51 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Wed, 24 Sep 2025 16:35:22 +0200 Message-ID: <20250924143611.166858-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758724562836 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm, cfg2cmd.pm, timer.pm, proxmox.com] Subject: [pve-devel] [PATCH-SERIES qemu-server 0/5] cfg2cmd: introduce dedicated module and turn off hpet timer X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Recent enough Linux versions already use 'kvm-clock' rather than 'hpet' as the default clock source [0][1]. Changes in QEMU [2] led to slightly increased CPU usage when using hpet [3][4]: > the timer must be kept running even if not enabled, in > order to set the ISR flag, so writes to HPET_TN_CFG must > not call hpet_del_timer() Upstream suggested to not use hpet if possible [5][6]: > That said, if you can disable the HPET timer by default without > problems with e.g. live migration I strongly suggest you do. And in > the mean time you can also revert these patches, they were actually > reported as bugs but it's not clear what guest OS was affected. > No, the bug reports are really just for corner cases and there are no > huge issues. However, both Linux and Windows give the HPET a > relatively high priority that it probably does not deserve. :) There were more changes in QEMU, so it would require more reverts. Thus, disable the timer. People having a Linux VM pinned to an older machine version or using other os types will see the increased usage again if installing the new QEMU 10.1 binary, but that seems like a fair trade-off for reducing CPU load for everybody else and being able to move forward. To facilitate changes to cfg2cmd in the future, this also introduces a dedicated cfg2cmd module. Having a dedicated Cfg2Cmd class allows having a cleaner interface by only calling into pre-defined methods. Important, global information about the VM like machine type or OS version will be recorded by the object and can be queried via methods. For now, there is only windows_version(). There will be sub-classes, each concerning a dedicated part of the configuration. The first one is for the timer. I will send the QEMU 10.1 patches separately. [0]: /sys/devices/system/clocksource/clocksource0/current_clocksource [1]: Kernel commit 790c73f6289a ("x86: KVM guest: paravirtualized clocksource") in v2.6.26+ [2]: QEMU commit f0ccf77078 ("hpet: fix and cleanup persistence of interrupt status") [3]: https://lore.kernel.org/qemu-devel/8183674f-a9cc-4727-bb52-fe3d3e44804b@proxmox.com/ [4]: https://forum.proxmox.com/threads/161849/post-756793 [5]: https://lore.kernel.org/qemu-devel/CABgObfaKJ5NFVKmYLFmu4C0iZZLJJtcWksLCzyA0tBoz0koZ4A@mail.gmail.com/ [6]: https://lore.kernel.org/qemu-devel/CABgObfYnOzg=BPeG5BjSmGEV_Q0pR7xGg6L3XNQCONtU_GiuGA@mail.gmail.com/ Fiona Ebner (6): tests: cfg2cmd: add tests for startdate parameter and disabled time drift fix tests: add tests for non-{Linux,Windows} OS types introduce dedicated cfg2cmd module config: schema: define default OS type cfg2cmd: turn off hpet for Linux VMs running at least kernel 2.6 and machine type >= 10.1 tests: cfg2cmd: regenerate with QEMU 10.1 binary debian/control | 2 +- src/PVE/QemuServer.pm | 33 ++--- src/PVE/QemuServer/Cfg2Cmd.pm | 115 ++++++++++++++++++ src/PVE/QemuServer/Cfg2Cmd/Timer.pm | 39 ++++++ src/PVE/QemuServer/Makefile | 2 + src/test/cfg2cmd/bootorder-empty.conf.cmd | 2 +- src/test/cfg2cmd/bootorder-legacy.conf.cmd | 2 +- src/test/cfg2cmd/bootorder.conf.cmd | 2 +- ...putype-icelake-client-deprecation.conf.cmd | 2 +- .../custom-cpu-model-defaults.conf.cmd | 2 +- src/test/cfg2cmd/efidisk-on-rbd.conf.cmd | 2 +- src/test/cfg2cmd/ide.conf.cmd | 2 +- .../cfg2cmd/memory-hotplug-hugepages.conf.cmd | 2 +- src/test/cfg2cmd/memory-hotplug.conf.cmd | 2 +- src/test/cfg2cmd/memory-hugepages-1g.conf.cmd | 2 +- src/test/cfg2cmd/memory-hugepages-2m.conf.cmd | 2 +- .../cfg2cmd/netdev-7.1-multiqueues.conf.cmd | 2 +- src/test/cfg2cmd/netdev-7.1.conf.cmd | 2 +- src/test/cfg2cmd/netdev_vxlan.conf.cmd | 2 +- src/test/cfg2cmd/os-l24.conf | 3 + src/test/cfg2cmd/os-l24.conf.cmd | 29 +++++ src/test/cfg2cmd/os-other.conf | 2 + src/test/cfg2cmd/os-other.conf.cmd | 26 ++++ src/test/cfg2cmd/os-solaris.conf | 2 + src/test/cfg2cmd/os-solaris.conf.cmd | 26 ++++ src/test/cfg2cmd/q35-ide.conf.cmd | 2 +- .../q35-linux-hostpci-mapping.conf.cmd | 2 +- .../q35-linux-hostpci-multifunction.conf.cmd | 2 +- ...q35-linux-hostpci-x-pci-overrides.conf.cmd | 2 +- src/test/cfg2cmd/q35-linux-hostpci.conf.cmd | 2 +- src/test/cfg2cmd/q35-simple.conf.cmd | 2 +- src/test/cfg2cmd/seabios_serial.conf.cmd | 2 +- src/test/cfg2cmd/simple-btrfs.conf.cmd | 2 +- src/test/cfg2cmd/simple-cifs.conf.cmd | 2 +- .../cfg2cmd/simple-disk-passthrough.conf.cmd | 2 +- src/test/cfg2cmd/simple-rbd.conf.cmd | 2 +- src/test/cfg2cmd/simple-virtio-blk.conf.cmd | 2 +- .../cfg2cmd/simple-zfs-over-iscsi.conf.cmd | 2 +- src/test/cfg2cmd/simple1.conf.cmd | 2 +- src/test/cfg2cmd/startdate-l26.conf | 3 + src/test/cfg2cmd/startdate-l26.conf.cmd | 27 ++++ src/test/cfg2cmd/startdate-win11.conf | 4 + src/test/cfg2cmd/startdate-win11.conf.cmd | 26 ++++ 43 files changed, 341 insertions(+), 54 deletions(-) create mode 100644 src/PVE/QemuServer/Cfg2Cmd.pm create mode 100644 src/PVE/QemuServer/Cfg2Cmd/Timer.pm create mode 100644 src/test/cfg2cmd/os-l24.conf create mode 100644 src/test/cfg2cmd/os-l24.conf.cmd create mode 100644 src/test/cfg2cmd/os-other.conf create mode 100644 src/test/cfg2cmd/os-other.conf.cmd create mode 100644 src/test/cfg2cmd/os-solaris.conf create mode 100644 src/test/cfg2cmd/os-solaris.conf.cmd create mode 100644 src/test/cfg2cmd/startdate-l26.conf create mode 100644 src/test/cfg2cmd/startdate-l26.conf.cmd create mode 100644 src/test/cfg2cmd/startdate-win11.conf create mode 100644 src/test/cfg2cmd/startdate-win11.conf.cmd -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel