Commit graph

1404 commits

Author SHA1 Message Date
aurel32 bb7e729397 hw/apic.c: use functions from host-utils.h
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5469 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-12 20:16:03 +00:00
aurel32 bad5b1ec8e Define macro QEMU_GNUC_PREREQ and use it
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5467 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-12 16:15:04 +00:00
aurel32 5b7ada46e5 Only use __builtin_* with GCC >= 3.4
Fix gcc 3.3 builds, broken in revision 5465.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5466 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-12 11:44:36 +00:00
aurel32 e95f5491bc hw/apic.c: use __builtin funtions instead of assembly code
Suggested by malc.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5465 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-12 00:53:17 +00:00
malc 1792f2867c Fix some debugging mistakes/leftovers
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5458 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-11 17:37:25 +00:00
blueswir1 22864256db Correct SCSI error reporting (Laurent Vivier)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5455 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-11 09:33:03 +00:00
balrog 71fb234866 Increase write buffer size in pflash emulation (Thomas Petazzoni).
The current flash emulation code advertises a write buffer size of 16
bytes (1 << 4, according to offset 0x2A of the CFI table). This is
very small compared to normal write buffer sizes, and makes the
process of writing to the flash very slow (at least from U-Boot).

This patch increases this size to 2048 bytes. Except the modification
of the CFI table, the only other required modification is to use
"value" instead of "cmd" to set pfl->counter, because cmd is truncated
to the 8 lower bits of value, while the number of bytes for a write
can now be greater than 255 bytes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5454 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-11 09:19:57 +00:00
aliguori 33256a25b3 Fix IDE DIAGNOSE for packet devices (Vincent Sanders)
The DIAGNOSE command in the qemu IDE implementation has an error when
use dfor packet devices. 

The status register value is dependant on the drive being a packet
device or not, this patch corrects the returned status.

From the ATA/PI specification (V6 draft):

"If the device implements the PACKET command feature set, the device
SHALL clear bits 6,5,4,3,2 and 0 in the Status register to zero."

A selection of physical devices have been checked and do conform to
the specifications behaviour.

Signed-off-by: Vincent Sanders <vince@simtec.co.uk>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5452 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-09 14:19:34 +00:00
aliguori b2097003ec machine struct - specify max_cpus at the per machine level (Jes Sorensen)
Introduce a max_cpus per-machine variable, allowing individual boards
to limit it's number of CPUs. Check requested number of CPUs in setup
code and exit if it exceeds the supported number for the machine.
This also renders the static MAX_CPUS check obsolete, so remove this
from vl.c.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5443 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-07 20:39:39 +00:00
aliguori 4b32e16880 machine struct - use C99 initializers (Jes Sorensen)
Modify all the machine struct declarations to use C99 initializers.
This patch has no functional changes.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5442 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-07 20:34:35 +00:00
aliguori 9366f41860 Introduce v3 of savevm protocol
The current savevm/loadvm protocol has some draw backs.  It does not support
the ability to do progressive saving which means it cannot be used for live
checkpointing or migration.  The sections sizes are 32-bit integers which
means that it will not function when using more than 4GB of memory for a guest.
It attempts to seek within the output file which means it cannot be streamed.
The current protocol also is pretty lax about how it supports forward
compatibility.  If a saved section version is greater than what the restore
code support, the restore code generally treats the saved data as being in
whatever version it supports.  This means that restoring a saved VM on an older
version of QEMU will likely result in silent guest failure.

This patch introduces a new version of the savevm protocol.  It has the
following features:

 * Support for progressive save of sections (for live checkpoint/migration)
 * An asynchronous API for doing save
 * Support for interleaving multiple progressive save sections
   (for future support of memory hot-add/storage migration)
 * Fully streaming format
 * Strong section version checking

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5434 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-06 14:53:52 +00:00
blueswir1 2bfdab638a Move nographic export to sysemu.h
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5414 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-04 07:22:29 +00:00
blueswir1 3b3fb32229 Use qemu-log.h
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5413 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-04 07:20:07 +00:00
balrog 06adb549e6 Improve pflash cfi01 debug messages (Thomas Petazzoni).
This patches slightly improves the debugging messages in pflash_read()
and pflash_write().

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5410 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-03 23:09:08 +00:00
balrog 3656744cdd Reset CFI01 flash wcycle after erase confirm (Thomas Petazzoni).
pfl->wcycle was set to 1 when the erase confirm command was set, which
lead to the next command being misinterpreted by Qemu:

pflash_write: Unimplemented flash cmd sequence (offset 00000000,
wcycle 0x1 cmd 0x20 value 0x70)

This patch fixes this issue by resetting pfl->wcycle to 0 on erase
confirm so that the next command is considered as a new one.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5409 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-03 23:00:09 +00:00
blueswir1 f4b1a842d7 Rearrange tick functions
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5408 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-03 19:04:42 +00:00
blueswir1 b6c4f71f50 Resurrect the safe part of r5274
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5401 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-02 19:14:17 +00:00
blueswir1 09bc878a13 Make PCI class description tables const
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5400 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-02 18:33:50 +00:00
blueswir1 88b4e9dbe2 Make some tables const
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5395 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-02 18:24:21 +00:00
blueswir1 daa41b0010 Sun ss20 OBP does 32bit register access to esp (Robert Reif)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5394 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-02 18:07:56 +00:00
aurel32 3003b8bbf9 Reset CPU on INIT IPI
INIT IPI should reset CPU. Also non boot CPU should be halted. It will
be un-halted by SIPI.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5390 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 22:01:28 +00:00
aurel32 f0f72ffe64 qemu: improve scsi dma speed by increasing the dma buffer size
taken from Xen 17267:f4a92f0db20f, original patch by Samuel Thibault.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5385 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 21:46:23 +00:00
aurel32 5a964d93dc hw/apic.c: use bsr and bsf on x86_64
(C.W. Betts)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5382 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 21:45:59 +00:00
balrog 5604e090cb Check that asynchronous (DMA) submission succeeds (Ian Jackson).
If it does not, abort the command immediately rather than dropping
it on the floor.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5369 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 01:43:16 +00:00
balrog e162cfb07b Actually check read/write errors in IDE (Ian Jackson).
This patch makes the ide emulation actually take notice of
error returns from bdrv_write and bdrv_aio_{read,write}.

(Cherry picked from qemu-xen e0e7a0afe0e324a1f7d64c240f567b15dbe454cf,
 first posted to qemu-devel Wed, 20 Feb 2008 15:26:41 +0000)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5368 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-01 01:13:37 +00:00
blueswir1 674bb26172 Add some missing static qualifiers
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5363 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30 18:18:27 +00:00
balrog e820e3f459 Make sure bluez programs (cross-)compile, add missing statics.
Spotted by Blue Swirl.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5358 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-30 02:27:44 +00:00
blueswir1 ada24f8466 Fix SS-2 crash
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5357 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 18:24:38 +00:00
aliguori 5dafc53f1f Refactor QEMUFile for live migration
To support live migration, we override QEMUFile so that instead of writing to
disk, the save/restore state happens over a network connection.

This patch makes QEMUFile read/write operations function pointers so that we
can override them for live migration.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5352 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 16:25:16 +00:00
balrog e6a6d5abc6 Emulate a USB bluetooth dongle (or HCI Transport layer).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5349 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 00:40:44 +00:00
balrog ab2b6f507d Use VHCI to allow the host os to participate in a qemu bluetooth "vlan".
This does the reverse of bt-host.c, proxying from guest to host.
Appears to be more reliable.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5348 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 00:31:41 +00:00
balrog 47e699dc80 Bluetooth HIDP emulation on top of usb-hid.c and L2CAP and SDP.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5347 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 00:25:17 +00:00
balrog 4d2d181cdb Add L2CAP logic and a virtual SDP server for use in emulated devices.
Note that the L2CAP flow-controlled mode is not fully supported.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5346 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 00:14:22 +00:00
balrog 4e38eb5438 Add a virtual HCI.
This implements most of the logic of a real HCI (at least the pieces
marked as mandatory).  It doesn't support keys, authentication etc.
It works on top of the LMP layer, which is not fully emulated because
software never has direct access to it.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5345 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-29 00:02:34 +00:00
balrog 58a26b477e Emulate a serial bluetooth HCI with H4+ extensions and attach to n8x0's UART.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5343 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 23:34:13 +00:00
balrog 1ae26a18a3 Add a "null" bluetooth HCI and a header file for bluetooth.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5342 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 23:19:47 +00:00
blueswir1 c9b1ae2cfd Add to machine structure a flag to use SCSI drives instead of IDE: fixes SS-20
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5339 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 18:55:17 +00:00
malc f87fc09b15 Fix dots per clock value, cleanup and "optimize"
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5338 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 02:43:18 +00:00
malc cb5a7aa8c3 Optional "precise" VGA retrace support
Selected via: -vga <name>,retrace=precise

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5336 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-28 00:42:12 +00:00
blueswir1 e87231d426 Add a generic Niagara machine
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5329 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-26 19:48:58 +00:00
blueswir1 2ca83a8dd6 Revert r5274 which breaks savevm/loadvm
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5321 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-25 20:24:19 +00:00
ths 547012f495 pflash: Add missing parenthesis in error message.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5311 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-24 14:33:07 +00:00
balrog 38334f7630 Don't use ds->dpy_copy directly from hw/ (Jan Niehusmann).
I left a TODO in the code because this still doesn't definitely
fix all issues.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5308 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-24 02:21:24 +00:00
aliguori a9dd6843be scsi-generic: decode correctly SCSI tape commands (Laurent Vivier)
This patch allows to use a "real" SCSI tape with qemu using
"-drive /dev/sgX,if=scsi".

It allows to decode correctly transfer length when the type of the
device is a tape.

Some issues remain when the application reading the tape tries to go
beyond the end of the stream (but they must be corrected at the SCSI
controller level).

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5305 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-23 13:38:44 +00:00
edgar_igl c64882682d ETRAX-FS: Correct ethernet PHY diagnostics register reads.
* Correct ethernet PHY diagnostics register reads.
* Add friendly names for the speed/duplex fields.
* Report duplex mismatches between MAC and PHY.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5300 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 20:34:18 +00:00
blueswir1 9d92659858 Add software and timer interrupt support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5299 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 19:50:28 +00:00
pbrook 64c68080da Add comment to windows SCSI hack.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5295 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 16:30:29 +00:00
aliguori ee4d919f30 LSI SCSI: raise UDC on infinite loop (Marcelo Tosatti)
Raise UDC (Unexpected Disconnect) when a large enough number of
instructions has been executed by the SCRIPTS processor. This "solution"
is much simpler than temporarily interrupting execution.

This remedies the situation with Windows which downloads SCRIPTS code
that busy loops on guest main memory. Their drivers _do_ handle UDC 
appropriately (at least XP and 2003).

It would be nicer to actually detect infinite loops, but until then,
this bandaid seems acceptable.

Since the situation seems to be rare enough, raise the number 
of instructions to 10000 (previously 1000).

Three people other than myself had success with this patch.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5293 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 16:04:16 +00:00
aliguori 72ecb8d9dd scsi-generic: correct 6-bytes commands transfer length (Laurent Vivier)
According to SCSI documentation, for 6 bytes commands (READ(6),
WRITE(6)), if transfer length is 0 it specifies 256 blocks.

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5292 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 15:30:26 +00:00
aliguori 4f26a4867c scsi-generic: correct usage of memset() (Laurent Vivier)
void *memset(void *s, int c, size_t n);

DESCRIPTION
       The  memset()  function  fills  the  first  n  bytes of the
memory area
       pointed to by s with the constant byte c."

Reported by Dietmar Maurer.

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5291 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 15:27:54 +00:00