aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-06-24android_adb: Listen for ADB connections on 127.0.0.1, not localhostranchu-linaro-beta1ranchuPeter Maydell
QEMU's inet_listen() routine only listens on the first result it gets back for the hostname it is passed; if that is an IPv6 address, as it is on Windows, then we end up listening on the IPv6 loopback address, and the adb server fails to connect to us because it is expecting to use IPv4. Use the explicit IPv4 loopback address 127.0.0.1 to ensure we are listening where the adb server expects to find us. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23ranchu: Create console and ADB ports automaticallyranchu-proposedPeter Maydell
On startup, start listening on the console and ADB ports automatically, using the same "start at 5554 and work up until we find a pair of ports which we can listen on" algorithm as the classic emulator. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23android_adb: add Android ADB backendChristoffer Dall
The Android adbd daemon running inside Android VMs on the emulator expect to be able to talk to a backend named "qemud:adb" (for historical reasons). The backend will carry out a handshake: 1. Listen for connections from the host adb server on adb_port = <5555 + (2 * emulator instance id)>. 2. Connect to the local adb server on port 5037 if it's available. 3. Listen for and accept the beginning of the handshake with the adbd daemon (adbd sends 'accept' over the write). 4. After the adb backend detects a connection on <adb_port>, it sends back an "ok" string to adbd. 5. The adb backend will not send any more data over the pipe until it recognizes a 'start' request, which means the adbd is ready to receive data from the host ADB server. Once the above process is complete, the adb backend will consume everything it receives on the socket connected on <adb_port> and send it over the adb pipe and will consume everything it receives over the adb pipe and send it on the socket connected on <adb_port>. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> [AJB: Bunch of clean-up/re-factoring to GIOChannel code] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2014-06-23android_adb_dbg: Add Android adb-debug backendChristoffer Dall
Add the adb-debug backend (identified by "qemud:adb-debug") which simply prints all chars send accross the pipe buffers from the guest to stderr. Reads are handled like the zero pipe. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2014-06-23android_pipe: Factor out example/test pipes from android_pipeChristoffer Dall
The Android Pipe main implementation file should only contain the actual implementation. Keeping all that test backend implementation code in there just makes it confusing to grep in the file and figure out what is going on. This could be made dependent on some sort of debug flag to avoid compiling test code as part of shipped binaries in the future. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2014-06-23android_pipe: import the qemu_pipe/goldfish_pipe codeAlex Bennée
This brings in the android emulator pipe code from the current aosp-qemu master branch. It works with and has been tested with the pingpong pipe device. Currently the device cannot save and restore. - remove dependency on android utils (ANEW/ASTRDUP/AFREE) - detach from the goldfish_device bus bits (inc irq raising) - import a few helper functions (uint64_set_high/low, goldfish_guest_is_64bit) - disable the VM save/restore code - use current_cpu for memory translation ops instead of cpu_single_env - fix debugging prints using portable formats - common code path for translating vaddr->qemu addr* - make some debug statments user-visible (unimp and guest errors) There is a hacking backlink between AndroidPipeState and the PipeDevice stuff (which should be merged cleanly later) just so we can get back to ->irq when we need to. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> [cdall: special casing "qemud:<name>"] Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2014-06-23android-console: Make 'help' output match the classic emulatorPeter Maydell
Implement the 'help' command ourselves rather than using the monitor's usual version, so we can make the output text match the format of the classic emulator. This might not be necessary but perhaps external tools are parsing the output to see what commands are supported. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23android-console: Add KO: prefix to parser syntax error messagesPeter Maydell
Indirect all the syntax error messages from the command parser through a function pointer, so the Android console can override it to put the KO: prefix on them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23android-console: Implement quitPeter Maydell
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23android-console: Add support for redir commandsPeter Maydell
Add support for the redir commands which allow addition, removal and listing of TCP and UDP port rediroctions. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23monitor.c: Add support for Android consolePeter Maydell
Implement the Android console by hijacking the stock QEMU monitor and implementing a different command set. This commit provides the initial minimal framework and changes to the core monitor code; it implements only the two commands 'help' and 'kill'. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23qemu-char: Add a chr_del_client method to char backendsPeter Maydell
Add a chr_del_client method to char backends. This makes sense mostly for TCP, where it means "close the current connection and then go back to listening for a new one"; the semantics are as if the remote end had closed the connection. This could for completeness be supported for other backends (eg pipe, fd, tty), but this patch only supports it in TCP. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23slirp: Make slirp_lookup() a public function net_slirp_lookup()Peter Maydell
Make slirp_lookup() a public function so other files can look up the Slirp stack too. We improve the interface a bit so this is practical: * use Error arguments to report failures rather than calling monitor_printf() directly * return a Slirp* rather than a SlirpStack*, since the latter is a type local to this source file * rename to net_slirp_lookup() to match the other public functions in net/slirp.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23hw/arm/ranchu: Add goldfish events devicePeter Maydell
Add the goldfish events device to the ranchu board. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23hw/input/goldfish_events.c: Implement goldfish events devicePeter Maydell
Implement the goldfish 'events' device which provides a variety of input events including simulated touchscreen and hard buttons. This is a forward port and revamp of the goldfish/events_device from the classic Android emulator. Some features from the classic emulator are not supported: * multitouch * full keyboard Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23hw/arm/ranchu: New machine model for 64-bit ARM Android emulatorPeter Maydell
Add a new machine model for the 64-bit ARM Android emulator. This is based heavily on the 'virt' machine model, and like that we also create a device tree to pass to the guest kernel. The major difference is that this board will have all the Android-specific devices in it. We leave space for putting in the goldfish_audio device but do not actually enable it for now, since audio is not an initial requirement and has not been tested. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23goldfish_fb: Don't use uninitialized ymin if screen is blankPeter Maydell
Initialize ymin in the code path taken if the screen is blank, to avoid use of an uninitialized variable. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23hw/display/goldfish_fb: Force update on FB_SET_BASE writesPeter Maydell
After an FB_SET_BASE write, the guest is waiting for us to complete an update cycle and notify it (via the FB_INT_BASE_UPDATE_DONE interrupt status bit). Force the graphics backend to actually do a redraw immediately; this avoids the guest timing out and producing periodic "goldfish_fb_pan_display: timeout waiting for base update" warnings on displays like VNC which make an effort to avoid redraw. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23hw/display/goldfish_fb: Use our own drawfns rather than milkymist'sPeter Maydell
Although the milkymist display device is indeed RGB565, it is bigendian, so we can't actually borrow its drawfn helpers. Implement our own instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23coroutine-win32.c: Add noinline attribute to work around gcc bugPeter Maydell
A gcc codegen bug in x86_64-w64-mingw32-gcc (GCC) 4.6.3 means that non-debug builds of QEMU for Windows tend to assert when using coroutines. Work around this by marking qemu_coroutine_switch as noinline. If we allow gcc to inline qemu_coroutine_switch into coroutine_trampoline, then it hoists the code to get the address of the TLS variable "current" out of the while() loop. This is an invalid transformation because the SwitchToFiber() call may be called when running thread A but return in thread B, and so we might be in a different thread context each time round the loop. This can happen quite often. Typically. a coroutine is started when a VCPU thread does bdrv_aio_readv: VCPU thread main VCPU thread coroutine I/O coroutine bdrv_aio_readv -----> start I/O operation thread_pool_submit_co <------------ yields back to emulation Then I/O finishes and the thread-pool.c event notifier triggers in the I/O thread. event_notifier_ready calls thread_pool_co_cb, and the I/O coroutine now restarts *in another thread*: iothread main iothread coroutine I/O coroutine (formerly in VCPU thread) event_notifier_ready thread_pool_co_cb -----> current = I/O coroutine; call AIO callback But on Win32, because of the bug, the "current" being set here the current coroutine of the VCPU thread, not the iothread. noinline is a good-enough workaround, and quite unlikely to break in the future. (Thanks to Paolo Bonzini for assistance in diagnosing the problem and providing the detailed example/ascii art quoted above.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23slirp: Honour vlan/stack in hostfwd_remove commandsPeter Maydell
The hostfwd_add and hostfwd_remove monitor commands allow the user to optionally specify a vlan/stack tuple. hostfwd_add honours this, but hostfwd_remove does not (it looks up the tuple but then ignores the SlirpState it has looked up and always uses the first stack in the list anyway). Correct this to honour what the user requested. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stackPeter Maydell
If the user specified a (vlan ID, slirp stack name) tuple in a monitor hostfwd_add/remove command and we can't find it, give the user an error message rather than silently doing nothing. This brings this error case in slirp_lookup() into line with the other two. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23qemu-char: Convert socket char backend to parse/kindPeter Maydell
Convert the socket char backend to the new style QAPI framework; this allows it to return an Error ** to callers who might not want it to print directly about socket failures. [The rationale for this patch from the ranchu perspective is that it means that if our attempt to create the android console backend chardev fails because the port was in use we don't get a spurious warning printed to stderr.] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23ui/cocoa: Honour -show-cursor command line optionPeter Maydell
Honour the -show-cursor command line option (which forces the mouse pointer to always be displayed even when input is grabbed) in the Cocoa UI backend. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23ui/cocoa: Fix handling of absolute positioning devicesPeter Maydell
Fix handling of absolute positioning devices, which were basically unusable for two separate reasons: (1) as soon as you pressed the left mouse button we would call CGAssociateMouseAndMouseCursorPosition(FALSE), which means that the absolute coordinates of the mouse events are never updated (2) we didn't account for MacOSX coordinate origin being bottom left rather than top right, and so all the Y values sent to the guest were inverted We fix (1) by aligning our behaviour with the SDL UI backend for absolute devices: * when the mouse moves into the window we do a grab (which means hiding the host cursor and sending special keys to the guest) * when the mouse moves out of the window we un-grab and fix (2) by doing the correct transformation in the call to qemu_input_queue_abs(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23ui/cocoa: Add utility method to check if point is within windowPeter Maydell
Add a utility method to check whether a point is within the current window bounds, and use it in the various places in the mouse handling code that were opencoding the check. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23ui/cocoa: Cope with first surface being same as initial window sizePeter Maydell
Do the recalculation of the content dimensions in switchSurface if the current cdx is zero as well as if the new surface is a different size to the current window. This catches the case where the first surface registered happens to be 640x480 (our current window size), and fixes a bug where we would always display a black screen until the first surface of a different size was registered. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23vnc: fix screen updatesGerd Hoffmann
Bug was added by 38ee14f4f33f8836fc0e209ca59c6ae8c6edf380. vnc_jobs_join call is missing in one code path. Reported-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1402647923-12300-1-git-send-email-kraxel@redhat.com
2014-06-20tcg-i386: Fix win64 qemu storeRichard Henderson
[Cherry pick of master commit 0b919667302aa.] The first non-register argument isn't placed at offset 0. Cc: qemu-stable@nongnu.org Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
2014-06-20w32: Fix regression caused by new g_poll implementationStefan Weil
[Cherry pick from master commit e637aa66470.] Commit 5a007547df76446ab891df93ebc55749716609bf tried to fix a performance degradation caused by bad handling of small timeouts in the original implementation of g_poll. Since that commit, hard disk I/O no longer works. Instead of rewriting the g_poll implementation, this patch simply copies the original code (released under LGPL) from latest glib and only modifies it where needed (see comments in the code). URL of the original code: https://git.gnome.org/browse/glib/tree/glib/gpoll.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Message-id: 1401291744-14314-1-git-send-email-sw@weilnetz.de Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-19target-arm: Correct handling of UXN bit in ARMv8 LPAE page tablesIan Campbell
[Cherry pick of master commit d615efac7c4dc.] In v8 page tables bit 54 in the PTE is UXN in the EL0/EL1 translation regimes and XN elsewhere. In v7 the bit is always XN. Since we only emulate EL0/EL1 we can just treat this bit as UXN whenever we are in v8 mode. Also correctly extract the upper attributes from the PTE entry, the v8 version tried to avoid extracting the CONTIG bit and ended up with the upper bits being off-by-one. Instead behave the same as v7 and extract (but ignore) the CONTIG bit. This fixes "Bad mode in Synchronous Abort handler detected, code 0x8400000f" seen when modprobing modules under Linux. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Claudio Fontana <claudio.fontana@huawei.com> Cc: Rob Herring <robherring2@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-16target-arm: Fix errors in writes to generic timer control registersPeter Maydell
[Cherry pick of master commit d3afacc7269f.] The code for handling writes to the generic timer control registers had several bugs: * ISTATUS (bit 2) is read-only but we forced it to zero on any write * the check for "was IMASK (bit 1) toggled?" incorrectly used '&' where it should be '^' * the handling of IMASK was inverted: we should set the IRQ if ISTATUS is set and IMASK is clear, not if both are set The combination of these bugs meant that when running a Linux guest that uses the generic timers we would fairly quickly end up either forgetting that the timer output should be asserted, or failing to set the IRQ when the timer was unmasked. The result is that the guest never gets any more timer interrupts. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1401803208-1281-1-git-send-email-peter.maydell@linaro.org Cc: qemu-stable@nongnu.org
2014-06-16hw/arm/spitz: Avoid clash with Windows header symbol MOD_SHIFTPeter Maydell
The Windows headers provided by MinGW define MOD_SHIFT. Avoid it by using SPITZ_MOD_* for our constants here. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-26add WIP lionhead machineGreg Hackmann
lionhead is an emulator-only platform based on the ARM vexpress board. The current differences are: 1. replace ARM LCDC and audio devices with virtual goldfish devices 2. remove MMC controller (better handled by virtio) 3. add goldfish battery device (using I/O space reclaimed from MMC) 4. remove "legacy" motherboard layout
2014-05-26goldfish_battery: port to modern qemu apisGreg Hackmann
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26import goldfish_battery from androidGreg Hackmann
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26goldfish_audio: port to modern qemu apisGreg Hackmann
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26goldfish_audio: remove code to read audio input from diskGreg Hackmann
Even on the android qemu, there are syntax errors when USE_QEMU_AUDIO_IN is defined to 0 or left undefined. No point in trying to port something that doesn't work. Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26import goldfish_audio from androidGreg Hackmann
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26goldfish_fb: port to modern qemu apisGreg Hackmann
The device/object APIs and display APIs have been significantly refactored. qemu also has a tracing API which can replace the debugging printfs. Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26HACK: goldfish_fb: disable UI rotation eventsGreg Hackmann
It's not clear how this worked or how to port it to the new display API, so disable it for now Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26HACK: goldfish_fb: remove FB_GET_FORMAT registerGreg Hackmann
FB_GET_FORMAT and associated code poke at a bunch of display internals, but are never referenced by the kernel. Revisit on top of the new qemu display API if/when it's needed by the kernel. Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-26import goldfish_fb from androidGreg Hackmann
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-05-22Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell
* remotes/qmp-unstable/queue/qmp: qapi: zero-initialize all QMP command parameters scripts/qapi.py: Avoid syntax not supported by Python 2.4 doc: add "setup" to list of migration states Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-22Merge remote-tracking branch 'remotes/kraxel/tags/pull-chardev-2' into stagingPeter Maydell
purge error_is_set() # gpg: Signature made Wed 21 May 2014 11:43:44 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-chardev-2: error: error_is_set() is finally unused; remove char: Explain qmp_chardev_add()'s unusual error handling char: Clean up fragile use of error_is_set() char: Use return values instead of error_is_set(errp) qemu-socket: Clean up inet_connect_opts() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-22Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-5' into stagingPeter Maydell
audio: two intel-hda fixes. # gpg: Signature made Wed 21 May 2014 09:49:39 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-audio-5: hw/audio/intel-hda: Avoid shift into sign bit audio/intel-hda: support FIFORDY Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-22Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20140520' into stagingPeter Maydell
some s390 patches: - Enable irqfds on s390 via the new adapter interrupt routing type. As a prereq, fix the kvm enable_cap helpers for some compilers and split the s390 flic into kvm and non-kvm parts. - Enable software and hardware debugging support on s390. This needs a kernel headers update. # gpg: Signature made Tue 20 May 2014 12:30:54 BST using RSA key ID C6F02FAF # gpg: Can't check signature: public key not found * remotes/cohuck/tags/s390x-20140520: s390x/kvm: hw debugging support via guest PER facility s390x/kvm: software breakpoint support s390x: remove duplicate definitions of DIAG 501 linux-headers: update s390x/virtio-ccw: wire up irq routing and irqfds s390x/virtio-ccw: reference-counted indicators s390x: add I/O adapter registration s390x: split flic into kvm and non-kvm parts kvm: Fix enable_cap helpers on older gcc Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-22Merge remote-tracking branch 'remotes/bonzini/scsi-next' into stagingPeter Maydell
* remotes/bonzini/scsi-next: megasas: remove buildtime strings block: iscsi build fix if LIBISCSI_FEATURE_IOVECTOR is not defined virtio-scsi: Plug memory leak on virtio_scsi_push_event() error path scsi: Document intentional fall through in scsi_req_length() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-21qapi: zero-initialize all QMP command parametersMichael Roth
In general QMP command parameter values are specified by consumers of the QMP/HMP interface, but in the case of optional parameters these values may be left uninitialized. It is considered a bug for code to make use of optional parameters that have not been flagged as being present by the marshalling code (via corresponding has_<parameter> parameter), however our marshalling code will still pass these uninitialized values on to the corresponding QMP function (to then be ignored). Some compilers (clang in particular) consider this unsafe however, and generate warnings as a result. As reported by Peter Maydell: This is something clang's -fsanitize=undefined spotted. The code generated by qapi-commands.py in qmp-marshal.c for qmp_marshal_* functions where there are some optional arguments looks like this: bool has_force = false; bool force; mi = qmp_input_visitor_new_strict(QOBJECT(args)); v = qmp_input_get_visitor(mi); visit_type_str(v, &device, "device", errp); visit_start_optional(v, &has_force, "force", errp); if (has_force) { visit_type_bool(v, &force, "force", errp); } visit_end_optional(v, errp); qmp_input_visitor_cleanup(mi); if (error_is_set(errp)) { goto out; } qmp_eject(device, has_force, force, errp); In the case where has_force is false, we never initialize force, but then we use it by passing it to qmp_eject. I imagine we don't then actually use the value, but clang complains in particular for 'bool' variables because the value that ends up being loaded from memory for 'force' is not either 0 or 1 (being uninitialized stack contents). Fix this by initializing all QMP command parameters to {0} in the marshalling code prior to passing them on to the QMP functions. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reported-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-21scripts/qapi.py: Avoid syntax not supported by Python 2.4Luiz Capitulino
The Python "except Foo as x" syntax was only introduced in Python 2.6, but we aim to support Python 2.4 and later. Use the old-style "except Foo, x" syntax instead, thus fixing configure/compile on systems with older Python. Reported-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>