Commit Graph

16103 Commits

Author SHA1 Message Date
Anthony Liguori 12d4536f7d main: force enabling of I/O thread
Enabling the I/O thread by default seems like an important part of declaring
1.0.  Besides allowing true SMP support with KVM, the I/O thread means that the
TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which
currently requires a (racey) signal based alarm system.

I know there have been concerns about performance.  I think so far the ones that
have come up (virtio-net) are most likely due to secondary reasons like
decreased batching.

I think we ought to force enabling I/O thread early in 1.0 development and
commit to resolving any lingering issues.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-02 10:34:55 -05:00
Anthony Liguori d9cd446b4f trace: fix out-of-tree builds
Reported-by: Lluis Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-02 10:28:35 -05:00
Anthony Liguori 88adbdfdf4 Merge remote-tracking branch 'stefanha/tracing' into staging 2011-09-02 10:08:48 -05:00
Anthony Liguori 625f9e1f54 Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2011-09-01 13:57:19 -05:00
Anthony Liguori a952c570c8 Merge remote-tracking branch 'qemu-kvm-tmp/memory/core' into staging 2011-09-01 13:55:58 -05:00
Stefan Hajnoczi e2a99ad3e1 build: sort objects to remove duplicates for link
Avoid duplicate object files during the link.  There are legitimate
cases where a link command-line would include duplicate object files
because two independent subsystems both depend on common infrastructure.

Use GNU make's $(sort) function to remove duplicate object files from
the link command-line.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-01 13:12:51 -05:00
Anthony Liguori 4d88a2ac86 main: switch qemu_set_fd_handler to g_io_add_watch
This patch changes qemu_set_fd_handler to be implemented in terms of
g_io_add_watch().  The semantics are a bit different so some glue is required.

qemu_set_fd_handler2 is much harder to convert because of its use of polling.

The glib main loop has the major of advantage of having a proven thread safe
architecture.  By using the glib main loop instead of our own, it will allow us
to eventually introduce multiple I/O threads.

I'm pretty sure that this will work on Win32, but I would appreciate some help
testing.  I think the semantics of g_io_channel_unix_new() are really just tied
to the notion of a "unix fd" and not necessarily unix itself.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-01 13:12:33 -05:00
Anthony Liguori 69e5bb68a5 Add glib support to main loop
This allows GSources to be used to register callback events in QEMU.  This is
useful as it allows us to take greater advantage of glib and also because it
allows us to write code that is more easily testable outside of QEMU since we
can make use of glib's main loop in unit tests.

All new code should use glib's callback mechanisms for registering fd events
which are very well documented at:

http://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html

And:

http://developer.gnome.org/gio/stable/

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-01 13:12:33 -05:00
Peter Maydell 70d705fd46 tcg/ppc/tcg-target.c: Avoid 'set but not used' gcc warnings
Move the declaration and initialisation of some variables in
tcg_out_qemu_ld and tcg_out_qemu_st inside CONFIG_SOFTMMU, to
avoid the "variable set but not used" warning of gcc 4.6.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: malc <av1474@comtv.ru>
2011-09-01 21:20:50 +04:00
Stefan Hajnoczi d8e8ef4ee0 simpletrace: fix process() argument count
The simpletrace.process() function invokes analyzer methods with the
wrong number of arguments if a timestamp should be included.  This patch
fixes the issue so that trace analysis scripts can make use of
timestamps.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-09-01 10:34:54 +01:00
Lluís 47f08d7a9d trace: enable all events
Given that all events with programmatically-controlled state are disabled by
default, we can delete the "disable" property from all events.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís 9a82b6a590 trace: [stderr] add support for dynamically enabling/disabling events
Uses the generic interface provided in "trace/control.h" in order to provide
a programmatic interface as well as command line and monitor controls.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís 03727e6a06 trace: [simple] disable all trace points by default
Note that this refers to the backend-specific state (whether the output must be
generated), not the event "disabled" property (which always uses the "nop"
backend).

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís dd215f646c trace: always use the "nop" backend on events with the "disable" keyword
Any event with the keyword/property "disable" generates an empty trace event
using the "nop" backend, regardless of the current backend.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís 23d15e860b trace: add "-trace events" argument to control initial state
The "-trace events" argument can be used to provide a file with a list of trace
event names that will be enabled prior to starting execution, thus providing
early tracing.

This saves the user from manually toggling event states through the monitor
interface or whichever backend-specific interface.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís 31965ae27b trace: always compile support for controlling and querying trace event states
The current interface is generic for this small set of operations, and thus
other backends can easily modify the "trace/control.c" file to add their own
implementation.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís fc76410539 trace: separate trace event control and query routines from the simple backend
Generalize the 'st_print_trace_events' and 'st_change_trace_event_state' into
backend-specific 'trace_print_events' and 'trace_event_set_state' (respectively)
in the "trace/control.h" file.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís 49926043c1 trace: generalize the "property" concept in the trace-events file
This adds/modifies the following functions:

* get_name: Get _only_ the event name
* has_property: Return whether an event has a property (keyword before the event
  name)

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:54 +01:00
Lluís e4858974ec trace: avoid conditional code compilation during option parsing
A default implementation for backend-specific routines is provided in
"trace/default.c", which backends can override by setting "trace_default=no" in
"configure".

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:53 +01:00
Lluís edb47ec498 trace: move backend-specific code into the trace/ directory
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:53 +01:00
Lluís 09001ee7b2 trace: [make] replace 'ifeq' with values in CONFIG_TRACE_*
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:53 +01:00
Lluís 6d8a764e0f trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*
Provides a more hierarchical view of the variable domain.

Also adds the CONFIG_TRACE_* variables for all backends.

[Stefan added missing 'test' in stap if statement]

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-09-01 10:34:53 +01:00
Lluís 51010317dd build: [simple] Include qemu-timer-common.o in trace-obj-y
Helper programs like qemu-ga use tracing primitives, but qemu-timer-common.o
(also used by simpletrace.o) is not necessarily included in the linkage line.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:53 +01:00
Lluís e03b41d477 build: Fix linkage of QEMU_PROG
Using '$^' to establish the files to link with will remove any repeated entries
in the list of dependencies.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01 10:34:53 +01:00
Peter Maydell bdc76462ac tusb6010: Convert to qdev
Convert the tusb6010 to qdev.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-31 21:48:10 +02:00
Jan Kiszka 021d26d161 memory: Fix memory_region_get_ram_ptr for ROM devices
Mask out the sub-page bits that are used by ROM device for storing the
io-index and the IO_MEM_ROMD flag.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-30 11:20:18 +03:00
Edgar E. Iglesias f0fb8b7180 Merge branch 'omap-for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm into pm 2011-08-29 23:59:06 +02:00
Anthony Liguori 9f4bd6baf6 Merge remote-tracking branch 'kwolf/for-anthony' into staging 2011-08-29 09:57:06 -05:00
Anthony Liguori 950c671df1 Merge remote-tracking branch 'qemu-kvm/memory/core' into staging 2011-08-29 08:48:43 -05:00
Anthony Liguori 751d63c371 Merge remote-tracking branch 'qemu-kvm/memory/urgent' into staging 2011-08-29 08:48:28 -05:00
Anthony Liguori c783924136 Merge remote-tracking branch 'mst/for_anthony' into staging 2011-08-29 08:48:15 -05:00
Anthony Liguori 8d76d4befb Merge remote-tracking branch 'qmp/queue/monitor' into staging 2011-08-29 08:48:07 -05:00
Kevin Wolf a22f123ca3 qemu-img: Require larger zero areas for sparse handling
By default, require 4k of consecutive zero bytes for qemu-img to make the
output file sparse by not issuing a write request for the zeroed parts. Add an
-S option to allow users to tune this setting.

This helps to avoid situations where a lot of zero sectors and data sectors are
mixed and qemu-img tended to issue many tiny 512 byte writes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-29 14:42:39 +02:00
Stefan Weil 2542bfd51c Fix spelling in comments and debug messages (recieve -> receive)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-08-29 11:47:33 +01:00
Alon Levy 11d6dded8e hw/pci-stub: fix comment typo
[Stefan fixed "doesn't" -> "don't"]

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-08-29 10:35:05 +01:00
Avi Kivity b5fe14cc7e memory: fix rom_device I/O mode
When adding a rom_device in I/O mode, we incorrectly masked off the low
bits, resulting in a pure RAM map.  Fix my masking off the high bits and
IO_MEM_ROMD, yielding a pure I/O map.

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-29 11:52:09 +03:00
Peter Maydell d5c8cf993a omap_gpmc: Implement prefetch engine
This commit implements the prefetch engine feature of the GPMC
which can be used for NAND devices. This includes both interrupt
driven and DMA-filling modes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:13 +00:00
Peter Maydell eee0a1c67e omap: Wire up the DMA request line to the GPMC
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:13 +00:00
Peter Maydell ef20677ca6 omap_gpmc: Pull prefetch engine data into sub-struct
Refactor the gpmc state structure so items relating to
the prefetch engine are in their own sub-struct and have
more useful names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:13 +00:00
Juha Riihimäki 856f2df771 omap_gpmc: Accept a zero mask field on omap3630
OMAP3630 adds an extra bit of address masking, so a mask of
0xb1111 is valid. Unfortunately the GPMC_REVISION is the same as
on the OMAP3430 which only has three bits of address masking, so
we have to derive this feature directly from the OMAP revision
rather than from the GPMC revision.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:13 +00:00
Peter Maydell f13e656e7e hw/omap.h: Add OMAP 3630 to omap_mpu_model enumeration
Add the OMAP 3630 to the omap_mpu_model enumeration, and add the
corresponding cpu_is_omap3630() function.

(OMAP3 isn't supported yet but this is useful in upgrading common
components to be "OMAP3 ready". We already have this for OMAP3430.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell 2a952feb83 omap_gpmc: Support NAND devices
Support accesses to NAND devices, both by mapping them into
the GPMC address space, and via the NAND_COMMAND, NAND_ADDRESS
and NAND_DATA GPMC registers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell 9ed3e1b183 omap_gpmc: Reindent misindented switch statements
Whitespace-only change fixing indentation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Juha Riihimäki 7c470ff1eb omap_gpmc: Calculate revision from OMAP model
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Juha Riihimäki b5325c2739 omap_gpmc: Take omap_mpu_state* in omap_gpmc_init
Take a pointer to the omap mpu state struct in omap_gpmc_init.
Some details of GPMC behaviour depend on the OMAP version we
are a part of.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell de8af7fe01 omap_gpmc: Fix handling of FIFOTHRESHOLDSTATUS bit
The OMAP3 TRM is inconsistent about whether the GPMC FIFOTHRESHOLDSTATUS
bit should be set when FIFOPOINTER > FIFOTHRESHOLD or when it is >=
FIFOTHRESHOLD. Apparently the underlying functional spec from which
the TRM was created states that the behaviour is ">=", and this also
makes more conceptual sense.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell 77c6c73690 omap_gpmc: Wire up the GPMC IRQ correctly
The omap_gpmc wasn't actually wiring up its IRQ, so
anything that provoked an interrupt would be using
uninitialised data for its IRQ number.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell 9c8255e124 omap_gpmc: GPMC_IRQSTATUS is write-one-to-clear
Fix a bug in the handling of writes to GPMC_IRQSTATUS:
it behaves as "write one to clear, writing zero is ignored".

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell 3387bf5581 omap_gpmc: Refactor omap_gpmc_cs_map and omap_gpmc_cs_unmap
Refactor the omap_gpmc_cs_map/unmap functions:
 * take the omap_gpmc_s* and a chipselect id rather than the
   omap_gpmc_cs_file_s*, so they have access to the general gpmc
   member fields
 * extract the base and mask from the config registers in the functions
   rather than at every callsite
 * check for CSVALID in the functions rather than at every callsite

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00
Peter Maydell 07bc2f8077 omap_gpmc: Clean up omap_gpmc_attach MemoryRegion conversion
Now that all callers of omap_gpmc_attach pass in a MemoryRegion*,
we can remove the base_update and unmap function pointer arguments,
and the opaque pointer that was passed into these callbacks.

We can also remove the base and size fields from omap_gpmc_cs_file_s
as these are no longer necessary (you don't need the base/size
to unmap a MemoryRegion the way you did to undo a mapping made
with cpu_register_physical_memory()).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:37:12 +00:00