summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-04-27uninorth: move PCI host bridge bus initialisation into device realizeMark Cave-Ayland3-57/+72
Since the IO address space is fixed to use the standard system IO address space then we can also use the opportunity to remove the address_space_io parameter from pci_pmac_init() and pci_pmac_u3_init(). Note we also move the default mac99 PCI bus to the end of the initialisation list so that it becomes the default destination for any devices specified via -device without an explicit PCI bus provided. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: introduce temporary pic_irqs device propertyMark Cave-Ayland2-2/+24
This is in preparation for moving the PCI bus wiring inside the uninorth host bridge devices. In the future it will be possible to remove this once the PICs have been switched to use qdev GPIOs. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: move PCI mmio memory region initialisation into init functionMark Cave-Ayland1-10/+18
Whilst we are here, rename the memory regions to better reflect whether they belong to either a PCI or an AGP bus. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27mac_oldworld: move wiring of macio IRQs to macio_oldworld_realize()Mark Cave-Ayland3-30/+22
Since the macio device has a link to the PIC device, we can now wire up the IRQs directly via qdev GPIOs rather than having to use an intermediate array. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27mac_oldworld: remove pics IRQ array and wire up macio to heathrow directlyMark Cave-Ayland2-13/+22
Introduce constants for the pre-defined Old World IRQs to help keep things readable. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27grackle: move PCI IO (ISA) memory region into the grackle deviceMark Cave-Ayland2-7/+9
This simplifies the Old World machine to simply mapping the ISA memory region into the main address space. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27grackle: remove deprecated pci_grackle_init() functionMark Cave-Ayland3-33/+19
Instead wire up the grackle device inside the Mac Old World machine. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27grackle: general tidy-up and QOMifyMark Cave-Ayland3-36/+64
This is the first step towards removing the old-style pci_grackle_init() function. Following on from the previous commit we can now pass the heathrow device as an object link and wire up the heathrow IRQs via qdev GPIOs. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27heathrow: remove obsolete heathow_init() functionMark Cave-Ayland4-31/+18
Instead wire up heathrow to the CPU and grackle PCI host using qdev GPIOs. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: alter pci_pmac_init() and pci_pmac_u3_init() to return uninorth deviceMark Cave-Ayland3-14/+22
This is in preparation for moving the device wiring into the New World machine. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: move uninorth definitions into uninorth.hMark Cave-Ayland2-21/+52
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [dwg: Added hw/hw.h #include as suggested by Philippe Mathieu-Daudé] Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: remove stray PCIBus realize from mac_newworld.cMark Cave-Ayland1-1/+0
After QOMification this is clearly no longer needed (and possibly hasn't been for some time). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: QOMify PCI and AGP host bridgesMark Cave-Ayland1-47/+32
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: remove second set of uninorth token registersMark Cave-Ayland1-4/+0
Commit 593c181160: "PPC: Newworld: Add second uninorth control register set" added a second set of uninorth registers at 0xf3000000. Testing MacOS 9.2 to MacOS X 10.4 reveals no accesses to this address and I can't find any reference to it in Apple's Core99.cpp source so I'm assuming that this was the result of another bug that has now been fixed. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27uninorth: trivial style fixupsMark Cave-Ayland1-10/+19
This makes sure we keep patchew/checkpatch happy during the remainder of this patchset. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-04-27sdl: Move DisplayOptions global to sdl2_consoleElie Tournier2-5/+6
Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Elie Tournier <elie.tournier@collabora.com> Message-id: 20180413135842.21325-3-tournier.elie@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-04-27qapi: Parameter gl of DisplayType now accept an enumElie Tournier2-6/+24
v2: Rebase on top of master v3: Fix the json format (Eric Blake) Fix a comparison issue (Gerd Hoffmann) Signed-off-by: Elie Tournier <elie.tournier@collabora.com> Message-id: 20180413135842.21325-2-tournier.elie@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-04-27vnc: fix use-after-freeGerd Hoffmann1-2/+3
When vnc_client_read() return value is -1 vs is not valid any more. Fixes: d49b87f0d1e0520443a990fc610d0f02bc63c556 Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420084820.3873-1-kraxel@redhat.com
2018-04-26Merge remote-tracking branch 'remotes/iwj/tags/for-upstream.depriv-2' into ↵Peter Maydell10-120/+242
staging xen: xen-domid-restrict improvements # gpg: Signature made Thu 26 Apr 2018 19:11:22 BST # gpg: using RSA key E3E3392348B50D39 # gpg: Good signature from "Ian Jackson (new general purpose key) <ijackson@chiark.greenend.org.uk>" # 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: 559A E46C 2D6B 6D32 65E7 CBA1 E3E3 3923 48B5 0D39 * remotes/iwj/tags/for-upstream.depriv-2: configure: do_compiler: Dump some extra info under bash os-posix: cleanup: Replace perror with error_report os-posix: cleanup: Replace fprintf with error_report in remaining call sites xen: Expect xenstore write to fail when restricted xen: Remove now-obsolete xen_xc_domain_add_to_physmap xen: Use newly added dmops for mapping VGA memory os-posix: Provide new -runas <uid>:<gid> facility os-posix: cleanup: Replace fprintfs with error_report in change_process_uid xen: destroy_hvm_domain: Try xendevicemodel_shutdown xen: move xc_interface compatibility fallback further up the file xen: destroy_hvm_domain: Move reason into a variable xen: defer call to xen_restrict until just before os_setup_post xen: restrict: use xentoolcore_restrict_all xen: link against xentoolcore AccelClass: Introduce accel_setup_post checkpatch: Add xendevicemodel_handle to the list of types Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-26configure: do_compiler: Dump some extra info under bashIan Jackson1-0/+5
This makes it much easier to find a particular thing in config.log. We have to use the ${BASH_LINENO[*]} syntax which is a syntax error in other shells, so test what shell we are running and use eval. The extra output is only printed if configure is run with bash. On systems where /bin/sh is not bash, it is necessary to say bash ./configure to get the extra debug info in the log. Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Kent R. Spillner <kspillner@acm.org> CC: Janosch Frank <frankja@linux.vnet.ibm.com> CC: Thomas Huth <thuth@redhat.com> CC: Peter Maydell <peter.maydell@linaro.org> CC: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com>
2018-04-26os-posix: cleanup: Replace perror with error_reportIan Jackson1-4/+4
perror() is defined to fprintf(stderr,...). HACKING says fprintf(stderr,...) is wrong. So perror() is too. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: Daniel P. Berrange <berrange@redhat.com> CC: Michael Tokarev <mjt@tls.msk.ru> CC: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2018-04-26os-posix: cleanup: Replace fprintf with error_report in remaining call sitesIan Jackson1-2/+2
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: Daniel P. Berrange <berrange@redhat.com> CC: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com>
2018-04-26xen: Expect xenstore write to fail when restrictedRoss Lagerwall1-1/+6
Saving the current state to xenstore may fail when running restricted (in particular, after a migration). Therefore, don't report the error or exit when running restricted. Toolstacks that want to allow running QEMU restricted should instead make use of QMP events to listen for state changes. CC: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2018-04-26xen: Remove now-obsolete xen_xc_domain_add_to_physmapIan Jackson1-22/+0
The last user was just removed; remove this function, accordingly. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2018-04-26xen: Use newly added dmops for mapping VGA memoryRoss Lagerwall3-23/+78
Xen unstable (to be in 4.11) has two new dmops, relocate_memory and pin_memory_cacheattr. Use these to set up the VGA memory, replacing the previous calls to libxc. This allows the VGA console to work properly when QEMU is running restricted (-xen-domid-restrict). Wrapper functions are provided to allow QEMU to work with older versions of Xen. Tweak the error handling while making this change: * Report pin_memory_cacheattr errors. * Report errors even when DEBUG_HVM is not set. This is useful for trying to understand why VGA is not working, since otherwise it just fails silently. * Fix the return values when an error occurs. The functions now consistently return -1 and set errno. CC: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2018-04-26os-posix: Provide new -runas <uid>:<gid> facilityIan Jackson2-13/+67
This allows the caller to specify a uid and gid to use, even if there is no corresponding password entry. This will be useful in certain Xen configurations. We don't support just -runas <uid> because: (i) deprivileging without calling setgroups would be ineffective (ii) given only a uid we don't know what gid we ought to use (since uids may eppear in multiple passwd file entries with different gids). Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: Daniel P. Berrange <berrange@redhat.com> CC: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2018-04-26os-posix: cleanup: Replace fprintfs with error_report in change_process_uidIan Jackson1-5/+5
I'm going to be editing this function and it makes sense to clean up this style problem in advance. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: Daniel P. Berrange <berrange@redhat.com> CC: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com>
2018-04-26xen: destroy_hvm_domain: Try xendevicemodel_shutdownIan Jackson2-0/+19
xc_interface_open etc. is not going to work if we have dropped privilege, but xendevicemodel_shutdown will if everything is new enough. xendevicemodel_shutdown is only availabe in Xen 4.10 and later, so provide a stub for earlier versions. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
2018-04-26xen: move xc_interface compatibility fallback further up the fileIan Jackson1-7/+11
We are going to want to use the dummy xendevicemodel_handle type in new stub functions in the CONFIG_XEN_CTRL_INTERFACE_VERSION < 41000 section. So we need to provide that definition, or (as applicable) include the appropriate header, earlier in the file. (Ideally the newer compatibility layers would be at the bottom of the file, so that they can naturally benefit from the compatibility layers for earlier version. But that's rather too much for this series.) No functional change. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2018-04-26xen: destroy_hvm_domain: Move reason into a variableIan Jackson1-2/+3
We are going to want to reuse this. No functional change. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2018-04-26xen: defer call to xen_restrict until just before os_setup_postIan Jackson2-8/+14
We need to restrict *all* the control fds that qemu opens. Looking in /proc/PID/fd shows there are many; their allocation seems scattered throughout Xen support code in qemu. We must postpone the restrict call until roughly the same time as qemu changes its uid, chroots (if applicable), and so on. There doesn't seem to be an appropriate hook already. The RunState change hook fires at different times depending on exactly what mode qemu is operating in. And it appears that no-one but the Xen code wants a hook at this phase of execution. So, introduce a bare call to a new function xen_setup_post, just before os_setup_post. Also provide the appropriate stub for when Xen compilation is disabled. We do the restriction before rather than after os_setup_post, because xen_restrict may need to open /dev/null, and os_setup_post might have called chroot. Currently this does not work with migration, because when running as the Xen device model qemu needs to signal to the toolstack that it is ready. It currently does this using xenstore, and for incoming migration (but not for ordinary startup) that happens after os_setup_post. It is correct that this happens late: we want the incoming migration stream to be processed by a restricted qemu. The fix for this will be to do the startup notification a different way, without using xenstore. (QMP is probably a reasonable choice.) So for now this restriction feature cannot be used in conjunction with migration. (Note that this is not a regression in this patch, because previously the -xen-restrict-domid call was, in fact, simply ineffective!) We will revisit this in the Xen 4.11 release cycle. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Paolo Bonzini <pbonzini@redhat.com> (maintainer:X86) CC: Richard Henderson <rth@twiddle.net> (maintainer:X86) CC: Eduardo Habkost <ehabkost@redhat.com> (maintainer:X86) CC: Michael S. Tsirkin <mst@redhat.com> (supporter:PC) Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2018-04-26xen: restrict: use xentoolcore_restrict_allIan Jackson1-35/+11
And insist that it works. Drop individual use of xendevicemodel_restrict and xenforeignmemory_restrict. These are not actually effective in this version of qemu, because qemu has a large number of fds open onto various Xen control devices. The restriction arrangements are still not right, because the restriction needs to be done very late - after qemu has opened all of its control fds. xentoolcore_restrict_all and xentoolcore.h are available in Xen 4.10 and later, only. Provide a compatibility stub. And drop the compatibility stubs for the old functions. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2018-04-26xen: link against xentoolcoreAnthony PERARD1-2/+7
Xen libraries in 4.10 include a new xentoolcore library. This contains the xentoolcore_restrict_all function which we are about to want to use. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2018-04-26AccelClass: Introduce accel_setup_postIan Jackson3-0/+13
This is called just before os_setup_post. Currently none of the accelerators provide this hook, but the Xen one is going to provide one in a moment. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
2018-04-26checkpatch: Add xendevicemodel_handle to the list of typesIan Jackson1-0/+1
This avoids checkpatch misparsing (as statements) long function definitions or declarations, which sometimes start with constructs like this: static inline int xendevicemodel_relocate_memory( xendevicemodel_handle *dmod, domid_t domid, ... The type xendevicemodel_handle does not conform to Qemu CODING_STYLE, which would suggest CamelCase. However, it is a type defined by the Xen Project in xen.git. It would be possible to introduce a typedef to allow the qemu code to refer to it by a differently-spelled name, but that would obfuscate more than it would clarify. CC: Eric Blake <eblake@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2018-04-26vl.c: new function serial_max_hds()Peter Maydell3-3/+10
Create a new function serial_max_hds() which returns the number of serial ports defined by the user. This is needed only by spapr. This allows us to remove the MAX_SERIAL_PORTS define. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-14-peter.maydell@linaro.org
2018-04-26vl.c: Remove compile time limit on number of serial portsPeter Maydell2-10/+7
Instead of having a fixed sized global serial_hds[] array, use a local dynamically reallocated one, so we don't have a compile time limit on how many serial ports a system has. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-13-peter.maydell@linaro.org
2018-04-26superio: Don't use MAX_SERIAL_PORTS for serial port limitPeter Maydell1-1/+3
The superio device has a limit on the number of serial ports it supports which is really only there because it has a fixed-size array serial[]. This limit isn't related particularly to the global MAX_SERIAL_PORTS limit, so use a different #define for it. (In practice the users of superio only ever want 2 serial ports.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-12-peter.maydell@linaro.org
2018-04-26serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTSPeter Maydell6-9/+12
The ISA serial port handling in serial-isa.c imposes a limit of 4 serial ports. This is because we only know of 4 IO port and IRQ settings for them, and is unrelated to the generic MAX_SERIAL_PORTS limit, though they happen to both be set at 4 currently. Use a new MAX_ISA_SERIAL_PORTS wherever that is the correct limit to be checking against. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-11-peter.maydell@linaro.org
2018-04-26hw/char/exynos4210_uart.c: Remove unneeded handling of NULL chardevPeter Maydell1-20/+0
The handling of NULL chardevs in exynos4210_uart_create() is now all unnecessary: we don't need to create 'null' chardevs, and we don't need to enforce a bounds check on serial_hd(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20180420145249.32435-10-peter.maydell@linaro.org
2018-04-26Remove checks on MAX_SERIAL_PORTS that are just bounds checksPeter Maydell7-20/+8
Remove checks on MAX_SERIAL_PORTS that were just checking whether they were within bounds for the serial_hds[] array and falling back to NULL if not. This isn't needed with the serial_hd() function, which returns NULL for all indexes beyond what the user set up. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-9-peter.maydell@linaro.org
2018-04-26Change references to serial_hds[] to serial_hd()Peter Maydell65-143/+143
Change all the uses of serial_hds[] to go via the new serial_hd() function. Code change produced with: find hw -name '*.[ch]' | xargs sed -i -e 's/serial_hds\[\([^]]*\)\]/serial_hd(\1)/g' Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20180420145249.32435-8-peter.maydell@linaro.org
2018-04-26vl.c: Provide accessor function serial_hd() for serial_hds[] arrayPeter Maydell2-0/+12
Provide an accessor function serial_hd() to return the Chardev (if any) associated with the numbered serial port. This will be used to replace direct accesses to the serial_hds[] array, so that calling code doesn't need to care about the size of that array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-7-peter.maydell@linaro.org
2018-04-26hw/xtensa/xtfpga.c: Don't create "null" chardevs for serial devicesPeter Maydell1-4/+0
Following commit 12051d82f004024, UART devices should handle being passed a NULL pointer chardev, so we don't need to create "null" backends in board code. Remove the code that does this and updates serial_hds[]. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-6-peter.maydell@linaro.org
2018-04-26hw/mips/mips_malta: Don't create "null" chardevs for serial devicesPeter Maydell1-5/+0
Following commit 12051d82f004024, UART devices should handle being passed a NULL pointer chardev, so we don't need to create "null" backends in board code. Remove the code that does this and updates serial_hds[]. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-5-peter.maydell@linaro.org
2018-04-26hw/mips/boston.c: Don't create "null" chardevs for serial devicesPeter Maydell1-4/+0
Following commit 12051d82f004024, UART devices should handle being passed a NULL pointer chardev, so we don't need to create "null" backends in board code. Remove the code that does this and updates serial_hds[]. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180420145249.32435-4-peter.maydell@linaro.org
2018-04-26hw/arm/fsl-imx*: Don't create "null" chardevs for serial devicesPeter Maydell3-34/+3
Following commit 12051d82f004024, UART devices should handle being passed a NULL pointer chardev, so we don't need to create "null" backends in board code. Remove the code that does this and updates serial_hds[]. (fsl-imx7.c was already written this way.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20180420145249.32435-3-peter.maydell@linaro.org
2018-04-26hw/char/serial: Allow disconnected chardevsPeter Maydell1-5/+0
Currently the serial.c realize code has an explicit check that it is not connected to a disconnected backend (ie one with a NULL chardev). This isn't what we want -- you should be able to create a serial device even if it isn't attached to anything. Remove the check. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Thomas Huth <thuth@redhat.com> Message-id: 20180420145249.32435-2-peter.maydell@linaro.org
2018-04-26Merge remote-tracking branch ↵Peter Maydell16-78/+148
'remotes/pmaydell/tags/pull-target-arm-20180426' into staging target-arm queue: * xilinx_spips: Correct SNOOP_NONE state when flushing the txfifo * timer/aspeed: fix vmstate version id * hw/arm/aspeed_soc: don't use vmstate_register_ram_global for SRAM * hw/arm/aspeed: don't make 'boot_rom' region 'nomigrate' * hw/arm/highbank: don't make sysram 'nomigrate' * hw/arm/raspi: Don't bother setting default_cpu_type * PMU emulation: some minor bugfixes and preparation for support of other events than just the cycle counter * target/arm: Use v7m_stack_read() for reading the frame signature * target/arm: Remove stale TODO comment * arm: always start from first_cpu when registering loader cpu reset callback * device_tree: Increase FDT_MAX_SIZE to 1 MiB # gpg: Signature made Thu 26 Apr 2018 11:46:31 BST # gpg: using RSA key 3C2525ED14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20180426: xilinx_spips: Correct SNOOP_NONE state when flushing the txfifo timer/aspeed: fix vmstate version id hw/arm/aspeed_soc: don't use vmstate_register_ram_global for SRAM hw/arm/aspeed: don't make 'boot_rom' region 'nomigrate' hw/arm/highbank: don't make sysram 'nomigrate' hw/arm/raspi: Don't bother setting default_cpu_type target/arm: Make PMOVSCLR and PMUSERENR 64 bits wide target/arm: Fix bitmask for PMCCFILTR writes target/arm: Allow EL change hooks to do IO target/arm: Add pre-EL change hooks target/arm: Support multiple EL change hooks target/arm: Fetch GICv3 state directly from CPUARMState target/arm: Mask PMU register writes based on PMCR_EL0.N target/arm: Treat PMCCNTR as alias of PMCCNTR_EL0 target/arm: Check PMCNTEN for whether PMCCNTR is enabled target/arm: Use v7m_stack_read() for reading the frame signature target/arm: Remove stale TODO comment arm: always start from first_cpu when registering loader cpu reset callback device_tree: Increase FDT_MAX_SIZE to 1 MiB Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-26Open 2.13 development treePeter Maydell1-1/+1
Unfortunately I forgot to do this before applying the merge in commit 8e383d19b44863556, so that commit will incorrectly claim to be 2.12 even though it isn't in the official 2.12 release. Oops. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>