aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-07-06tests/tcg: compile system emulation tests as freestandingPaolo Bonzini5-4/+5
System emulation tests do not run in a hosted environment, since they do not link with libc. They should only use freestanding headers (float.h, limits.h, stdarg.h, stddef.h, stdbool.h, stdint.h, stdalign.h, stdnoreturn.h) and should be compiled with -ffreestanding in order to use the compiler implementation of those headers rather than the one in libc. Some tests are using inttypes.h instead of stdint.h, so fix that. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06configure: write EXTRA_CFLAGS for all sub-MakefilesPaolo Bonzini1-4/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06configure: allow more host/target combos to use the host compilerPaolo Bonzini1-0/+4
Add more pairs of bi-arch compilers, so that it is not necessary to have e.g. both little-endian and big-endian ARM compilers. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06configure, pc-bios/vof: pass cross CFLAGS correctlyPaolo Bonzini2-14/+7
Use the flags passed to the configure script for the ppc cross compiler, which in fact default to those that are needed to get the 32-bit ISA. Add the endianness flag so that it remains possible to use a ppc64le compiler to compile VOF. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06configure, pc-bios/s390-ccw: pass cross CFLAGS correctlyPaolo Bonzini3-13/+14
QEMU_CFLAGS is not available in pc-bios/s390-ccw/netboot.mak, but the Makefile needs to access the flags passed to the configure script for the s390x cross compiler. Fix everything and rename QEMU_CFLAGS to EXTRA_CFLAGS for consistency with tests/tcg. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06configure, pc-bios/optionrom: pass cross CFLAGS correctlyPaolo Bonzini2-15/+19
The optionrom build is disregarding the flags passed to the configure script via --cross-cflags-i386. Pass it down and add it to the Makefile. This will make it possible to get the -m32 flag from $target_cflags to force a 32-bit build on 64-bit hosts, instead of supplying manually the arcane -Wa,-32 and linker emulation options. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06pc-bios/optionrom: use -m16 unconditionallyPaolo Bonzini2-17/+1
Remove support for .code16gcc, all supported platforms have -m16. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06scsi/lsi53c895a: fix use-after-free in lsi_do_msgout (CVE-2022-0216)Mauro Matteo Cascella1-1/+2
Set current_req->req to NULL to prevent reusing a free'd buffer in case of repeated SCSI cancel requests. Thanks to Thomas Huth for suggesting the patch. Fixes: CVE-2022-0216 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972 Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220705200543.2366809-1-mcascell@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06tests/vm: do not specify -bios optionPaolo Bonzini4-4/+0
When running from the build tree, the executable is able to find the BIOS on its own; when running from the source tree, a firmware blob should already be installed and there is no guarantee that the one in the source tree works with the QEMU that is being used for the installation. Just remove the -bios option, since it is unnecessary and in fact there are other x86 VM tests that do not bother specifying it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-07-06Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into stagingRichard Henderson2-2/+5
# -----BEGIN PGP SIGNATURE----- # Version: GnuPG v1 # # iQEcBAABAgAGBQJixQP1AAoJEO8Ells5jWIRAsEH/jDlZa1m8jM7vGn6VVUhC6gR # wnwMZVVrg/N+P6614dQ6jFEhTL52AhNONCwl+nzKZDksWMtkX/Owy3DEx0HqXk3m # DyQyI5ngBiRPOOOlgyVHMyc304TFmf9qh4Cz80o5UNsI50lpLMA/vpwgK3zz/KXZ # V6d5C3+kL2y7l5dmHuASiUD8xRTQvDn3/mY94VNzwU36uqODwAizm6Ft6ohTkvdO # WtPQ9AXiVUyHigCxX4r7l9vZjBw0sobVYS1TEoagB2wiEpwTnOYbPhGntBP1eMzv # E1Wf2tJbz67SP+DHuUCrrUyFaDCVLmG7IAh44wIoK4XCGqfrjTxwUftvo1XZ6Gk= # =yqUz # -----END PGP SIGNATURE----- # gpg: Signature made Wed 06 Jul 2022 09:09:33 AM +0530 # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [undefined] # 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: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * tag 'net-pull-request' of https://github.com/jasowang/qemu: ebpf: replace deprecated bpf_program__set_socket_filter e1000: set RX descriptor status in a separate operation Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-06ebpf: replace deprecated bpf_program__set_socket_filterHaochen Tong1-1/+1
bpf_program__set_<TYPE> functions have been deprecated since libbpf 0.8. Replace with the equivalent bpf_program__set_type call to avoid a deprecation warning. Signed-off-by: Haochen Tong <i@hexchain.org> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2022-07-06e1000: set RX descriptor status in a separate operationDing Hui1-1/+4
The code of setting RX descriptor status field maybe work fine in previously, however with the update of glibc version, it shows two issues when guest using dpdk receive packets: 1. The dpdk has a certain probability getting wrong buffer_addr this impact may be not obvious, such as lost a packet once in a while 2. The dpdk may consume a packet twice when scan the RX desc queue over again this impact will lead a infinite wait in Qemu, since the RDT (tail pointer) be inscreased to equal to RDH by unexpected, which regard as the RX desc queue is full Write a whole of RX desc with DD flag on is not quite correct, because when the underlying implementation of memcpy using XMM registers to copy e1000_rx_desc (when AVX or something else CPU feature is usable), the bytes order of desc writing to memory is indeterminacy We can use full-scale test case to reproduce the issue-2 by https://github.com/BASM/qemu_dpdk_e1000_test (thanks to Leonid Myravjev) I also write a POC test case at https://github.com/cdkey/e1000_poc which can reproduce both of them, and easy to verify the patch effect. The hw watchpoint also shows that, when Qemu using XMM related instructions writing 16 bytes e1000_rx_desc, concurrent with DPDK using movb writing 1 byte status, the final result of writing to memory will be one of them, if it made by Qemu which DD flag is on, DPDK will consume it again. Setting DD status in a separate operation, can prevent the impact of disorder memory writing by memcpy, also avoid unexpected data when concurrent writing status by qemu and guest dpdk. Links: https://lore.kernel.org/qemu-devel/20200102110504.GG121208@stefanha-x1.localdomain/T/ Reported-by: Leonid Myravjev <asm@asm.pp.ru> Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: qemu-stable@nongnu.org Tested-by: Jing Zhang <zhangjing@sangfor.com.cn> Reviewed-by: Frank Lee <lifan38153@sangfor.com.cn> Signed-off-by: Ding Hui <dinghui@sangfor.com.cn> Signed-off-by: Jason Wang <jasowang@redhat.com>
2022-07-05Merge tag 'pull-xen-20220705' of ↵Richard Henderson1-10/+15
https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging Xen patches - Xen PCI passthrough fixes # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmLEQFMACgkQDPVXL9f7 # Va9K8ggArmxiJ+g+RQtY8/D7MXjDTA3wfUFWytCAIxarbmxR3eVf5N3DnrP8Yak2 # BX3UmCuZuwedkU11ZXKaMa9PM/tQOpZTWwai2tDuxw8AwjpW3iG4V1jXJ58BXZsM # /81p1/1NqJhGacY1agdf4Yd0uJW+atxbo8/ejLOpmA8S9pHGDMRvSkRezrrOyQEG # z8V9l1ZiAWeJCny98blhfY+RyJ7vj27xf0gBli/kpDwwm/wnxcD6geT3U7hNAwT6 # gcw22u3cHHf9svGUP+X2Y4XpJI5hv4ZoKwVG5ogEkyPiT4eY3ApRzYSAwMtQesqR # rLMpkOEwiGfSJzfHAtdHVconx7Q/fw== # =lPaS # -----END PGP SIGNATURE----- # gpg: Signature made Tue 05 Jul 2022 07:14:51 PM +0530 # gpg: using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [unknown] # gpg: aka "Anthony PERARD <anthony.perard@citrix.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: 5379 2F71 024C 600F 778A 7161 D8D5 7199 DF83 42C8 # Subkey fingerprint: F80C 0063 08E2 2CFD 8A92 E798 0CF5 572F D7FB 55AF * tag 'pull-xen-20220705' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm: xen/pass-through: don't create needless register group xen/pass-through: merge emulated bits correctly Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05xen/pass-through: don't create needless register groupChuck Zmudzinski1-5/+9
Currently we are creating a register group for the Intel IGD OpRegion for every device we pass through, but the XEN_PCI_INTEL_OPREGION register group is only valid for an Intel IGD. Add a check to make sure the device is an Intel IGD and a check that the administrator has enabled gfx_passthru in the xl domain configuration. Require both checks to be true before creating the register group. Use the existing is_igd_vga_passthrough() function to check for a graphics device from any vendor and that the administrator enabled gfx_passthru in the xl domain configuration, but further require that the vendor be Intel, because only Intel IGD devices have an Intel OpRegion. These are the same checks hvmloader and libxl do to determine if the Intel OpRegion needs to be mapped into the guest's memory. Also, move the comment about trapping 0xfc for the Intel OpRegion where it belongs after applying this patch. Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <c76dff6369ccf2256bd9eed5141da1db767293d2.1656480662.git.brchuckz@aol.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2022-07-05xen/pass-through: merge emulated bits correctlyChuck Zmudzinski1-5/+6
In xen_pt_config_reg_init(), there is an error in the merging of the emulated data with the host value. With the current Qemu, instead of merging the emulated bits with the host bits as defined by emu_mask, the emulated bits are merged with the host bits as defined by the inverse of emu_mask. In some cases, depending on the data in the registers on the host, the way the registers are setup, and the initial values of the emulated bits, the end result will be that the register is initialized with the wrong value. To correct this error, use the XEN_PT_MERGE_VALUE macro to help ensure the merge is done correctly. This correction is needed to resolve Qemu project issue #1061, which describes the failure of Xen HVM Linux guests to boot in certain configurations with passed through PCI devices, that is, when this error disables instead of enables the PCI_STATUS_CAP_LIST bit of the PCI_STATUS register of a passed through PCI device, which in turn disables the MSI-X capability of the device in Linux guests with the end result being that the Linux guest never completes the boot process. Fixes: 2e87512eccf3 ("xen/pt: Sync up the dev.config and data values") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1061 Buglink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988333 Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <e4392535d8e5266063dc5461d0f1d301e3dd5951.1656522217.git.brchuckz@aol.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2022-07-05Merge tag 'pull-request-2022-07-05' of https://gitlab.com/thuth/qemu into ↵Richard Henderson40-15233/+314
staging * Fix memory leak in test-cutils * Fix edk2/opensbi jobs to not run automatically by accident * Improve timings in the migration qtest * Remove libvixl disassembler * Add ukrainian translation * Require a recent version of libpng # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmLECEkRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbV7lxAAmEItM6PIoW58eWPzReKVH8LE2w3UlvOZ # JQhNgJjuN23fqjUVkcT0yCfdNCz/nKvafHnxfHQnrAXyB5V5vU8ovBgSuWK2mcmD # NTFK+/2x5lcsyBrOe3QoeD2g1r7+Os3AYVkdnN/t2HAMLwQyaoshKaMV/UHC9O/i # Kle1svYRNyCgyXJgxaOdbVMBSLi/L9h2R5AaG31GIi9wnf0n8HDH/ONtmeIpN09g # BlMeZqPhGJT+tpMvviif65/Za57Y9h/r+TOgEIIs00cWmxqaBmcXXN9qog2s0n7A # nOm3ck2lpGJCQ6+sl6/Mphyr3X6nWHsxGrLDElS0Ba5bg6T/Xqfg2pBcb81Klkjc # QcTdFPiMxKUczgpFq326sqiaVzMgys4vwnW5iPSd5swNzrkYKADAIreki5jyM3cH # lohBG/ruOmg5xMkX2K6pra0iOAeCz44Ku/HTREfY1CTUgEQZJY4SZrMJSnmUTnM+ # EQCkDcmOsnFDaQazneCbo18l37cXOgEhH8VoGAOqg1aRjr7TNlsJzx87PoD+9zNR # GEh7kp18ABRGik5ZACdLQ/HhhOJa8+UWsGCwCdeBGv/TVug1Byz0OUG0PxX3X5SV # WwubeKyZcqzoH92SQI3jZGSmuGBySy9q51T2k8FjZvaDsPiUN/MLPspNezH1qj2B # W7qEaqIyGmo= # =Q2vV # -----END PGP SIGNATURE----- # gpg: Signature made Tue 05 Jul 2022 03:15:45 PM +0530 # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined] # gpg: aka "Thomas Huth <thuth@redhat.com>" [undefined] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [undefined] # 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: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2022-07-05' of https://gitlab.com/thuth/qemu: include/qemu/host-utils: Remove unused code in the *_overflow wrappers meson.build: Require a recent version of libpng po: add ukrainian translation disas: Remove libvixl disassembler tests: use consistent bandwidth/downtime limits in migration tests tests: increase migration test converge downtime to 30 seconds tests: wait for migration completion before looking for STOP event tests: wait max 120 seconds for migration test status changes gitlab-ci: Extend timeout for ubuntu-20.04-s390x-all to 75m gitlab: honour QEMU_CI variable in edk2/opensbi jobs gitlab: tweak comments in edk2/opensbi jobs gitlab: normalize indentation in edk2/opensbi rules tests/fp: Do not build softfloat3 tests if TCG is disabled tests: fix test-cutils leaks Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05Merge tag 'pull-la-20220705' of https://gitlab.com/rth7680/qemu into stagingRichard Henderson8-67/+80
Loongarch patch queue: Build fix for --enable-debug --enable-tcg-interpreter. Build fix for ls7a_rtc. Clear tlb on reset. Fixes for ipi mailboxes. Minor tweak to scripts/qemu-binfmt-conf. # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmLEGVIdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV+SYAgAqMk+GHMT6VQANEsk # So58d9WCPG0XSavowl9oD4w/YSSvPZe5P4KVpJbC3WAgVwEI0RRKTX3RMAeg5z0I # zEEzFUSplSl7cO/7vQG86JRf5C7C/n4V9Q1pQUstNnTEf1s7MdgcG9597OZbV+cF # G5KY1RTQRUr6gpChZQSrv+6j6+aQCA5ZgNwjiVnkBjsNefz1GVFKYppanwHXmMiX # qjxVLgZb1FwOysiKpHKObLsC9pV7ub0QKrlBBk90UyidNjXxcLvV+oQrkyaVwB0m # UM/NN/x5Ive2dqEDfq007TXUc1RpFgwDvKU8EffavBYxx8hCed3DysroiYN+v2MK # qoYWmg== # =+zUy # -----END PGP SIGNATURE----- # gpg: Signature made Tue 05 Jul 2022 04:28:26 PM +0530 # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate] * tag 'pull-la-20220705' of https://gitlab.com/rth7680/qemu: hw/intc/loongarch_ipi: Fix mail send and any send function hw/intc/loongarch_ipi: Fix ipi device access of 64bits tcg/tci: Remove CONFIG_DEBUG_TCG_INTERPRETER scripts/qemu-binfmt-conf: Add LoongArch to qemu_get_family() target/loongarch: Clean up tlb when cpu reset hw/rtc/ls7a_rtc: Drop unused inline functions Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05hw/intc/loongarch_ipi: Fix mail send and any send functionXiaojuan Yang1-23/+31
By the document of ipi mailsend device, byte is written only when the mask bit is 0. The original code discards mask bit and overwrite the data always, this patch fixes the issue. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Message-Id: <20220705064901.2353349-3-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05hw/intc/loongarch_ipi: Fix ipi device access of 64bitsXiaojuan Yang3-11/+39
In general loongarch ipi device, 32bit registers is emulated, however for anysend/mailsend device only 64bit register access is supported. So separate the ipi memory region into two regions, including 32 bits and 64 bits. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Message-Id: <20220705064901.2353349-2-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05tcg/tci: Remove CONFIG_DEBUG_TCG_INTERPRETERRichard Henderson2-12/+0
There is nothing in this environment variable that cannot be done better with -d flags. There is nothing special about TCI that warrants this hack. Moreover, it does not compile -- remove it. Reported-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05scripts/qemu-binfmt-conf: Add LoongArch to qemu_get_family()Song Gao1-0/+3
qemu_get_family() needs to add LoongArch support. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705065943.2353930-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05target/loongarch: Clean up tlb when cpu resetSong Gao1-0/+1
We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05hw/rtc/ls7a_rtc: Drop unused inline functionsRichard Henderson1-21/+6
Remove toy_val_to_time_mon and toy_val_to_time_year as unused, to avoid a build failure with clang. Remove all of the other inline markers too so that this does not creep back in. Reviewed-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-05include/qemu/host-utils: Remove unused code in the *_overflow wrappersThomas Huth1-65/+0
According to commit cec07c0b612975 the code in the #else paths was required for GCC < 5.0 and Clang < 3.8. We don't support such old compilers at all anymore, so we can remove these lines now. We keep the wrapper function, though, since they are easier to read and help to make sure that the parameters have the right types. Message-Id: <20220701025132.303469-1-thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05meson.build: Require a recent version of libpngThomas Huth1-1/+1
According to https://gitlab.com/qemu-project/qemu/-/issues/1080#note_998088246 QEMU does not compile with older versions of libpng, so we should check for a good version in meson.build. According to repology.org, our supported host target operating systems ship these versions: Fedora 35: 1.6.37 CentOS 8 (RHEL-8): 1.6.34 Debian 11: 1.6.37 OpenSUSE Leap 15.3: 1.6.34 Ubuntu LTS 20.04: 1.6.37 FreeBSD Ports: 1.6.37 NetBSD pkgsrc: 1.6.37 OpenBSD Ports: 1.6.37 Homebrew: 1.6.37 MSYS2 mingw: 1.6.37 So it seem reasonable to require at least libpng version 1.6.34 for our builds. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1080 Message-Id: <20220623174941.531196-1-thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05po: add ukrainian translationAndrij Mizyk2-0/+76
Signed-off-by: Andrij Mizyk <andmizyk@gmail.com> Message-Id: <20220613123758.13280-1-andmizyk@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05disas: Remove libvixl disassemblerThomas Huth30-15015/+3
The disassembly via capstone should be superiour to our old vixl sources nowadays, so let's finally cut this old disassembler out of the QEMU source tree. Message-Id: <20220603164249.112459-1-thuth@redhat.com> Tested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05tests: use consistent bandwidth/downtime limits in migration testsDaniel P. Berrangé1-34/+20
The different migration test cases are using a variety of settings to ensure convergance/non-convergance. Introduce two helpers to extra the common functionality and ensure consistency. * Non-convergance: 1ms downtime, 30mbs bandwidth * Convergance: 30s downtime, 1gbs bandwidth Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20220628105434.295905-5-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05tests: increase migration test converge downtime to 30 secondsDaniel P. Berrangé1-1/+1
While 1 second might be enough to converge migration on a fast host, this is not guaranteed, especially if using TLS in the tests without hardware accelerated crypto available. Increasing the downtime to 30 seconds should guarantee it can converge in any sane scenario. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220628105434.295905-4-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05tests: wait for migration completion before looking for STOP eventDaniel P. Berrangé1-1/+4
When moving into the convergance phase, the precopy tests will first look for a STOP event and once found will look for migration completion status. If the test VM is not converging, the test suite will be waiting for the STOP event forever. If we wait for the migration completion status first, then we will trigger the previously added timeout and prevent the test hanging forever. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220628105434.295905-3-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05tests: wait max 120 seconds for migration test status changesDaniel P. Berrangé1-0/+14
Currently the wait_for_migration_fail and wait_for_migration_complete functions will spin in an infinite loop checking query-migrate status to detect a specific change/goal. This is fine when everything goes to plan, but when the unusual happens, these will hang the test suite forever. Any normally executing migration test case normally takes < 1 second for a state change, with exception of the autoconverge test which takes about 5 seconds. Taking into account possibility of people running tests inside TCG, allowing a factor of x20 slowdown gives a reasonable worst case of 120 seconds. Anything taking longer than this is a strong sign that the test has hung, or the test should be rewritten to be faster. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220628105434.295905-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05gitlab-ci: Extend timeout for ubuntu-20.04-s390x-all to 75mRichard Henderson1-0/+1
Recent runs have been taking just over the 60m default. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220606182436.410053-1-richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05gitlab: honour QEMU_CI variable in edk2/opensbi jobsDaniel P. Berrangé2-0/+46
To preserve contributor CI credits we don't want jobs to run by default unless the QEMU_CI variable is set. For most jobs we can achieve this using the base template, but the edk2/opensbi jobs are a little special as they have some complex conditions we can't easily model in the base template. We duplicate existing rules and put them under control of QEMU_CI variable, such that QEMU_CI=1 creates manual jobs and QEMU_CI=2 immediately runs jobs. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220629170638.520630-4-berrange@redhat.com> [thuth: Fixed "on_success" <-> "manual" copy-n-paste bug] Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05gitlab: tweak comments in edk2/opensbi jobsDaniel P. Berrangé2-13/+16
Get rid of comments stating the obvious and re-arrange remaining comments. The opensbi split of rules for file matches is also merged into one rule. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220629170638.520630-3-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05gitlab: normalize indentation in edk2/opensbi rulesDaniel P. Berrangé2-109/+109
The edk2/opensbi gitlab CI config was using single space indents which is not consistent with the rest of the gitlab CI config files. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220629170638.520630-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-05tests/fp: Do not build softfloat3 tests if TCG is disabledPhilippe Mathieu-Daudé1-0/+3
Technically we don't need the TCG accelerator to run the softfloat3 tests. However it is unlikely an interesting build combination. Developers using softfloat3 likely use TCG too. Similarly, developers disabling TCG shouldn't mind much about softfloat3 tests. This reduces a non-TCG build by 474 objects! Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220204152924.6253-3-f4bug@amsat.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-04tests: fix test-cutils leaksMarc-André Lureau1-8/+34
Reported by ASAN. Fixes commit cfb34489 ("cutils: add functions for IEC and SI prefixes"). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220621083420.66365-1-marcandre.lureau@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-04Merge tag 'pull-la-20220704' of https://gitlab.com/rth7680/qemu into stagingRichard Henderson32-95/+1226
LoongArch patch queue: Support linux-user. Fixes for CSR BADV. Fix ASRT{LE,GT} exception. Fixes for LS7A RTC. Fix for interrupt vector spacing. # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmLCs4gdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV89IQgAsgGM117dgDlI48wP # zRVRE9rmK9EE/YR8b4rejh5iFlH0kZTELWAaXmjxWSv9uyXwsApNdnxnthUH1CRD # RbT8AOIUphH6MBMb2joy+zFyBkGBnJQbSxJWN0jDT/ie67I/O0qOIemXU9tETssn # OLNCn+GuNFLiS8EytczkZHDmQjjt00PGZLsnCm+ZY+/ejNci0FV0NItBo6iWxDdj # 8MPJU8pDkXyi+djJpExPc0hTxJ2qmH0FZtpjKwWnU8dbLSRD9IfYhFK5Tsh1oxYJ # 9Er9ZS0RI2CqK3o2k7keYsJHMaIZbNZKhcoA3XiGs15T9YHe1Rc9FeYDasrQw4wQ # 60FwkA== # =i2CR # -----END PGP SIGNATURE----- # gpg: Signature made Mon 04 Jul 2022 03:01:52 PM +0530 # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate] * tag 'pull-la-20220704' of https://gitlab.com/rth7680/qemu: (23 commits) target/loongarch: Add lock when writing timer clear reg target/loongarch: Fix the meaning of ECFG reg's VS field hw/rtc/ls7a_rtc: Fix 'calculate' spelling errors hw/rtc/ls7a_rtc: Use tm struct pointer as arguments in toy_time_to_val() hw/rtc/ls7a_rtc: Fix rtc enable and disable function hw/rtc/ls7a_rtc: Add reset function hw/rtc/ls7a_rtc: Remove unimplemented device in realized function hw/rtc/ls7a_rtc: Fix timer call back function hw/rtc/ls7a_rtc: Fix uninitialied bugs and toymatch writing function hw/intc/loongarch_pch_msi: Fix msi vector convertion target/loongarch: Update README default-configs: Add loongarch linux-user support target/loongarch: Adjust functions and structure to support user-mode target/loongarch: remove unused include hw/loader.h target/loongarch: Fix helper_asrtle_d/asrtgt_d raise wrong exception target/loongarch: Fix missing update CSR_BADV target/loongarch: remove badaddr from CPULoongArch scripts: add loongarch64 binfmt config linux-user: Add LoongArch cpu_loop support linux-user: Add LoongArch syscall support ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04Merge tag 'kraxel-20220704-pull-request' of https://gitlab.com/kraxel/qemu ↵Richard Henderson7-110/+189
into staging usb: canokey fixes. ui: better tab labels, cocoa fix, docs: convert fw_cfg to rst. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmLCndwACgkQTLbY7tPo # cTjNHA/+MT56crVXnjMTdgBRLOuq0cxYnIUptN0JPKx9DTJzdlXEyT+zYD7iIzUt # W0xbOrTLVzU9hfJVh9/5V2HuFmc1eAhfl0BDTzd1TT0kdH6LyUkz5RWgotzo3nvH # 7tnl/sBy48a7diSyQn6K2s8r35ubrX1GNJiJcCLWdVEqvzKKWDEqebs02PxbN/OJ # 9UG9xtkM/QQ1+h74jq5BGKXf08xOhOZIjO274Sn5zievBC9JU6RVkCOlUXiBdk51 # +vNTfKt3c864cstryXSTknYWyVv7zKzCqr7xR7c+fgbt3cN/HmLkM9LGytDMEDl/ # IC0CtKiRN316GgVHHMDT8v8X2dVHNH9ZEEoXRKIbc5jD/tetJw7IIEO7blJphdpV # WE4/bRpJwYVW9UHzig9rPRxsHLs3NSZbNCQEbGUvAbZzS2kq9hnDa/BBtFSYaf+X # RIwR7rY7WhENfSrus1jR5rfWRU7n+q+fcNIFZetUakH1V6Idb0xQir3eM/yM6sBC # nzQSzzLsd3Mwh2ahbnLZ1HkyybZV692usVylKsFLVwcUhCvk+VHccOF31QfrxO/j # ogVzTYYtfrGM5kaknueIMg7XAhjQ04Av70+0b886kZawB3ZE5Ccare2TztHq1jcG # dMdEm7DLaDRm2RXa9NtcbxsIrS0DT2EuFcBnQ1mHMCGql4MidzE= # =Bhbw # -----END PGP SIGNATURE----- # gpg: Signature made Mon 04 Jul 2022 01:29:24 PM +0530 # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [undefined] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [undefined] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [undefined] # 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: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * tag 'kraxel-20220704-pull-request' of https://gitlab.com/kraxel/qemu: hw: canokey: Remove HS support as not compliant to the spec docs/system/devices/usb/canokey: remove limitations on qemu-xhci hw/usb/canokey: fix compatibility of qemu-xhci hw/usb/canokey: Fix CCID ZLP ui/cocoa: Fix clipboard text release ui/console: allow display device to be labeled with given id Convert fw_cfg.rst to reStructuredText syntax Rename docs/specs/fw_cfg.txt to .rst Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04target/loongarch: Add lock when writing timer clear regXiaojuan Yang1-0/+2
There is such error info when running linux kernel: tcg_handle_interrupt: assertion failed: (qemu_mutex_iothread_locked()). calling stack: #0 in raise () at /lib64/libc.so.6 #1 in abort () at /lib64/libc.so.6 #2 in g_assertion_message_expr.cold () at /lib64/libglib-2.0.so.0 #3 in g_assertion_message_expr () at /lib64/libglib-2.0.so.0 #4 in tcg_handle_interrupt (cpu=0x632000030800, mask=2) at ../accel/tcg/tcg-accel-ops.c:79 #5 in cpu_interrupt (cpu=0x632000030800, mask=2) at ../softmmu/cpus.c:248 #6 in loongarch_cpu_set_irq (opaque=0x632000030800, irq=11, level=0) at ../target/loongarch/cpu.c:100 #7 in helper_csrwr_ticlr (env=0x632000039440, val=1) at ../target/loongarch/csr_helper.c:85 #8 in code_gen_buffer () #9 in cpu_tb_exec (cpu=0x632000030800, itb=0x7fff946ac280, tb_exit=0x7ffe4fcb6c30) at ../accel/tcg/cpu-exec.c:358 Add mutex iothread lock around loongarch_cpu_set_irq in csrwr_ticlr() to fix the bug. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-10-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04target/loongarch: Fix the meaning of ECFG reg's VS fieldXiaojuan Yang1-0/+4
By the manual of LoongArch CSR, the VS field(18:16 bits) of ECFG reg means that the number of instructions between each exception entry is 2^VS. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-9-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Fix 'calculate' spelling errorsXiaojuan Yang1-6/+6
Fix 'calculate' spelling errors. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-8-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Use tm struct pointer as arguments in toy_time_to_val()Xiaojuan Yang1-7/+7
Use pointer as arguments in toy_time_to_val() instead of struct tm. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-7-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Fix rtc enable and disable functionXiaojuan Yang1-53/+7
Fix ls7a rtc enable and disable function. When rtc disabled, it do not support to read or write, but the real time is still continue, so we need not neither save the time nor update the rtc offset. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-6-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Add reset functionXiaojuan Yang1-0/+20
Add ls7a rtc reset function to delete timers and clear regs when rtc reset. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Message-Id: <20220701093407.2150607-5-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Remove unimplemented device in realized functionXiaojuan Yang1-1/+0
Remove the unimplemented device when realized ls7a RTC, as it is not uesd. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-4-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Fix timer call back functionXiaojuan Yang1-2/+2
Replace qemu_irq_pulse with qemu_irq_raise in ls7a_timer_cb function to keep consistent with hardware behavior when raise irq. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-3-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/rtc/ls7a_rtc: Fix uninitialied bugs and toymatch writing functionXiaojuan Yang1-9/+11
1. Initialize the tm struct in toymatch_write() and ls7a_toy_start() to fix uninitialized bugs. 2. Fix toymatch_val_to_time function. By the document, when we calculate the expiration year, we should first get current year, and replace the 0-5 bits with toymatch's 26-31 bits. Fixes: Coverity CID 1489766, 1489763 Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220701093407.2150607-2-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04hw/intc/loongarch_pch_msi: Fix msi vector convertionMao Bibo3-2/+23
Loongarch pch msi intc connects to extioi controller, the range of irq number is 64-255. Add a property for irqbase, so that we can compute the irq offset from the view of pch_msi controller with the method: msi vector (from view of upper extioi intc) - irqbase Signed-off-by: Mao Bibo <maobibo@loongson.cn> Message-Id: <20220701030740.2469162-1-maobibo@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-07-04target/loongarch: Update READMESong Gao1-2/+37
Add linux-user emulation introduction Signed-off-by: Song Gao <gaosong@loongson.cn> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220624031049.1716097-14-gaosong@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>