sim-card
/
qemu
Archived
10
0
Fork 0
Commit Graph

18025 Commits

Author SHA1 Message Date
Peter Maydell 05b922dd0a tcg/arm: Use r6 as TCG_AREG0 to avoid clash with Thumb framepointer
On ARM, in Thumb mode r7 is used for the framepointer; this meant
that we would fail to compile in debug mode because we were using r7
for TCG_AREG0. Shift to r6 instead to avoid this clash.
(Bug reported as LP:870990.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-10 17:52:49 +01:00
Stefan Weil 520a02f8b8 cris-dis: Clean memory allocation
The old code used sizeof(const struct cris_opcode **) where it should
have used sizeof(const struct cris_opcode *). As both sizes give the
same value, the resulting binary was ok, but static code analyzers
like coverity and clang complained.

This is fixed here, and the code is also simplified by using g_new0.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-01-10 09:36:43 +01:00
Anthony Liguori cd9244e48a Merge remote-tracking branch 'qemu-kvm/fix-vhost-after-memory-listener' into staging
* qemu-kvm/fix-vhost-after-memory-listener:
  vhost: improve region filtering
  vhost: fix mem_sections memory corruption
  vhost: fix incorrect userspace address
2012-01-09 08:54:04 -06:00
Avi Kivity c49450b98f vhost: improve region filtering
vhost memory management doesn't care about non-memory (e.g. PIO) or non-RAM
regions.  Adjust the filtering to reflect that, and move it earlier so it
applies to mem_sections too.

Signed-off-by: Avi Kivity <avi@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
2012-01-09 14:01:39 +02:00
Avi Kivity 637f7a6a01 vhost: fix mem_sections memory corruption
A memset() used to delete an entry in an array did not take into account
the array element's size.

Signed-off-by: Avi Kivity <avi@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
2012-01-09 13:59:50 +02:00
Avi Kivity d743c38286 vhost: fix incorrect userspace address
MemoryListener::region_add() gives us a slice of a MemoryRegion, not a
region.  Adjust the userspace address to reflect that.

Signed-off-by: Avi Kivity <avi@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
2012-01-09 13:09:40 +02:00
Avi Kivity 1ddde08780 Fix vmstate_register_ram() for rom/device regions
rom/device regions have a ram_addr that is composed of both an I/O handler
(low bits) and RAM region (high bits); but qemu_ram_set_idstr() expects just
a RAM region.  Mask the I/O handler to make it happy.

Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-08 18:16:31 +02:00
Andreas Färber 1470a0cdca memory: Fix adjust_endianness()
Commit a621f38de8 (Direct dispatch
through MemoryRegion) moved byte swaps to a central function.

Add a missing break, so that long-sized byte swaps don't abort.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-08 13:10:16 +02:00
Andreas Färber 2c3579ab07 memory: Fix memory_region_wrong_endianness()
Since commit be675c9720 (memory: move
endianness compensation to memory core) it was checking for
TARGET_BIG_ENDIAN instead of TARGET_WORDS_BIGENDIAN, thereby not
swapping correctly for Big Endian targets.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-08 13:10:09 +02:00
Avi Kivity 6148b23d69 kvm: fix build error in ppc kvm due to memory_region_init_ram_ptr() change
Commit c5705a772 ("vmstate, memory: decouple vmstate from memory API") changed
the signature of memory_region_init_ram_ptr() but did not update a caller in
the ppc kvm module.  Fix.

Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-08 12:59:16 +02:00
Aurelien Jarno e7f929028c 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:
  arm: add dummy A9-specific cp15 registers
  target-arm: Ignore attempts to set invalid modes in CPSR
  target-arm: Don't use cpu_single_env in bank_number()
2012-01-07 22:19:14 +01:00
Aurelien Jarno 15f43ccda1 Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
* 'ppc-next' of git://repo.or.cz/qemu/agraf:
  PPC: Add description for the Freescale e500mc core.
  pseries: Check for duplicate addresses on the spapr-vio bus
  pseries: Populate "/chosen/linux,stdout-path" in the FDT
  pseries: Add a routine to find a stable "default" vty and use it
  pseries: Emit device tree nodes in reg order
  pseries: FDT NUMA extensions to support multi-node guests
  pseries: Remove hcalls callback
  kvm-ppc: halt secondary cpus when guest reset
  console: Fix segfault on screendump without VGA adapter
  PPC: monitor: add ability to dump SLB entries
2012-01-07 22:01:57 +01:00
Stefan Weil c27808657b sm501: Fix size of color_reg
color_reg is expected to hold 32 bit values, so it was too small.

This bug was reported by coverity:

hw/sm501.c:624:
result_independent_of_operands:
color_reg >> 16 is 0 regardless of the values of its operands.
This occurs as the bitwise first operand of '&'.

Cc: Shin-ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-01-07 21:29:26 +01:00
Stefan Weil f840fa995f target-sh4: Fix operands for fipr, ftrv instructions
Coverity complained about right shifts of opcode (16, 18) which were
larger than the size of opcode (16 bit).

Using the correct shift values fixes this.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-01-07 18:16:24 +01:00
Stefan Weil e9b40fd34c malta: Fix regression (i8259 interrupts did not work)
Commit 5632ae46d5 passes the address
of i8259 to qemu_irq_proxy. i8259 is an auto variable with undefined
value outside of mips_malta_init.

This made the interrupt proxy unusable: either QEMU crashes, or
the interrupt handler was not called.

Ethernet for example no longer worked with MIPS Malta.

v2:
While v1 used a static variable for i8259, this patch introduces
a qdev for the malta machine. i8259 is now part of the device status.
This is a minimal qdev implementation to keep the patch small.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-01-07 18:16:24 +01:00
Anthony Liguori a2e4d53ec5 Merge remote-tracking branch 'stefanha/trivial-patches' into staging
* stefanha/trivial-patches:
  qemu-nbd: drop loop which can never loop
  Make python mandatory
  net/socket.c: Fix fd leak in net_socket_listen_init() error paths
  gdbstub: Fix fd leak in gdbserver_open() error path
  configure: Fix test for supported host CPU type
  configure: CONFIG_QEMU_INTERP_PREFIX only for user mode
  scsi virtio-blk usb-msd: Clean up device init error messages
  Strip trailing '\n' from error_report()'s first argument (again)
  qemu-options.hx: fix tls-channel help text
2012-01-06 12:51:21 -06:00
Peter Maydell 2afee49fc4 virtio-9p-proxy: Fix typo causing compile failure on 32 bit hosts
Fix a compile failure on 32 bit hosts (integer constant is too large
for 'unsigned long' type) by correcting a typo where the mask used
for filling in the second f_fsid word had too many 'F's in it.
Also drop the 'L' suffix that allowed this typo to go undetected on
64 bit hosts.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-06 12:50:44 -06:00
Stefan Hajnoczi dc10e8b3c5 qemu-nbd: drop loop which can never loop
For some reason nbd_client_thread() has a do..while loop which can never
loop, the condition is bogus because we would take a goto instead.  Drop
the loop.

Reported-by: Dr David Alan Gilbert <davidagilbert@uk.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:09:53 +00:00
Sebastian Herbszt 7a3fc891ae Make python mandatory
The QEMU build depends on Python so make it an explicit requirement.

Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:15 +00:00
Peter Maydell a46667ea29 net/socket.c: Fix fd leak in net_socket_listen_init() error paths
Fix a leak of a file descriptor due to missing closesocket() calls
in error paths in net_socket_listen_init().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:14 +00:00
Peter Maydell bb16172c52 gdbstub: Fix fd leak in gdbserver_open() error path
Fix a leak of a file descriptor in error exit paths in
gdbserver_open().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:14 +00:00
Peter Maydell 359bc95d3e configure: Fix test for supported host CPU type
The test for whether the host CPU is supported had several problems:
 * the attempt to fall back to TCI was done as a duplicate
   test, very late (so "--cpu foo" would fail early but "--cpu unicore32"
   would fail late, differently, and after configure had already
   printed a lot of output)
 * a number of CPUs only supported as guests were included in the
   list of CPUs we would accept as valid hosts, which would result
   in a late compile failure on those systems rather than a
   configure failure or fallback to TCI
 * bailing out for an unsupported CPU happened before the main
   option parsing, so "configure --help" wouldn't work

Fix these by folding the setting of ARCH into the first test for
supported host CPU, removing spurious guest-only CPU names from it,
and moving the "fall back to TCI" code earlier.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:14 +00:00
Stefan Weil a2c80be948 configure: CONFIG_QEMU_INTERP_PREFIX only for user mode
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:14 +00:00
Markus Armbruster 6a84cb1f28 scsi virtio-blk usb-msd: Clean up device init error messages
Replace

    error_report("DEVICE-NAME: MESSAGE");

by just

    error_report("MESSAGE");

in block device init functions.

DEVICE-NAME is bogus in some cases: it's "scsi-disk" for device
scsi-hd and scsi-cd, "virtio-blk-pci" for virtio-blk-s390, and
"usb-msd" for usb-storage.

There is no real need to put a device name in the message, because
error_report() points to the offending command line option already:

$ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb -device virtio-blk-pci
upstream-qemu: -device virtio-blk-pci: virtio-blk-pci: drive property not set
upstream-qemu: -device virtio-blk-pci: Device 'virtio-blk-pci' could not be initialized

And for a monitor command, it's obvious anyway:

$ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb
(qemu) device_add virtio-blk-pci
virtio-blk-pci: drive property not set
Device 'virtio-blk-pci' could not be initialized

Reported-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:00 +00:00
Markus Armbruster be62a2ebab Strip trailing '\n' from error_report()'s first argument (again)
Commit 6daf194d got rid of them, but Hans and Gerd added some more
lately.  Tracked down with this Coccinelle semantic patch:

@r@
    expression fmt;
    position p;
@@
    error_report(fmt, ...)@p
@script:python@
    fmt << r.fmt;
    p << r.p;
@@
if "\\n" in str(fmt):
    print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
2012-01-06 15:07:00 +00:00
Alon Levy d70d6b3109 qemu-options.hx: fix tls-channel help text
Remove the default compiled out tunnel channel, add the always available
cursor channel. Optimally the man page would depend on compiled in
options, but that's harder to do.

RHBZ: 688586

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06 15:07:00 +00:00
Anthony Liguori f40b7d113d Merge remote-tracking branch 'amit/master' into staging
* amit/master:
  virtio-console: Fix failure on unconnected pty
2012-01-06 08:15:39 -06:00
Anthony Liguori 74b728e4f3 Merge remote-tracking branch 'aneesh/for-upstream' into staging
* aneesh/for-upstream:
  hw/9pfs: Add support to use named socket for proxy FS
  hw/9pfs: man page for proxy helper
  hw/9pfs: Documentation changes related to proxy fs
  hw/9pfs: Proxy getversion
  hw/9pfs: xattr interfaces in proxy filesystem driver
  hw/9pfs: File ownership and others
  hw/9pfs: Add stat/readlink/statfs for proxy FS
  hw/9pfs: Create other filesystem objects
  hw/9pfs: Open and create files
  hw/9pfs: File system helper process for qemu 9p proxy FS
  hw/9pfs: Add new proxy filesystem driver
  hw/9pfs: Add validation to {un}marshal code
  hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file
  hw/9pfs: Move opt validation to FsDriver callback
2012-01-06 08:14:28 -06:00
Anthony Liguori 40aceb98f3 Merge remote-tracking branch 'sstabellini/xen_mem_fix' into staging
* sstabellini/xen_mem_fix:
  xen: Fix after recent change in dirty bitmap tracking.
2012-01-06 08:12:23 -06:00
Anthony Liguori f3e8275f49 Merge remote-tracking branch 'kraxel/usb.33' into staging
* kraxel/usb.33:
  usb-ohci: td.cbp incorrectly updated near page end
  usb-host: properly release port on unplug & exit
  usb-storage: cancel I/O on reset
  Fix parse of usb device description with multiple configurations
2012-01-06 08:11:41 -06:00
Andriy Gapon fd891c9318 usb-ohci: td.cbp incorrectly updated near page end
The current code that updates the cbp value after a transfer looks like this:
td.cbp += ret;
if ((td.cbp & 0xfff) + ret > 0xfff) {
	<handle page overflow>
because the 'ret' value is effectively added twice the check may fire too early
when the overflow hasn't happened yet.

Below is one of the possible changes that correct the behavior:

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-06 12:36:14 +01:00
Gerd Hoffmann c75fead66e usb-host: properly release port on unplug & exit
Factor out port release into a separate function.  Call release function
in exit notifier too.  Add explicit call the USBDEVFS_RELEASE_PORT
ioctl, just closing the hub file handle seems not to be enougth.  Make
sure we release the port before resetting the device, otherwise host
drivers will not re-attach.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-06 12:36:14 +01:00
Gerd Hoffmann 24a5bbe1c8 usb-storage: cancel I/O on reset
When resetting the usb-storage device we'll have to carefully cancel
and clear any requests which might be in flight, otherwise we'll confuse
the state machine.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-06 12:36:14 +01:00
Mark Langsdorf 7da362d016 arm: add dummy A9-specific cp15 registers
Add dummy register support for the cp15, CRn=c15 registers.

config_base_register and power_control_register currently
default to 0, but may have improved support after the QOM
CPU patches are finished.

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-05 15:49:06 +00:00
Peter Maydell 37064a8b6f target-arm: Ignore attempts to set invalid modes in CPSR
Ignore attempts to set the CPSR mode field to an invalid value.
This is UNPREDICTABLE, but we should not cpu_abort() for things
a malicious guest (or a confused user on the gdbstub interface)
can provoke.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-05 15:49:06 +00:00
Peter Maydell 1b9e01c110 target-arm: Don't use cpu_single_env in bank_number()
Avoid using cpu_single_env in bank_number() -- if we were
called via the gdb stub reading or writing the CPSR then
it is NULL and we will segfault if we take the cpu_abort().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-05 15:49:06 +00:00
Anthony PERARD b18620cf76 xen: Fix after recent change in dirty bitmap tracking.
A recent patch set from Avi break the dirty bitmap support of Xen. But
this is because xen_sync_dirty_bitmap will return an error for an
unhandled memory range (a0000 - bffff). However this is not a fatal
error, so we should just continue instead of aborting.

There is now an error printed when the Xen call failed.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-01-05 12:47:08 +00:00
Anthony Liguori c47f322365 Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
* pmaydell/arm-devs.for-upstream:
  add L2x0/PL310 cache controller device
  arm: add dummy gic security registers
  arm: Set frequencies for arm_timer
  arm: add missing scu registers
  hw/omap_gpmc: Fix region map/unmap when configuring prefetch engine
  hw/omap1.c: Drop unused includes
  hw/omap1.c: Separate dpll_ctl from omap_mpu_state
  hw/omap1.c: Separate PWT from omap_mpu_state
  hw/omap1.c: Separate PWL from omap_mpu_state
  hw/omap1.c: omap_mpuio_init() need not be public
  hw/pl110.c: Add post-load hook to invalidate display
  hw/pl181.c: Add save/load support
2012-01-04 10:06:25 -06:00
M. Mohan Kumar 84a87cc4cc hw/9pfs: Add support to use named socket for proxy FS
Add option to use named socket for communicating between proxy helper
and qemu proxy FS. Access to socket can be given by using command line
options -u and -g.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 21:23:55 +05:30
M. Mohan Kumar a2d8f1beb1 hw/9pfs: man page for proxy helper
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 21:23:53 +05:30
M. Mohan Kumar f67e3ffd34 hw/9pfs: Documentation changes related to proxy fs
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 21:23:53 +05:30
M. Mohan Kumar d090e452d4 hw/9pfs: Proxy getversion
Add proxy getversion to get generation number

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:20:55 +05:30
M. Mohan Kumar d52b09e475 hw/9pfs: xattr interfaces in proxy filesystem driver
Add xattr support for proxy FS

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:20:46 +05:30
M. Mohan Kumar ea75fc4ec5 hw/9pfs: File ownership and others
Add file ownership interfaces like chmod/chown, utime update, rename,
remove and truncating files for proxy FS

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:19:48 +05:30
M. Mohan Kumar b178adc3e7 hw/9pfs: Add stat/readlink/statfs for proxy FS
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:19:39 +05:30
M. Mohan Kumar 39f8c32c3f hw/9pfs: Create other filesystem objects
Add interfaces to create filesystem objects like directory,
device nodes, symbolic links, links for proxy filesytem driver

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:18:09 +05:30
M. Mohan Kumar daf0b9aca9 hw/9pfs: Open and create files
Add interfaces to open and create files for proxy file system driver.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:14:28 +05:30
M. Mohan Kumar 17bff52b62 hw/9pfs: File system helper process for qemu 9p proxy FS
Provide root privilege access to QEMU 9p proxy filesystem using socket
communication.

Proxy helper is started by root user as:
~ # virtfs-proxy-helper -f|--fd <socket descriptor> -p|--path <path-to-share>

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:14:02 +05:30
M. Mohan Kumar 4c793dda22 hw/9pfs: Add new proxy filesystem driver
Add new proxy filesystem driver to add root privilege to qemu process.
It needs a helper process to be started by root user.

Following command line can be used to utilize proxy filesystem driver
-virtfs proxy,id=<id>,mount_tag=<tag>,socket_fd=<socket-fd>

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 20:13:39 +05:30
M. Mohan Kumar ddca7f86ac hw/9pfs: Add validation to {un}marshal code
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04 19:53:22 +05:30