msi: simplify write config a bit.
use pci_device_deassert_intx().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: deassert intx on reset.
deassert intx on device reset.So far pci_device_reset() is used for system reset.In that case, interrupt controller is reset at the same time so thatall irq is are deasserted.But now pci bus reset/flr is supported, and in that case irq needs to be...
pci: fix device paths
Patch a6a7005d14b3c32d4864a718fb1cb19c789f58a5 generatedbroken device paths. We snprintf with a length shorterthan the output, so the last character is discarded and replacedby the null byte. Fix it up by snprintf to a bufferwhich is larger by 1 byte and then memcpy the data (without...
acpi_piix4: expose no_hotplug attribute via i/o port
Expose no_hotplug attribute via I/O port, so ACPI BIOS can indicateremovability status to guest OS.
An updated seabios is required to make use of this feature (seabios.gitcommit ID 3c241edf3d7ef29c21)....
virtio-serial-bus: bump up control vq size to 32
The current default of 16 buffers for the control vq is too small. Wecan get more entries in there, for example when asking the guest to addmax. allowed ports.
Note: a more robust solution would involve some kind of event queueing...
ioeventfd: error handling cleanup
- Don't return status from start/stop functions where it's ignored- report errors to make debugging easier- assert on unexpected failures- don't disable notifiers on error so that we'll retry when guest driver restarts...
virtio-pci: Use ioeventfd for virtqueue notify
Virtqueue notify is currently handled synchronously in userspace virtio. Thisprevents the vcpu from executing guest code while hardware emulation codehandles the notify.
On systems that support KVM, the ioeventfd mechanism can be used to make...
virtio: move vmstate change tracking to core
Move tracking vmstate change from virtio-net to virtio.cas it is going to be used by virito-blk and virtio-pcifor the ioeventfd support.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio-pci: Rename bugs field to flags
The VirtIOPCIProxy bugs field is currently used to enable workaroundsfor older guests. Rename it to flags so that other per-device behaviorcan be tracked.
A later patch uses the flags field to remember whether ioeventfd should...
qxl: tag as not hotpluggable
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Merge remote branch 'origin/master' into pci
vga: tag as not hotplugable.
This patch tags all vga cards as not hotpluggable. The qemustandard vga will never ever be hotpluggable. For cirrus + vmwareit might be possible to get that work some day. Todays we can'thandle that for a number of reasons though....
piix: tag as not hotpluggable.
This patch tags all pci devices which belong to the piix3/4 chipsets asnot hotpluggable (Host bridge, ISA bridge, IDE controller, ACPI bridge).
Acked-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
pci: allow devices being tagged as not hotpluggable.
This patch adds a field to PCIDeviceInfo to tag devices as beingnot hotpluggable. Any attempt to plug-in or -out such a devicewill throw an error.
target-sh4: implement writes to mmaped ITLB
Some Linux kernels seems to implement ITLB/UTLB flushing through bywriting all TLB entries through the memory mapped interface insteadof writing one to MMUCR.TI.
Implement memory mapped ITLB write interface so that such kernels can...
cirrus: delete GCC 4.6 warnings
Commit 92d675d1c1f23f3617e24b63c825074a1d1da44b triggered uninitializedvariables warning with GCC 4.6. Fix them by adding zero initializers.
Acked-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
cirrus_vga: Declare as little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
CC: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pc: move port 92 stuff back to pc.c from pckbd.c
956a3e6bb7386de48b642d4fee11f7f86a2fcf9a introduced a bug concerningreset bit for port 92.
Since the keyboard output port and port 92 are not compatible anyway,let's separate them.
Reported-by: Peter Lieven <pl@dlh.net>...
rtl8139: Use subsection to restrict migration after hotplug
rtl8139 includes a cpu_register_io_memory acquired value in it'smigration data. This is not only unecessary, but we should treatthese values as unique to the VM instances since the value depends...
qdev: Track runtime machine modifications
Create a trivial interface to track whether the machine has beenmodified since boot. Adding or removing devices will trigger thisto return true. An example usage scenario for such an interface isthe rtl8139 driver which includes a cpu_register_io_memory() value...
Fix curses on big endian hosts
On big endian hosts, the curses interface is unusable: the emulatedgraphic card only displays garbage, while the monitor interface displaysnothing (or rather only spaces).
The curses interface is waiting for data in native endianness, so...
cirrus_vga: fix division by 0 for color expansion rop
Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regressionwith Windows ME that leads to a division by 0 and a crash.
It uses the color expansion rop with the source pitch set to 0. This is...
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
pci: fix migration path for devices behind bridges
The device path used for migration is currently broken forfor all devices behind a nested bridge.
Replace this by a hierarchical list of slot/function numbers, walkingthe path from root down to device. Add :00 after the domain number...
s390: compile fixes
The s390 target doesn't compile out of the box anymore. This patch fixes allthe obvious glitches that got introduced in the last few weeks.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pcie/aer: glue aer error injection into qemu monitor
introduce pcie_aer_inject_error command.
pci: introduce a helper function to convert qdev id to PCIDevice
This patch introduce a helper function to get PCIDevice from qdev id.This function will be used later.
qdev: export qdev_find_recursive() for later use
This patch exports qdev_find_recursive() for later use.
build, pci: remove QMP dependency on core PCI code
by introducing pci-stub.c, eliminate QMP dependency on core PCI coderquired by query-pci command.
pcie: add flr support
Support flr: trigger device reset on flr config write.
pc/piix: fix mismerge of b1aeb92666d2fde413c34578b3b42bbfe5f2a506
The change set of b1aeb92666d2fde413c34578b3b42bbfe5f2a506 in pci branchwas mismerged. The compatibility should be kept for 0.13, not for 0.14.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
qdev: sysbus_get_default must not return a NULL pointer (fix regression)
Every system should have some sort of main system bus,so sysbus_get_default should always return a valid bus.
Without this patch, at least mipssim and malta no longerstart but raise a null pointer access exception (caused by...
qdev: remove an unused function
qbus_reset_all is unused, remove it
sparc32: ledma extra registers need tracing too
Also trace the extra registers, and update the comments with newinfo from Artyom Tarasenko.
Signed-off-by: Bob Breuer <breuerr@mc.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
wdt_ib700: Fix accidental use of SoftFloat int64 type
softfloat.h's int64 type has least-width semantics.Since we're assigning an int64_t, use plain int64_t.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
apic: Fix accidental use of SoftFloat uint32 type
softfloat.h's uint32 type has least-width semantics.Surrounding code uses uint32_t, so use uint32_t here, too.
qbus: register reset handler for qbus whose parent is NULL
Stefan Weil reported the regression caused byec990eb622ad46df5ddcb1e94c418c271894d416 as follows
The second regression also occurs with MIPS malta.Networking no longer works with the default pcnet nic....
pci: don't use bus number in migration, stub out
Using bus numbers in migration is clearly wrong asthey are guest assigned. Not really sure what theright thing to do is, for now stick 0 in there so thingskeep working for non-nested setups, add a TODO....
ahci: delete write-only variables (v2)
Avoid these warnings with GCC 4.6.0:/src/qemu/hw/ide/ahci.c: In function 'ahci_reset_port':/src/qemu/hw/ide/ahci.c:810:14: error: variable 'tfd' set but not used [-Werror=unused-but-set-variable]/src/qemu/hw/ide/ahci.c: In function 'handle_cmd':...
vga: Declare as little endian
CC: Alexander Graf <agraf@suse.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc32: ledma extra registers
ledma has 0x20 bytes of registers according to OBP, and at least Solaris9reads the 5th register which is beyond what we've mapped. So let's setupa flag (inspired by a previous patch from Blue Swirl) to identify ledmafrom espdma, and map another 16 bytes of registers which return 0....
ide: Build fix for via.c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Fix build for cmd646.c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Acked-by: Andreas Färber <andreas.faerber@web.de>
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.
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
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...
spice: add qxl device
qxl is a paravirtual graphics card. The qxl device is the bridgebetween the guest and the spice server (aka libspice-server). Thespice server will send the rendering commands to the spice client, whichwill actually render them....
pci/aer: factor out common code
Same logic is used to assert interruptsand send msix messages, so add a static functin for this.
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.