Anthony Liguori [Mon, 22 Apr 2013 13:05:14 +0000 (08:05 -0500)]
Merge remote-tracking branch 'bonzini/nbd-next' into staging
# By Stefan Hajnoczi
# Via Paolo Bonzini
* bonzini/nbd-next:
nbd: set TCP_NODELAY
nbd: use TCP_CORK in nbd_co_send_request()
nbd: unlock mutex in nbd_co_send_request() error path
Anthony Liguori [Mon, 22 Apr 2013 13:05:05 +0000 (08:05 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging
# By Paolo Bonzini (5) and others
# Via Paolo Bonzini
* bonzini/scsi-next:
vhost-scsi-s390: new device supporting the tcm_vhost Linux kernel module
vhost-scsi-ccw: new device supporting the tcm_vhost Linux kernel module
vhost-scsi-pci: new device supporting the tcm_vhost Linux kernel module
vhost-scsi: new device supporting the tcm_vhost Linux kernel module
virtio: simplify Makefile conditionals
virtio-scsi: create VirtIOSCSICommon
vhost: Add vhost_commit callback for SeaBIOS ROM region re-mapping
scsi: VMWare PVSCSI paravirtual device implementation
scsi: avoid assertion failure on VERIFY command
Anthony Liguori [Mon, 22 Apr 2013 13:04:21 +0000 (08:04 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Amos Kong (1) and Luiz Capitulino (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event
monitor: fix the wrong order of releasing keys
Peter Maydell [Wed, 17 Apr 2013 09:16:35 +0000 (09:16 +0000)]
ui/cocoa.m: Fix recent compile breakage
Fix failures to compile introduced by recent console commits 1dbfa00503, 81c0d5a6) which removed is_graphic_console() and
vga_hw_update() without updating the cocoa UI backend to match.
Peter Maydell [Sat, 20 Apr 2013 13:48:28 +0000 (14:48 +0100)]
qdev: Drop taddr properties
Drop all the infrastructure for taddr properties (ie ones which
are 'hwaddr' sized). These are now unused, and any further desired
use would be rather questionable since device properties shouldn't
generally depend on a type that is conceptually variable based on
the target CPU. 32 or 64 bit integer properties should be used instead
as appropriate for the specific device.
Blue Swirl [Sat, 20 Apr 2013 11:39:08 +0000 (11:39 +0000)]
Merge branch 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm
* 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm:
hw/versatile_pci: Drop unnecessary vpb_pci_config_addr()
versatile_pci: Expose PCI memory space to system
arm/realview: Fix mapping of PCI regions
versatile_pci: Implement the PCI controller's control registers
versatile_pci: Implement the correct PCI IRQ mapping
versatile_pci: Put the host bridge PCI device at slot 29
versatile_pci: Use separate PCI I/O space rather than system I/O space
versatile_pci: Change to subclassing TYPE_PCI_HOST_BRIDGE
versatile_pci: Update to realize and instance init functions
versatile_pci: Expose PCI I/O region on Versatile PB
versatile_pci: Fix hardcoded tabs
Blue Swirl [Sat, 20 Apr 2013 11:38:48 +0000 (11:38 +0000)]
Merge branch 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-arm
* 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-arm:
target-arm: Correctly restore FPSCR
target-arm: Add some missing CPU state fields to VMState
target-arm: port ARM CPU save/load to use VMState
target-arm: Reinsert missing return statement in ARM mode SRS decode
Blue Swirl [Sat, 20 Apr 2013 11:38:29 +0000 (11:38 +0000)]
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu
* 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu:
linux-user: fix setgroups/getgroups for non-UID16 archs
linux-user: fix undefined shift in copy_to_user_fdset
linux-user: change do_semop to return target errno when unsuccessful
vhost-scsi: new device supporting the tcm_vhost Linux kernel module
The WWPN specified in configfs is passed to "-device vhost-scsi-pci".
The tgpt field of the SET_ENDPOINT ioctl is obsolete now, so it is not
available from the QEMU command-line. Instead, I hardcode it to zero.
Changes in Patch-v2:
- Add vhost_scsi_get_features() in order to determine feature bits
supports by host kernel (mst + nab)
- Re-enable usage of DEFINE_VIRTIO_COMMON_FEATURES, and allow
EVENT_IDX to be disabled by host in vhost_scsi_get_features()
- Drop unused hotplug bit in DEFINE_VHOST_SCSI_PROPERTIES
Changes in Patch-v1:
- Set event_idx=off by default (nab, thanks asias)
- Disable hotplug feature bit for v3.9 tcm_vhost kernel code, need to
re-enable in v3.10 (nab)
- Update to latest qemu.git/master HEAD
Changes in WIP-V3:
- Drop ioeventfd vhost_scsi_properties (asias, thanks stefanha)
- Add CONFIG_VHOST_SCSI (asias, thanks stefanha)
- Add hotplug feature bit
Changes in WIP-V2:
- Add backend guest masking support (nab)
- Bump ABI_VERSION to 1 (nab)
- Set up set_guest_notifiers (asias)
- Set up vs->dev.vq_index (asias)
- Drop vs->vs.vdev.{set,clear}_vhost_endpoint (asias)
- Drop VIRTIO_CONFIG_S_DRIVER check in vhost_scsi_set_status (asias)
Howto:
Use the latest seabios, at least commit b44a7be17b
git clone git://git.seabios.org/seabios.git
make
cp out/bios.bin /usr/share/qemu/bios.bin
qemu -device vhost-scsi-pci,wwpn=naa.6001405bd4e8476d,event_idx=off
...
Cc: Michael S. Tsirkin <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]> Signed-off-by: Asias He <[email protected]>
[ Rebase on top of VirtIOSCSICommon patch, fix bugs in feature
negotiation and irqfd masking - Paolo ] Signed-off-by: Paolo Bonzini <[email protected]>
Paolo Bonzini [Fri, 29 Mar 2013 01:08:15 +0000 (01:08 +0000)]
virtio-scsi: create VirtIOSCSICommon
This patch refactors existing virtio-scsi code into VirtIOSCSICommon
in order to allow virtio_scsi_init_common() to be used by both internal
virtio_scsi_init() and external vhost-scsi-pci code.
Anthony Liguori [Fri, 19 Apr 2013 13:38:16 +0000 (08:38 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
# By Stefan Weil (3) and others
# Via Stefan Hajnoczi
* stefanha/trivial-patches:
m25p80: Remove bogus include of devices.h
ssh: Remove unnecessary use of strlen function.
block/ssh: Add missing gcc format attributes
linux-user: change do_semop to return target errno when unsuccessful
w64: Fix compiler warnings (wrong format specifier)
Remove unneeded type casts
virtio.h: drop unused function prototypes
bswap: fix compiler warning
Anthony Liguori [Fri, 19 Apr 2013 13:38:05 +0000 (08:38 -0500)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci: add pci test device
This adds a new device that we can use for testing PCI PIO and MMIO, with and
without ioeventfd in different configurations. FAST_MMIO will be added if/when
kvm supports it. Also included are minor cleanups in kvm APIs that it needs.
Signed-off-by: Michael S. Tsirkin <[email protected]>
# gpg: Signature made Mon 15 Apr 2013 05:42:24 PM CDT using RSA key ID D28D5469
# gpg: Can't check signature: public key not found
# By Michael S. Tsirkin
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
pci: add pci test device
kvm: support non datamatch ioeventfd
kvm: support any size for pio eventfd
kvm: remove unused APIs
Anthony Liguori [Fri, 19 Apr 2013 13:37:58 +0000 (08:37 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
# By Jan Kiszka (4) and Marcelo Tosatti (1)
# Via Marcelo Tosatti
* qemu-kvm/uq/master:
vmxcap: Update according to SDM of January 2013
target-i386: kvm: save/restore steal time MSR
vmxcap: Report APIC register emulation and RDTSCP control
vmxcap: Augment reported information
vmxcap: Open MSR file in unbuffered mode
virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event
Because dev->actual is uint32_t, the expression 'dev->actual <<
VIRTIO_BALLOON_PFN_SHIFT' is truncated to 32 bits. This overflows when
dev->actual >= 1048576.
To reproduce:
1. Start a VM with a QMP socket and 5G of RAM
2. Connect to the QMP socket, negotiate capabilities and issue:
Amos Kong [Tue, 16 Apr 2013 05:47:32 +0000 (13:47 +0800)]
monitor: fix the wrong order of releasing keys
(qemu) sendkey ctrl_r-scroll_lock-scroll_lock
Executing this command could not let Windows guest panic, it caused by
the wrong order of releasing keys. This problem was introduced by
commit e4c8f004c55d9da3eae3e14df740238bf805b5d6.
The right release order should be starting from last item.
Peter Maydell [Fri, 19 Apr 2013 11:24:19 +0000 (12:24 +0100)]
target-arm: Correctly restore FPSCR
Use the helper functions to save and restore the FPSCR, so that
we correctly propagate rounding mode and flushing behaviour into
the float_status fields. This also allows us to stop saving the
vector length/stride fields separately.
Peter Maydell [Fri, 19 Apr 2013 11:24:19 +0000 (12:24 +0100)]
target-arm: Add some missing CPU state fields to VMState
A number of CPU state fields were accidentally omitted from
our migration state: some OMAP specific cp15 registers, and
some related to state for load/store exclusive insns. Add them.
Juan Quintela [Fri, 19 Apr 2013 11:24:19 +0000 (12:24 +0100)]
target-arm: port ARM CPU save/load to use VMState
Port the ARM CPU save/load code to use VMState. Some state is
saved in a slightly different order to simplify things -- for
example arrays are saved one after the other rather than 'striped',
and we always save all 32 VFP registers even if the CPU happens
to only have 16.
Use one subsection for each feature. This means that we don't need to
bump the version field each time that a new feature gets introduced.
Signed-off-by: Juan Quintela <[email protected]>
[PMM: fixed conflicts, updated to use cpu_class_set_vmsd(), updated
with new/removed fields since original patch, changed to use custom
VMStateInfo for cpsr rather than presave/postload hooks, corrected
subsection names so vmload doesn't fail] Signed-off-by: Peter Maydell <[email protected]>
The problem is a missing return directive that was removed in the
refactoring, so after decoding the instruction, qemu would fall through
to generate an UNDEF exception for an illegal instruction.
Peter Maydell [Fri, 19 Apr 2013 10:15:21 +0000 (11:15 +0100)]
hw/versatile_pci: Drop unnecessary vpb_pci_config_addr()
Drop the vpb_pci_config_addr() function -- it is unnecessary since
the size of the memory regions means the hwaddr is always within
the 24 bit size. (This function was probably a leftover from when
read/write functions were called with absolute addresses rather
than relative ones.)
Peter Maydell [Fri, 19 Apr 2013 10:15:20 +0000 (11:15 +0100)]
versatile_pci: Expose PCI memory space to system
The VersatilePB's PCI controller exposes the PCI memory space to the
system via three regions controlled by the mapping control registers.
Implement this so that guests can actually use MMIO-BAR PCI cards.
Peter Maydell [Fri, 19 Apr 2013 10:15:20 +0000 (11:15 +0100)]
arm/realview: Fix mapping of PCI regions
Fix the mapping of the PCI regions for the realview board, which were
all incorrect. (This was never noticed because the Linux kernel
doesn't actually include a PCI driver for the realview boards.)
Peter Maydell [Fri, 19 Apr 2013 10:15:20 +0000 (11:15 +0100)]
versatile_pci: Implement the PCI controller's control registers
The versatile_pci PCI controller has a set of control registers which
handle the mapping between PCI and system address spaces. Implement
these registers (though for now they have no effect since we don't
implement mapping PCI space into system memory at all).
The most natural order for our sysbus regions has the control
registers at the start, so move all the others down one.
Peter Maydell [Fri, 19 Apr 2013 10:15:19 +0000 (11:15 +0100)]
versatile_pci: Implement the correct PCI IRQ mapping
Implement the correct IRQ mapping for the Versatile PCI controller; it
differs between realview and versatile boards, but the previous QEMU
implementation was correct only for the first PCI card on a versatile
board, since we weren't swizzling IRQs based on the slot number.
Since this change would otherwise break any uses of PCI on Linux kernels
which have an equivalent bug (since they have effectively only been
tested against QEMU, not real hardware), we implement a mechanism
for automatically detecting those broken kernels and switching back
to the old mapping. This works by looking at the values the kernel
writes to the PCI_INTERRUPT_LINE register in the config space, which
is effectively the interrupt number the kernel expects the device
to be using.
Peter Maydell [Fri, 19 Apr 2013 10:15:18 +0000 (11:15 +0100)]
versatile_pci: Use separate PCI I/O space rather than system I/O space
Rather than overloading the system I/O space (which doesn't even make
any sense on ARM) for PCI I/O, create an memory region in the PCI
controller and use that to represent the I/O space.
Peter Maydell [Fri, 19 Apr 2013 10:15:18 +0000 (11:15 +0100)]
versatile_pci: Update to realize and instance init functions
Update the Versatile PCI controller to use a realize function rather
than SysBusDevice::init. To reflect the fact that the 'realview_pci'
class is taking most of its implementation from 'versatile_pci' (and
to make the QOM casts work) we make 'realview_pci' a subclass of
'versatile_pci'.
Peter Maydell [Fri, 19 Apr 2013 10:15:17 +0000 (11:15 +0100)]
versatile_pci: Expose PCI I/O region on Versatile PB
Comments in the QEMU source code claim that the version of the PCI
controller on the VersatilePB board doesn't support the PCI I/O
region, but this is incorrect; expose that region, map it in the
correct location, and drop the misleading comments.
This change removes the only currently implemented difference
between the realview-pci and versatile-pci models; however there
are other differences in not-yet-implemented functionality, so we
retain the distinction between the two device types.
I think in the early revisions of this we had an instantiation helper
for the device in devices.h. This was later removed and this header was
left over. Removed
Petar Jovanovic [Thu, 21 Mar 2013 17:57:36 +0000 (18:57 +0100)]
linux-user: change do_semop to return target errno when unsuccessful
do_semop() is called from two places, and one of these fails to convert
return error to target errno when semop fails. This patch changes the
function to always return target errno in case of an unsuccessful call.
The bswap functions use memcpy but the bswap.h header itself does not seem to
include it in some configuration such as cross compiling for powerpc64
on x86_64 machine.
vhost: Add vhost_commit callback for SeaBIOS ROM region re-mapping
This patch follows MST's recommendation to move checks for
vhost_verify_ring_mappings() -> cpu_physical_memory_map() operations
from MemoryListener->region_[add,del]() -> vhost_set_memory() into
final MemoryListener->commit() -> vhost_commit() callback.
It addresses the case where virtio-scsi vq ioport RAM re-mapping
to read-only SeaBIOS ROM triggers a cpu_physical_memory_map()
NIL MemoryRegionSection pointer failure.
Also save vhost_dev->mem_changed_[start,end]_addr values in
vhost_set_memory() for final ranges_overlap checks. (Thanks Paolo!)
Signed-off-by: Dmitry Fleytman <[email protected]> Signed-off-by: Yan Vugenfirer <[email protected]>
[ Rename files to vmw_pvscsi, fix setting of hostStatus in
pvscsi_request_cancelled - Paolo ] Signed-off-by: Paolo Bonzini <[email protected]>
Petar Jovanovic [Thu, 21 Mar 2013 07:57:36 +0000 (07:57 +0000)]
linux-user: change do_semop to return target errno when unsuccessful
do_semop() is called from two places, and one of these fails to convert
return error to target errno when semop fails. This patch changes the
function to always return target errno in case of an unsuccessful call.
Paolo Bonzini [Wed, 17 Apr 2013 14:26:41 +0000 (16:26 +0200)]
elfload: only give abi_long/ulong the alignment specified by the target
Previously, this was done for target_long/ulong, and propagated to
abi_long/ulong via a typedef. But target_long/ulong should not
have any specific alignment, it is never used to access guest
memory.
Configure to use the DTC submodule to build libfdt when no system libfdt
is found. Prompt to install the DTC submodule if --enable-fdt is set but
no DTC can be found.
DTC has no out-of-tree build capability, so the configure will symlink
the Makefile and scripts directory in the out of tree build directory
and pass in all the needed DTC arguments to make out of tree build happen.
Ideally we fix the DTC make to support out of tree, but did it this way to
avoid commits to DTC.
configure: Put cross compile flags in EXTRA_CFLAGS
The cross compile CFLAGS are needed to properly build pixman (and any other
submodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS,
so put the cross compile flags in EXTRA_CFLAGS instead.
KONRAD Frederic [Thu, 11 Apr 2013 14:30:00 +0000 (16:30 +0200)]
virtio-net-ccw: switch to the new API.
Here the virtio-net-ccw is modified for the new API. The device
virtio-net-ccw extends virtio-ccw-device as before. It creates and
connects a virtio-net-device during the init. The properties are not modified.
KONRAD Frederic [Thu, 11 Apr 2013 14:29:59 +0000 (16:29 +0200)]
virtio-net-s390: switch to the new API.
Here the virtio-net-s390 is modified for the new API. The device
virtio-net-s390 extends virtio-s390-device as before. It creates and
connects a virtio-net-device during the init. The properties are not modified.
KONRAD Frederic [Thu, 11 Apr 2013 14:29:58 +0000 (16:29 +0200)]
virtio-net-pci: switch to the new API.
Here the virtio-net-pci is modified for the new API. The device
virtio-net-pci extends virtio-pci. It creates and connects a
virtio-net-device during the init. The properties are not changed.
Anthony Liguori [Tue, 16 Apr 2013 14:45:20 +0000 (09:45 -0500)]
i440fx-test: add test for PAM functionality
This tests PAM settings for the i440fx. This test does a lot of
byte MMIO which is fairly slow with qtest today. But the test
does complete in under 2 seconds.
We don't fully emulate PAM largely because of limitations with
KVM so we #if 0 that part of the test case.
Anthony Liguori [Tue, 16 Apr 2013 14:45:19 +0000 (09:45 -0500)]
i440fx-test: add test to compare default register values
This test compares all of the default register values against the
spec. It turns out we deviate in quite a few places. These
places are really only visible to the BIOS though which is why
this hasn't created any problems.
The deviation actually happens in the core PCI layer so I suspect
it's not a simple fix if we really care to fix it. For now, just
disable the affected checks.
Anthony Liguori [Tue, 16 Apr 2013 14:45:15 +0000 (09:45 -0500)]
qtest: don't use system command to avoid double fork
Currently we waitpid on the child process we spawn off that does
nothing more than system() another process. While this does not
appear to be incorrect, it's wasteful and confusing so get rid of
it.
Anthony Liguori [Wed, 17 Apr 2013 15:14:07 +0000 (10:14 -0500)]
Merge remote-tracking branch 'bonzini/migration-writev' into staging
# By Paolo Bonzini
# Via Paolo Bonzini
* bonzini/migration-writev:
qemu-file: do not use stdio for qemu_fdopen
iov: handle partial writes from sendmsg and recvmsg
iov: reorganize iov_send_recv, part 3
iov: reorganize iov_send_recv, part 2
iov: reorganize iov_send_recv, part 1
qemu-file: drop socket_put_buffer
Paolo Bonzini [Wed, 27 Mar 2013 16:36:32 +0000 (17:36 +0100)]
qemu-file: do not use stdio for qemu_fdopen
This uses system calls directly for Unix file descriptors, so that the
efficient writev_buffer can be used. Pay attention to the possibility
of partial writes in writev.
Paolo Bonzini [Wed, 27 Mar 2013 16:36:31 +0000 (17:36 +0100)]
iov: handle partial writes from sendmsg and recvmsg
Partial writes can still happen in sendmsg and recvmsg, if a
signal is received in the middle of a write. To handle this,
retry the operation with a new offset/bytes pair.
This happens when starting a guest with '-device virtio-rng-pci',
issuing a 'cat /dev/hwrng' in the guest, while also doing 'cat
/dev/random' on the host.
Paolo Bonzini [Tue, 9 Apr 2013 15:43:43 +0000 (17:43 +0200)]
migration: initialize RAM to zero
Using qemu_memalign only leaves the RAM zero by chance, because libc
will usually use mmap to satisfy our huge requests. But memory will
not be zero when using MALLOC_PERTURB_ with a nonzero value. In the
case of incoming migration, this breaks a recently-introduced
invariant (commit f1c7279, migration: do not sent zero pages in
bulk stage, 2013-03-26).
To fix this, use mmap ourselves to get a well-aligned, always zero
block for the RAM. Mmap-ed memory is easy to "trim" at the sides.
This also removes the need to do something special on valgrind
(see commit c2a8238a, Support running QEMU on Valgrind, 2011-10-31),
thus effectively reverts that patch.