OSDN Git Service
Anthony Liguori [Fri, 12 Oct 2012 14:14:14 +0000 (09:14 -0500)]
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-
20121008.0' into staging
* awilliam/tags/vfio-pci-for-qemu-
20121008.0:
vfio-pci: Fix BAR->VFIODevice translation in
vfio-pci: Clang cleanup
vfio-pci: Cleanup on INTx setup failure
vfio-pci: Extend reset
vfio-pci: Remove setting of MSI qsize
vfio-pci: Use uintptr_t for void* cast
vfio-pci: Don't peak at msi_supported
vfio-pci: Roll the header into the .c file
vfio-pci: No spurious MSIs
vfio-pci: Rework MSIX setup/teardown
vfio-pci: Unmap and retry DMA mapping
vfio-pci: Re-order map/unmap
vfio-pci: Update slow path INTx algorithm
Anthony Liguori [Fri, 12 Oct 2012 14:14:04 +0000 (09:14 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging
* stefanha/net:
net: consolidate NetClientState header files into one
virtio-net: update nc.link_down in virtio_net_load()
e1000: update nc.link_down in e1000_post_load()
rtl8139: implement 8139cp link status
Anthony Liguori [Fri, 12 Oct 2012 14:13:58 +0000 (09:13 -0500)]
Merge remote-tracking branch 'spice/spice.v61' into staging
* spice/spice.v61:
qxl: set default revision to 4
spice: raise requirement to 0.12
hw/qxl: qxl_dirty_surfaces: use uintptr_t
hw/qxl: fix condition for exiting guest_bug
hw/qxl: exit on failure to register qxl interface
qxl: fix range check for rev3 io commands.
qxl/update_area_io: cleanup invalid parameters handling
qxl: always update displaysurface on resize
Peter Crosthwaite [Mon, 1 Oct 2012 02:34:37 +0000 (12:34 +1000)]
ssi: Add slave autoconnect helper
Added helper function to automatically connect SPI slaves based on the QOM child
nodes of a device. A SSI master device can call this routine to automatically
hook-up all child nodes to its SPI bus.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Mon, 6 Aug 2012 01:38:19 +0000 (11:38 +1000)]
MAINTAINERS: Added maintainerships for SSI
Added maintainership for SSI, M25P80 and the Xilinx SPI controllers.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Fri, 3 Aug 2012 06:08:48 +0000 (16:08 +1000)]
xilinx_zynq: Added SPI controllers + flashes
Added the two SPI controllers to the zynq machine model. Attached two SPI flash
devices to each controller.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Wed, 1 Aug 2012 10:52:36 +0000 (20:52 +1000)]
xilinx_spips: Xilinx Zynq SPI cntrlr device model
Added device model for the Xilinx Zynq SPI controller (SPIPS).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 27 Mar 2012 07:57:47 +0000 (17:57 +1000)]
petalogix-ml605: added SPI controller with n25q128
Added SPI controller to the reference design, with two n25q128 spi-flashes
connected.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Mon, 26 Mar 2012 12:59:55 +0000 (22:59 +1000)]
xilinx_spi: Initial impl. of Xilinx SPI controller
Device model for xilinx XPS SPI controller (v2.0)
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Mon, 26 Mar 2012 12:10:59 +0000 (22:10 +1000)]
m25p80: Initial implementation of SPI flash device
Added device model for m25p80 style SPI flash family.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Wed, 1 Aug 2012 10:26:12 +0000 (20:26 +1000)]
hw: Added generic FIFO API.
Added a FIFO API that can be used to create and operate byte FIFOs.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Tue, 31 Jul 2012 06:42:04 +0000 (16:42 +1000)]
stellaris: Removed SSI mux
Removed the explicit SSI mux and wired the CS line directly up to the SSI
devices.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Tue, 31 Jul 2012 02:24:06 +0000 (12:24 +1000)]
qdev: allow multiple qdev_init_gpio_in() calls
Allow multiple qdev_init_gpio_in() calls for the one device. The first call will
define GPIOs 0-N-1, the next GPIOs N- ... . Allows different GPIOs to be handled
with different handlers. Needed when two levels of the QOM class heirachy both
define GPIO functionality, as a single GPIO handler with an index selecter is
not possible.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 24 Jul 2012 03:56:27 +0000 (13:56 +1000)]
ssi: Added create_slave_no_init()
Slave creation function that can be used to create an SSI slave without
qdev_init() being called. This give machine models a chance to set properties.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 24 Jul 2012 02:23:22 +0000 (12:23 +1000)]
ssi: Implemented CS behaviour
Added default CS behaviour for SSI slaves. SSI devices can set a property
to enable CS behaviour which will create a GPIO on the device which is the
CS. Tristating of the bus on SSI transfers is implemented.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 24 Jul 2012 00:55:15 +0000 (10:55 +1000)]
ssi: Support for multiple attached devices
Removed assertion that only one device is attached to the SSI bus.
When multiple devices are attached, all slaves have their transfer function
called for transfers. Each device is responsible for knowing whether or not its
CS is active, and if not returning 0. The returned data is the logical or of
all responses from the (mulitple) devices.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Jan Kiszka [Mon, 8 Oct 2012 14:45:31 +0000 (08:45 -0600)]
vfio-pci: Fix BAR->VFIODevice translation in
DO_UPCAST is supposed to translate from the first member of a struct to
that struct, not from arbitrary ones. And it (usually) breaks the build
when neglecting this rule. Use container_of to fix the build breakage
and likely also the runtime behavior.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
aw: runtime behavior is actually the same, but clearly misuse of DO_UPCAST
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:31 +0000 (08:45 -0600)]
vfio-pci: Clang cleanup
Blue Swirl reports that Clang doesn't like the structure we define to
avoid dynamic allocation for a number of calls to VFIO_DEVICE_SET_IRQS.
Adding an element after a variable sized type is a GNU extension.
Switch back to dynamic allocation, which really isn't a problem since
this is only done on interrupt setup changes.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Cleanup on INTx setup failure
Missing some unwind code.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Extend reset
Take what we've learned from pci-assign and apply it to vfio-pci.
On reset, disable previous interrupt config, perform a device
reset if available, re-enable INTx, and disable memory regions on
the device to prevent continuing DMA.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Remove setting of MSI qsize
This was a misinterpretation of the spec, hardware doesn't get to
specify how many were actually enabled through this field.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Use uintptr_t for void* cast
We don't seem to run into any sign extension problems, but
unsigned looks more correct.
Signed-off-by: Alex williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Don't peak at msi_supported
Let the init function fail, just don't warn for -ENOTSUP.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Roll the header into the .c file
It's only ~100 lines and nobody else should be using this.
Suggested by Michael Tsirkin.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: No spurious MSIs
FreeBSD doesn't like these spurious MSIs, remove them as they're
mostly paranoia anyway.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Rework MSIX setup/teardown
We try to do lazy initialization of MSIX since we don't actually need
to setup anything until MSIX vectors start getting used. This leads
to problems if MSIX is enabled, but never used (we can end up trying
to re-enable INTx while it's still enabled). We also run into
problems trying to expand our reset function to tear down interrupts
as we can then get vector release notifications after we've released
data structures. By making explicit initialization and teardown we
can avoid both of these problems and behave more similar to bare
metal.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Unmap and retry DMA mapping
Occasionally we get regions added that overlap with existing mappings.
These always seems to be in the VGA ROM range. VFIO returns EBUSY
for these mapping attempts. We can try a little harder and assume
that the latest mapping is correct by removing any overlapping ranges
and retrying the original request.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Re-order map/unmap
This cleans up the next patch that calls unmap from map.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Update slow path INTx algorithm
We can't afford the overhead of switching out and back into mmap mode
around each interrupt, but we can do it lazily via a timer. On INTx
interrupt, disable the mmap'd memory regions and set a timer. On
every interrupt, push the timer out. If the timer expires and the
interrupt is no longer pending, switch back to mmap mode.
This has the benefit that things like graphics cards, which rarely or
never, fire an interrupt don't need manual user intervention to add
the x-intx=off parameter. They'll just remain in mmap mode until they
trigger an interrupt, and if they don't continue to regularly fire
interrupts, they'll switch back.
The default timeout is tuned for network cards so that a ping is just
enough to keep them in non-mmap mode, where they have much better
latency. It is tunable with an experimental option,
x-intx-mmap-timeout-ms. A value of 0 keeps the device in non-mmap
mode after the first interrupt.
It's possible we could look at the class code of devices and come up
with reasonable per-class defaults based on expected interrupt
frequency and latency. None of this is used for MSI interrupts and
also won't be used if we can bypass through KVM.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Paolo Bonzini [Mon, 17 Sep 2012 16:43:51 +0000 (18:43 +0200)]
net: consolidate NetClientState header files into one
This patch doesn't seem much useful alone, I must admit. However,
it makes sense as part of the upcoming directory reorganization,
where I want to have include/net/tap.h as the net<->hw interface
for tap. Then having both net/tap.h and include/net/tap.h does
not work. "Fixed" by moving all the init functions to a single
header file net/clients.h.
The patch also adopts a uniform style for including net/*.h files
from net/*.c, without the net/ path.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Amos Kong [Fri, 28 Sep 2012 02:06:02 +0000 (10:06 +0800)]
virtio-net: update nc.link_down in virtio_net_load()
nc.link_down could not be migrated, this patch updates link_down in
virtio_post_load() to keep it coincident with real link status.
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Amos Kong [Fri, 28 Sep 2012 02:06:01 +0000 (10:06 +0800)]
e1000: update nc.link_down in e1000_post_load()
This patch introduced e1000_post_load(), it will be called in the end of
migration. nc.link_down could not be migrated, this patch updates
link_down in e1000_post_load() to keep it coincident with real link
status.
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Jason Wang [Fri, 28 Sep 2012 02:06:00 +0000 (10:06 +0800)]
rtl8139: implement 8139cp link status
Add a link status chang callback and change the link status bit in BMSR
& MSR accordingly. Tested in Linux/Windows guests.
The link status bit of MediaStatus is infered from BasicModeStatus,
they are inverse.
nc.link_down could not be migrated, this patch updates link_down in
rtl8139_post_load() to keep it coincident with real link status.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Gerd Hoffmann [Mon, 8 Oct 2012 08:05:22 +0000 (10:05 +0200)]
qxl: set default revision to 4
Set qxl pci revision to 4 (for pc-1.3+) so guests know
spice-server 0.12 features are available.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Mon, 24 Sep 2012 08:23:40 +0000 (10:23 +0200)]
spice: raise requirement to 0.12
With the next qemu version (1.3) we are going to bump the qxl device
revision to 4. The new features available require a recent spice-server
version, so raise up the bar. Otherwise we would end up with different
qxl revisions depending on the spice-server version installed, which
would be a major PITA when it comes to compat properties.
Clear out a big bunch of #ifdefs which are not needed any more.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Alon Levy [Sun, 7 Oct 2012 15:03:35 +0000 (17:03 +0200)]
hw/qxl: qxl_dirty_surfaces: use uintptr_t
As suggested by Paolo Bonzini, to avoid possible integer overflow issues.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Alon Levy [Tue, 2 Oct 2012 09:39:14 +0000 (11:39 +0200)]
hw/qxl: fix condition for exiting guest_bug
Reported and suggested by Paolo Bonzini, thanks.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Alon Levy [Wed, 3 Oct 2012 18:13:58 +0000 (20:13 +0200)]
hw/qxl: exit on failure to register qxl interface
This prevents a segfault later on when the device reset handler
tries to access a NULL ssd.worker since interface_attach_worker has
not been called.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Tue, 25 Sep 2012 11:56:40 +0000 (13:56 +0200)]
qxl: fix range check for rev3 io commands.
Enables QXL_IO_FLUSH_SURFACES_ASYNC and QXL_IO_FLUSH_RELEASE
which are part of the qxl rev3 feature set.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Michael Tokarev [Wed, 19 Sep 2012 13:41:26 +0000 (17:41 +0400)]
qxl/update_area_io: cleanup invalid parameters handling
This cleans up two additions of almost the same code in commits
511b13e2c9 and
ccc2960d654. While at it, make error paths
consistent (always use 'break' instead of 'return').
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Dunrong Huang <riegamaths@gmail.com>
Cc: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 14 Sep 2012 20:09:23 +0000 (22:09 +0200)]
qxl: always update displaysurface on resize
Don't try to be clever and skip displaysurface reinitialization in case
the size hasn't changed. Other parameters might have changed
nevertheless, for example depth or stride, resulting in rendering being
broken then.
Trigger: boot linux guest with vesafb, start X11, make sure both vesafb
and X11 use the display same resolution. Then watch X11 screen being
upside down.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Blue Swirl [Sun, 7 Oct 2012 18:42:18 +0000 (18:42 +0000)]
Merge branch 'master' of git.qemu.org:/pub/git/qemu
* 'master' of git.qemu.org:/pub/git/qemu:
qemu-barrier: Fix compilation on i386 hosts
Aurelien Jarno [Sun, 7 Oct 2012 18:07:11 +0000 (20:07 +0200)]
qemu-barrier: Fix compilation on i386 hosts
Commit
1d31fca470648ec66afd8743491bfb5846306341 tried to fix bug
introduced by
610b823ef66b993660f1ab1447a769f190e4f3b3 by including
qemu-common.h, which breaks the build further.
Include compiler.h instead, as suggested by Blue Swirl.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Fri, 5 Oct 2012 23:55:10 +0000 (16:55 -0700)]
target-sparc: Optimize conditionals using SUBCC
Aka "normal" comparisons. We now have the infrastructure to
pass back non-boolean results from gen_compare. This will
automatically get used by both branches and conditional moves.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:09 +0000 (16:55 -0700)]
target-sparc: Fall through from not-taken trap
Now that we've cleaned up global temporary allocation, we can
continue translating the fallthru path of a conditional trap.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:08 +0000 (16:55 -0700)]
target-sparc: Cleanup "global" temporary allocation
There are 6 temporaries that disas_sparc_insn relies on having been
allocated. Now that they are no longer referenced across branches,
they need not be allocated as local temps.
Move the allocation/free of these temporaries to make it clear that
they are local to the translation of a single insn.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:07 +0000 (16:55 -0700)]
target-sparc: Use movcond for FMOV*R
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:06 +0000 (16:55 -0700)]
target-sparc: Use movcond in mulscc
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:05 +0000 (16:55 -0700)]
target-sparc: Move taddcctv and tsubcctv out of line
The branches around the exception are maintaining an otherwise
unnecessary use of local temps for the cpu destination.
Note that gen_op_t{add,sub}_cc were identical to gen_op_{add,sub}_cc.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:04 +0000 (16:55 -0700)]
target-sparc: Tidy Tcc
Share more code between unconditional and conditional paths.
Move the computation of the trap number into the conditional BB;
avoid using temporaries that have gone out of scope (cpu_tmp32)
or rely on local temps (cpu_dst).
Fully fold the exception number when the trap number is %g0+imm.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:03 +0000 (16:55 -0700)]
target-sparc: Move sdivx and udivx out of line
The branches around the exception are maintaining an otherwise
unnecessary use of local temps for the cpu destination.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:02 +0000 (16:55 -0700)]
target-sparc: Use movcond in gen_generic_branch
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:01 +0000 (16:55 -0700)]
target-sparc: Use DisasCompare and movcond in MOVR
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:55:00 +0000 (16:55 -0700)]
target-sparc: Use DisasCompare and movcond in MOVCC
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:59 +0000 (16:54 -0700)]
target-sparc: Use DisasCompare and movcond in FMOVR, FMOVCC
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:58 +0000 (16:54 -0700)]
target-sparc: Use DisasCompare in Tcc
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:57 +0000 (16:54 -0700)]
target-sparc: Introduce DisasCompare and functions to generate it
For the moment gen_cond et al retain their existing interface,
using setcond to turn a (potential) comparison back into a boolean.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:56 +0000 (16:54 -0700)]
target-sparc: Tidy gen_generic_branch interface
The arguments passed are always the same.
Pass down just DisasContext instead.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:55 +0000 (16:54 -0700)]
target-sparc: Tidy save_npc interface
Use the cpu_cond global register directly instead of passing it down.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:54 +0000 (16:54 -0700)]
target-sparc: Tidy gen_mov_pc_npc interface
Use the cpu_cond global register directly instead of passing it down.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:53 +0000 (16:54 -0700)]
target-sparc: Tidy save_state interface
Use the cpu_cond global register directly instead of passing it down.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:52 +0000 (16:54 -0700)]
target-sparc: Tidy gen_trap_ifnofpu interface
We always pass cpu_cond to the cond parameter. Use that global
register directly instead of passing it down.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:51 +0000 (16:54 -0700)]
target-sparc: Tidy flush_cond interface
We always pass cpu_cond to the cond parameter. Use that global
register directly instead of passing it down.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:50 +0000 (16:54 -0700)]
target-sparc: Tidy do_branch interfaces
We always pass cpu_cond to the r_cond parameter. Use that global
register directly instead of passing it down.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:49 +0000 (16:54 -0700)]
target-sparc: Make CPU_LOG_INT useful by default
No need for ifdefs when the log mask does just as well.
No need to print pc/npc when we're dumping the whole cpu state.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Fri, 5 Oct 2012 23:54:48 +0000 (16:54 -0700)]
target-sparc: Tidy cpu_dump_state
We don't really need to be told that %g are general register, etc.
Issue a trailing newline to separate blocks.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Stefan Weil [Thu, 4 Oct 2012 18:29:02 +0000 (20:29 +0200)]
tcg: Remove redundant pointer from TCGContext
The pointer entry 'temps' always refers to the array entry 'static_temps'.
Removing the pointer and renaming 'static_temps' to 'temps' reduces the
size of TCGContext (4 or 8 byte) and allows better code generation.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Aurelien Jarno [Sat, 6 Oct 2012 16:54:46 +0000 (18:54 +0200)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
target-arm: Drop unused DECODE_CPREG_CRN macro
target-arm: use deposit instead of hardcoded version
target-arm: mark a few integer helpers const and pure
target-arm: convert sar, shl and shr helpers to TCG
target-arm: convert add_cc and sub_cc helpers to TCG
target-arm: use globals for CC flags
target-arm: Reinstate display of VFP registers in cpu_dump_state
cpu_dump_state: move DUMP_FPU and DUMP_CCOP flags from x86-only to generic
Aurelien Jarno [Sat, 6 Oct 2012 16:54:14 +0000 (18:54 +0200)]
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
* 'trivial-patches' of git://github.com/stefanha/qemu:
versatilepb: Use symbolic indices for ARM PIC
qdev: kill bogus comment
qemu-barrier: Fix compiler version check for future gcc versions
hw: Add missing 'static' attribute for QEMUMachine
cleanup useless return sentence
qemu-sockets: Fix compiler warning (regression for MinGW)
vnc: Fix spelling (hellmen -> hellman) in comment
slirp: Fix spelling in comment (enought -> enough, insure -> ensure)
tcg/arm: Use tcg_out_mov_reg rather than inline equivalent code
cpu: Add missing 'static' attribute to qemu_global_mutex
configure: Support empty target list (--target-list=)
hw: Fix return value check for bdrv_read, bdrv_write
Aurelien Jarno [Sat, 6 Oct 2012 16:51:36 +0000 (18:51 +0200)]
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf: (35 commits)
PPC: KVM: Fix BAT put
PPC: e500: Only expose even TLB sizes in initial TLB
ppc/pseries: Reset VPA registration on CPU reset
pseries: Don't test for MSR_PR for hypercalls under KVM
PPC: e500: calculate initrd_base like dt_base
PPC: e500: increase DTC_LOAD_PAD
device tree: simplify dumpdtb code
fdt: move dumpdtb interpretation code to device_tree.c
target-ppc: Remove unused power_mode field from cpu state
pseries: Set hash table size based on RAM size
pseries: Remove unnecessary locking from PAPR hash table hcalls
ppc405_uc: Fix buffer overflow
target-ppc: KVM: Fix some kernel version edge cases for kvmppc_reset_htab()
pseries: Fix semantics of RTAS int-on, int-off and set-xive functions
pseries: Rework implementation of TCE bypass
pseries: Remove never used flags field from spapr vio devices
pseries: Remove XICS irq type enum type
pseries: Remove C bitfields from xics code
pseries: Small cleanup to H_CEDE implementation
pseries: Fix XICS reset
...
Stefan Weil [Sat, 6 Oct 2012 10:46:15 +0000 (12:46 +0200)]
qemu-barrier: Fix compilation on i386 hosts
Commit
610b823ef66b993660f1ab1447a769f190e4f3b3 uses QEMU_GNUC_PREREQ
on i386 hosts.
That macro is defined in qemu-common.h which is not always included
before qemu-barrier.h, so compilation on i386 hosts was broken.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 24 Sep 2012 21:21:41 +0000 (14:21 -0700)]
tcg: Add tcg_high_cond
The table that was recently added for hppa is generally usable.
And with the renumbering of the TCG_COND constants it's not too
difficult to compute rather than have a table.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 24 Sep 2012 21:21:40 +0000 (14:21 -0700)]
tcg: Add TCG_COND_NEVER, TCG_COND_ALWAYS
There are several cases that can be handled easier inside both
translators and code generators if we have out-of-band values
for conditions. It's easy enough to handle ALWAYS and NEVER in
the natural way inside the tcg middle-end.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 24 Sep 2012 21:21:39 +0000 (14:21 -0700)]
tcg: Add is_unsigned_cond
Before we rearrange the TCG_COND enumeration, add a predicate for
the (single) use of comparisons vs TCGCond.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:58:09 +0000 (12:58 +0200)]
vga: cleanup after isa_vga_init() and pci_vga_init() conversion
Now that all machines call isa_vga_init() or pci_vga_init(), some unused
code can be removed.
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 15:02:29 +0000 (17:02 +0200)]
mips/r4k: use the new is_vga_init() function
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:47:45 +0000 (12:47 +0200)]
pc: use the new pci_vga_init() and isa_vga_init() functions
The CONFIG_SPICE is now tested in vl.c and thus not needed anymore.
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:23:54 +0000 (12:23 +0200)]
sun/sun4u: use the new pci_vga_init() function
As a bonus it allows new vga card types (including none).
Acked-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:40:45 +0000 (12:40 +0200)]
ppc/pSeries: use the new pci_vga_init() function
Keep the case to prevent some vga card to be selected.
Cc: Alexander Graf <agraf@suse.de>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:22:44 +0000 (12:22 +0200)]
ppc/prep: use the new pci_vga_init() function
As a bonus it allows new vga card types (including none).
Acked-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:21:20 +0000 (12:21 +0200)]
ppc/oldworld: use the new pci_vga_init() function
As a bonus it allows new vga card types (including none).
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:19:38 +0000 (12:19 +0200)]
ppc/newworld: use the new pci_vga_init() function
As a bonus it allows new vga card types (including none).
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:16:28 +0000 (12:16 +0200)]
alpha: use the new pci_vga_init() function
This remove the fallback to std-vga in case, as availability of the
requested vga device is now tested in vl.c, and returns an error message
to the user.
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 09:53:12 +0000 (11:53 +0200)]
mips/malta: use the new pci_vga_init() function
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 14:58:57 +0000 (16:58 +0200)]
isa: add a isa_vga_init() function
This function create a ISA VGA device according to the value of
vga_interface_type. It returns a ISADevice (and not a DeviceState).
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 09:49:24 +0000 (11:49 +0200)]
pci: add a pci_vga_init() function
This function create a PCI VGA device according to the value of
vga_interface_type. It returns a PCIDevice (and not a DeviceState).
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sun, 9 Sep 2012 23:01:44 +0000 (01:01 +0200)]
vl.c: default to std if cirrus is not available
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 10:01:06 +0000 (12:01 +0200)]
vl.c: check for qxl availability
Check for qxl availability in vl.c. This will allow to remove #ifdef
CONFIG_SPICE .. #endif later in this series
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 14:01:20 +0000 (16:01 +0200)]
vl.c: convert *vga_enabled functions to QOM
And get rid of qdev_exists().
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 14:40:56 +0000 (16:40 +0200)]
vga: rename isa_vga_init() to isa_std_vga_init()
This better explains what is this function about. Adjust all callers.
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 8 Sep 2012 09:38:41 +0000 (11:38 +0200)]
vga: rename pci_vga_init() into pci_std_vga_init()
This better explains what is this function about. Adjust all callers.
Cc: Alexander Graf <agraf@suse.de>
Cc: Andreas Färber <andreas.faerber@web.de>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Acked-by: Blue Swirl <blauwirbel@gmail.com>
Acked-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Mon, 1 Oct 2012 19:00:43 +0000 (21:00 +0200)]
tcg: remove obsolete jmp op
The TCG jmp operation doesn't really make sense in the QEMU context, it
is unused, it is not implemented by some targets, and it is wrongly
implemented by some others.
This patch simply removes it.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-by: Blue Swirl <blauwirbel@gmail.com>
Acked-by: Stefan Weil<sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Mon, 1 Oct 2012 19:00:42 +0000 (21:00 +0200)]
target-xtensa: de-optimize EXTUI
Now that "and" with 0xff, 0xffff and 0xffffffff and "shr" with 0 shift
are optimized in tcg/tcg-op.h there is no need to do it in
target-xtensa/translate.c.
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Fri, 5 Oct 2012 17:39:33 +0000 (19:39 +0200)]
Remove libhw
The entries for libhw* are no longer needed in .gitignore.
There is also no longer a difference between common-obj-y and
hw-obj-y, so one of those two macros is sufficient.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Peter Maydell [Fri, 5 Oct 2012 14:04:45 +0000 (15:04 +0100)]
target-arm: Drop unused DECODE_CPREG_CRN macro
This macro snuck through code review despite being unused; drop it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Aurelien Jarno [Fri, 5 Oct 2012 14:04:45 +0000 (15:04 +0100)]
target-arm: use deposit instead of hardcoded version
Use the deposit op instead of and hardcoded bit field insertion. It
allows the host to emit the corresponding instruction if available.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Aurelien Jarno [Fri, 5 Oct 2012 14:04:45 +0000 (15:04 +0100)]
target-arm: mark a few integer helpers const and pure
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Aurelien Jarno [Fri, 5 Oct 2012 14:04:44 +0000 (15:04 +0100)]
target-arm: convert sar, shl and shr helpers to TCG
Now that the movcond TCG op is available, it's possible to replace
shl and shr helpers by TCG code. The code generated by TCG is slightly
longer than the code generated by GCC for the helper but is still worth
it as this avoid all the consequences of using an helper: globals saved
back to memory, no possible optimization, call overhead, etc.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Aurelien Jarno [Fri, 5 Oct 2012 14:04:44 +0000 (15:04 +0100)]
target-arm: convert add_cc and sub_cc helpers to TCG
Now that the setcond TCG op is available, it's possible to replace
add_cc and sub_cc helpers by TCG code. The code generated by TCG is
actually very close to the one generated by GCC for the helper, and
this avoid all the consequences of using an helper: globals saved back
to memory, no possible optimization, call overhead, etc.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Aurelien Jarno [Fri, 5 Oct 2012 14:04:44 +0000 (15:04 +0100)]
target-arm: use globals for CC flags
Use globals for CC flags instead of loading/storing them each they are
accessed. This allows some optimizations to be performed by the TCG
optimization passes.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>