aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-04hw/arm/virt: Check for attempt to use TrustZone with KVM or HVFexynos-gicPeter Maydell
It's not possible to provide the guest with the Security extensions (TrustZone) when using KVM or HVF, because the hardware virtualization extensions don't permit running EL3 guest code. However, we weren't checking for this combination, with the result that QEMU would assert if you tried it: $ qemu-system-aarch64 -enable-kvm -machine virt,secure=on -cpu host -display none Unexpected error in object_property_find_err() at ../../qom/object.c:1304: qemu-system-aarch64: Property 'host-arm-cpu.secure-memory' not found Aborted Check for this combination of options and report an error, in the same way we already do for attempts to give a KVM or HVF guest the Virtualization or MTE extensions. Now we will report: Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Drop Exynos4210Irq structPeter Maydell
The only time we use the int_combiner_irq[] and ext_combiner_irq[] arrays in the Exynos4210Irq struct is during realize of the SoC -- we initialize them with the input IRQs of the combiner devices, and then connect those to outputs of other devices in exynos4210_init_board_irqs(). Now that the combiner objects are easily accessible as s->int_combiner and s->ext_combiner we can make the connections directly from one device to the other without going via these arrays. Since these are the only two remaining elements of Exynos4210Irq, we can remove that struct entirely. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Put combiners into state structPeter Maydell
Switch the creation of the combiner devices to the new-style "embedded in state struct" approach, so we can easily refer to the object elsewhere during realize. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Fold combiner splits into exynos4210_init_board_irqs()Peter Maydell
At this point, the function exynos4210_init_board_irqs() splits input IRQ lines to connect them to the input combiner, output combiner and external GIC. The function exynos4210_combiner_get_gpioin() splits some of the combiner input lines further to connect them to multiple different inputs on the combiner. Because (unlike qemu_irq_split()) the TYPE_SPLIT_IRQ device has a configurable number of outputs, we can do all this in one place, by making exynos4210_init_board_irqs() add extra outputs to the splitter device when it must be connected to more than one input on each combiner. We do this with a new data structure, the combinermap, which is an array each of whose elements is a list of the interrupt IDs on the combiner which must be tied together. As we loop through each interrupt ID, if we find that it is the first one in one of these lists, we configure the splitter device with eonugh extra outputs and wire them up to the other interrupt IDs in the list. Conveniently, for all the cases where this is necessary, the lowest-numbered interrupt ID in each group is in the range of the external combiner, so we only need to code for this in the first of the two loops in exynos4210_init_board_irqs(). The old code in exynos4210_combiner_get_gpioin() which is being deleted here had several problems which don't exist in the new code in its handling of the multi-core timer interrupts: (1) the case labels specified bits 4 ... 8, but bit '8' doesn't exist; these should have been 4 ... 7 (2) it used the input irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)] multiple times as the input of several different splitters, which isn't allowed (3) in an apparent cut-and-paste error, the cases for all the multi-core timer inputs used "bit + 4" even though the bit range for the case was (intended to be) 4 ... 7, which meant it was looking at non-existent bits 8 ... 11. None of these exist in the new code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Don't connect multiple lines to external GIC inputsPeter Maydell
The combiner_grp_to_gic_id[] array includes the EXT_GIC_ID_MCT_G0 and EXT_GIC_ID_MCT_G1 multiple times. This means that we will connect multiple IRQs up to the same external GIC input, which is not permitted. We do the same thing in the code in exynos4210_init_board_irqs() because the conditionals selecting an irq_id in the first loop match multiple interrupt IDs. Overall we do this for interrupt IDs (1, 4), (12, 4), (35, 4), (51, 4), (53, 4) for EXT_GIC_ID_MCT_G0 and (1, 5), (12, 5), (35, 5), (51, 5), (53, 5) for EXT_GIC_ID_MCT_G1 These correspond to the cases for the multi-core timer that we are wiring up to multiple inputs on the combiner in exynos4210_combiner_get_gpioin(). That code already deals with all these interrupt IDs being the same input source, so we don't need to connect the external GIC interrupt for any of them except the first (1, 4) and (1, 5). Remove the array entries and conditionals which were incorrectly causing us to wire up extra lines. This bug didn't cause any visible effects, because we only connect up a device to the "primary" ID values (1, 4) and (1, 5), so the extra lines would never be set to a level. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Connect MCT_G0 and MCT_G1 to both combinersPeter Maydell
Currently for the interrupts MCT_G0 and MCT_G1 which are the only ones in the input range of the external combiner and which are also wired to the external GIC, we connect them only to the internal combiner and the external GIC. This seems likely to be a bug, as all other interrupts which are in the input range of both combiners are connected to both combiners. (The fact that the code in exynos4210_combiner_get_gpioin() is also trying to wire up these inputs on both combiners also suggests this.) Wire these interrupts up to both combiners, like the rest. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Fill in irq_table[] for internal-combiner-only IRQ linesPeter Maydell
In exynos4210_init_board_irqs(), the loop that handles IRQ lines that are in a range that applies to the internal combiner only creates a splitter for those interrupts which go to both the internal combiner and to the external GIC, but it does nothing at all for the interrupts which don't go to the external GIC, leaving the irq_table[] array element empty for those. (This will result in those interrupts simply being lost, not in a QEMU crash.) I don't have a reliable datasheet for this SoC, but since we do wire up one interrupt line in this category (the HDMI I2C device on interrupt 16,1), this seems like it must be a bug in the existing QEMU code. Fill in the irq_table[] entries where we're not splitting the IRQ to both the internal combiner and the external GIC with the IRQ line of the internal combiner. (That is, these IRQ lines go to just one device, not multiple.) This bug didn't have any visible guest effects because the only implemented device that was affected was the HDMI I2C controller, and we never connect any I2C devices to that bus. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Use TYPE_SPLIT_IRQ in exynos4210_init_board_irqs()Peter Maydell
In exynos4210_init_board_irqs(), use the TYPE_SPLIT_IRQ device instead of qemu_irq_split(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Delete unused macro definitionsPeter Maydell
Delete a couple of #defines which are never used. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Move exynos4210_combiner_get_gpioin() into exynos4210.cPeter Maydell
The function exynos4210_combiner_get_gpioin() currently lives in exynos4210_combiner.c, but it isn't really part of the combiner device itself -- it is a function that implements the wiring up of some interrupt sources to multiple combiner inputs. Move it to live with the other SoC-level code in exynos4210.c, along with a few macros previously defined in exynos4210.h which are now used only in exynos4210.c. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Drop ext_gic_irq[] from Exynos4210Irq structPeter Maydell
The only time we use the ext_gic_irq[] array in the Exynos4210Irq struct is during realize of the SoC -- we initialize it with the input IRQs of the external GIC device, and then connect those to outputs of other devices further on in realize (including in the exynos4210_init_board_irqs() function). Now that the ext_gic object is easily accessible as s->ext_gic we can make the connections directly from one device to the other without going via this array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Put external GIC into state structPeter Maydell
Switch the creation of the external GIC to the new-style "embedded in state struct" approach, so we can easily refer to the object elsewhere during realize. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Move exynos4210_init_board_irqs() into exynos4210.cPeter Maydell
The function exynos4210_init_board_irqs() currently lives in exynos4210_gic.c, but it isn't really part of the exynos4210.gic device -- it is a function that implements (some of) the wiring up of interrupts between the SoC's GIC and combiner components. This means it fits better in exynos4210.c, which is the SoC-level code. Move it there. Similarly, exynos4210_git_irq() is used almost only in the SoC-level code, so move it too. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Fix code style nit in combiner_grp_to_gic_id[]Peter Maydell
Fix a missing set of spaces around '-' in the definition of combiner_grp_to_gic_id[]. We're about to move this code, so fix the style issue first to keep checkpatch happy with the code-motion patch. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04hw/arm/exynos4210: Coalesce board_irqs and irq_tablePeter Maydell
The exynos4210 code currently has two very similar arrays of IRQs: * board_irqs is a field of the Exynos4210Irq struct which is filled in by exynos4210_init_board_irqs() with the appropriate qemu_irqs for each IRQ the board/SoC can assert * irq_table is a set of qemu_irqs pointed to from the Exynos4210State struct. It's allocated in exynos4210_init_irq, and the only behaviour these irqs have is that they pass on the level to the equivalent board_irqs[] irq The extra indirection through irq_table is unnecessary, so coalesce these into a single irq_table[] array as a direct field in Exynos4210State which exynos4210_init_board_irqs() fills in. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-01hw/arm/exynos4210: Drop int_gic_irq[] from Exynos4210Irq structPeter Maydell
The only time we use the int_gic_irq[] array in the Exynos4210Irq struct is in the exynos4210_realize() function: we initialize it with the GPIO inputs of the a9mpcore device, and then a bit later on we connect those to the outputs of the internal combiner. Now that the a9mpcore object is easily accessible as s->a9mpcore we can make the connection directly from one device to the other without going via this array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-01hw/arm/exynos4210: Put a9mpcore device into state structPeter Maydell
The exynos4210 SoC mostly creates its child devices as if it were board code. This includes the a9mpcore object. Switch that to a new-style "embedded in the state struct" creation, because in the next commit we're going to want to refer to the object again further down in the exynos4210_realize() function. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- I don't propose to try to do a full conversion of every child device; I'm only going to do them where it makes a subsequent commit a bit nicer, like this one.
2022-04-01hw/intc/exynos4210_gic: Remove unused TYPE_EXYNOS4210_IRQ_GATEPeter Maydell
Now we have removed the only use of TYPE_EXYNOS4210_IRQ_GATE we can delete the device entirely. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-01hw/arm/exynos4210: Use TYPE_OR_IRQ instead of custom OR-gate devicePeter Maydell
The Exynos4210 SoC device currently uses a custom device "exynos4210.irq_gate" to model the OR gate that feeds each CPU's IRQ line. We have a standard TYPE_OR_IRQ device for this now, so use that instead. (This is a migration compatibility break, but that is OK for this machine type.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-31Merge tag 'pull-tcg-20220331' of https://gitlab.com/rth7680/qemu into stagingPeter Maydell
Fix tcg/aarch64 buglet for Windows on ARM host (#947). # gpg: Signature made Thu 31 Mar 2022 18:05:46 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * tag 'pull-tcg-20220331' of https://gitlab.com/rth7680/qemu: tcg/aarch64: Use 'ull' suffix to force 64-bit constant Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-31tcg/aarch64: Use 'ull' suffix to force 64-bit constantRichard Henderson
Typo used only 'ul' suffix, which is still 32-bits for windows host. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/947 Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2022-03-31Merge tag 'pull-qapi-2022-03-31' of git://repo.or.cz/qemu/armbru into stagingPeter Maydell
QAPI patches patches for 2022-03-31 # gpg: Signature made Thu 31 Mar 2022 11:51:34 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-qapi-2022-03-31' of git://repo.or.cz/qemu/armbru: qapi: fix example of dump-guest-memory qapi: fix example of ACPI_DEVICE_OST event qapi: ui examples: add missing @websocket member qapi: fix example of MEMORY_FAILURE qapi: run-state examples: add missing @timestamp qapi: fix examples: SHUTDOWN and RESET events qapi: fix example of FAILOVER_NEGOTIATED event qapi: fix example of UNPLUG_PRIMARY event qapi: fix example of MEMORY_DEVICE_SIZE_CHANGE event qapi: fix example of DUMP_COMPLETED event qapi: fix example of BLOCK_JOB_PENDING event qapi: fix example of BLOCK_IO_ERROR event qapi: fix example of BLOCK_IMAGE_CORRUPTED event qapi: BlockExportRemoveMode: move comments to TODO schemas: add missing vim modeline Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-31qapi: fix example of dump-guest-memoryVictor Toso
Example output lacks mandatory member @paging. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-15-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of ACPI_DEVICE_OST eventVictor Toso
Example output lacks mandatory member @timestamp. Provide it. Event's @data member is missing @info object. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-14-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: ui examples: add missing @websocket memberVictor Toso
The examples were missing mandatory member @websocket. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-13-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of MEMORY_FAILUREVictor Toso
Example output lacks mandatory member @timestamp. Provide it. Example output lacks mandatory member flags.recursive. Provide it. Minor: Change quotes from '' to "" in @action-required member. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-12-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message fixed up] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: run-state examples: add missing @timestampVictor Toso
The changed examples were lacking mandatory member @timestamp. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-11-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix examples: SHUTDOWN and RESET eventsVictor Toso
Example output lacks mandatory member @reason. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-10-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of FAILOVER_NEGOTIATED eventVictor Toso
Example output lacks mandatory member @timestamp. Provide it. Event's documentation is not properly formatted. Fix it by: - Adding @ to "device-id" - Adding extra line for "Since" section Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-9-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of UNPLUG_PRIMARY eventVictor Toso
Example output lacks mandatory member @timestamp. Provide it. Example output is not properly formatted. Fixing it by: - Adding '<-' to signalize it is receiving the data; - Breaking lines similar to the other examples. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-8-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of MEMORY_DEVICE_SIZE_CHANGE eventVictor Toso
Example output lacks mandatory member @qom-path. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220328140604.41484-7-victortoso@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of DUMP_COMPLETED eventVictor Toso
Example output lacks mandatory member @timestamp. Provide it. Example output is not properly formatted. Fixing it by: - Adding '<-' to signalize it is receiving the data; - Adding extra spaces around members @result, @total and @completed Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-6-victortoso@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of BLOCK_JOB_PENDING eventVictor Toso
Example output has the wrong event's name in it. Fix it. Example output shows incorrect member @device. Fix it. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220328140604.41484-5-victortoso@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of BLOCK_IO_ERROR eventVictor Toso
Example output lacks mandatory member @reason. Provide it. Signed-off-by: Victor Toso <victortoso@redhat.com> Message-Id: <20220328140604.41484-4-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: fix example of BLOCK_IMAGE_CORRUPTED eventVictor Toso
Example output lacks mandatory member @fatal. Provide it. Example output shows a value of @msg no version of the code produces. No big deal, but replace it anyway by one that today's code does produce. Signed-off-by: Victor Toso <victortoso@redhat.com> Message-Id: <20220328140604.41484-3-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31qapi: BlockExportRemoveMode: move comments to TODOVictor Toso
@hide and @soft are potential additions which fits the TODO section perfectly. The main motivation is to avoid this whole block of comment entering the wrong section in the python parser. Signed-off-by: Victor Toso <victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20220328140604.41484-2-victortoso@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-31schemas: add missing vim modelineVictor Toso
This is the last qapi schema that is missing the modeline. Fixes 7e7237cd2b "schemas: add missing vim modeline" Signed-off-by: Victor Toso <victortoso@redhat.com> Message-Id: <20220325221605.53995-1-victortoso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-03-29Update version for v7.0.0-rc2 releasePeter Maydell
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-29Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into stagingPeter Maydell
Build bugfixes. # gpg: Signature made Tue 29 Mar 2022 14:59:03 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: tests/tcg: really fix path to target configuration virtio: fix --enable-vhost-user build on non-Linux Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-29Merge tag 'pull-block-2022-03-29' of https://gitlab.com/hreitz/qemu into stagingPeter Maydell
Block patches for 7.0-rc2: - Disable GLOBAL_STATE_CODE() assertion for the 7.0 release: We got another bug report for this, and we do not have the time to investigate before 7.0, so disable the assertion for the release, to re-enable and continue investigation in the 7.1 cycle - stream job fix (regarding interaction with concurrent block jobs) - iotests fixes # gpg: Signature made Tue 29 Mar 2022 15:55:33 BST # gpg: using RSA key CB62D7A0EE3829E45F004D34A1FA40D098019CDF # gpg: issuer "hreitz@redhat.com" # gpg: Good signature from "Hanna Reitz <hreitz@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: CB62 D7A0 EE38 29E4 5F00 4D34 A1FA 40D0 9801 9CDF * tag 'pull-block-2022-03-29' of https://gitlab.com/hreitz/qemu: iotests: Fix status checks block/stream: Drain subtree around graph change main-loop: Disable GLOBAL_STATE_CODE() assertions iotests: update test owner contact information Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-29tests/qtest: failover: fix infinite loopLaurent Vivier
If the migration is over before we cancel it, we are waiting in a loop a state that never comes because the state is already "completed". To avoid an infinite loop, skip the test if the migration is "completed" before we were able to cancel it. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-id: 20220329124259.355995-1-lvivier@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-29iotests: Fix status checksHanna Reitz
An iotest's 'paused' condition is fickle; it will be reported as true whenever the job is drained, for example, or when it is in the process of completing. 030 and 041 contain such checks, we should replace them by checking the job status instead. (As was done for 129 in commit f9a6256b48f29c2816 for the 'busy' condition.) Additionally, when we want to test that a job is paused on error, we might want to give it some time to actually switch to the paused state. Do that by waiting on the corresponding JOB_STATUS_CHANGE event. (But only if they are not already paused; the loops these places are in fetch all VM events, so they may have already fetched that event from the queue.) Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220324180221.24508-1-hreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2022-03-29block/stream: Drain subtree around graph changeHanna Reitz
When the stream block job cuts out the nodes between top and base in stream_prepare(), it does not drain the subtree manually; it fetches the base node, and tries to insert it as the top node's backing node with bdrv_set_backing_hd(). bdrv_set_backing_hd() however will drain, and so the actual base node might change (because the base node is actually not part of the stream job) before the old base node passed to bdrv_set_backing_hd() is installed. This has two implications: First, the stream job does not keep a strong reference to the base node. Therefore, if it is deleted in bdrv_set_backing_hd()'s drain (e.g. because some other block job is drained to finish), we will get a use-after-free. We should keep a strong reference to that node. Second, even with such a strong reference, the problem remains that the base node might change before bdrv_set_backing_hd() actually runs and as a result the wrong base node is installed. Both effects can be seen in 030's TestParallelOps.test_overlapping_5() case, which has five nodes, and simultaneously streams from the middle node to the top node, and commits the middle node down to the base node. As it is, this will sometimes crash, namely when we encounter the above-described use-after-free. Taking a strong reference to the base node, we no longer get a crash, but the resuling block graph is less than ideal: The expected result is obviously that all middle nodes are cut out and the base node is the immediate backing child of the top node. However, if stream_prepare() takes a strong reference to its base node (the middle node), and then the commit job finishes in bdrv_set_backing_hd(), supposedly dropping that middle node, the stream job will just reinstall it again. Therefore, we need to keep the whole subtree drained in stream_prepare(), so that the graph modification it performs is effectively atomic, i.e. that the base node it fetches is still the base node when bdrv_set_backing_hd() sets it as the top node's backing node. Verify this by asserting in said 030's test case that the base node is always the top node's immediate backing child when both jobs are done. Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220324140907.17192-1-hreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
2022-03-29main-loop: Disable GLOBAL_STATE_CODE() assertionsHanna Reitz
These assertions are very useful for developers to find bugs, and so they have indeed pointed us towards bugs already. For users, it is not so useful to find these bugs. We should probably not enable them in releases until we are sufficiently certain that they will not fire during normal operation, unless something is going seriously wrong. For example, we have received a bug report that you cannot add an NBD server on a BDS in an I/O thread with `-incoming defer`. I am sure this is a real bug that needs investigation, but we do not really have that time right now, so close to release, and so I would rather disable the assertions to get time to investigate such reports. (I am just putting the link as "buglink" below, not "closes", because disabling the assertion will not fix the likely underlying bug.) Buglink: https://gitlab.com/qemu-project/qemu/-/issues/945 Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220329093545.52114-1-hreitz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
2022-03-29iotests: update test owner contact informationJohn Snow
Quite a few of these tests have stale contact information. This patch updates the stale ones that I happen to be aware of at the moment. Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20220322174212.1169630-1-jsnow@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
2022-03-29Merge tag 'darwin-20220329' of https://github.com/philmd/qemu into stagingPeter Maydell
Darwin patches - UI fixes # gpg: Signature made Mon 28 Mar 2022 23:42:21 BST # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [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: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'darwin-20220329' of https://github.com/philmd/qemu: ui/console: Check console before emitting GL event ui/cocoa: Respect left-command-key option main-loop: Disable block backend global state assertion on Cocoa gitattributes: Cover Objective-C source files Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-29tests/tcg: really fix path to target configurationPaolo Bonzini
This was attempted in commit 533b0a1a41 ("tests/tcg: Fix target-specific Makefile variables path for user-mode", 2022-01-12) but it also used the wrong path; default.mak is used for config/devices, not config/targets. While at it, explain what the inclusion is about. Cc: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-29virtio: fix --enable-vhost-user build on non-LinuxPaolo Bonzini
The vhost-shadow-virtqueue.c build requires include files from linux-headers/, so it cannot be built on non-Linux systems. Fortunately it is only needed by vhost-vdpa, so move it there. Acked-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-29Merge tag 'mips-20220329' of https://github.com/philmd/qemu into stagingPeter Maydell
MIPS patches queue - ABI fixes (Xuerui, Andreas) - Memory API alias fix (David) # gpg: Signature made Tue 29 Mar 2022 11:34:42 BST # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [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: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'mips-20220329' of https://github.com/philmd/qemu: qemu-binfmt-conf.sh: mips: allow nonzero EI_ABIVERSION, distinguish o32 and n32 target/mips: Fix address space range declaration on n32 memory: Make memory_region_readd_subregion() properly handle mapped aliases Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-03-29qemu-binfmt-conf.sh: mips: allow nonzero EI_ABIVERSION, distinguish o32 and n32Andreas K. Hüttel
With the command line flag -mplt and a recent toolchain, ELF binaries generated by gcc can obtain EI_ABIVERSION=1, which makes, e.g., gcc three-stage bootstrap in a mips-unknown-linux-gnu qemu-user chroot fail since the binfmt-misc magic does not match anymore. Also other values are technically possible. qemu executes these binaries just fine, so relax the mask for the EI_ABIVERSION byte at offset 0x08. In addition, extend magic string to distinguish mips o32 and n32 ABI. This information is given by the EF_MIPS_ABI2 (0x20) bit in the e_flags field of the ELF header (a 4-byte value at offset 0x24 for the here applicable ELFCLASS32). See-also: ace3d65459 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: WANG Xuerui <xen0n@gentoo.org> Cc: Laurent Vivier <laurent@vivier.eu> Cc: WANG Xuerui <xen0n@gentoo.org> Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Alex Bennee <alex.bennee@linaro.org> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Closes: https://gitlab.com/qemu-project/qemu/-/issues/843 Message-Id: <20220328204900.3914990-1-dilfridge@gentoo.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>