Commit Graph

3379 Commits

Author SHA1 Message Date
Christoph Hellwig 99aba0c41b scsi: update comment on the standards revision
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 23:05:59 +01:00
Amit Shah 21be440c6a ppc440_bamboo: Disable new virtio-serial features for 0.12 machine type
Disable the MULTIPORT feature and MSI vectors for the 0.12 machine
types; those features are added only for 0.13 onwards.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 22:56:54 +01:00
Amit Shah 977b6b91ce ppc440_bamboo: Add 0.12 and 0.13 machine types for backward compat
Add a 0.12 machine type for compatibility with older versions. Mark the
default one as 0.13.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 22:56:53 +01:00
Amit Shah ad509737f8 s390-virtio: Fix compile error for virtio-block init
Commit 428c149b0b modified the argument
that virtio_blk_init takes. Update the s390 bus code that calls this
function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 22:55:18 +01:00
Aurelien Jarno cdee7bdfee hw/serial.c: fix THRE interrupt clearing
UART_IIR_THRI is not a mask, but a possible value for the IIR ID.
Use UART_IIR_ID to extract this value.

Broken by commit 71e605f803.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 22:28:07 +01:00
Aurelien Jarno 2f4f22bd44 hw/serial.c: fix indentation
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 20:23:09 +01:00
Anthony Liguori f374e826e3 Merge remote branch 'qemu-kvm/uq/master' into pulls 2010-03-04 09:14:24 -06:00
Jan Kiszka 6cb2996cef x86: Extend validity of bsp_to_cpu
As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equals
cpu_index, bsp_to_cpu can also be based on the latter directly. This
will help an early user of it: KVM while initializing mp_state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-04 00:29:32 -03:00
Jan Kiszka ea375f9ab8 KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load related
synchronization points in favor of four(!) generic hooks:

- cpu_synchronize_all_states in qemu_savevm_state_complete
  (initial sync from kernel before vmsave)
- cpu_synchronize_all_post_init in qemu_loadvm_state
  (writeback after vmload)
- cpu_synchronize_all_post_init in main after machine init
- cpu_synchronize_all_post_reset in qemu_system_reset
  (writeback after system reset)

These writeback points + the existing one of VCPU exec after
cpu_synchronize_state map on three levels of writeback:

- KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run)
- KVM_PUT_RESET_STATE   (on synchronous system reset, all VCPUs stopped)
- KVM_PUT_FULL_STATE    (on init or vmload, all VCPUs stopped as well)

This level is passed to the arch-specific VCPU state writing function
that will decide which concrete substates need to be written. That way,
no writer of load, save or reset functions that interact with in-kernel
KVM states will ever have to worry about synchronization again. That
also means that a lot of reasons for races, segfaults and deadlocks are
eliminated.

cpu_synchronize_state remains untouched, just as Anthony suggested. We
continue to need it before reading or writing of VCPU states that are
also tracked by in-kernel KVM subsystems.

Consequently, this patch removes many cpu_synchronize_state calls that
are now redundant, just like remaining explicit register syncs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-04 00:29:28 -03:00
Avi Kivity 60e4c6317b Allocate memory below 4GB as one chunk
Instead of allocating a separate chunk for the first 640KB and another
for 1MB+, allocate one large chunk.  This plays well in terms of alignment
and size with large pages.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-04 00:28:41 -03:00
Stefan Weil 78728c92a4 eepro100: Keep includes sorted
I always try to keep standard includes sorted
and add a comment why they are there (so they
can be removed when they are no longer needed).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:47:53 +02:00
Stefan Weil e7493b25c0 eepro100: Remove C++ comments
C++ comments are unwanted, so this is fixed here.

* Replace C++ comments by C comments.
* Put code which was deactivated by a C++ comment in #if 0...#endif.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:47:45 +02:00
Stefan Weil f80a7fc34e eepro100: Add diagnose command
Real hardware would run an internal self-test.
The emulation just returns a passed status.

Original patch was from Reimar Döffinger, thanks.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:44:32 +02:00
Stefan Weil 3d0f4b9bb5 eepro100: New function for reading command block
Move code which reads the command block to the
new function read_cb. The patch also fixes some
endianess issues related to the command block
and moves declarations of local variables to
the beginning of the block.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:44:20 +02:00
Stefan Weil ec1d02d8de eepro100: Use tx.status
There is no need for a local variable "status".
Using tx.status makes it clearer which status
is addressed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:19 +02:00
Stefan Weil cc02c66cc8 eepro100: Prettify code (no functional changes)
* Fix indentation.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:17 +02:00
Stefan Weil cb25a3fb60 eepro100: Fix CU Start command
CU Start is allowed when the CU is in the idle or suspended state.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:10 +02:00
Stefan Weil e824012bc2 eepro100: Support RNR interrupt
The RNR interrupt is triggered under these conditions:

* the RU is not ready to receive a frame due to missing resources
* the RU is ready and a RU abort command was requested

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:07 +02:00
Stefan Weil e715c8e84c eepro100: Replace variable name to fix a compiler warning
When compiling with -Wshadow, gcc gives a warning
which is fixed by renaming stat -> status.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:06 +02:00
Stefan Weil b1e87018f2 eepro100: Use symbolic names for bits in EEPROM id
V2 - Use UPPER_CASE for enum values

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:04 +02:00
Stefan Weil c5bac30252 eepro100: Remove old unused code
This code is no longer needed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:02 +02:00
Stefan Weil ced5296ab7 eepro100: Use symbolic names and BIT macros in binary operations
Instead of magic numbers like 0x8000, symbolic names are used
for the SCB command and status bits.

There are too many configuration bits to use symbolic names
there, too. Using the BIT macro is a little help when comparing
code and documentation.

For the same reason, some other constants were replaced by
the BITS macro.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:34:01 +02:00
Stefan Weil 762401e2f8 eepro100: Add device descriptions
Add descriptions for all devices.
These descriptions are shown when users call
		qemu -device ?

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:59 +02:00
Stefan Weil 230a167c29 eepro100: Update copyright notice
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:57 +02:00
Stefan Weil ba19f2dea5 eepro100: Add TODO list
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:55 +02:00
Stefan Weil da51e79b7f eepro100: Support gpxe boot for all eepro100 devices
Only two boot ROM files are needed for all devices.

* Add these GPXE ROM files using new naming convention
  (as discussed on qemu-devel). Both files were created
  with http://rom-o-matic.net/, PCI vendor / device ids
  as in ROM filenames and option BANNER_TIMEOUT = 0.

* Remove old PXE ROM file for i82559er.
  It was replaced by gpxe-eepro100-80861209.rom.

* Update pc-bios/README (and sort entries).

Full support still needs additional eepro100 fixes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:52 +02:00
Stefan Weil 6cded3a43a eepro100: Fix PXE boot
The phy handling was wrong for PXE, GPXE boot:
GPXE's eepro100 driver did not detect a valid link.

This is fixed here.

V2 - Use UPPER_CASE for enum values

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:50 +02:00
Stefan Weil 0908bba157 eepro100: Add missing SCB register names
Some system control block registers were addressed
using their offset value. Use symbolic names now
and clean the documentation.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:48 +02:00
Stefan Weil ce0e58b394 eepro100: Fix compiler errors from debug messages
When debug output was enabled (by defining DEBUG_EEPRO100),
some debug messages resulted in a compiler error.

This is fixed here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-03 13:33:46 +02:00
Paul Brook 35bed8ee91 Move ioport.h out of cpu-all.h
Only include ioport.h where it is actually needed.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-01 03:29:21 +00:00
Richard Henderson 6049f4f831 alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so that
we can send signals from there.  This also makes alpha_palcode.c
system-level only, so don't build it for userland.  Add defines
for GENTRAP PALcall mapping to signals.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-28 17:54:52 +01:00
Liu Yu 75bb6589c9 powerpc/e500: adjust fdt and ramdisk loading addr
Since kernel uimage is getting bigger,
old fixed loading bases will result in regions overlap.

Add pad for fdt and ramdisk, so that they won't overlap with uimage.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 19:48:00 +01:00
Aurelien Jarno dbf916d85b powerpc: fix compilation with CONFIG_FDT undefined
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 19:47:22 +01:00
Liu Yu 04088adbe0 powerpc/booke: move fdt loading to rom infrastructure
It's convinent to use rom to checking overlap, to reset etc.
And uImage and ramdisk loading has already moved to it.

Also, after we add fdt to rom, free it.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 16:30:21 +01:00
Liu Yu c49638177f target-ppc: add synchronize register for booke init
So that the following registers init could be flushed back to kvm.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollis@penguinppc.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 16:21:04 +01:00
Paul Brook d44168fffa Fix -usbdevice crash
If -usbdevice is used on a machine with no USB busses, usb_create
will fail and return NULL.  Patch below handles this failure gracefully
rather than crashing when we try to init the device.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-02-25 13:29:06 +00:00
Frediano Ziglio 05447803d0 rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeout
irq wanted and timer set).

This patch is required for Darwin. Patch has been tested under
FreeBSD, Darwin and Linux.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-23 13:23:29 -06:00
Justin T. Gibbs 71e605f803 Fix lost serial TX interrupts. Report receive overruns.
o Implement receive overrun status.  The FreeBSD uart driver
   relies on this status in it's probe routine to determine the size
   of the FIFO supported.
 o As per the 16550 spec, do not overwrite the RX FIFO on an RX overrun.
 o Do not allow TX or RX FIFO overruns to increment the data valid count
   beyond the size of the FIFO.
 o For reads of the IIR register, only clear the "TX holding register
   emtpy interrupt" if the read reports this interrupt.  This is required
   by the specification and avoids losing TX interrupts when other,
   higher priority interrupts (usually RX) are reported first.

Signed-off-by: Justin T. Gibbs <gibbs@FreeBSD.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-22 16:16:16 -06:00
Michael S. Tsirkin 63e6f31d1b apc_pci: simplify using rwhandler
Use rwhandler to simplify apb_pci.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-02-22 21:23:11 +00:00
Michael S. Tsirkin 8414f45cb0 apb_pci: minor cleanup
pci_data_write ignores high 8 bit in address,
so there seems to be no need to set them
in apb_pci.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-02-22 21:02:46 +00:00
Blue Swirl f21126df5f Fix arm-softmmu compile
cc1: warnings being treated as errors
/src/qemu/hw/pl181.c: In function 'pl181_fifo_run':
/src/qemu/hw/pl181.c:185: error: 'value' may be used uninitialized in this function

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-02-22 20:42:51 +00:00
Paul Brook bc3b26f535 PL181 write fix
The PL181 data transfer loop incorrectly terminates after the last FIFO
word is popped, discarding the last 3 bytes of data on a write transfer.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-02-22 15:33:59 +00:00
Blue Swirl 4fc8d6711a Fix warning on mingw32
/src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save':
/src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-02-20 08:29:17 +00:00
Kevin Wolf 0f853a3867 qdev: Free opts on failed do_device_add
If the device can't be created, don't leak the QemuOpts and release the id of
the device that should have been added by the failed device_add.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:53:54 -06:00
Jes Sorensen 4c5b10b7b6 QEMU e820 reservation patch
Hi,

Kevin and I have agreed on the approach for this one now. So here is
the latest version of the patch for QEMU, submitting e820 reservation
entries via fw_cfg.

Cheers,
Jes

Use qemu-cfg to provide the BIOS with an optional table of e820 entries.

Notify the BIOS of the location of the TSS+EPT range to by reserving
it via the e820 table.

This matches a corresponding patch for Seabios, however older versions
of Seabios will default to the hardcoded address range and stay
compatible with current QEMU.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:53:54 -06:00
Marcelo Tosatti ed487bb1d6 ide save/restore pio/atapi cmd transfer fields and io buffer
Save/restore information necessary to continue in progress PIO/ATAPI CMD
transfers.

This includes the IO buffer.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:33:13 -06:00
Amit Shah 7b665b668a virtio-serial: pci: Allow MSI to be disabled
Michael noted we don't allow disabling of MSI for the virtio-serial-pci
device. Fix that.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:32:16 -06:00
Michael S. Tsirkin ee4d45be0d virtio-serial: don't set MULTIPORT for 1 port dev
Since commit 98b19252cf, all
serial devices declare MULTIPORT feature.
To allow 0.12 compatibility, we should clear this when
max_nr_ports is 1.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:32:16 -06:00
Amit Shah 8bfbde6d35 pc: Add backward compatibility options for virtio-serial
virtio-serial-pci can support multiple ports in the current development
version that will become 0.13. Add compatibility options for the 0.12
and 0.11 pc machine types.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:32:16 -06:00
Amit Shah d76fa62dba pc: Bump up pc version to 0.13 and add a 0.12 compat version
The version 0.13 will be the new default and compatibility options will
be added to the 0.12 version.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-19 15:32:16 -06:00