ahci: set SATA Mode Select
Set SATA Mode Select to AHCI in the Address Map Register.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: honor ncq for atapi
ATAPI also can do ncq, so let's expose the capability.
This patch makes CD-ROM support work on Windows 7 for me.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Remove NULL checks for bdrv_new return value
It's an indirect call to qemu_malloc, which never returns an error.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Register vm change state handler once only
We register the vm change state handler in a PCI BAR map() function.This function can be called multiple times throughout the lifetime of aPCI IDE device. This results in duplicate vm change state handlers...
scsi-disk: support WRITE SAME (16) with unmap bit
Support discards via the WRITE SAME command with the unmap bit set, andtell the initiator about the support for it via the block limit and thenew thin provisioning EVPD pages. Also fix the comment which incorrectly...
ide: add ncq identify data for ahci sata drives
I modified ide_identify() to include the zero-based queue lengthvalue in word 75, and set bit 8 in word 76 to signal NCQ supportin the identify data for AHCI SATA drives.
Signed-off-by: Roland Elek <elek.roland@gmail.com>...
pci: add storage class for sata
This patch adds the storage sata class id.
pci: add ich9 pci id
We need a PCI ID for our new AHCI adapter. I just picked an ICH-9because that's the one in the Q35 chipset.
This patch adds a PCI ID define for an ICH-9 AHCI adapter.
ahci: add ahci emulation
This patch adds an emulation layer for an ICH-9 AHCI controller. For nowthis controller does not do IDE legacy emulation. It is a pure AHCI controller.
ide: Split out BMDMA code from ATA core
The ATA core is currently heavily intertwined with BMDMA code. Let's loosenthat a bit, so we can happily replace the DMA backend with differentimplementations.
ide: move transfer_start after variable modification
We hook into transfer_start and immediately call the end functionfor ahci. This means that everything needs to be in place for theend function when we start the transfer, so let's move the functiondown to where all state is in place....
ide: split ide command interpretation off
The ATA command interpretation code can be used for PATA and SATAinterfaces alike. So let's split it out into a separate function.
ide: fix whitespace gap in ide_exec_cmd
Now that we have the function split out, we have to reindent it.In order to increase the readability of the actual functional change,this is split out.
Merge remote branch 'jvrao/for-anthony' into staging
Merge remote branch 'mst/for_anthony' into staging
Watchdog: disable watchdog timer when hard-rebooting a guest.
This commit causes the watchdog timer to be reset when a guest ishard-rebooted.
The failure case previously was as follows:
(a) guest boots, watchdog is enabled
(b) guest does a reset eg:...
Pass boot device list to firmware.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add bootindex for option roms.
Extend -option-rom command to have additional parameter ,bootindex=.
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Change fw_cfg_add_file() to get full file path as a parameter.
Change fw_cfg_add_file() to get full file path as a parameter insteadof building one internally. Two reasons for that. First caller may needto know how file is named. Second this moves policy of file naming out...
Add get_fw_dev_path callback to scsi bus.
Record which USBDevice USBPort belongs too.
Ports on root hub will have NULL here. This is needed to reconstructpath from device to its root hub to build device path.
Add get_fw_dev_path callback for usb bus.
Add get_fw_dev_path callback for pci bus.
Add get_fw_dev_path callback for system bus.
Prints out mmio or pio used to access child device.
Add get_fw_dev_path callback to IDE bus.
Add get_fw_dev_path callback to ISA bus in qdev.
Use device ioports to create unique device path.
Store IDE bus id in IDEBus structure for easy access.
Keep track of ISA ports ISA device is using in qdev.
Store all io ports used by device in ISADevice structure.
Introduce new BusInfo callback get_fw_dev_path.
New get_fw_dev_path callback will be used for build device path usableby firmware in contrast to qdev qemu internal device path.
Introduce fw_name field to DeviceInfo structure.
Add "fw_name" to DeviceInfo to use in device path building. Incontrast to "name" "fw_name" should refer to functionality deviceprovides instead of particular device model like "name" does.
wdt_i6300esb: register a reset function
The device shall set its default hardware state after each reset.This includes that the timer is stopped which is especially importantif the guest does a reboot independantly of a watchdog bite. I movedthe initialization of the state variables completely from the init...
isa-bus.c: use hw_error instead of fprintf
Minor clean-up in isa-bus.c. Using hw_error is more consistent.There is a difference however: hw_error dumps the cpu state.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
uninorth: Get rid of bswap
There's no need to bswap once we correctly set the mmio to be little endian.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
e1000: Make little endian
The e1000 has compatibility code to handle big endianness which makes itmandatory to be recompiled on different targets.
With the generic mmio endianness solution, there's no need for that anymore.We just declare all mmio to be little endian and call it a day....
prep: Declare as little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
versatile_pci: Declare as little endian
ppc4xx_pci: Declare as little endian
openpic: Replace explicit byte swap with endian hints
rtl8139: Declare as little endian
Because we don't depend on the target endianness anymore, we can alsomove the driver over to Makefile.objs.
Signed-off-by: Alexander Graf <agraf@suse.de>...
heathrow_pic: Declare as little endian
isa_mmio: Always use little endian
This patch converts the ISA MMIO bridge code to always use little endian mmio.All bswap code that existed was only there to convert from native cpuendianness to little endian ISA devices.
usb_ohci: Always use little endian
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
Make simple io mem handler endian aware
As an alternative to the 3 individual handlers, there is also a simplifiedio mem hook function. To be consistent, let's add an endianness parameterthere too.
dbdma: Make little endian
The device is only used on big endian systems, but always byte swaps. That'sa very good indicator that it's actually a little endian device ;-).
pci-host: Delegate bswap to mmio layer
The only reason we have bswap versions of the pci host code is thatmost pci host devices are little endian. The ppc e500 is the onlyodd one here, being big endian.
So let's directly pass the endianness down to the mmio layer and not...
pci/aer: factor out common code
Same logic is used to assert interruptsand send msix messages, so add a static functin for this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci/aer: remove dead code
Remove some unused variables and return values.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
pci/aer: fix interrupt on config write
config write handling for aer seems broken:For example, it won't clear a level interruptwhen command register is set to 0.
Make it match the spec: level should equalthe logical or of enabled bits, msi onlybe sent when the logical or changes....
pci/aer: fix error injection
Fix the injection logic upon aer message to follow 6.2.4.1.2 moreclosely: specifically only send an msi interrupt when the logical or ofthe enabled bits changed, not when a bit which was previously clearbecomes set.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pci: untangle pci/msi dependency
msi depends on pci but pci should not depend on msi.The only dependency we have is a recent additionof pci_msi_ functions, IMO they add little enough toopen-code in the small number of users.
Follow-up patches add more cleanups....
virtio-net: don't dma while vm is stopped
DMA into memory while VM is stopped makes ithard to debug migration (consequitive savesresult in different files).Fixing this completely is a large effort,this patch does this for virtio-net.
virtio-net: stop/start bh when appropriate
Avoid sending out packets, and modifyingmemory, when VM is stopped.Add assert statements to verify this does not happen.
Avoid scheduling bh when vhost-net is started.
Stop bh when driver disabled bus mastering...
pci: make command SERR bit writable
pcie aer needs SERR bit to be writable, and the PCI spec requiresthis as well. For compatibility, introduce compat global propertycommand_serr_enable and make this bit readonly for a pre 0.14 pcmachine.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
Fix mingw32 and OpenBSD warnings
ffsl() is not universally available, so there are these warningson both mingw32 and OpenBSD:/src/qemu/hw/pcie_aer.c: In function 'pcie_aer_update_log':/src/qemu/hw/pcie_aer.c:399: warning: implicit declaration of function 'ffsl'...
virtio-9p: fix build on !CONFIG_UTIMENSAT
This patch introduce a fallback mechanism for old systems that do notsupport utimensat(). This fix build failure with following warnings:
hw/virtio-9p-local.c: In function 'local_utimensat':hw/virtio-9p-local.c:479: warning: implicit declaration of function 'utimensat'...
virtio-9p: Check the return value of llistxattr.
If llistxattr returned 0, qemu aborts.
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
hw/virtio9p: Use appropriate debug print functions in TLINK path
Running fsstress with debug enabled causes assertion failurebecause of inappropriate usage of debug print functions.With this patch, fsstress passes without assertion failure.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>...
[virtio-9p] Add datasync to server side TFSYNC/RFSYNC for dotl
SYNOPSIS size4 Tfsync tag2 fid4 datasync4
size[4] Rfsync tag[2]
DESCRIPTION
The Tfsync transaction transfers ("flushes") all modified in-core data of file identified by fid to the disk device (or other permanent storage...
migration: allow rate > 4g
I'd like to disable bandwidth limit or make it very high,Use int64_t all over to make values >= 4g work.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Tested-by: Jason Wang <jasowang@redhat.com>
vhost: Fix address calculation in vhost_dev_sync_region()
We still need advance address even we find there's no dirty pages incurrent chunk.
Signed-off-by: Jason Wang <jasowang@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Merge remote branch 'origin/master' into pci
Conflicts: Makefile.objs hw/virtio.c
Merge remote branch 'kwolf/for-anthony' into staging
ide: Reset current_addr after stopping DMA
Whenever SSBM is reset in the command register all state information is lost.Restarting DMA means that current_addr must be reset to the base address of thePRD table. The OS is not required to change the base address register before...
ide: Ignore double DMA transfer starts/stops
You can only start a DMA transfer if it's not running yet, and you can onlycancel it if it's running.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
ide: Factor ide_dma_set_inactive out
Several places that stop a DMA transfer duplicate this code. Factor it out intoa common function.
ide: Set bus master inactive on error
BMIDEA in the status register must be cleared on error. This makes FreeBSDrespond (more) correctly to I/O errors.
Add pcnet-pci.c
Add file missing from last commit.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Split out common pcnet code
The core pcnet emulation code is used by both the PCI "pcnet" deviceand the SPARC "lance" device. Split the common code frm the PCI code sothat that can be configures independantly.
scsi-disk: Remove duplicate cdb parsing
We parse the CDB twice, which is completely unnecessary.
Signed-off-by: Hannes Reinecke <hare@suse.de>Acked-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: Move sense handling into the driver
The current sense handling in scsi-bus is only used by thescsi-disk driver; the scsi-generic driver is using its own.So we should move the current sense handling into thescsi-disk driver.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
scsi: INQUIRY VPD fixes
We should announce and support the block device characterics pageonly on block devices, not on CDROMs. And the VPD page 0x83 hasan off-by-one error.
Signed-off-by: Hannes Reinecke <hare@suse.de>Acked-by: Christoph Hellwig <hch@lst.de>...
scsi: Return SAM status codes
Traditionally, the linux stack is using SCSI status codeswhich are shifted by one as compared to those defined in SAM.A SCSI emulation should naturally return the SAM defined codes,not the linux ones.So to avoid any confusion this patch modifies the existing...
scsi: Increase the number of possible devices
The SCSI parallel interface has a limit of 8 devices, butnot the SCSI stack in general. So we should be removing thehard-coded limit and use MAX_SCSI_DEVS instead.And we only need to scan those devices which are allocated...
ide: convert bmdma address ioport to ioport_register()
cmd646, via compile tested, pci lightly boot tested.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu and qemu-xen: support empty write barriers in xen_disk
This patch can be applied to both qemu-xen and qemu and adds supportfor empty write barriers to xen_disk.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
scsi-disk: Move active request asserts
SCSI read/write requests should not be re-issued before the currentfragment of I/O completes. There are asserts in scsi-disk.c that guardthis constraint but they trigger on SPARC Linux 2.4. It turns out thatthe asserts are too early in the code path and don't allow for read...
virtio: fix up VQ checks
When migration triggers before a VQ is initialized,base pa is 0 and last_used_index must be 0 too:we don't have a ring to compare to.
Reported-by: Juan Quintela <quintela@redhat.com>Tested-by: Juan Quintela <quintela@redhat.com>...
virtio: Convert fprintf() to error_report()
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>(cherry picked from commit cd92f4cc22fbe12a7bf60c9430731f768dc1537c)
pci: fix bus walk under secondary bus reset
Take into account secondary bus reset bit forbus walk: devices behind a reset bus should notrespond to configuration cycles.
pci: Automatically patch PCI vendor id and device id in PCI ROM
PCI devices with different vendor or device ids sometimes sharethe same rom code. Only the ids and the checksumdiffers in a boot rom for such devices.
The i825xx ethernet controller family is a typical example...
eepro100: Use a single rom file for all i825xx devices
Patching the rom data during load (in qemu) nowalso supports i82801 (which had no rom file).
We only need a single rom file for the whole device family,so remove the second one which is no longer needed....
qbus: add functions to walk both devices and busses
There are some cases where you want to walk the busses, in particular, whensearching for a bus either by name or DeviceInfo.Paolo suggested that we model the return values on how GCC's walkers work which...
qdev: reset qdev along with qdev tree
This patch changes the reset handling so that qdev has no knowledge of theglobal system reset. Instead, a new bus/device level function is introducedthat allows all devices/buses on the bus/device to be reset using a depth...
qdev: introduce reset call back for qbus level
and make it called via qbus_reset_all().The qbus reset callback will be used by pci bus reset.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qdev: trigger reset from a given device
Introduce a helper function which triggers reset from a given device.Will be used by pci bus emulation.
pci: use qdev reset framework for pci bus reset
pci bridge: implement secondary bus reset
Trigger secondary bus reset when secondary bus reset bitvalue changes from 0 to 1.
pci: add W1C bits to pci status register
This patch adds W1C bit support in the initialization/reset of pcistatus registers.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pcie_regs.h: more constants
Add constants for PCI AER log.
pcie/aer: helper functions for pcie aer capability
This patch implements helper functions for pcie aer capabilitywhich will be used later.
pcie_aer: get rid of recursion
Added some TODOs: they are trivial but omitted hereto make the patch logic as transparent as possible.
pcie_aer: complete unwinding recursion
Open-code functions created in the previous patch,to make code more compact and clear.Detcted and documented what looks like a bug in codethat becomes apparent from this refactoring.
ioh3420: support aer
Add aer support.
x3130/upstream: support aer
add aer support.
x3130/downstream: support aer.
pci: fix bridge control bit wmask
Bits 12 to 15 in bridge control register are reserver and must beread-only zero, curent mask is 0xffff which makes them writeable. Fixthis up by using symbolic bit names for writeable bits instead of ahardcoded constant....
pcie/port: fix bridge control register wmask
pci generic layer initialized wmask for bridge control registeraccording to pci spec. pcie deviates slightly from it,so initialize it properly.
pci: Replace unneeded type casts in calls of pci_register_bar
There is no need for these type casts (as other existingcode shows). So re-write the first argument withouttype cast (and remove a related TODO comment).
Cc: Michael S. Tsirkin <mst@redhat.com>...