aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-09-19nbd: add reference counting to NBDExportPaolo Bonzini3-6/+35
We will use a similar two-phase destruction for NBDExport, so we need each NBDClient to add a reference to NBDExport. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-09-19nbd: do not leak nbd_trip coroutines when a connection is torn downPaolo Bonzini2-6/+28
Because nbd_client_close removes the I/O handlers for the client socket, there is no way that any suspended coroutines are restarted. This will be a problem with the QEMU embedded NBD server, because we will have a QMP command to forcibly close all connections with the clients. Instead, we can exploit the reference counting of NBDClients; shutdown the client socket, which will make it readable and writeable. Also call the close callback, which will release the user's reference. The coroutines then will fail and exit cleanly, and release all remaining references, until the last refcount finally triggers the closure of the client. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-09-19nbd: make refcount interface publicPaolo Bonzini2-2/+5
After the next patch, the close callback will have to release its reference. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-09-19nbd: do not close BlockDriverState in nbd_export_closePaolo Bonzini2-1/+1
This is not desirable when embedding the NBD server inside QEMU. Move the bdrv_close to qemu-nbd. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-09-19nbd: pass NBDClient to nbd_send_negotiatePaolo Bonzini1-37/+41
We will need the NBDClient in nbd_send_negotiate to store the export requested by the client. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-09-18nbd: add more constantsPaolo Bonzini1-7/+10
Avoid magic numbers and magic size computations; hide them behind constants. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-09-15Remove unused CONFIG_TCG_PASS_AREG0 and dead codeBlue Swirl31-525/+53
Now that CONFIG_TCG_PASS_AREG0 is enabled for all targets, remove dead code and support for !CONFIG_TCG_PASS_AREG0 case. Remove dyngen-exec.h and all references to it. Although included by hw/spapr_hcall.c, it does not seem to use it. Remove unused HELPER_CFLAGS. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-09-15target-mips: switch to AREG0 free modeBlue Swirl6-1086/+1163
Add an explicit CPUState parameter instead of relying on AREG0 and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-15target-sh4: switch to AREG0 free modeBlue Swirl5-189/+195
Add an explicit CPUState parameter instead of relying on AREG0 and switch to AREG0 free mode. Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15target-cris: Switch to AREG0 free modeAurelien Jarno6-187/+181
Add an explicit CPUCRISState parameter instead of relying on AREG0, and use cpu_ld* in translation and interrupt handling. Remove AREG0 swapping in tlb_fill(). Switch to AREG0 free mode Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-15target-cris: Avoid AREG0 for helpersAurelien Jarno4-77/+88
Add an explicit CPUCRISState parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-15target-microblaze: switch to AREG0 free modeBlue Swirl5-118/+110
Add an explicit CPUState parameter instead of relying on AREG0 and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15target-arm: final conversion to AREG0 free modeBlue Swirl6-21/+16
Convert code load functions and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2012-09-15target-arm: convert remaining helpersBlue Swirl3-125/+125
Convert remaining helpers to AREG0 free mode: add an explicit CPUState parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2012-09-15target-arm: convert void helpersBlue Swirl3-18/+18
Add an explicit CPUState parameter instead of relying on AREG0. For easier review, convert only op helpers which don't return any value. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2012-09-15target-unicore32: switch to AREG0 free modeBlue Swirl5-75/+58
Add an explicit CPUState parameter instead of relying on AREG0 and switch to AREG0 free mode. Tested-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15target-m68k: avoid using cpu_single_envBlue Swirl1-130/+140
Pass around CPUState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15target-m68k: switch to AREG0 free modeBlue Swirl5-82/+68
Add an explicit CPUState parameter instead of relying on AREG0 and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15target-lm32: switch to AREG0 free modeBlue Swirl5-46/+35
Add an explicit CPUState parameter instead of relying on AREG0 and switch to AREG0 free mode. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15target-s390x: avoid cpu_single_envBlue Swirl1-173/+183
Pass around CPUState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15configure: properly check if -lrt and -lm is neededNatanael Copa1-2/+29
Fixes build against uClibc. uClibc provides 2 versions of clock_gettime(), one with realtime support and one without (this is so you can avoid linking in -lrt unless actually needed). This means that the clock_gettime() don't need -lrt. We still need it for timer_create() so we check for this function in addition. We also need check if -lm is needed for isnan(). Both -lm and -lrt are needed for libs_qga. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-15tcg: Fix MAX_OPC_PARAM_IARGSStefan Weil2-1/+3
DEF_HELPER_FLAGS_5 was added some time ago without adjusting MAX_OPC_PARAM_IARGS. Fixing the definition becomes more important as QEMU is using an increasing number of helper functions called with 5 arguments. Add also a comment to avoid future problems when DEF_HELPER_FLAGS_6 will be added. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-09-11Merge branch 'usb.64' of git://git.kraxel.org/qemuAurelien Jarno13-1042/+1376
* 'usb.64' of git://git.kraxel.org/qemu: (54 commits) xhci: allow bytewise capability register reads xhci: kill xhci_mem_{read,write} dispatcher functions xhci: support multiple interrupters xhci: pick target interrupter xhci: prepare xhci_runtime_{read,write} for multiple interrupters xhci: add XHCIInterrupter xhci: move register update into xhci_intr_raise xhci: add msix support xhci: rework interrupt handling xhci: fix & cleanup msi. usb-storage: usb3 support usb3: bos decriptor usb3: superspeed endpoint companion usb3: superspeed descriptors xhci: update port handling xhci: update register layout xhci: fix runtime write tracepoint xhci: add trace_usb_xhci_ep_set_dequeue xhci: trace cc codes in cleartext xhci: iso xfer support ...
2012-09-11tcg/optimize: fix if/else/break coding styleAurelien Jarno1-23/+11
optimizer.c contains some cases were the break is appearing in both the if and the else parts. Fix that by moving it to the outer part. Also move some common code there. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: add constant folding for brcondAurelien Jarno1-1/+26
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: add constant folding for setcondAurelien Jarno1-0/+81
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: swap brcond/setcond arguments when possibleAurelien Jarno1-0/+18
brcond and setcond ops are not commutative, but it's easy to compute the new condition after swapping the arguments. Try to always put the constant argument in second position like for commutative ops, to help backends to generate better code. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: simplify shift/rot r, 0, a => movi r, 0 casesAurelien Jarno1-0/+20
shift/rot r, 0, a is equivalent to movi r, 0. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: simplify and r, a, 0 casesAurelien Jarno1-0/+1
and r, a, 0 is equivalent to a movi r, 0. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: simplify or/xor r, a, 0 casesAurelien Jarno1-0/+2
or/xor r, a, 0 is equivalent to a mov r, a. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg/optimize: split expression simplificationAurelien Jarno1-1/+13
Split expression simplification in multiple parts so that a given op can appear multiple times. This patch should not change anything. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11tcg: improve profilerAurelien Jarno2-1/+12
Now that there are two passes of optimization (optimize.c, liveness) there is no point of outputing the statistics of the liveness part only. Update the code to take into account both optimizations. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-11xhci: allow bytewise capability register readsGerd Hoffmann1-1/+3
Some guests need this according to Alejandro Martinez Ruiz <alex@securiforest.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: kill xhci_mem_{read,write} dispatcher functionsGerd Hoffmann1-65/+75
... and register subregions instead, so we offload the dispatching to the the memory subsystem which is designed to handle it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: support multiple interruptersGerd Hoffmann1-5/+1
Everything is in place, flip the big switch now and enable support for multiple interrupters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: pick target interrupterGerd Hoffmann1-6/+16
Pick the correct interrupter when queuing an event. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: prepare xhci_runtime_{read,write} for multiple interruptersGerd Hoffmann1-43/+57
Prepare xhci runtime register access function for multiple interrupters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add XHCIInterrupterGerd Hoffmann2-148/+161
Move all state belonging to the (single) interrupter into a separate struct. First step in adding support for multiple interrupters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: move register update into xhci_intr_raiseGerd Hoffmann1-9/+5
Now that we have a separate function to raise an IRQ we can move some comon code into the function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add msix supportGerd Hoffmann2-1/+49
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: rework interrupt handlingGerd Hoffmann1-14/+33
Split xhci_irq_update into a function which handles intx updates (including lowering the irq line once the guests acks the interrupt) and one which is used for raising an irq only. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: fix & cleanup msi.Gerd Hoffmann1-18/+9
Drop custom write_config function which isn't needed any more. Make the msi property a bit property so it accepts 'on' & 'off'. Enable MSI by default. TODO: add compat property to disable on old machine types. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb-storage: usb3 supportGerd Hoffmann1-3/+43
Add usb3 descriptors to usb-storage, so it shows up as superspeed device when connected to xhci. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb3: bos decriptorGerd Hoffmann4-0/+141
Add support for creating BOS descriptor and device cappability descriptors. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb3: superspeed endpoint companionGerd Hoffmann3-20/+62
Add support for building superspeed endpoint companion descriptors, create them for superspeed usb devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11usb3: superspeed descriptorsGerd Hoffmann2-1/+10
Add superspeed descriptor entry to USBDesc, advertise superspeed support when present. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: update port handlingGerd Hoffmann1-40/+97
This patch changes the way xhci ports are linked to USBPorts. The fixed 1:1 relationship between xhci ports and USBPorts is gone. Now each USBPort represents a physical plug which has usually two xhci ports assigned: one usb2 and ond usb3 port. usb devices show up at one or the other, depending on whenever they support superspeed or not. This patch also makes the number of usb2 and usb3 ports runtime configurable by adding 'p2' and 'p3' properties. It is allowed to have different numbers of usb2 and usb3 ports. Specifying p2=4,p3=2 will give you an xhci adapter which supports all speeds on physical ports 1+2 and usb2 only on ports 3+4.
2012-09-11xhci: update register layoutGerd Hoffmann1-8/+13
Change the register layout to be a bit more sparse and also not depend on the number of ports. Useful when for making the number of ports runtime-configurable.
2012-09-11xhci: fix runtime write tracepointGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-11xhci: add trace_usb_xhci_ep_set_dequeueGerd Hoffmann2-1/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>