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

15844 Commits

Author SHA1 Message Date
Richard Henderson 25c4d9cc84 tcg: Always define all of the TCGOpcode enum members.
By always defining these symbols, we can eliminate a lot of ifdefs.

To allow this to be checked reliably, the semantics of the
TCG_TARGET_HAS_* macros must be changed from def/undef to true/false.
This allows even more ifdefs to be removed, converting them into
C if statements.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 18:52:24 +00:00
Richard Henderson 8399ad59e7 tcg: Add and use TCG_OPF_64BIT.
This allows the simplification of the op_bits function from
tcg/optimize.c.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 18:52:22 +00:00
Brad 4b29ec41c8 Check for presence of compiler -pthread flag.
OpenBSD / FreeBSD and some other OS's require the use of
cc -pthread to link threaded programs so have QEMU's
configure script check for the presence of the flag
and use it if so.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 18:46:34 +00:00
Blue Swirl 58a06675d3 Convert last qemu_free and qemu_malloc uses
7267c0947d missed
a few cases, fix them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 18:42:08 +00:00
Austin Clements c76c8416be monitor: Show combined protection bits in "info mem"
Previously, "info mem" considered and displayed only the last-level
protection bits for a memory range, which doesn't accurrately
represent the protection of that range.  Now it shows the combined
protection.

Signed-off-by: Austin Clements <amdragon@mit.edu>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 16:42:39 +00:00
Austin Clements 8a94b8ca53 monitor: Fix "info mem" to print the last memory range
"info mem" groups its output into contiguous ranges with identical
protection bits, but previously forgot to print the last range.

Signed-off-by: Austin Clements <amdragon@mit.edu>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 16:42:36 +00:00
Austin Clements b49ca72dd7 monitor: Prevent sign-extension of 32-bit addresses printed by info mem
Previously, on 32-bit i386, info mem used signed 32-bit int's to store
the page table indexes.  As a result, address calculation was done in
32 bits and then incorrectly sign-extended to 64 bits, yielding output
like

ffffffffef000000-ffffffffef031000 0000000000031000 ur-
ffffffffef7bc000-ffffffffef7bd000 0000000000001000 urw
ffffffffef7bd000-ffffffffef7be000 0000000000001000 ur-

This makes these indexes unsigned, which yields correct output

00000000ef000000-00000000ef031000 0000000000031000 ur-
00000000ef7bc000-00000000ef7bd000 0000000000001000 urw
00000000ef7bd000-00000000ef7be000 0000000000001000 ur-

Signed-off-by: Austin Clements <amdragon@mit.edu>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 16:42:31 +00:00
Stefan Weil 59ad3403c2 w32: Fix format string regression
Commit 953ffe0f93
introduced FMT_pid which is wrong for w32 and w64 getpid():
those getpid() implementations always return an int value.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 15:33:33 +00:00
Stefan Weil 0e0167bacc w64: Add definition of FMT_pid
For mingw-w64, pid_t is _pid_t which is __int64,
so this platform needs its own definition of FMT_pid.

Reviewed-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 15:33:22 +00:00
Stefan Weil 3feaca9e88 Fix conversions from pointer to tcg_target_long
tcg_gen_exit_tb takes a parameter of type tcg_target_long,
so the type casts of pointer to long should be replaced by
type casts of pointer to tcg_target_long.

These changes are needed for build environments where
sizeof(long) != sizeof(void *), especially for w64.

See 4b4a72e556 which fixed the
same issue for the other targets.

Cc: Alexander Graf <agraf@suse.de>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Guan Xuetao<gxt@mprc.pku.edu.cn>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 15:32:21 +00:00
Anthony Liguori 92f562ec56 Remove remenants of qemu_malloc
This covers the various check commands

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-21 08:37:10 -05:00
Anthony Liguori 145e21dbd0 Update HACKING to refer to g_malloc instead of qemu_malloc
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-21 08:16:56 -05:00
Anthony Liguori 0750112af4 Add trace points for g_malloc/g_free functions
Derived from a patch submitted by Avi Kivity.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:09 -05:00
Anthony Liguori 41a748265f Remove qemu_malloc/qemu_free
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:08 -05:00
Anthony Liguori 7267c0947d Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:08 -05:00
Anthony Liguori 14015304b6 Make glib mandatory and fixup utils appropriately
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:03 -05:00
Jan Kiszka 0ac543de94 Reorder default ram_size initialization
code_gen_alloc depends on it, and that is now called earlier via
configure_accelerator.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-21 00:50:23 +02:00
Blue Swirl 02fa69b6e8 scsi-disk: fix DPRINTF
The variable 'status' does not exist anymore, adjust DPRINTF
accordingly.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-20 09:22:52 +00:00
Peter Maydell 871708bf39 target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SP
The REG_PC constant used in opcode-cris.h can clash with a
similar define in system include files. In particular the
Ubuntu Lucid SPARC signal.h will define REG_PC, and since
qemu-common.h now includes signal.h this was causing compile
failures. Rename the constants to avoid this issue.
(NB that REG_SP is not actually used within QEMU.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-20 01:41:01 +02:00
Paolo Bonzini 8b2a04eeb9 scsi: do not overwrite memory on REQUEST SENSE commands with a large buffer
Other scsi_target_reqops commands were careful about not using r->cmd.xfer
directly, and instead always cap it to a fixed length.  This was not done
for REQUEST SENSE, and this patch fixes it.

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-16 19:11:51 +00:00
Peter Maydell 3b6ffe5030 hw/scsi-bus.c: Fix use of uninitialised variable
Don't use req before it has been initialised in scsi_req_new().
This fixes a compile failure due to gcc complaining about this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-14 19:34:25 +00:00
Michael Roth 7534ba0130 qapi: fix build issue due to missing newline in generated header
Fixes a build issue on RHEL5, and potentially other distros, where gcc
will generate an error due to us not writing a trailing "\n" when
generating *qmp-commands.h

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:30 -05:00
Avi Kivity 7075ba3097 memory: correct documentation typos
Noted by Drew Jones.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:30 -05:00
Avi Kivity d0a9b5bc0a memory: add API for creating ROM/device regions
ROM/device regions act as mapped RAM for reads, can I/O memory for
writes.  This allow emulation of flash devices.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:30 -05:00
Avi Kivity 545e92e06a memory: reclaim resources when a memory region is destroyed for good
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:29 -05:00
Jiri Denemark 76dc3cf82c build: Move QEMU_INCLUDES before QEMU_CFLAGS
This patch fixes build when any of the include paths from QEMU_CFLAGS
contains a header file with similar name to a header file in qemu
sources. I hit it with error.h included by qapi/qapi-types-core.h. GCC
decided to use /usr/include/alsa/error.h instead of qemu's error.h.

Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:29 -05:00
Stefan Weil 83b2f0a0d8 configure: Disable guest_agent for mingw32
guest_agent is not supported for mingw32, so the default value
should be 'no', not 'yes'.

This removes the dependencies to glib-2.0 and python which
makes native and cross builds for w32 much easier (no need
to get and install these extra packages).

It also avoids the problems caused by different bitfield alignment
which is required by glib-2.0.

It is still possible to set guest_agent=yes via configure option.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:29 -05:00
Paolo Bonzini 98254542f9 scsi: add special traces for common commands
Can be useful when debugging the device scan phase.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:28 -05:00
Paolo Bonzini c7b488721d scsi: report unit attention on reset
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:28 -05:00
Paolo Bonzini 6dc06f08b3 scsi: add support for unit attention conditions
Unit attention conditions override any sense data the device already
has.  Their signaling and clearing is handled entirely by the SCSIBus
code, and they are completely transparent to the SCSIDevices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:28 -05:00
Paolo Bonzini a872a3049a scsi: add a bunch more common sense codes
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:05 -05:00
Paolo Bonzini 739df2150d scsi: move handling of REQUEST SENSE to common code
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:05 -05:00
Paolo Bonzini fdaef06917 scsi: move handling of REPORT LUNS and invalid LUNs to common code
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:30:20 -05:00
Paolo Bonzini afa46c468a scsi: move request parsing to common code
Also introduce the first occurrence of "independent" SCSIReqOps,
to handle invalid commands in common code.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:29:01 -05:00
Paolo Bonzini 87dcd1b2c2 scsi: push lun field to SCSIDevice
This will let SCSIBus detect requests sent to an invalid LUN, and
handle them itself.  However, there will be still support for only one
LUN per target

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:29:01 -05:00
Paolo Bonzini 2599aece1b scsi: introduce SCSICommand
This struct is currently unnamed.  Give it a name and use it
explicitly to decouple (some parts of) CDB parsing from
SCSIRequest.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:29:01 -05:00
Paolo Bonzini c39ce112b6 scsi: pass cdb already to scsi_req_new
Right now the CDB is not passed to the SCSIBus until scsi_req_enqueue.
Passing it to scsi_req_new will let scsi_req_new dispatch common requests
through different reqops.

Moving the memcpy to scsi_req_new is a hack that will go away as
soon as scsi_req_new will also take care of the parsing.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:37 -05:00
Paolo Bonzini 12010e7b29 scsi: move request-related callbacks from SCSIDeviceInfo to SCSIReqOps
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:37 -05:00
Paolo Bonzini 8dbd457488 scsi: introduce SCSIReqOps
This will let allow requests to be dispatched through different callbacks,
either common or per-device.

This patch adjusts the API, the next one will move members to SCSIReqOps.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:36 -05:00
Paolo Bonzini b45ef674f4 scsi: move sense handling to generic code
With this patch, sense data is stored in the generic data structures
for SCSI devices and requests.  The SCSI layer takes care of storing
sense data in the SCSIDevice for the subsequent REQUEST SENSE command.

At the same time, get_sense is removed and scsi_req_get_sense can use
an entirely generic implementation.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:30 -05:00
Paolo Bonzini 682a9b213c scsi: pass status when completing
A small improvement in the SCSI request API.  Pass the status
at the time the request is completed, so that we can assert that
no request is completed twice.  This would have detected the
problem fixed in the previous patch.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:00 -05:00
Paolo Bonzini 05751d3ff7 vscsi: always use get_sense
vscsi supports autosensing by providing sense data directly in the
response.  When get_sense was added, the older state machine approach
that sent REQUEST SENSE commands separately was left in place.  Remove
it, all existing SCSIDevices do support autosensing and the next patches
will make the support come for free from the SCSIBus.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:00 -05:00
Paolo Bonzini e44089c79d scsi-disk: no need to call scsi_req_data on a short read
In fact, if the HBA's transfer_data callback goes on with scsi_req_continue
the request will be completed successfully instead of showing a failure.
It can even cause a segmentation fault.

An easy way to trigger it is "eject -f cd" during installation (during media
test if the installer does something like that).

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:00 -05:00
Anthony Liguori 4333979e3d pc: make vgabios exit port more useful
We've always listened on port 501 for vgabios panic messages.  In the entire
time I've worked on QEMU, I've never actually seen a vgabios panic message :-)

If we change the semantics of this port a little bit, it makes it possible to
use it for more interesting use-cases.  I chose this approach instead of adding
a new I/O port because it avoids having a guest visible change.

This change allows single-byte access to port 501 and also uses the value
written to construct an exit code.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:27:00 -05:00
Anthony Liguori 9b024b5f96 Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2011-08-12 08:06:02 -05:00
Anthony Liguori eecaecedec Merge remote-tracking branch 'aneesh/for-upstream-1' into staging 2011-08-12 07:52:53 -05:00
Anthony Liguori 25a263cdec Merge remote-tracking branch 'spice/spice.v41' into staging 2011-08-12 07:51:09 -05:00
Anthony Liguori 7cb78eec5c Merge remote-tracking branch 'kraxel/usb.23' into staging 2011-08-12 07:50:35 -05:00
Anthony Liguori 9c4dd424c3 Merge remote-tracking branch 'kraxel/seabios' into staging 2011-08-12 07:50:16 -05:00
Paolo Bonzini 85d59fef9d fix QLIST usage for RAM list
Spotted while reviewing the migration thread patches.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-08-12 13:07:58 +01:00