eepro100: New function for reading command block
Move code which reads the command block to thenew function read_cb. The patch also fixes someendianess issues related to the command blockand moves declarations of local variables tothe beginning of the block....
eepro100: Use tx.status
There is no need for a local variable "status".Using tx.status makes it clearer which statusis addressed.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: Prettify code (no functional changes)
eepro100: Fix CU Start command
CU Start is allowed when the CU is in the idle or suspended state.
eepro100: Support RNR interrupt
The RNR interrupt is triggered under these conditions:
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
eepro100: Replace variable name to fix a compiler warning
When compiling with -Wshadow, gcc gives a warningwhich is fixed by renaming stat -> status.
eepro100: Use symbolic names for bits in EEPROM id
V2 - Use UPPER_CASE for enum values
eepro100: Remove old unused code
This code is no longer needed.
eepro100: Use symbolic names and BIT macros in binary operations
Instead of magic numbers like 0x8000, symbolic names are usedfor the SCB command and status bits.
There are too many configuration bits to use symbolic namesthere, too. Using the BIT macro is a little help when comparing...
eepro100: Add device descriptions
Add descriptions for all devices.These descriptions are shown when users call qemu -device ?
eepro100: Update copyright notice
eepro100: Add TODO list
eepro100: Support gpxe boot for all eepro100 devices
Only two boot ROM files are needed for all devices.
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.
eepro100: Add missing SCB register names
Some system control block registers were addressedusing their offset value. Use symbolic names nowand clean the documentation.
eepro100: Fix compiler errors from debug messages
When debug output was enabled (by defining DEBUG_EEPRO100),some debug messages resulted in a compiler error.
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>
alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so thatwe can send signals from there. This also makes alpha_palcode.csystem-level only, so don't build it for userland. Add definesfor GENTRAP PALcall mapping to signals....
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>...
powerpc: fix compilation with CONFIG_FDT undefined
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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.
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>
Fix -usbdevice crash
If -usbdevice is used on a machine with no USB busses, usb_createwill fail and return NULL. Patch below handles this failure gracefullyrather than crashing when we try to init the device.
rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeoutirq wanted and timer set).
This patch is required for Darwin. Patch has been tested underFreeBSD, Darwin and Linux.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>...
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....
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>
apb_pci: minor cleanup
pci_data_write ignores high 8 bit in address,so there seems to be no need to set themin apb_pci.
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>
PL181 write fix
The PL181 data transfer loop incorrectly terminates after the last FIFOword is popped, discarding the last 3 bytes of data on a write transfer.
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
QEMU e820 reservation patch
Hi,
Kevin and I have agreed on the approach for this one now. So here isthe latest version of the patch for QEMU, submitting e820 reservationentries via fw_cfg.
Cheers,Jes
Use qemu-cfg to provide the BIOS with an optional table of e820 entries....
qdev: Free opts on failed do_device_add
If the device can't be created, don't leak the QemuOpts and release the id ofthe 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>
ide save/restore pio/atapi cmd transfer fields and io buffer
Save/restore information necessary to continue in progress PIO/ATAPI CMDtransfers.
This includes the IO buffer.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
USB HID does not support Set_Idle
I found that the QEMU USB keyboard support does not work properly withthe Set_Idle command. Once a non-zero value is given to Set_Idle,then the keyboard reports an event on every poll - not based on thetime issued in the Set_Idle command....
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 willbe added to the 0.12 version.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Add backward compatibility options for virtio-serial
virtio-serial-pci can support multiple ports in the current developmentversion that will become 0.13. Add compatibility options for the 0.12and 0.11 pc machine types.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-serial: don't set MULTIPORT for 1 port dev
Since commit 98b19252cf1bd97c54bc4613f3537c5ec0aae263, allserial devices declare MULTIPORT feature.To allow 0.12 compatibility, we should clear this whenmax_nr_ports is 1.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-serial: pci: Allow MSI to be disabled
Michael noted we don't allow disabling of MSI for the virtio-serial-pcidevice. 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>
Monitor: Convert pci_device_hot_add() to cmd_new_ret()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Monitor: Convert pci_device_hot_remove() to cmd_new_ret()
Merge remote branch 'mst/for_anthony' into staging
sparc32 fix spurious dma interrupts v2
Don't raise irq when not enabled.Raise irq on enabling if DMA_INTR is setDon't clear irq unless it was raised by DMA, as there are other irq sourcesDon't set DMA_INTR bit spuriously.
v1->v2: - Don't clear irq unless it was raised by DMA...
Revert "Sparc32: improve DMA controller IRQ debugging"
This reverts commit 787cfbc432bf1d353a77cbdb613754f3963371a3.
PPC: Uninorth config space accessor
The Uninorth PCI bridge requires different layouts in its PCI config spaceaccessors.
This patch introduces a conversion function that makes it compatible withthe way Linux accesses it.
I also kept an OpenBIOS compatibility hack in. I think it'd be better to...
PPC: Use Mac99_U3 type on ppc64
The "Mac99" type so far defines a "U2" based configuration. Unfortunately,there have never been any U2 based PPC64 machines. That's what the U3 wasdeveloped for.
So let's split the Mac99 machine in a PPC64 and a PPC32 machine. The PPC32...
PPC: Include dump of lspci -nn on real G5
To ease debugging and to know what we're lacking, I found it really useful tohave an lspci dump of a real U3 based G5 around. So I added a comment for it.
If people don't think it's important enough to include this information in the...
PPC: Make interrupts work
The interrupt code as is didn't really work for me. I couldn't even convinceLinux to take interrupt 9 in an interrupt-map.
So let's do this right. Let's map all PCI interrupts to 0x1b - 0x1e. That waywe're at least a small step closer to what real hardware does....
PPC: tell the guest about the time base frequency
Our guest systems need to know by how much the timebase increases every second,so there usually is a "timebase-frequency" property in the cpu leaf of thedevice tree.
This property is missing in OpenBIOS....
PPC: Use macio IDE controller for Newworld
Per default Linux doesn't come with a lot of storage adapters enabled onMac configurations. The one that's pretty much always present is the pmac-ide,while the cmd64x is almost never included in any distribution....
PPC: Get rid of segfaults in DBDMA emulation
While trying to find the right channel number for the DBDMA emulation Istumbled across segmentation faults that were purely triggered by the guest.
The guest should never have the possiblity to segfault us, so let's check...
PPC: Add USB per default on U3
Linux with CONFIG_PPC64 doesn't support ADB devices anymore, so we have touse USB for keyboard and mouse.
This patch enables USB per default on U3 and adds a virtual keyboard and mousethere.
Signed-off-by: Alexander Graf <agraf@suse.de>...
versatile_pci: convert to symbolic names
This converts versatile_pci to use symbolicconstants. Verified by comparing binary tooriginal one.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Anthony Liguori <aliguori@us.ibm.com>
versatile_pci: cleanup
Cleanup versatile_pci: no need to re-set fieldsto zero (pci core sets 0 already), use set_wordfor status field. Compile-tested only, but seems obvious.
pci: move pcibus_t to qemu-common
move pcibus_t to qemu-common.h to simplify header dependencies.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci_host: rewrite using rwhandler
Save a ton of code by switching pcihost to use rwhandler.
dec: use PCI accessors
sparc64: use PCI accessors for APB/PBM
Remove useless set to zero lines. Latency programming should bedone by BIOS, reset value is zero.
Add revision to APB, don't enable PCI_COMMAND_MASTER and set statusaccording to APB specification.
Remove conditional rom loading support
Commit c2039bd0ffce8807e0eaac55254fde790825fa92 made rom loadingautomatic for non-PC architectures. Remove now mostly unusedconditional rom loading support.
pci: fix info pci with host bridge.
This patch fixes 525e05147d5a3bdc08caa422d108c1ef71b584b5.pci host bridge doesn't have header type of bridge.The check should be by header type, instead of pci class device.
Cc: Blue Swirl <blauwirbel@gmail.com>Cc: "Michael S. Tsirkin" <mst@redhat.com>...
Merge branch 'for_anthony' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu
virtio-blk: add topology support
Export all topology information in the block config structure,guarded by a new VIRTIO_BLK_F_TOPOLOGY feature flag.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: add topology support
Export the physical block size in the READ CAPACITY (16) command,and add the new block limits VPD page to export the minimum andoptiomal I/O sizes.
Note that we also need to bump the scsi revision level to SPC-2as that is the minimum requirement by at least the Linux kernel...
ide: add topology support
Export the physical block size in the ATA IDENTIFY command. Theother topology values are not supported in ATA so skip them.
block: add topology qdev properties
Add three new qdev properties to export block topology information tothe guest. This is needed to get optimal I/O alignment for RAID arraysor SSDs.
The options are:
- physical_block_size to specify the physical block size of the device,...
virtio-blk: revert serial number support
The addition of the whole ATA IDENTIY page caused the config space togo above the allowed size in the PCI spec, and thus the feature wasalready reverted in the Linux guest driver and disabled by default inqemu....
Monitor: remove unneeded checks
It's not needed to check the return of qobject_from_jsonf()anymore, as an assert() has been added there.
virtio-net: fix network stall under load
Fix a race condition where qemu finds that there are not enough virtioring buffers available and the guest make more buffers available beforeqemu can enable notifications.
Signed-off-by: Tom Lendacky <toml@us.ibm.com>...
audio streaming from usb devices
I have streaming audio devices working within qemu-kvm. This is a portof the changes to qemu.
Streaming audio generates a series of isochronous requests that arerepetitive and time sensitive. The URBs need to be submitted in...
segfault due to buffer overrun in usb-serial
This fixes a segfault due to buffer overrun in the usb-serial device.The memcpy was incrementing the start location by recv_used yet, thecomputation of first_size (how much to write at the end of the bufferbefore wrapping to the front) was not accounting for it. This causes the...
ide: Generate BLOCK_IO_ERROR QMP event
Just call bdrv_mon_event() in the right place.
scsi: Generate BLOCK_IO_ERROR QMP event
virtio-blk: Generate BLOCK_IO_ERROR QMP event
sh7750: handle MMUCR TI bit
When the MMUCR TI bit is set, all the UTLB and ITLB entries should beflushed.
Merge remote branch 'qemu-kvm/uq/master' into staging-tmp
SH4/R2D: fix poweroff
The write the the PA_POWOFF register is currently ignored. Fix that bycalling qemu_system_shutdown_request() when a poweroff is requested.
pci: fix pci_find_bus()
typo in c021f8e65f5009a5ab5711d9d5326fcab553ef1c.comparison fix.
Cc: Blue Swirl <blauwirbel@gmail.com>Cc: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
dec: actually implement PCI bridging
esp: use CamelCaseFunc for function types
fw_cfg: don't use reserved _ prefix
fdc: don't use reserved _ prefix
fdc: don't use reserved _t suffix
escc: don't use reserved _t suffix
m48t59: don't use reserved _t suffix
Do not use dprintf
dprintf is already claimed by POSIX1, and on at least one systemis implemented as a macro
[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html
Signed-off-by: malc <av1474@comtv.ru>
mips/malta: fix typo
PCI: show also host bridge data in "info pci" output
PCI: fix multiple bridge problems
When several PCI bridges were in use, monitor command "info pci" wouldenter into infinite loop. Buses behind the bridge were not discoverablebecause secondary and subordinate bus numbers were not used properly.Other buses were not found because bus search terminated on first miss....
Refactor DEC 21154 PCI bridge
It's currently not used by PPC machines. Refactor so that also Sparc64machines can use it.
KVM: Make vmport KVM-compatible
The vmport "device" accesses the VCPU registers, so it requires propercpu_synchronize_state. Add it to vmport_ioport_read, which alsosynchronizes vmport_ioport_write.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
qdev: Fix exit code for -device ?
Help was shoehorned into device creation, qdev_device_add(). Sincehelp doesn't create a device, it returns NULL, which looks to callersjust like failed device creation. Monitor handler do_device_add()doesn't care, but main() exits unsuccessfully....
Revert "qdev: Add help for property value"
This reverts commit 922910ce42d15bdb7c2347436b1b5798b5401de4.
The commit has four issues:
Revert "qdev: Add help for device properties"
This reverts commit 2ba6edf0dd740166632df80caa85992b20791a68.
The commit has two issues:
qdev: Add help for device properties
Option "-device DRIVER,?" and monitor command "device_add DRIVER,?" print the supported properties instead of creating a device. Theformer also terminates the program.
This is commit 2ba6edf0 (just reverted) done right....
qdev: Add rudimentary help for property value
This provides the same information as reverted commit 2ba6edf0. Notmuch, just better than nothing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sparc64: implement basic IOMMU/interrupt handling
Also add reset control.
Sparc64: byte swap IO port access
This requires an updated OpenBIOS image.
virtio-blk: Fix restart after read error
Current code assumes that only write requests are ever going to be restarted.This is wrong since rerror=stop exists. Instead of directly starting writes,use the same request processing as used for new requests....
virtio-blk: Fix error cases which ignored rerror/werror
If an I/O request fails right away instead of getting an error only in thecallback, we still need to consider rerror/werror.
cirrus: Properly re-register cirrus_linear_io_addr on vram unmap
This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more:
When switching away from linearly mapped vram, we also have to restorethe I/O handlers for the LFB.
This regression was once introduced by commit 2bec46dc97....
virtio_blk: Factor virtio_blk_handle_request out
We need a function that handles a single request. Create one by splitting outcode from virtio_blk_handle_output.