summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* docs/specs: Add ACPI GED documentationShameer Kolothum2019-10-052-0/+71
| | | | | | | | | | | | Documents basic concepts of ACPI Generic Event device(GED) and interface between QEMU and the ACPI BIOS. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Message-Id: <20190918130633.4872-10-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/arm: Use GED for system_powerdown eventShameer Kolothum2019-10-055-9/+27
| | | | | | | | | | | | | For machines 4.2 or higher with ACPI boot use GED for system_powerdown event instead of GPIO. Guest boot with DT still uses GPIO. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-9-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/arm: Factor out powerdown notifier from GPIOShameer Kolothum2019-10-052-8/+5Star
| | | | | | | | | | | | | | This is in preparation of using GED device for system_powerdown event. Make the powerdown notifier registration independent of create_gpio() fn. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-8-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/arm/virt-acpi-build: Add PC-DIMM in SRATShameer Kolothum2019-10-052-0/+10
| | | | | | | | | | | | | | | | | | | Generate Memory Affinity Structures for PC-DIMM ranges. Also, Linux and Windows need ACPI SRAT table to make memory hotplug work properly, however currently QEMU doesn't create SRAT table if numa options aren't present on CLI. Hence add support(>=4.2) to create numa node automatically (auto_enable_numa_with_memhp) when QEMU is started with memory hotplug enabled but without '-numa' options on CLI. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-7-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/arm/virt: Enable device memory cold/hot plug with ACPI bootShameer Kolothum2019-10-055-7/+80
| | | | | | | | | | | | | | | | | | This initializes the GED device with base memory and irq, configures ged memory hotplug event and builds the corresponding aml code. With this, both hot and cold plug of device memory is enabled now for Guest with ACPI boot. Memory cold plug support with Guest DT boot is not yet supported. As DSDT table gets changed by this, update bios-tables-test-allowed-diff.h to avoid "make check" failure. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Message-Id: <20190918130633.4872-6-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* hw/arm/virt: Add memory hotplug frameworkEric Auger2019-10-052-1/+54
| | | | | | | | | | | | | | | | | This patch adds the memory hot-plug/hot-unplug infrastructure in machvirt. The device memory is not yet exposed to the Guest either through DT or ACPI and hence both cold/hot plug of memory is explicitly disabled for now. Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Kwangwoo Lee <kwangwoo.lee@sk.com> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-5-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/acpi: Add ACPI Generic Event Device SupportSamuel Ortiz2019-10-054-0/+408
| | | | | | | | | | | | | | | | | | | | | | | | | | The ACPI Generic Event Device (GED) is a hardware-reduced specific device[ACPI v6.1 Section 5.6.9] that handles all platform events, including the hotplug ones. This patch generates the AML code that defines GEDs. Platforms need to specify their own GED Event bitmap to describe what kind of events they want to support through GED. Also this uses a a single interrupt for the GED device, relying on IO memory region to communicate the type of device affected by the interrupt. This way, we can support up to 32 events with a unique interrupt. This supports only memory hotplug for now. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Message-Id: <20190918130633.4872-4-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* hw/acpi: Do not create memory hotplug method when handler is not definedSamuel Ortiz2019-10-051-4/+6
| | | | | | | | | | | | | | | | With Hardware-reduced ACPI, the GED device will manage ACPI hotplug entirely. As a consequence, make the memory specific events AML generation optional. The code will only be added when the method name is not NULL. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-3-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/acpi: Make ACPI IO address space configurableShameer Kolothum2019-10-055-22/+33
| | | | | | | | | | | | | | | | | | | | This is in preparation for adding support for ARM64 platforms where it doesn't use port mapped IO for ACPI IO space. We are making changes so that MMIO region can be accommodated and board can pass the base address into the aml build function. Also move few MEMORY_* definitions to header so that other memory hotplug event signalling mechanisms (eg. Generic Event Device on HW-reduced acpi platforms) can use the same from their respective event handler code. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190918130633.4872-2-shameerali.kolothum.thodi@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost-user: save features if the char dev is closedAdrian Moreno2019-10-051-0/+4
| | | | | | | | | | | | | | | | | That way the state can be correctly restored when the device is opened again. This might happen if the backend is restarted. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1738768 Reported-by: Pei Zhang <pezhang@redhat.com> Fixes: 6ab79a20af3a ("do not call vhost_net_cleanup() on running net from char user event") Cc: ddstreet@canonical.com Cc: Michael S. Tsirkin <mst@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Message-Id: <20190924162044.11414-1-amorenoz@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-oct-01-2019' ↵Peter Maydell2019-10-016-491/+2151
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging MIPS queue for October 1st, 2019 # gpg: Signature made Tue 01 Oct 2019 16:10:43 BST # gpg: using RSA key D4972A8967F75A65 # gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.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: 8526 FBF1 5DA3 811F 4A01 DD75 D497 2A89 67F7 5A65 * remotes/amarkovic/tags/mips-queue-oct-01-2019: target/mips: msa: Move helpers for <AND|NOR|OR|XOR>.V target/mips: msa: Simplify and move helper for MOVE.V target/mips: msa: Split helpers for MOD_<S|U>.<B|H|W|D> target/mips: msa: Split helpers for DIV_<S|U>.<B|H|W|D> target/mips: msa: Split helpers for CLT_<S|U>.<B|H|W|D> target/mips: msa: Split helpers for CLE_<S|U>.<B|H|W|D> target/mips: msa: Split helpers for CEQ.<B|H|W|D> target/mips: msa: Split helpers for AVER_<S|U>.<B|H|W|D> target/mips: msa: Split helpers for AVE_<S|U>.<B|H|W|D> target/mips: msa: Split helpers for B<CLR|NEG|SEL>.<B|H|W|D> target/mips: msa: Unroll loops and demacro <BMNZ|BMZ|BSEL>.V target/mips: msa: Split helpers for BINS<L|R>.<B|H|W|D> target/mips: msa: Split helpers for PCNT.<B|H|W|D> target/mips: msa: Split helpers for <NLOC|NLZC>.<B|H|W|D> target/mips: Clean up translate.c target/mips: Clean up mips-defs.h target/mips: Clean up kvm_mips.h target/mips: Clean up internal.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target/mips: msa: Move helpers for <AND|NOR|OR|XOR>.VAleksandar Markovic2019-10-012-45/+45
| | | | | | | | | | | | | | | | Cosmetic reorganization. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-21-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Simplify and move helper for MOVE.VAleksandar Markovic2019-10-012-19/+14Star
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-20-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for MOD_<S|U>.<B|H|W|D>Aleksandar Markovic2019-10-013-26/+188
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-19-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for DIV_<S|U>.<B|H|W|D>Aleksandar Markovic2019-10-013-27/+190
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-18-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for CLT_<S|U>.<B|H|W|D>Aleksandar Markovic2019-10-013-22/+186
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-17-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for CLE_<S|U>.<B|H|W|D>Aleksandar Markovic2019-10-013-22/+186
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-16-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for CEQ.<B|H|W|D>Aleksandar Markovic2019-10-013-11/+87
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-15-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for AVER_<S|U>.<B|H|W|D>Aleksandar Markovic2019-10-013-24/+188
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-14-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for AVE_<S|U>.<B|H|W|D>Aleksandar Markovic2019-10-013-25/+187
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-13-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for B<CLR|NEG|SEL>.<B|H|W|D>Aleksandar Markovic2019-10-013-35/+267
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-12-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Unroll loops and demacro <BMNZ|BMZ|BSEL>.VAleksandar Markovic2019-10-012-27/+43
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-11-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for BINS<L|R>.<B|H|W|D>Aleksandar Markovic2019-10-013-40/+206
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-10-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for PCNT.<B|H|W|D>Aleksandar Markovic2019-10-013-73/+95
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-9-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: msa: Split helpers for <NLOC|NLZC>.<B|H|W|D>Aleksandar Markovic2019-10-013-33/+181
| | | | | | | | | | | | | | | | Achieves clearer code and slightly better performance. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Message-Id: <1569415572-19635-8-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: Clean up translate.cAleksandar Markovic2019-10-011-12/+18
| | | | | | | | | | | | | | | | | | Mostly fix errors and warnings reported by 'checkpatch.pl -f'. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1569331602-2586-7-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: Clean up mips-defs.hAleksandar Markovic2019-10-011-26/+32
| | | | | | | | | | | | | | | | | | Mostly fix errors and warnings reported by 'checkpatch.pl -f'. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1569331602-2586-5-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: Clean up kvm_mips.hAleksandar Markovic2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | Mostly fix errors and warnings reported by 'checkpatch.pl -f'. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1569331602-2586-4-git-send-email-aleksandar.markovic@rt-rk.com>
| * target/mips: Clean up internal.hAleksandar Markovic2019-10-011-23/+37
| | | | | | | | | | | | | | | | | | Mostly fix errors and warnings reported by 'checkpatch.pl -f'. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <1569331602-2586-3-git-send-email-aleksandar.markovic@rt-rk.com>
* | Merge remote-tracking branch ↵Peter Maydell2019-10-016-40/+50
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/huth-gitlab/tags/pull-request-2019-10-01' into staging - Fix and re-enable the usb-hcd-ehci-test - Silence a Coverity warning in hw/m68k/next-cube.c - Fix crash that can occur when using bad binaries with "-kernel" - Disallow colons in the "-accel" parameter # gpg: Signature made Tue 01 Oct 2019 11:03:13 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 * remotes/huth-gitlab/tags/pull-request-2019-10-01: Disallow colons in the parameter of "-accel" hw/core/loader: Fix possible crash in rom_copy() hw/m68k/next-cube: Avoid static RTC variables and introduce control register tests: fix echi/ehci typo tests: fix usb-hcd-ehci-test compilation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | Disallow colons in the parameter of "-accel"Thomas Huth2019-10-012-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Everybody who used something like "-machine accel=kvm:tcg" in the past might be tempted to specify a similar list with the -accel parameter, too, for example "-accel kvm:tcg". However, this is not how this options is thought to be used, since each "-accel" should only take care of one specific accelerator. In the long run, we really should rework the "-accel" code completely, so that it does not set "-machine accel=..." anymore internally, but is completely independent from "-machine". For the short run, let's make sure that users cannot use "-accel xyz:tcg", so that we avoid that we have to deal with such cases in the wild later. Message-Id: <20190930123505.11607-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | hw/core/loader: Fix possible crash in rom_copy()Thomas Huth2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both, "rom->addr" and "addr" are derived from the binary image that can be loaded with the "-kernel" paramer. The code in rom_copy() then calculates: d = dest + (rom->addr - addr); and uses "d" as destination in a memcpy() some lines later. Now with bad kernel images, it is possible that rom->addr is smaller than addr, thus "rom->addr - addr" gets negative and the memcpy() then tries to copy contents from the image to a bad memory location. This could maybe be used to inject code from a kernel image into the QEMU binary, so we better fix it with an additional sanity check here. Cc: qemu-stable@nongnu.org Reported-by: Guangming Liu Buglink: https://bugs.launchpad.net/qemu/+bug/1844635 Message-Id: <20190925130331.27825-1-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | hw/m68k/next-cube: Avoid static RTC variables and introduce control registerThomas Huth2019-10-011-33/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity currently complains that the "if (0x00 & (0x80 >> (phase - 8))" in next-cube.c can never be true. Right it is. The "0x00" is meant as value of the control register of the RTC, which is currently not implemented yet. Thus, let's add a register variable for this now. However, the RTC registers are currently defined as static variables in nextscr2_write(), which is quite ugly. Thus let's also move the RTC variables to the main machine state instead. In the long run, we should likely even refactor the whole RTC code into a separate device in a separate file, but that's something for calm winter nights later... as a first step, cleaning up the static variables and shutting up the warning from Coverity should be sufficient. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20190921091738.26953-1-huth@tuxfamily.org> Signed-off-by: Thomas Huth <huth@tuxfamily.org>
| * | tests: fix echi/ehci typoMarc-André Lureau2019-10-011-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, simplify using $(land). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190926111955.17276-3-marcandre.lureau@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Fixes: dad5ddcea3b661 ("check: Only test usb-ehci when it is compiled in") Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | tests: fix usb-hcd-ehci-test compilationMarc-André Lureau2019-10-011-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes commit e5758de4e836c3b2edc2befd904651fc6967d74f ("tests/libqtest: Make qtest_qmp_device_add/del independent from global_qtest") and commit dd210749727530cdef7c335040edbf81c3c5d041 ("tests/libqtest: Use libqtest-single.h in tests that require global_qtest"). Cc: Thomas Huth <thuth@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190926111955.17276-2-marcandre.lureau@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* | Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-09-28' into ↵Peter Maydell2019-10-01183-698/+847
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging QAPI patches for 2019-09-28 # gpg: Signature made Sat 28 Sep 2019 16:18:13 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 * remotes/armbru/tags/pull-qapi-2019-09-28: (27 commits) qapi: Improve source file read error handling qapi: Improve reporting of redefinition qapi: Improve reporting of missing documentation comment qapi: Eliminate check_keys(), rename check_known_keys() qapi: Improve reporting of invalid 'if' further qapi: Avoid redundant definition references in error messages qapi: Improve reporting of missing / unknown definition keys qapi: Improve reporting of invalid flags qapi: Improve reporting of invalid 'if' errors qapi: Move context-free checking to the proper place qapi: Move context-sensitive checking to the proper place qapi: Inline check_name() into check_union() qapi: Plumb info to the QAPISchemaMember qapi: Make check_type()'s array case a bit more obvious qapi: Move check for reserved names out of add_name() qapi: Report invalid '*' prefix like any other invalid name qapi: Use check_name_str() where it suffices qapi: Improve reporting of invalid name errors qapi: Reorder check_FOO() parameters for consistency qapi: Improve reporting of member name clashes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * qapi: Improve source file read error handlingMarkus Armbruster2019-09-282-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qapi-gen.py crashes when it can't open the main schema file, and when it can't read from any schema file. Lazy. Change QAPISchema.__init__() to take a file name instead of a file object. Move the open code from _include() to __init__(), so it's used for the main schema file, too. Move the read into the try for good measure, and rephrase the error message. Reporting open or read failure for the main schema file needs a QAPISourceInfo representing "no source". Make QAPISourceInfo cope with fname=None. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-27-armbru@redhat.com>
| * qapi: Improve reporting of redefinitionMarkus Armbruster2019-09-284-3/+14
| | | | | | | | | | | | | | | | Point to the previous definition, unless it's a built-in. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-26-armbru@redhat.com>
| * qapi: Improve reporting of missing documentation commentMarkus Armbruster2019-09-282-11/+10Star
| | | | | | | | | | | | | | | | | | Have check_exprs() check this later, so the error message gains an "in definition line". Tweak the error message. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-25-armbru@redhat.com>
| * qapi: Eliminate check_keys(), rename check_known_keys()Markus Armbruster2019-09-281-19/+21
| | | | | | | | | | | | | | | | | | | | | | check_keys() has become a trivial wrapper for check_known_keys(). Eliminate it. This makes its name available. Rename check_known_keys(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-24-armbru@redhat.com>
| * qapi: Improve reporting of invalid 'if' furtherMarkus Armbruster2019-09-2810-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check_if()'s errors don't point to the offending part of the expression. For instance: tests/qapi-schema/alternate-branch-if-invalid.json:2: 'if' condition ' ' makes no sense Other check_FOO() do, with the help of a @source argument. Make check_if() do that, too. The example above improves to: tests/qapi-schema/alternate-branch-if-invalid.json:2: 'if' condition ' ' of 'data' member 'branch' makes no sense Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190927134639.4284-23-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * qapi: Avoid redundant definition references in error messagesMarkus Armbruster2019-09-2853-132/+101Star
| | | | | | | | | | | | | | | | | | Many error messages refer to the offending definition even though they're preceded by an "in definition" line. Rephrase them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190927134639.4284-22-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * qapi: Improve reporting of missing / unknown definition keysMarkus Armbruster2019-09-287-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Have check_exprs() call check_keys() later, so its error messages gain an "in definition" line. Both check_keys() and check_name_is_str() check the definition's name is a string. Since check_keys() now runs after check_name_is_str() rather than before, its check is dead. Bury it. Checking values in check_keys() is unclean anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-21-armbru@redhat.com>
| * qapi: Improve reporting of invalid flagsMarkus Armbruster2019-09-285-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | Split check_flags() off check_keys() and have check_exprs() call it later, so its error messages gain an "in definition" line. Tweak the error messages. Checking values in a function named check_keys() is unclean anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-20-armbru@redhat.com>
| * qapi: Improve reporting of invalid 'if' errorsMarkus Armbruster2019-09-285-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move check_if() from check_keys() to check_exprs() and call it later, so its error messages gain an "in definition" line. Checking values in a function named check_keys() is unclean anyway. The original sin was commit 0545f6b887 "qapi: Better error messages for bad expressions", which checks the value of key 'name'. More sinning in commit 2cbf09925a "qapi: More rigorous checking for type safety bypass", commit c818408e44 "qapi: Implement boxed types for commands/events", and commit 967c885108 "qapi: add 'if' to top-level expressions". This commit does penance for the latter. The next commits will do penance for the others. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-19-armbru@redhat.com>
| * qapi: Move context-free checking to the proper placeMarkus Armbruster2019-09-282-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAPISchemaCommand.check() and QAPISchemaEvent().check() check 'data' is present when 'boxed': true. That's context-free. Move to check_command() and check_event(). Tweak the error message while there. check_exprs() & friends now check exactly what qapi-code-gen.txt calls the second layer of syntax. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-18-armbru@redhat.com>
| * qapi: Move context-sensitive checking to the proper placeMarkus Armbruster2019-09-2840-270/+230Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we introduced the QAPISchema intermediate representation (commit ac88219a6c7), we took a shortcut: we left check_exprs() & friends alone instead of moving semantic checks into the QAPISchemaFOO.check(). The .check() assert check_exprs() did its job. Time to finish the conversion job. Move exactly the context-sensitive checks to the .check(). They replace assertions there. Context-free checks stay put. Fixes the misleading optional tag error demonstrated by test flat-union-optional-discriminator. A few other error message improve. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-17-armbru@redhat.com>
| * qapi: Inline check_name() into check_union()Markus Armbruster2019-09-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | check_name() consists of check_name_is_str() and check_name_str(). check_union() relies on the latter to catch optional discriminators. The next commit will replace that by a more straightforward check. Inlining check_name() into check_union() now should make that easier to review. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-16-armbru@redhat.com>
| * qapi: Plumb info to the QAPISchemaMemberMarkus Armbruster2019-09-282-35/+43
| | | | | | | | | | | | | | | | | | Future commits will need info in the .check() methods of QAPISchemaMember and its descendants. Get it there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-15-armbru@redhat.com>
| * qapi: Make check_type()'s array case a bit more obviousMarkus Armbruster2019-09-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | check_type() checks the array's contents, then peels off the array and falls through to the "not array" code without resetting allow_array and allow_dict to False. Works because the peeled value is a string, and allow_array and allow_dict aren't used then. Tidy up anyway: recurse instead, defaulting allow_array and allow_dict to False. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-14-armbru@redhat.com>