Commit graph

13470 commits

Author SHA1 Message Date
Paolo Bonzini f9728943ff do not pass bogus $(SRC_PATH) include paths to cc during configure
Non-existent -I paths are dropped silently by the compiler, but still
it is not polite to pass bogus options.  Configure-time tests do not
need any include files from the source path, so only include -I flags
at make time (when they're properly expanded).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:58 +00:00
Paolo Bonzini 8d05095cec test cc with the complete set of chosen flags
The "test the C compiler works ok" comes before a bunch of flags
are added for --cpu or just depending on the host.  It helps
debugging if the test is done after these flags are (unconditionally)
added.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:58 +00:00
Paolo Bonzini e39f0062cc fix sparse support (?)
I didn't test with sparse, but the old code using += before a variable
was set was wrong.  Sparse support should probably be ripped out or
redone, but this at least keeps some sanity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:57 +00:00
Paolo Bonzini 377529c009 move feature variables to the top
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:57 +00:00
Paolo Bonzini 0db4a06759 default make and install to environment variables
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:57 +00:00
Paolo Bonzini 3d8df6409b default compilation tools to environment variables
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:57 +00:00
Edgar E. Iglesias 844bab604b microblaze: Improve unconditional direct branching
Avoid emitting conditional tcg operations for uncoditional
direct branches.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-01-14 12:30:26 +01:00
Edgar E. Iglesias d03d11260e cris: Set btaken when storing direct jumps
When storing a direct jmp from translation state into
runtime state we should set the btaken flag.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-13 15:14:04 +01:00
Sergei Gavrikov facf1a60f2 slirp: Use strcasecmp() to check tftp mode, tsize
According to RFC 1350 (TFTP Revision 2) the mode field can contain any
combination of upper and lower case; also RFC 2349 propagates that the
transfer size option ("tsize") is case in-sensitive too.

Current implementation of embedded TFTP server missed that what does
mess some TFTP clients. Fixed by using STRCASECMP(3) in the required
places.

Signed-off-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-13 11:38:44 +01:00
Blue Swirl 4508d81a78 ppc405_uc: fix a buffer overflow
Fix a buffer overflow, reported by cppcheck:
[/src/qemu/hw/ppc405_uc.c:72]: (error) Buffer access out-of-bounds: bd.bi_s_version

The use of field bi_s_version seems to be a typo, it should be
bi_r_version.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 21:12:31 +00:00
Blue Swirl c46a3ea025 lan9118: fix a buffer overflow
Fix a buffer overflow, reported by cppcheck:
[/src/qemu/hw/lan9118.c:849]: (error) Buffer access out-of-bounds: s.eeprom

All eeprom handling code assumes that the size of eeprom is 128,
except lan9118_eeprom_cmd. Fix this by restricting the address passed.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 21:00:01 +00:00
Blue Swirl f0ff243a16 vpc: fix a file descriptor leak
Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/block/vpc.c:524]: (error) Resource leak: fd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 19:49:00 +00:00
Blue Swirl 1afec9138f qemu-io: fix a memory leak
Fix a memory leak, reported by cppcheck:
[/src/qemu/qemu-io.c:1135]: (error) Memory leak: ctx

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 19:48:59 +00:00
Blue Swirl 08089edcd2 vvfat: fix a file descriptor leak
Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/block/vvfat.c:759]: (error) Resource leak: dir

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 19:48:58 +00:00
Blue Swirl cedf9a6f45 loader: fix a file descriptor leak
Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/hw/loader.c:311]: (error) Resource leak: fd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 19:48:57 +00:00
Blue Swirl 8ce7d35273 vnc-auth-sasl: fix a memory leak
Fix a memory leak reported by cppcheck:
[/src/qemu/ui/vnc-auth-sasl.c:448]: (error) Memory leak: mechname

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 19:48:56 +00:00
Amit Shah a01a9cb821 virtio-serial-bus: bump up control vq size to 32
The current default of 16 buffers for the control vq is too small.  We
can get more entries in there, for example when asking the guest to add
max. allowed ports.

Note: a more robust solution would involve some kind of event queueing
in host to guarantee no event loss. Added a TODO to look into
this later.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-12 17:55:30 +02:00
Michael S. Tsirkin c2e08bddcd Merge remote branch 'origin/master' into pci 2011-01-12 17:39:36 +02:00
Michael Walle 00e076795f audio: split sample conversion and volume mixing
Refactor the volume mixing, so it can be reused for capturing devices.
Additionally, it removes superfluous multiplications with the nominal
volume within the hardware voice code path.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: malc <av1474@comtv.ru>
2011-01-12 18:36:22 +03:00
Aurelien Jarno 0f136d9e06 disas: remove opcode printing on ARM hosts
Following commit 5d48e9174e, it's possible
to remove the hack that used to display the opcodes on ARM hosts only.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-12 15:12:58 +01:00
Peter Maydell 5d48e9174e arm-dis: Include opcode hex when doing disassembly
Enhance the ARM disassembler used for debugging so that it includes
the hex dump of the opcode as well as the symbolic disassembly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-12 15:10:47 +01:00
Aurelien Jarno 5677903453 tcg arm/mips/ia64: add a comment about retranslation and caches
Add a comment about cache coherency and retranslation, so that people
developping new targets based on existing ones are warned of the issue.

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-12 00:06:07 +01:00
Peter Maydell dace20dcc9 linux-user: Add configure check for linux/fiemap.h and IOC_FS_FIEMAP
Add a configure check for the existence of linux/fiemap.h and the
IOC_FS_FIEMAP ioctl. This fixes a compilation failure on Linux
systems which don't have that header file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-12 00:06:06 +01:00
Peter Maydell 0322b26e2d ARM: Fix decoding of VQSHL/VQSHLU immediate forms
Fix errors in the decoding of ARM VQSHL/VQSHLU immediate forms,
including using the new VQSHLU helper functions where appropriate.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-12 00:06:06 +01:00
Juha Riihimäki 4ca4502c93 ARM: add neon helpers for VQSHLU
Add neon helper functions to implement VQSHLU, which is a
signed-to-unsigned version of VQSHL available only as an
immediate form.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-12 00:06:06 +01:00
Aurelien Jarno 86865c5ff1 target-sh4: fix fpu disabled/illegal exception
Illegal instructions in a slot delay should generate a slot illegal
instruction exception instead of an illegal instruction exception.

The current PC should be saved before generating such an exception,
but should not be corrected if in a delay slot, given it's already
done in the exception handler do_interrupt().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-11 17:25:24 +01:00
Michael S. Tsirkin b36e391441 ioeventfd: error handling cleanup
- Don't return status from start/stop functions where it's ignored
- report errors to make debugging easier
- assert on unexpected failures
- don't disable notifiers on error so that we'll
  retry when guest driver restarts

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-01-11 17:47:48 +02:00
Edgar E. Iglesias 05bf441eb6 cris: Remove unused orig_flags
Based on a patch by Blue Swirl <blauwirbel@gmail.com>.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10 23:28:08 +01:00
Edgar E. Iglesias 5cabc5ccfe cris: Allow more TB chaining for crisv10
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10 23:24:36 +01:00
Edgar E. Iglesias b09cd072df cris: Support disassembly of crisv10
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10 22:31:09 +01:00
Anthony Liguori a7bd621d7a Merge remote branch 'mst/for_anthony' into staging 2011-01-10 10:32:01 -06:00
Stefan Hajnoczi 65d6dcbde8 docs: Document virtio PCI -device ioeventfd=on|off
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-01-10 14:44:16 +02:00
Stefan Hajnoczi 25db9ebe15 virtio-pci: Use ioeventfd for virtqueue notify
Virtqueue notify is currently handled synchronously in userspace virtio.  This
prevents the vcpu from executing guest code while hardware emulation code
handles the notify.

On systems that support KVM, the ioeventfd mechanism can be used to make
virtqueue notify a lightweight exit by deferring hardware emulation to the
iothread and allowing the VM to continue execution.  This model is similar to
how vhost receives virtqueue notifies.

The result of this change is improved performance for userspace virtio devices.
Virtio-blk throughput increases especially for multithreaded scenarios and
virtio-net transmit throughput increases substantially.

Some virtio devices are known to have guest drivers which expect a notify to be
processed synchronously and spin waiting for completion.
For virtio-net, this also seems to interact with the guest stack in strange
ways so that TCP throughput for small message sizes (~200bytes)
is harmed. Only enable ioeventfd for virtio-blk for now.

Care must be taken not to interfere with vhost-net, which uses host
notifiers.  If the set_host_notifier() API is used by a device
virtio-pci will disable virtio-ioeventfd and let the device deal with
host notifiers as it wishes.

Finally, there used to be a limit of 6 KVM io bus devices inside the
kernel.  On such a kernel, don't use ioeventfd for virtqueue host
notification since the limit is reached too easily.  This ensures that
existing vhost-net setups (which always use ioeventfd) have ioeventfds
available so they can continue to work.

After migration and on VM change state (running/paused) virtio-ioeventfd
will enable/disable itself.

 * VIRTIO_CONFIG_S_DRIVER_OK -> enable virtio-ioeventfd
 * !VIRTIO_CONFIG_S_DRIVER_OK -> disable virtio-ioeventfd
 * virtio_pci_set_host_notifier() -> disable virtio-ioeventfd
 * vm_change_state(running=0) -> disable virtio-ioeventfd
 * vm_change_state(running=1) -> enable virtio-ioeventfd

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 14:44:16 +02:00
Stefan Hajnoczi d2f2b8a740 kvm: test for ioeventfd support on old kernels
There used to be a limit of 6 KVM io bus devices in the kernel.
On such a kernel, we can't use many ioeventfds for host notification
since the limit is reached too easily.

Add an API to test for this condition.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 14:44:16 +02:00
Michael S. Tsirkin 85cf2a8d74 virtio: move vmstate change tracking to core
Move tracking vmstate change from virtio-net to virtio.c
as it is going to be used by virito-blk and virtio-pci
for the ioeventfd support.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 14:44:07 +02:00
Stefan Hajnoczi 3dbca8e6a7 virtio-pci: Rename bugs field to flags
The VirtIOPCIProxy bugs field is currently used to enable workarounds
for older guests.  Rename it to flags so that other per-device behavior
can be tracked.

A later patch uses the flags field to remember whether ioeventfd should
be used for virtqueue host notification.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 13:47:41 +02:00
Gerd Hoffmann 2f6bfe3b0c qxl: tag as not hotpluggable
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 13:43:55 +02:00
Michael S. Tsirkin 6107ff1292 Merge remote branch 'origin/master' into pci 2011-01-10 13:43:48 +02:00
Gerd Hoffmann be92bbf73d vga: tag as not hotplugable.
This patch tags all vga cards as not hotpluggable.  The qemu
standard vga will never ever be hotpluggable.  For cirrus + vmware
it might be possible to get that work some day.  Todays we can't
handle that for a number of reasons though.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 13:29:42 +02:00
Gerd Hoffmann 0965f12da6 piix: tag as not hotpluggable.
This patch tags all pci devices which belong to the piix3/4 chipsets as
not hotpluggable (Host bridge, ISA bridge, IDE controller, ACPI bridge).

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 13:29:25 +02:00
Gerd Hoffmann 180c22e18b pci: allow devices being tagged as not hotpluggable.
This patch adds a field to PCIDeviceInfo to tag devices as being
not hotpluggable.  Any attempt to plug-in or -out such a device
will throw an error.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-10 13:29:16 +02:00
Aurelien Jarno 8aaf42ed0f slirp: fix unaligned access in bootp code
Slirp code tries to be smart an avoid data copy by using pointer to
the data. This solution leads to unaligned access, in this case
preq_addr, which is a 32-bit long structure. There is no real point
of avoiding data copy in a such case, as the value itself is smaller
or the same size as a pointer.

The patch replaces pointers to the preq_addr structure by the strcture
itself, and use the address 0.0.0.0 if no address has been requested
(this is not a valid address in such a request). It compares it with
htonl(0L) for correctness reasons, in case a code checker look for such
mistakes. It also uses memcpy() for copying the data, which takes care
of alignement issues.

This fixes an unaligned access on IA64 host while requesting a DHCP
address.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10 10:56:25 +01:00
Aurelien Jarno 102c29769f bswap.h: add cpu_to_be64wu()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10 10:55:10 +01:00
Aurelien Jarno 0f11f25a00 tcg/arm: improve constant loading
Improve constant loading in two ways:
- On all ARM versions, it's possible to load 0xffffff00 = -0x100 using
  the mvn rd, #0. Fix the conditions.
- On <= ARMv6 versions, where movw and movt are not available, load the
  constants using mov and orr with rotations depending on the constant
  to load. This is very useful for example to load constants where the
  low byte is 0. This reduce the generated code size by about 7%.

Also fix the coding style at the same time.

Cc: Andrzej Zaborowski <balrog@zabor.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10 07:30:30 +01:00
Aurelien Jarno a3e28aa5c7 tcg/ia64: remove an unnecessary stop bit
Spotted by Richard Henderson.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10 01:39:49 +01:00
Aurelien Jarno 829a49274f target-sh4: improve TLB
SH4 is using 16-bit instructions which means most of the constants are
loaded through a constant pool at the end of the subroutine. The same
memory page is therefore accessed in exec and read mode.

With the current implementation, a QEMU TLB entry is set to read or
read/write mode after an UTLB search and to exec mode after an ITLB
search, which causes a lot of TLB exceptions to switch from read or
read/write to exec and vice versa.

This patch optimizes that by already setting the QEMU TLB entry in read
or read/write mode when an UTLB entry is copied into ITLB (during an
ITLB miss). This improve the emulation speed by about 14%.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10 00:02:16 +01:00
Aurelien Jarno c0f809c46a target-sh4: implement writes to mmaped ITLB
Some Linux kernels seems to implement ITLB/UTLB flushing through by
writing all TLB entries through the memory mapped interface instead
of writing one to MMUCR.TI.

Implement memory mapped ITLB write interface so that such kernels can
boot. This fixes https://bugs.launchpad.net/bugs/700774 .

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-09 23:59:12 +01:00
Mike Frysinger 759c90ba3d tcg: fix typo in readme
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09 21:01:01 +00:00
Stefan Weil aa95e3a57f tcg/README: Spelling fixes
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09 21:00:16 +00:00
Stefan Weil e8dc093822 qemu-tech: Spelling fixes
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-09 20:59:53 +00:00