qdev: add user-specified identifier to devices.
Add id field to DeviceState. Make "info qtree" print it.
This helps users and management apps identifying devices in monitoroutput, which is especially useful with otherwise identical devicessuch as two virtio disks....
qdev/compat: virtio-blk-pci 0.10 compatibility.
Add class property to virtio-blk-pci allowing to specify the PCI class.Add compat property to pc-0.10 to set the old PCI class.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: add id= support for pci nics.
qdev/compat: virtio-console-pci 0.10 compatibility.
Add class property to virtio-console-pci allowing to specify the PCI class.Add compat property to pc-0.10 to set the old PCI class.
qdev: print device id in "info pci".
qdev/compat: virtio-net-pci 0.10 compatibility.
Add vectors property, allowing to turn off msi by setting vectors=0.Add compat property to pc-0.10 disabling msi.
qdev: es1370+ac97 description
qdev: factor out driver search to qdev_find_info()
qdev/compat: compat property infrastructure.
This add support for switching devices into a compatibility modeusing device properties. Machine types can have a list of propertiesfor specific devices attached to allow the easy creation of machinetypes compatible to older qemu versions....
qdev: add no_user, alias and desc
no_user: prevent users from adding certain devices.desc: description of the device.alias: to allow user friendly shortcuts on the command line, i.e. -device usbmouse instead of -device "QEMU USB Mouse" or -device lsi instead of -device lsi53c895a...
qdev/compat: add pc-0.10 machine type.
Initialize PS2 keyboard / mouse state on reset
Currently only common PS2 state is initialized, leaving keyboard andmouse specific state to contain stale values.
Signed-off-by: Dinesh Subhraveti <dineshs@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: rework device properties.
This patch is a major overhaul of the device properties. The propertiesare saved directly in the device state struct now, the linked list ofproperty values is gone.
Advantages: * We don't have to maintain the list with the property values....
cleanup: drop unused struct elements from VirtIOPCIProxy.
Handle vga= in -append
Here is a patch I had sent twice to the list 2 years ago.Hopefuly this time someone will be interested
It adds support for passing vga mode to linux kernel throughvga= option in -append
Signed-off-by: Pascal Terjan <pterjan@gmail.com>...
Reset HPET config register on hpet_reset
Without this, after system reset, hpet does not detect transition fromnon-legacy to legacy mode.
Signed-off-by: Beth Kon <eak@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Update to a hopefully more future proof FSF address
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Sparc32: convert slavio interrupt controller to qdev
Also increase QDEV_MAX_IRQ.
Sparc32: refactor CPU init
Sparc32: convert memory to qdev
Sparc32: convert boot prom to qdev
Sparc32: convert iommu to qdev
Sparc32: convert cs4231 to qdev
Sparc32: fix SDL zooming with TCX
pci.c: remove unnecessary #ifdef DEBUG_PCI.
remove unnecessary #ifdef DEBUG_PCI.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Move boot_set callback backend
Move registration function for the boot_set callback handler and provideqemu_boot_set so that it can also be used outside the monitor code.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add qemu_unregister_reset
Will be used by '-boot once=...', and should also help in other usecases.
Add boot menu control via command line switch
Disable the lengthy BIOS prompt for selecting a boot device by default,but let the user reenable it via '-boot menu=on'.
Add a pc-0-10 machine type for compatibility with 0.10.x
Add a pc-0-10 machine type to allow a pc machine to be created withvirtio block and console devices compatibility with qemu-0.10.x.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Change default PCI class of virtio-blk to PCI_CLASS_STORAGE_SCSI
Windows virtio driver cannot pass DTM (certification) tests while thestorage class is PCI_CLASS_STORAGE_UNKNOWN.
A new qdev type is introduced to allow devices using the old classto be created for compatibility with qemu-0.10.x....
Change default PCI class of virtio-console to PCI_CLASS_SERIAL_OTHER
We're using PCI_CLASS_DISPLAY_OTHER now, but qemu-kvm.git is usingPCI_CLASS_OTHERS because:
"As a PCI_CLASS_DISPLAY_OTHER, it reduces primary display somehow on Windows XP (possibly Windows disables acceleration since it fails...
Sparc32: convert sparc32_dma to qdev
Convert fdc to qdev
Sparc32: convert slavio timers to qdev
Sparc32/PPC: convert escc to qdev
Sparc32: convert slavio_misc to qdev
Sparc32: convert idreg to qdev
target-ppc: fix typo in _cpu_ppc_load_decr
Use parameter 'next' to fix the hdecr case.Also pass 'next' by value instead of pointer (more easy to read and noperformance issue for an always_inline function).
Signed-off-by: Tristan Gingold <gingold@adacore.com>...
Sparc32/Sparc64/PPC: convert m48txx to qdev
Sparc32: convert tcx to qdev
Also increase QDEV_MAX_MMIO.
Sparc32: use the OpenFirmware name for ecc
Sparc64: convert ebus to qdev
Sparc32: convert eccmemctl to qdev
sparc64: really initialize irq
Allocate irq just before passing it to pci bridge initializationand actually use it to initialize pci bridge.
Signed-off-by: igor.v.kovalenko@gmail.com
--Kind regards,Igor V. Kovalenko
Fix PCI IRQ breakage
Zero initialize the PCI bus irq count.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Revert "Fix the PCI header type of APB"
This reverts commit e8d2a88755b849bdadaf80d19e342eade3c017bc.
Fix APB by reverting 16eaedf2668e9b347a59d73346fcc4c764c58348 partially
Indent ac97 and es1370 according to audio formatting
For the sake of consistency. I pulled in the wrong patches from Gerd whenhe did the qdev conversion.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/msi: clean used vectors state on load
Clean up msix vector usage state on load. Since guest might have controlover it through the device, the device will have to load this state fromfile.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/msi: missing braces
MSIX present bit is tested incorrectly, and only happens to work becausethe bit we are testing is 0x1. Add braces to fix this.
Reported-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/virtio: mark msi vectors used on load
Usage of msi vectors is controlled by the guest and so needs to berestored on load. Do this for msi vectors used by the virtio device.
usb-ohci: Fix endianness issue
This fixes a possible endianness issue in the usb-ohci hw module.hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16().
Signed-off-by: Michael Buesch <mb@bu3sch.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Unregister savevm callback in eeprom93xx_free()
Otherwise if you hot remove an eepro100 NIC and then migrate,you get:
Unknown savevm section or instance 'eeprom' 0
on the destination side.
fix segfault in msix_save
This fixes segfault reported by Kevin Wolf,and simplifies the code in msix_save.
Reported-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu: remove control vector save
control vector is saved/restored by virtio-pci,it does not belong in virtio.
Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer,but then goes on to require that the same pointer matchesVLANClientState::opaque.
That is no longer the case for virtio-net since qdev and wasn't...
use constant IOPORTS_MASK instead of 0xffff.
split out ioport related stuffs from vl.c into ioport.c.
qdev: replace bus_type enum with bus_info struct.
BusInfo is filled with name and size (pretty much like I did forDeviceInfo as well). There is also a function pointer to printbus-specific device information to the monitor. sysbus is hookedup there, I've also added a print function for PCI....
qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list ofDeviceInfo structs. This removes DeviceType and add a next field toDeviceInfo instead, so the DeviceInfo structs can be changed that way.Elimitates a pointless extra level of indirection....
qdev/pci: misc fixes.
qdev: convert es1370.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev: convert ac97.
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunchof parameters. Also adds config_read and config_write callbacks toPCIDeviceInfo, so drivers needing these can be converted to the qdevdevice API too....
Fix the PCI header type of APB
Fix Sparse warning
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
x86: Factor out pc_new_cpu
At this point, this refactoring looks like overkill. But we will need itfor CPU hotplugging, and qemu-kvm already carries it. Merging it earlywould help qemu-kvm when rebasing against upstream.
Replace -no-virtio-balloon by -balloon
We want to do (at least) two things to the virtio-balloon device:suppress it, and control its PCI address. Option -no-virtio-balloonlets us do only the former. To get the latter, replace-no-virtio-balloon with...
monitor: Drop pci_addr prefix from hotplug commands
The "pci_addr=" prefix currently required by pci_add/remove anddrive_add has no practical use. Drop it, but still silently accept itfor backward compatibility.
kvm: Rework VCPU synchronization
During startup and after reset we have to synchronize user space to thein-kernel KVM state. Namely, we need to transfer the VCPU registers whenthey change due to VCPU as well as APIC reset.
This patch refactors the required hooks so that kvm_init_vcpu registers...
monitor: Make pci_add device options truely optional
Change bochs bios init order
For multiboot support, we need bochs_bios_init to happen beforeload_linux, so we get the fw_cfg device.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Expose fw_cfg v2
Multiboot passes options to the option rom using the fw_cfg device.Right now, that device is local to the bochs_bios_init function.
Let's change that and expose it, so everyone may put data in there.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Multiboot support v5
This patch implements support for Multiboot on x86 for -kernel.Multiboot is a "new" approach to get rid of different bootloaders, providinga unified interface for the kernel. It supports command line options andkernel modules.
The two probably best known projects using multiboot are Xen and GNU Hurd....
net: Provide VLAN client lookup helper
Introduce qemu_find_vlan_client_by_name for VLANClientState lookup basedon VLAN ID and client name. This is useful for monitor commands.
qemu/virtio: virtio save/load bindings
Implement bindings for virtio save/load. Use them in virtio pci.
qemu/pci: add pci_get/set_byte
Add pci_get/set_byte to keep *_word and *_long access functions company.They are unused for now.
qemu/net: request 3 vectors in virtio-net
Request up to 3 vectors in virtio-net. Actual bindings might supplyless.
qemu/net: flag to control the number of vectors a nic has
Add an option to specify the number of MSI-X vectors for PCI NIC cards. Thiscan also be used to disable MSI-X, for compatibility with old qemu. Thisoption currently only affects virtio cards.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
Add serial number support for virtio_blk
[brought forward to current qemu-kvm.git]
This patch implements the missing qemu logic tointerpret a '-drive .. serial=XYZ ..' flag fora virtio_blk device.
The serial number string is contained in askeletal IDENTIFY DEVICE data structure and...
qemu/pci: make default_write_config use mask table
Change much of hw/pci to use symbolic constants and a table-drivendesign: add a mask table with writable bits set and readonly bits unset.Detect change by comparing original and new registers.
This makes it easy to support capabilities where read-only/writeable...
qemu/pci: helper routines for pci access
Add inline routines for convenient access to pci deviceswith correct (little) endianness. Will be used by MSI-X support.
qemu/pci: add routines to manage PCI capabilities
Add routines to manage PCI capability list. First user will be MSI-X.
qemu/pci: check constant registers on load
Add "cmask" table of constant register masks: if a bit is not writeableand is set in cmask table, this bit is checked on load. An attempt toload an image that would change such a register causes load to fail....
qemu/pci: MSI-X support functions
Add functions implementing MSI-X support. First user will be virtio-pci.Note that platform must set a flag to declare MSI supported: thisis a safety measure to avoid breaking platforms which should supportMSI-X but currently lack this in the interrupt controller emulation....
qemu/apic: minimal MSI/MSI-X implementation for PC
Implement MSI support in APIC. Note that MSI and MMIO APIC registersare at the same memory location, but actually not on the global bus: MSIis on PCI bus, APIC is connected directly to the CPU. We map them on the...
qemu/virtio: virtio support for many interrupt vectors
Extend virtio to support many interrupt vectors, and rearrange code inpreparation for multi-vector support (mostly move reset out to bindings,because we will have to reset the vectors in transport-specific code)....
qemu/virtio: MSI-X support in virtio PCI
This enables actual support for MSI-X in virtio PCI.First user will be virtio-net.
sparc64 follow pci_nic_init change
sun4u.c: correct pci_nic_init arguments followingcommit 5607c38820366954c38dd702e979499486057481
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
virtio-net: implement async packet sending
vmware_vga: clean up
use NULL instead of 0 for pci_register_device() argumentfor consistency. Any other caller uses NULL.
Fix do_pci_register_device() to reject devfn already in use
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Support addr=... in option argument of -net nic
Make net_client_init() accept addr=, put the value into structNICinfo. Use it in pci_nic_init(), and remove arguments bus anddevfn.
Don't support addr= in third argument of monitor command pci_add,because that clashes with its first argument. Admittedly unelegant....
Make first argument of monitor command pci_add work
Simply pass the PCI address through qemu_pci_hot_add_nic() topci_nic_init() and through qemu_pci_hot_add_storage() to pci_create().
Before, pci_device_hot_add() passed along the PCI bus to use, andignored any user-specified slot....
Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo.Use it in all the places that create virtio-blk-pci devices:pc_init1(), bamboo_init(), mpc8544ds_init().
Don't support addr= in third argument of monitor command pci_add and...
Don't register cpu reset handler for cpu with APIC.
APIC reset handler already resets cpu, no need to reset it twice.Also register cpu_reset handler directly to make it impossible toadd additional code to main_cpu_reset() by mistake.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Handle init/sipi in a main cpu exec loop. (v2)
This should fix compilation problem in case of CONFIG_USER_ONLY.
Currently INIT/SIPI is handled in the context of CPU that sends IPI.This patch changes this to handle them like all other events in a maincpu exec loop. When KVM will gain thread per vcpu capability it will...
acpi.c: make qemu_system_device_hot_add piix independent.
introruce piix4_device_hot_add() for piix4 specific codeand make qemu_system_device_hot_add() generic.
virtio-net: enable mergeable receive buffers
When virtio-net was merged in from qemu-kvm.git, the VNET_HDR relatedfeatures were dropped from the code.
However, VIRTIO_NET_F_MRG_RXBUF appears to have accidentally beendropped too. Re-instate that now.
Reported-by: Michael S. Tsirkin <mst@redhat.com>...