summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use gcc warning flag -Wnested-externsBlue Swirl2010-09-184-3/+4
| | | | | | | | | If the compiler supports the warning flag -Wnested-externs, use it. Avoid the only warning by moving the declaration of xml_builtin to a more proper place. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use gcc warning flag -Wempty-bodyBlue Swirl2010-09-186-10/+14
| | | | | | | | If the compiler supports the warning flag -Wempty-body, use it. Adjust the code to avoid the warnings. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use a few more gcc warning flagsBlue Swirl2010-09-181-1/+4
| | | | | | | | | | | If the compiler supports the following warning flags, use them: -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wmissing-include-dirs Currently, these flags don't produce any warnings. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use gcc warning flag -Wtype-limitsBlue Swirl2010-09-181-1/+1
| | | | | | If the compiler supports the warning flag -Wtype-limits, use it. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pxa2xx: fix SSSR TFN logicBlue Swirl2010-09-181-4/+4
| | | | | | | | | Fix SSSR TFN logic: TX FIFO is never filled, so it is always in underrun condition if SSP is enabled. This also avoids a gcc warning with -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* MIPS: fix yield handlingBlue Swirl2010-09-181-1/+3
| | | | | | | | | The parameter for yield should be handled as a signed integer for the comparisons to have any effect. This also avoids a gcc warning with -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* PPC: Suppress gcc warnings with -Wtype-limitsBlue Swirl2010-09-181-25/+25
| | | | | | | | The hack added by c5b76b381081680633e2e0a91216507430409fb2 was not enough to avoid warnings with gcc flag -Wtype-limits. Add a new macro to fix both problems. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* blkdebug: fix enum comparisonBlue Swirl2010-09-181-3/+1
| | | | | | | | | | | | | | The signedness of enum types depend on the compiler implementation. Therefore the check for negative values may or may not be meaningful. Fix by explicitly casting to a signed integer. Since the values are also checked earlier against event_names table, this is an internal error. Change the 'if' to 'assert'. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pxa2xx: remove useless checksBlue Swirl2010-09-181-1/+1
| | | | | | | | | Remove checks which were made useless by r5849, 8da3ff180974732fc4272cb4433fef85c1822961. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use range_covers_byteBlue Swirl2010-09-182-8/+11
| | | | | | | | Use range_covers_byte() instead of comparisons. This avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce range.hBlue Swirl2010-09-187-31/+34
| | | | | | | Extract range functions from pci.h. These will be used by later patches by non-PCI devices. Adjust current users. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: improve flatload error checkingBlue Swirl2010-09-181-1/+2
| | | | | | | | | | | Because of the use of unsigned type, possible errors during load were ignored. Fix by using a signed type. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: fix types in a comparisonBlue Swirl2010-09-181-1/+1
| | | | | | | | | | | -1ul is unsigned long, which does not necessarily match abi_ulong type. Fix by using abi_long instead. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* linux-user: fix socklen_t comparisonsBlue Swirl2010-09-181-7/+13
| | | | | | | | | | | On many systems, socklen_t is defined as unsigned. This means that checks for negative values are not meaningful. Fix by explicitly casting to a signed integer. This also avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Check for errors during BIOS or kernel loadBlue Swirl2010-09-184-13/+18
| | | | | | | | | | | Because of the use of unsigned types, possible errors during BIOS or kernel load were ignored. Fix by using a signed type. This also avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make ARP replies at least 64 bytes longHervé Poussineau2010-09-171-1/+2
| | | | | | | | IEEE 802.3 standard requires Ethernet frames to be at least 64 bytes long. If it is not the case, they will be considered as runt frames, and may be ignored by netcard and/or OS Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Accept packets with TTL=1Hervé Poussineau2010-09-171-1/+1
| | | | | | | | Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard them This is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1 Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* cris: Avoid spurios hw_abort on recursive bus faultsEdgar E. Iglesias2010-09-161-1/+7
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* PPC: Redesign interrupt trigger pathAlexander Graf2010-09-151-51/+29
| | | | | | | | | | | | | | According to the Book3S spec, the interrupt context starts with an MSR value that is rather simple. If we leave out the HV case, it's almost always 0. To reflect this, let's redesign the way that MSR value gets calculated. Using this, we also squash the bug where MSR_POW can slip through into the interrupt handler MSR. Reported-by: Thomas Monjalon <thomas.monjalon@openwide.fr> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* PPC: Enable hint bits for lwarx/ldarxAlexander Graf2010-09-151-2/+2
| | | | | | | | | | | | | The lwarx and ldarx instructions have a bit to give some hint to the CPU which is safe to ignore. We currently refuse to accept any instruction with that bit set, as it used to be declared MBZ. Let's remove the reserved bit and make the instruction work as expected. This fixes Linux boot for ppc64. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* serial: Update parameters after loadMichal Novotny2010-09-151-0/+1
| | | | | | | | This is the patch to update serial port parameters after guest is already loaded. Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Remove wrong semicolon in macro definitionStefan Weil2010-09-142-3/+3
| | | | | | | | | Macros normally should not end with a semicolon, otherwise their usage results in two statements where only one statement was expected. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* serial: Wrap debug prints around a DPRINTF macroMichal Novotny2010-09-131-12/+13
| | | | | Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* ESP: fix ESP DMA access when DMA is not enabledBlue Swirl2010-09-115-18/+88
| | | | | | | | | | | | | | Sending ESP a command caused it to trigger DMA immediately even if DMA was not enabled at the DMA controller. Add a signal from DMA controller to ESP to tell ESP about changes in DMA enable bit. Also use the correct function for setting up GPIO outputs. This fixes NetBSD 1.6.1 through 3.0 boot. Thanks to Artyom Tarasenko for extensive debugging of the problem. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* powerpc: Avoid TLB related log spammingEdgar E. Iglesias2010-09-111-1/+0
| | | | | | Invalid TLB entries are normal and should not spam the log. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* trace: fix a regex portability problemBlue Swirl2010-09-111-1/+1
| | | | | | | | | | The /bin/sh in Milax has problems with the regex: Error: invalid trace backend Please choose a supported trace backend. Fix it by escaping ')' like the regexes with '('. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* trace: fix a typoBlue Swirl2010-09-101-1/+1
| | | | | | There is no qemu_valloc() but qemu_vmalloc(). Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HACKING: add rules for printf-like functionsBlue Swirl2010-09-101-0/+13
| | | | | | Add rules for printf-like functions, based on libvirt HACKING. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HACKING: add string management rulesBlue Swirl2010-09-101-0/+24
| | | | | | Add string management rules, somewhat like libvirt HACKING. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HACKING: add memory management rulesBlue Swirl2010-09-101-0/+14
| | | | | | Add memory management rules, somewhat like libvirt HACKING. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HACKING: add C type rulesBlue Swirl2010-09-102-3/+68
| | | | | | | | | | Add C type rules, adapted from libvirt HACKING. Also include a description of special QEMU scalar types. Move typedef rule from CODING_STYLE rule 3 to HACKING rule 6 where it belongs. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HACKING: add preprocessor rulesBlue Swirl2010-09-101-0/+6
| | | | | | | | | Add a new file, HACKING, in order to collect recurring issues with submitted patches. Start with preprocessor rules, adapted from libvirt HACKING. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vmware_vga: Replace the few tab-indents with spaces (clean-up).Andrzej Zaborowski2010-09-101-9/+9
| | | | Use 4 spaces instead of 2, too.
* vmware_vga: Add checks to deal with non-atomic fifo writes.Andrzej Zaborowski2010-09-101-8/+56
| | | | | | | | | | | | Janne Huttunen noticed that the FIFO end pointer is updated by the guest after writing each word to the FIFO, at least the X.org driver which is open does this. This means that there's no way for the host to know if the guest is in the middle a write operation. Qemu thus needs to read the beginning of the command up to when it's able to tell how many words are expected for the given command. It will abort reading and rewind the FIFO if there aren't enough words yet, this should be relatively rare but it is suspected to have been the cause of the occasional FIFO overrun that killed the display.
* hw/omap: Fix default setup for OMAP UART devicesStefan Weil2010-09-104-8/+19
| | | | | | | | | | | | | | | | | | Character devices created by qemu_chr_open don't allow duplicate device names, so naming all UART devices "null" no longer works. Running "qemu-system-arm -M n800" (and some other machines) results in this error message: qemu-system-arm: Duplicate ID 'null' for chardev Can't create serial device, empty char device This is fixed by setting a default label "uart1", "uart2" or "uart3". Cc: Andrzej Zaborowski <andrew.zaborowski@intel.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
* trace: Trace entry point of balloon request handlerPrerna Saxena2010-09-092-0/+6
| | | | | Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Trace port IOPrerna Saxena2010-09-092-0/+11
| | | | | Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Trace virtqueue operationsStefan Hajnoczi2010-09-092-0/+16
| | | | | | | | This patch adds trace events for virtqueue operations including adding/removing buffers, notifying the guest, and receiving a notify from the guest. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Trace virtio-blk, multiwrite, and paio_submitStefan Hajnoczi2010-09-094-0/+31
| | | | | | | This patch adds trace events that make it possible to observe virtio-blk. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Trace qemu_malloc() and qemu_vmalloc()Stefan Hajnoczi2010-09-093-8/+38
| | | | | | | | It is often useful to instrument memory management functions in order to find leaks or performance problems. This patch adds trace events for the memory allocation primitives. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Add user documentationStefan Hajnoczi2010-09-091-0/+177
| | | | Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Add LTTng Userspace Tracer backendStefan Hajnoczi2010-09-092-3/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds LTTng Userspace Tracer (UST) backend support. The UST system requires no kernel support but libust and liburcu must be installed. $ ./configure --trace-backend ust $ make Start the UST daemon: $ ustd & List available tracepoints and enable some: $ ustctl --list-markers $(pgrep qemu) [...] {PID: 5458, channel/marker: ust/paio_submit, state: 0, fmt: "acb %p opaque %p sector_num %lu nb_sectors %lu type %lu" 0x4b32ba} $ ustctl --enable-marker "ust/paio_submit" $(pgrep qemu) Run the trace: $ ustctl --create-trace $(pgrep qemu) $ ustctl --start-trace $(pgrep qemu) [...] $ ustctl --stop-trace $(pgrep qemu) $ ustctl --destroy-trace $(pgrep qemu) Trace results can be viewed using lttv-gui. More information about UST: http://lttng.org/ust Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> trace: Check for LTTng Userspace Tracer headers When using the 'ust' backend, check if the relevant headers are available at host. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Add trace file name command-line optionPrerna Saxena2010-09-093-0/+50
| | | | | | | | | | | | This patch adds an optional command line switch '-trace' to specify the filename to write traces to, when qemu starts. Eg, If compiled with the 'simple' trace backend, [temp@system]$ qemu -trace FILENAME IMAGE Allows the binary traces to be written to FILENAME instead of the option set at config-time. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Add trace-file command to open/close/flush trace fileStefan Hajnoczi2010-09-094-13/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the trace-file command: trace-file [on|off|flush] Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed. The trace file is turned on by default but is only written out when the trace buffer becomes full. The flush operation can be used to force write out at any time. Turning off the trace file does not change the state of trace events; tracing will continue to the trace buffer. When the trace file is off, use "info trace" to display the contents of the trace buffer in memory. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> This commit also contains the trace-file sub-command from the following commit: commit 5ce8d1a957afae2c52ad748944ce72848ccf57bd Author: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Wed Aug 4 16:23:54 2010 +0530 trace: Add options to specify trace file name at startup and runtime This patch adds an optional command line switch '-trace' to specify the filename to write traces to, when qemu starts. Eg, If compiled with the 'simple' trace backend, [temp@system]$ qemu -trace FILENAME IMAGE Allows the binary traces to be written to FILENAME instead of the option set at config-time. Also, this adds monitor sub-command 'set' to trace-file commands to dynamically change trace log file at runtime. Eg, (qemu)trace-file set FILENAME This allows one to set trace outputs to FILENAME from the default specified at startup. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Specify trace file namePrerna Saxena2010-09-092-4/+29
| | | | | | | | | | | | | | | | | | | | Allow users to specify a file for trace-outputs at configuration. Also, allow trace files to be annotated by <pid> so each qemu instance has unique traces. The trace file name can be passed as a config option: --trace-file=/path/to/file (Default: trace ) At runtime, the pid of the qemu process is appended to the filename so that mutiple qemu instances do not have overlapping logs. Eg : trace-1234 for qemu launched with pid 1234. I have yet to test this on windows. getpid() is used at many places in code(including vnc.c), so I'm hoping this would be okay too. Edited-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Support disabled events in trace-eventsStefan Hajnoczi2010-09-092-6/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it is useful to disable a trace event. Removing the event from trace-events is not enough since source code will call the trace_*() function for the event. This patch makes it easy to build without specific trace events by marking them disabled in trace-events: disable multiwrite_cb(void *mcb, int ret) "mcb %p ret %d" This builds without the multiwrite_cb trace event. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> trace: Allow bulk enabling/disabling of trace events at compile time For 'simple' trace backend, allow bulk enabling/disabling of trace events at compile time. Trace events that are preceded by 'disable' keyword are compiled in, but turned off by default. These can individually be turned on using the monitor. All other trace events are enabled by default. TODO : This could be enhanced when the trace-event namespace is partitioned into a group and an ID within that group. In such a case, marking a group as enabled would automatically enable all trace-events listed under it. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Support for dynamically enabling/disabling trace eventsPrerna Saxena2010-09-096-4/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for dynamically enabling/disabling of trace events. This is done by internally maintaining each trace event's state, and permitting logging of data from a trace event only if it is in an 'active' state. Monitor commands added : 1) info trace-events : to view all available trace events and their state. 2) trace-event NAME on|off : to enable/disable data logging from a given trace event. Eg, trace-event paio_submit off disables logging of data when paio_submit is hit. By default, all trace-events are disabled. One can enable desired trace-events via the monitor. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> trace: Monitor command 'info trace' Monitor command 'info trace' to display contents of trace buffer Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> trace: Remove monitor.h dependency from simpletrace User-mode targets don't have a monitor so the simple trace backend currently does not build on those targets. This patch abstracts the monitor printing interface so there is no direct coupling between simpletrace and the monitor. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Add simple built-in tracing backendStefan Hajnoczi2010-09-098-4/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a simple tracer which produces binary trace files. To try out the simple backend: $ ./configure --trace-backend=simple $ make After running QEMU you can pretty-print the trace: $ ./simpletrace.py trace-events trace.log The output of simpletrace.py looks like this: qemu_realloc 0.699 ptr=0x24363f0 size=0x3 newptr=0x24363f0 qemu_free 0.768 ptr=0x24363f0 ^ ^---- timestamp delta (us) |____ trace event name Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> trace: Make trace record fields 64-bit Explicitly use 64-bit fields in trace records so that timestamps and magic numbers work for 32-bit host builds. Includes fixes from Prerna Saxena <prerna@linux.vnet.ibm.com>. Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Add trace-events file for declaring trace eventsStefan Hajnoczi2010-09-097-4/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the trace-events file where trace events can be declared like so: qemu_malloc(size_t size) "size %zu" qemu_free(void *ptr) "ptr %p" These trace event declarations are processed by a new tool called tracetool to generate code for the trace events. Trace event declarations are independent of the backend tracing system (LTTng User Space Tracing, ftrace markers, DTrace). The default "nop" backend generates empty trace event functions. Therefore trace events are disabled by default. The trace-events file serves two purposes: 1. Adding trace events is easy. It is not necessary to understand the details of a backend tracing system. The trace-events file is a single location where trace events can be declared without code duplication. 2. QEMU is not tightly coupled to one particular backend tracing system. In order to support tracing across QEMU host platforms and to anticipate new backend tracing systems that are currently maturing, it is important to be flexible and not tied to one system. This commit includes fixes from Prerna Saxena <prerna@linux.vnet.ibm.com> and Blue Swirl <blauwirbel@gmail.com>. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* microblaze: Add support for fcmp.unEdgar E. Iglesias2010-09-091-2/+16
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
OpenPOWER on IntegriCloud