aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-10-21replace error_setg(&error_fatal, ...) with error_report()Tudor Gheorghiu
According to include/qapi/error.h: * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. Patch updates all instances of error_setg(&error_fatal, ...) with error_report(...), adds the explicit exit(1) and removes redundant return statements. Signed-off-by: Tudor Gheorghiu <tudor.reda@gmail.com> Suggested-by: Thomas Huth <thuth@redhat.com> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2587 Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (Mjt: also fold __func__ to previous line)
2024-10-21meson.build: Remove ncurses workaround for OpenBSDBrad Smith
meson.build: Remove ncurses workaround for OpenBSD OpenBSD 7.5 has upgraded to ncurses 6.4. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-10-21configure: Replace literally printed '\n' with newlineKevin Wolf
The idea here was to leave an empty line before the message, but by default, echo prints '\n' literally instead of interpreting it. Use a separate echo without parameter instead like in other places in the script. Fixes: 6fdc5bc173188f5e4942616b16d589500b874a15 Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-10-21ui/console-vc: Silence warning about sprintf() on OpenBSDThomas Huth
The linker on OpenBSD complains: ld: warning: console-vc.c:824 (../src/ui/console-vc.c:824)([...]): warning: sprintf() is often misused, please use snprintf() Using g_strdup_printf() is certainly better here, so let's switch to that function instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-10-21linux-user: Clean up unused headerGustavo Romero
Clean up unused (already commented-out) header from syscall.c. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-10-21Merge tag 'pull-request-2024-10-21' of https://gitlab.com/thuth/qemu into ↵Peter Maydell
staging * Convert most Tuxrun Avocado tests to the new functional framework * Update the OpenBSD CI image to OpenBSD v7.6 * Bump timeout of the ide-test * New maintainer for the QTests * Disable the pci-bridge on s390x by default # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmcWfCgRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbV6kQ//YwRebyA192IBM+XQK5YYmguieHmWxV8J # fZf0a1dWN8oiT3jzI48YWttiU9P6AMa/dwiuepVl4G9+d+w1c3RhS6kQqJljNbDb # NGw+LVZZcwY1FJpEsEwbDfePkugYHmNXUU672kxz3I8bv/8NmLDc7R3cI5U/7+SP # N4lxVM6Hd3XZZdc+O2S8En20E1oAJ6IvJwwhCqjLlT36Ez8P69KQhE0V8MtLnrBg # FsXZuzmaxt/ZDMhTsiHNl6f7N1oD7Y2TPJrdq7V2aihpDA+zx0RlvBPpzD98ZgeS # PtdkqjL63B5S3RL4fjJUSb/gbL4oChQ5TZDb2Dfw7Q5qPMZ1cgeJLBwdzHZEZrzF # RTtn4fObYUqtRF3M0Ha4xXc8odSzJTV2fvpSVXcljG1E4AMcD6CMK0E472XbhkMS # txZHW+C/IDVJ4OoSncrH8ybi1JasEqJZ0YaPfb+aTsPV058b65l+0jQJtlxLoTIf # p5LluL3exwr0sS3Aq5tcV3pNITtCv1FkcUk7So8sohO2OLQtC9QA300CSXna8XhQ # OxgRA1c3HXw23MTJKSWjseDIt1bajvBu+cr/pmDxlYnWWsSCcEFaAoQohwhOMA6Z # JfJF0tSv+koUsw6hSl7146aylSvDYUKPilAGgAUAy1yscgglMvtmQqWkEta/XGP2 # U8qvX8nUwOM= # =DJf9 # -----END PGP SIGNATURE----- # gpg: Signature made Mon 21 Oct 2024 17:07:04 BST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2024-10-21' of https://gitlab.com/thuth/qemu: tests/functional: Convert the Avocado sh4 tuxrun test Revert "hw/sh4/r2d: Realize IDE controller before accessing it" tests/functional: Convert the Avocado ppc32 tuxrun test tests/functional: Convert the Avocado mips64el tuxrun test tests/functional: Convert the Avocado mips64 tuxrun test tests/functional: Convert the Avocado mipsel tuxrun test tests/functional: Convert the Avocado mips tuxrun test tests/functional: Convert the Avocado x86_64 tuxrun test tests/functional: Convert the Avocado i386 tuxrun test tests/functional: Convert the Avocado riscv64 tuxrun tests tests/functional: Convert the Avocado riscv32 tuxrun tests tests/functional: Convert the Avocado arm tuxrun tests tests/functional: Convert the Avocado s390x tuxrun test tests/functional: Convert the Avocado sparc64 tuxrun test tests/functional: Convert the Avocado ppc64 tuxrun tests tests/functional: Add a base class for the TuxRun tests hw/pci-bridge: Add a Kconfig switch for the normal PCI bridge MAINTAINERS: A new maintainer for the qtests tests/qtest: Raise the ide-test timeout tests/vm: update openbsd image to 7.6 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-10-21Merge tag 'edgar/xen-queue-2024-10-21.for-upstream' of ↵Peter Maydell
https://gitlab.com/edgar.iglesias/qemu into staging Edgars Xen queue. # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEErET+3BT38evtv0FRKcWWeA9ryoMFAmcV7NYACgkQKcWWeA9r # yoM0pAgA2RNMysVe9IhoAlZ6ThGRvAE9epuHtoPERSTfqtFPOOY3UOU7zxrsX9Ov # YPh41I5YtbV3fB3X8kp51pqcTOWZBBdyCLtj0EFB0XTArPvpOFPueL1q2LgEnlLV # 77mBHnMarb3SI4INRm/tWWpk7ljgXMA6TSd2JlmO5l1OcZGlURdhLFWBBIRnTg1n # K+ZqQyq2KMANhIYvN0JAvM45FkwXntUzbxVMIjo0ICk2/EDgcFnGn9V0TgMkcIs3 # ctBEk6reZrdvNghX02r1wsH0HKGn78358G5uZAo9YEQOoTeGDswujHOVsn73ia2a # 6DChqCfyvlrJt4ljip2WoaoCMlZGdA== # =QB2W # -----END PGP SIGNATURE----- # gpg: Signature made Mon 21 Oct 2024 06:55:34 BST # gpg: using RSA key AC44FEDC14F7F1EBEDBF415129C596780F6BCA83 # gpg: Good signature from "Edgar E. Iglesias (Xilinx key) <edgar.iglesias@xilinx.com>" [unknown] # gpg: aka "Edgar E. Iglesias <edgar.iglesias@gmail.com>" [full] # Primary key fingerprint: AC44 FEDC 14F7 F1EB EDBF 4151 29C5 9678 0F6B CA83 * tag 'edgar/xen-queue-2024-10-21.for-upstream' of https://gitlab.com/edgar.iglesias/qemu: hw/xen: Avoid use of uninitialized bufioreq_evtchn Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-10-21tests/functional: Convert the Avocado sh4 tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-sh4 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-18-thuth@redhat.com>
2024-10-21Revert "hw/sh4/r2d: Realize IDE controller before accessing it"Thomas Huth
This reverts commit 3c5f86a22686ef475a8259c0d8ee714f61c770c9. Changing the order here caused a regression with the "tuxrun" kernels (from https://storage.tuxboot.com/20230331/) - ATA commands fail with a "ata1: lost interrupt (Status 0x58)" message. Apparently we need to wire the interrupt here first before realizing the device, so revert the change to the original behavior. Reported-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-17-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado ppc32 tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-ppc in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-16-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado mips64el tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-mips64el in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-15-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado mips64 tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-mips64 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-14-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado mipsel tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-mipsel in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-13-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado mips tuxrun testThomas Huth
Move the test into a new file so that it can be run via qemu-system-mips in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-12-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado x86_64 tuxrun testThomas Huth
Move the tests to a new file so that they can be run via qemu-system-x86_64 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-11-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado i386 tuxrun testThomas Huth
Move the tests to a new file so that they can be run via qemu-system-i386 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-10-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado riscv64 tuxrun testsThomas Huth
Move the tests to a new file so that they can be run via qemu-system-riscv64 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-9-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado riscv32 tuxrun testsThomas Huth
Move the tests to a new file so that they can be run via qemu-system-riscv32 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-8-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado arm tuxrun testsThomas Huth
Move the tests to a new file so that they can be run via qemu-system-arm in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-7-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado s390x tuxrun testThomas Huth
Move the test to a new file so that it can be run via qemu-system-s390x in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-6-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado sparc64 tuxrun testThomas Huth
Move the test to a new file so that it can be run via qemu-system-sparc64 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-5-thuth@redhat.com>
2024-10-21tests/functional: Convert the Avocado ppc64 tuxrun testsThomas Huth
Move the tests to a new file so that they can be run via qemu-system-ppc64 in the functional framework. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-3-thuth@redhat.com>
2024-10-21tests/functional: Add a base class for the TuxRun testsThomas Huth
Add a base class for the TuxRun tests, based on the code from tests/avocado/tuxrun_baselines.py (the test have to be put into separate file in the following commits, depending on the target architecture that gets tested). Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241011131937.377223-2-thuth@redhat.com>
2024-10-21hw/pci-bridge: Add a Kconfig switch for the normal PCI bridgeThomas Huth
The pci-bridge device is not usable on s390x, so introduce a Kconfig switch that allows to disable it. Message-ID: <20240913144844.427899-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-10-21MAINTAINERS: A new maintainer for the qtestsThomas Huth
Since I blundered into becoming the maintainer of the new functional test framework in QEMU (tests/functional/) recently, I need to drop some other duties - it's getting too much for me otherwise. Laurent is also quite busy with other projects nowadays, so I looked around for help. Fabiano did quite a lot of work in the qtests in the past already, and is also already a maintainer for migration, so I thought he would be a very good fit, thus I asked him whether he would be interested to help out with the qtests and he agreed. Thank you very much, Fabiano! Message-ID: <20241011141344.379781-1-thuth@redhat.com> Acked-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-10-21tests/qtest: Raise the ide-test timeoutPeter Maydell
The ide-test occasionally times out: on the system I run vm-build-openbsd on, it usually takes about 18 seconds, but occasionally hits the 60s timeout, likely when the host machine is under heavy load. I have also seen this test hit its time limit on the s390x CI runner. Double the timeout for this test so that it won't hit its timeout even when the host is running more slowly than usual. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241015113705.239067-1-peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-10-21tests/vm: update openbsd image to 7.6Brad Smith
Remove tomli as Python has been updated to 3.11. [thuth: The "Time appears wrong" line is now necessary since the server seems to provide a wrong timestamp. We likely have to remove that again later once the server is running with the correct time again] Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Message-ID: <ZwtmfVlWgFRF9G8W@humpty.home.comstyle.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-10-21hw/xen: Avoid use of uninitialized bufioreq_evtchnEdgar E. Iglesias
Avoid use of uninitialized bufioreq_evtchn. It should only be used if buffered IOREQs are enabled. Resolves: Coverity CID 1563383 Reported-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
2024-10-18Merge tag 'pull-tpm-2024-10-18-1' of ↵Peter Maydell
https://github.com/stefanberger/qemu-tpm into staging Merge tpm 2024/10/18 v1 # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCAAdFiEEuBi5yt+QicLVzsZrda1lgCoLQhEFAmcSXq4ACgkQda1lgCoL # QhHTRQgAhlSeKfhK1iJsExOmkT/mgAsfoawRUl4DZW4nVmm1xjXmRYcGK8cgEFPn # gw8UJp294cQqxzP9iehEvXP5zkrjmkIQm8fE3hh9nim6bREeo66uDfcfHJEnUK7i # eLXLChsTvpCRO6TtILW65jXwvajPzC5ZBu2Wsbao4HUdEPWAm/g6+gMnaHMe4Dq/ # ml19bOhPJy7J7+0g8dBVannD2X/PKbXhBEjbBu15QdvzW8jQNp4s6z3YN84Fec6X # IoDm+rr0ZZ7hZL/zrbLFT5yGPc23lyVWGyvXBUUNBZCy0jYUFwP7XJFuKwfHp1F1 # 323i4AWBF4fqCtodJje15L+xIJKi1A== # =c7lX # -----END PGP SIGNATURE----- # gpg: Signature made Fri 18 Oct 2024 14:12:14 BST # gpg: using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * tag 'pull-tpm-2024-10-18-1' of https://github.com/stefanberger/qemu-tpm: tests: Wait for migration completion on destination QEMU to avoid failures tpm_emulator: Read control channel response in 2 passes tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-10-18Merge tag 'pull-error-2024-10-18' of https://repo.or.cz/qemu/armbru into stagingPeter Maydell
Error reporting patches for 2024-10-18 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmcSXQQSHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTRKcP/R/nmE22MJBDT8LLZEaQpvkqEURpHFVY # uHcLPBfezWy2A9qgWiPMKEs9Q7L3qpJq2FKCPFx7VyzctMcYt2W70AzVpaBOBkTN # g5JAyFaJ3cGj6VT/HDZrBeIpySHZI1ynZyRqLvay5aV6l2dIzMWAcpFI4w6He0yJ # 9CVV5z8K3zh7a7HjkBeWeKn75W2v6cE1PnRlPIsA4Q05LGVU6iHOhZ9LCJYpgIlL # StJh1zlscSItMbHnfdx0iEiEuoP/nqwoFbA+XpDRzZOLX6+dm2oVwFoApv95bE+/ # CZ8QIy3zda6+V1AGhTfBqDV/NfZZCqzi58YPOo+ny4+sNKXsU7/z2OQzGNVd7NqF # fpflJAPOe+1tuAd/c40VrJn/DN+TgYVV199kMNfbBojMNaoJh262uvQ9L0NuLcW+ # v0cKYRJsTIIHOFj7NwHR8ALY6ZlE3pdLvz9AivFuLLtK+RtfKw2YQvTDTmqXgRsG # J6glqTeN+2M9cYb7/r6Kc/P9TGEaSEoCwmAadfmfwLSW/m1UkrqNzn+iC4m1iLe1 # bq+N1iW5T4nhibw8dFCvD4AwFSP9VQNAy5AlKW78Y+K/xAC2781A8PHV9QAIM1/t # Kz6FRts0Jg6uyB0I7AAZ9k18i1oiEqoz3SjGWpQlTiI7VCMCpgHX6nvwWFPf3Zxa # Rn0SUg10eUW9 # =sR8Q # -----END PGP SIGNATURE----- # gpg: Signature made Fri 18 Oct 2024 14:05:08 BST # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * tag 'pull-error-2024-10-18' of https://repo.or.cz/qemu/armbru: qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, drop hw/intc/openpic: Improve errors for out of bounds property values target/i386/cpu: Improve errors for out of bounds property values target/i386/cpu: Avoid mixing signed and unsigned in property setters block: Adjust check_block_size() signature block: Improve errors about block sizes error: Drop superfluous #include "qapi/qmp/qerror.h" qga: Improve error for guest-set-user-password parameter @crypted qga/qapi-schema: Drop obsolete note on "unsupported" errors Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-10-18qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, dropMarkus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-8-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-10-18hw/intc/openpic: Improve errors for out of bounds property valuesMarkus Armbruster
The error message doesn't matter much, as the "openpic" device isn't user-creatable. But it's the last use of QERR_PROPERTY_VALUE_OUT_OF_RANGE, which has to go. Change the message just like the previous commit did for x86 CPUs. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-7-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-10-18target/i386/cpu: Improve errors for out of bounds property valuesMarkus Armbruster
The error message for a "stepping" value that is out of bounds is a bit odd: $ qemu-system-x86_64 -cpu qemu64,stepping=16 qemu-system-x86_64: can't apply global qemu64-x86_64-cpu.stepping=16: Property .stepping doesn't take value 16 (minimum: 0, maximum: 15) The "can't apply global" part is an unfortunate artifact of -cpu's implementation. Left for another day. The remainder feels overly verbose. Change it to qemu64-x86_64-cpu: can't apply global qemu64-x86_64-cpu.stepping=16: parameter 'stepping' can be at most 15 Likewise for "family", "model", and "tsc-frequency". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-6-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2024-10-18target/i386/cpu: Avoid mixing signed and unsigned in property settersMarkus Armbruster
Properties "family", "model", and "stepping" are visited as signed integers. They are backed by bits in CPUX86State member @cpuid_version. The code to extract and insert these bits mixes signed and unsigned. Not actually wrong, but avoiding such mixing is good practice. Visit them as unsigned integers instead. This adds a few mildly ugly cast in arguments of error_setg(). The next commit will get rid of them again. Property "tsc-frequency" is also visited as signed integer. The value ultimately flows into the kernel, where it is 31 bits unsigned. The QEMU code freely mixes int, uint32_t, int64_t. I elect not to attempt draining this swamp today. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-5-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2024-10-18block: Adjust check_block_size() signatureMarkus Armbruster
Parameter @id is no longer used, drop. Return a bool to indicate success / failure, as recommended by qapi/error.h. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-4-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-10-18block: Improve errors about block sizesMarkus Armbruster
Block sizes need to be a power of two between 512 and an arbitrary limit, currently 2MiB. Commit 5937835ac4c factored block size checking out of set_blocksize() into new check_block_size(), for reuse in block/export/. Its two error messages are okay for the original purpose: $ qemu-system-x86_64 -device ide-hd,physical_block_size=1 qemu-system-x86_64: -device ide-hd,physical_block_size=1: Property .physical_block_size doesn't take value 1 (minimum: 512, maximum: 2097152) $ qemu-system-x86_64 -device ide-hd,physical_block_size=513 qemu-system-x86_64: -device ide-hd,physical_block_size=513: Property .physical_block_size doesn't take value '513', it's not a power of 2 They're mildly off for block exports: $ qemu-storage-daemon --blockdev node-name=nod0,driver=file,filename=foo.img --export type=vduse-blk,id=exp0,node-name=nod0,name=foo,logical-block-size=1 qemu-storage-daemon: --export type=vduse-blk,id=exp0,node-name=nod0,name=foo,logical-block-size=1: Property exp0.logical-block-size doesn't take value 1 (minimum: 512, maximum: 2097152) The error message talks about a property. CLI options like --export don't have properties, they have parameters. Replace the two error messages by a single one that's okay for both purposes. Looks like this: qemu-storage-daemon: --export type=vduse-blk,id=exp0,node-name=nod0,name=foo,logical-block-size=1: parameter logical-block-size must be a power of 2 between 512 and 2097152 Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-3-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-10-18error: Drop superfluous #include "qapi/qmp/qerror.h"Markus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-2-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-10-18qga: Improve error for guest-set-user-password parameter @cryptedMarkus Armbruster
The Windows version of guest-set-user-password rejects argument "crypted": true with the rather useless "this feature or command is not currently supported". Improve to "'crypted' must be off on this host". QERR_UNSUPPORTED is now unused. Drop. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240911131206.2503035-3-armbru@redhat.com>
2024-10-18qga/qapi-schema: Drop obsolete note on "unsupported" errorsMarkus Armbruster
The note talks about "unsupported" errors and QERR_UNSUPPORTED. The former is vague, and the latter makes sense only in C, not in external interface documentation. Fortunately, we don't have to address this anymore: recent merge commit 3b5efc553eb got rid of these errors. Delete the note. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240911131206.2503035-2-armbru@redhat.com>
2024-10-18tests: Wait for migration completion on destination QEMU to avoid failuresStefan Berger
Rather than waiting for the completion of migration on the source side, wait for it on the destination QEMU side to avoid accessing the TPM TIS memory mapped registers before QEMU could restore their state. This error condition could be triggered on busy systems where the destination QEMU did not have enough time to restore the TIS state while the test case was already reading its registers. The test case was for example reading the STS register and received an unexpected value (0xffffffff), which lead to a segmentation fault later on due to trying to read 0xffff bytes from the TIS into a buffer. Cc: <qemu-stable@nongnu.org> Reported-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-10-18tpm_emulator: Read control channel response in 2 passesStefan Berger
Error responses from swtpm are typically only 4 bytes long with the exception of a few commands that return more bytes. Therefore, read the entire response in 2 steps and stop if the first few bytes indicate an error response with no subsequent bytes readable. Read the rest in a 2nd step, if needed. This avoids getting stuck while waiting for too many bytes in case of an error. The 'getting stuck' condition has not been observed in practice so far, though. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2615 Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-10-18tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITYStefan Berger
Use the new ptm_cap_n structure for getting the PTM_GET_CAPABILITY response from swtpm. Previously only 17 bits could possibly have been set in ptm_cap (uint64_t) in big endian order and those bits are now found in the 2nd 32bit word in the response in the caps field. This data structure makes it now clear that the 1st 32bit word carries the tpm_result like all the other response structures of all other commands do. The changes are taken from the swtpm project's tpm_ioctl.h. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-10-18Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into stagingPeter Maydell
* tcg/s390x: Fix for TSTEQ/TSTNE * target/i386: Fixes for IN and OUT with REX prefix * target/i386: New CPUID features and logic fixes * target/i386: Add support save/load HWCR MSR * target/i386: Move more instructions to new decoder; separate decoding and IR generation * target/i386/tcg: Use DPL-level accesses for interrupts and call gates * accel/kvm: perform capability checks on VM file descriptor when necessary * accel/kvm: dynamically sized kvm memslots array * target/i386: fixes for Hyper-V * docs/system: Add recommendations to Hyper-V enlightenments doc # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmcRTIoUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroMCewf8DnZbz7/0beql2YycrdPJZ3xnmfWW # JenWKIThKHGWRTW2ODsac21n0TNXE0vsOYjw/Z/dNLO+72sLcqvmEB18+dpHAD2J # ltb8OvuROc3nn64OEi08qIj7JYLmJ/osroI+6NnZrCOHo8nCirXoCHB7ZPqAE7/n # yDnownWaduXmXt3+Vs1mpqlBklcClxaURDDEQ8CGsxjC3jW03cno6opJPZpJqk0t # 6aX92vX+3lNhIlije3QESsDX0cP1CFnQmQlNNg/xzk+ZQO+vSRrPV+A/N9xf8m1b # HiaCrlBWYef/sLgOHziOSrJV5/N8W0GDEVYDmpEswHE81BZxrOTZLxqzWw== # =qwfc # -----END PGP SIGNATURE----- # gpg: Signature made Thu 17 Oct 2024 18:42:34 BST # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (26 commits) target/i386: Use only 16 and 32-bit operands for IN/OUT accel/kvm: check for KVM_CAP_MEMORY_ATTRIBUTES on vm accel/kvm: check for KVM_CAP_MULTI_ADDRESS_SPACE on vm accel/kvm: check for KVM_CAP_READONLY_MEM on VM target/i386/tcg: Use DPL-level accesses for interrupts and call gates KVM: Rename KVMState->nr_slots to nr_slots_max KVM: Rename KVMMemoryListener.nr_used_slots to nr_slots_used KVM: Define KVM_MEMSLOTS_NUM_MAX_DEFAULT KVM: Dynamic sized kvm memslots array target/i386: assert that cc_op* and pc_save are preserved target/i386: list instructions still in translate.c target/i386: do not check PREFIX_LOCK in old-style decoder target/i386: convert CMPXCHG8B/CMPXCHG16B to new decoder target/i386: decode address before going back to translate.c target/i386: convert bit test instructions to new decoder tcg/s390x: fix constraint for 32-bit TSTEQ/TSTNE docs/system: Add recommendations to Hyper-V enlightenments doc target/i386: Make sure SynIC state is really updated before KVM_RUN target/i386: Exclude 'hv-syndbg' from 'hv-passthrough' target/i386: Fix conditional CONFIG_SYNDBG enablement ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2024-10-17target/i386: Use only 16 and 32-bit operands for IN/OUTRichard Henderson
The REX.W prefix is ignored for these instructions. Mirror the solution already used for INS/OUTS: X86_SIZE_z. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2581 Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Cc: qemu-stable@nongnu.org Link: https://lore.kernel.org/r/20241015004144.2111817-1-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-17accel/kvm: check for KVM_CAP_MEMORY_ATTRIBUTES on vmPaolo Bonzini
The exact set of available memory attributes can vary by VM. In the future it might vary depending on enabled capabilities, too. Query the extension on the VM level instead of on the KVM level, and only after architecture-specific initialization. Inspired by an analogous patch by Tom Dohrmann. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-17accel/kvm: check for KVM_CAP_MULTI_ADDRESS_SPACE on vmPaolo Bonzini
KVM_CAP_MULTI_ADDRESS_SPACE used to be a global capability, but with the introduction of AMD SEV-SNP confidential VMs, the number of address spaces can vary by VM type. Query the extension on the VM level instead of on the KVM level. Inspired by an analogous patch by Tom Dohrmann. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-17accel/kvm: check for KVM_CAP_READONLY_MEM on VMTom Dohrmann
KVM_CAP_READONLY_MEM used to be a global capability, but with the introduction of AMD SEV-SNP confidential VMs, this extension is not always available on all VM types [1,2]. Query the extension on the VM level instead of on the KVM level. [1] https://patchwork.kernel.org/project/kvm/patch/20240809190319.1710470-2-seanjc@google.com/ [2] https://patchwork.kernel.org/project/kvm/patch/20240902144219.3716974-1-erbse.13@gmx.de/ Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Tom Dohrmann <erbse.13@gmx.de> Link: https://lore.kernel.org/r/20240903062953.3926498-1-erbse.13@gmx.de Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-17target/i386/tcg: Use DPL-level accesses for interrupts and call gatesPaolo Bonzini
Stack accesses should be explicit and use the privilege level of the target stack. This ensures that SMAP is not applied when the target stack is in ring 3. This fixes a bug wherein i386/tcg assumed that an interrupt return, or a far call using the CALL or JMP instruction, was always going from kernel or user mode to kernel mode when using a call gate. This assumption is violated if the call gate has a DPL that is greater than 0. Analyzed-by: Robert R. Henry <rrh.henry@gmail.com> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/249 Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-17KVM: Rename KVMState->nr_slots to nr_slots_maxPeter Xu
This value used to reflect the maximum supported memslots from KVM kernel. Rename it to be clearer. Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20240917163835.194664-5-peterx@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-17KVM: Rename KVMMemoryListener.nr_used_slots to nr_slots_usedPeter Xu
This will make all nr_slots counters to be named in the same manner. Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20240917163835.194664-4-peterx@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>