History | View | Annotate | Download (32.7 kB)
zap DeviceState->nd
No users left.Also cleanup obsolete helper functions.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
prepare pci nic init path for qdev property configuration.
Initialization path will work with both converted and not-converteddrivers, so we can convert drivers one by one.
net: remove id field from NICInfo
Just use the name field instead since we now use the id paramater asthe name, if supplied. Only implication with this change is that ifid is not supplied, the value of the name paramater is used as anid.
Patchworks-ID: 35512...
Check return value of qdev_init()
But do so only where it may actually fail. Leave the rest for thenext commit.
Patchworks-ID: 35167Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
qemu/pci: clarify pci config load routine
PCI load routine has to be called with size equal to 256 (otherwise itwill crash in weird ways). So assert this, making code clearer.Also avoid dynamically sized array on stack - good for portability.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
qemu/pci: make pci not depend on msix
Making pci device cleanup msix automatically makes pci.c depend onmsix.c, which is IMO messy. Since devices do msix_init it's easy andnatural for them to also do msix_uninit.
Revert "Fix exit on 'pci_add' Monitor command"
This reverts commit 0148fde54c2478ea8a47c8dbfe4c0fb8bda4d996.
As requested by Luiz.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix pci_add storage not to exit on bad first argument
Monitor command "pci_add ADDR storage ..." does its work inqemu_pci_hot_add_nic(). It called pci_create(..., ADDR) to create thedevice. That's wrong, because pci_create() terminates the programwhen ADDR is invalid....
Make it obvious that pci_nic_init() can't fail
Before this patch, pci_nic_init() returns NULL when it can't find themodel in pci_nic_models[]. Except this can't happen, becauseqemu_check_nic_model_list() just searched for model inpci_nic_models[], and terminated the program on failure....
Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() tocreate the NIC. When MODEL is unknown or "?", this prints to stderrand terminates the program.
Change pci_nic_init() not to treat "?" specially, and to return NULL...
pci_create() is now unused, remove it
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rename pci_create_noinit() to pci_create()
It's qdev_create() specialized for PCI, so name it accordingly.
qemu/pci: refactor code/symbolic constants
refactor code slightly, adding symbolic constants and functions, andusing macros where possible. This will also make following resetpatches easier.
No functional changes.
qemu/pci: reset device registers on bus reset
Reset BARs and a couple of other registers on bus reset, as per PCIspec.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: hotplug windup
Create qdev infrastructure for pci hotplug. PCI bus implementationsmust register a handler for hotplug. Creating a new PCI device willautomagically hot-plug it in case the PCI bus in question supports this.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
pci: use qdev for device destruction.
pci_unregister_device is static now and hooked into Devicestate->exit.qdev_free(pci_device) works now.
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
support inplace allocation for pci bus, split irq init.
convert pci bridge to qdev
Fix exit on 'pci_add' Monitor command
If the user issues one of the following commands to the Monitor:
pci_add pci_addr=auto nic model=Nonepci_add pci_addr=auto nic model=?
QEMU will exit, because the function used to perform sanitychecks (qemu_check_nic_model_list()) exits on error....
vmstate: remove const for put operations
In a later patch, we introduce pre_save() and post_save() functions.The whole point of that operation is to change things in the state.Without this patch, we have to remove the const qualifier in eachuse with a cast...
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
qdev/pci: add pci_create_noinit()
Like pci_create_simple() but doesn't call qdev_init(), so one canset properties before initializing the device.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
We want the argument pass to set_irq to be opaque
piix_pci want to pass more things that the pic
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
low_set_irq is not used anywhere
Add pci_ne2000_{save/load} functions, then remove pci_dev NE2000State field
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
Port PCI Bus to VMState design
This uses VARRAY and INT32_EQUAL values
Add version_id to PCIDevice.
It is needed for VMState
Port PCIDevice state to VMState
This uses a variant of buffer, with extra checks. Also uses the newsupport for cheking that a read value is less or equal than a field.
qdev/prop: convert pci.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
qdev/pci: use qdev_prop_pci_devfn
Put the new property into use.
Sparc64: convert APB to qdev
Thanks to Igor Kovalenko for a bugfix.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qdev: add id= support for pci nics.
qdev: print device id in "info pci".
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....
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>
Fix PCI IRQ breakage
Zero initialize the PCI bus irq count.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Fix APB by reverting 16eaedf2668e9b347a59d73346fcc4c764c58348 partially
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/pci: misc fixes.
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....
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>...
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.
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: 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....
Fix do_pci_register_device() to reject devfn already in use
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....
Add pci_bus_reset() function.
To reset internal irq handling data structures.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Yaniv Kamay <ykamay@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rename pci_register_io_region() to pci_register_bar()
This function is used to manage a PCI BAR, so make the more genericpci_register_io_region() available to other uses.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: move name+size into DeviceInfo (v2)
Rationale: move device information from code to data structures.
v2: Adapt the drivers missed in the first version.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Remove unused and misnamed field and variable
Add common BusState
Implement and use a common device bus state. The main side-effect isthat creating a bus and attaching it to a parent device are no longerseparate operations. For legacy code we allow a NULL parent, but thatshould go away eventually....
Separate virtio PCI code
Split the PCI host bindings from the VRing transport implementation.
PCI qdev support
PCI network qdev conversion
Virtio-net qdev conversion
minor fix of pci_register_bus()
keep first_bus linked list correct.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
use PCI_HEADER_TYPE.
use symbolic value instead of 0x0e and related value.
Make PCI config status register read-only
From the documentation I can find, this register is supposed to be read-only.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7070 c046a42c-6fe2-441c-8c8c-71466251a162
monitor: Rework API (Jan Kiszka)
Refactor the monitor API and prepare it for decoupled terminals:term_print functions are renamed to monitor_* and all monitor servicesgain a new parameter (mon) that will once refer to the monitor instancethe output is supposed to appear on. However, the argument remains...
Parse full PCI device addresses (Markus Armbruster)
This code parses full PCI device addresses. It then rejects domainsother than zero, because these are not supported in QEMU.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
qemu: warn if PCI region is not power of two (Marcelo Tosatti)
Otherwise the PCI size for such regions can be calculated erroneously.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6604 c046a42c-6fe2-441c-8c8c-71466251a162
qemu: add pci_unregister_device (Marcelo Tosatti)
Unregister the pci device, unassign its IO and memory regions, and freeassociated data.
Add a callback so drivers can free device state.
qemu: return PCIDevice on net device init and record devfn (Marcelo Tosatti)
Change the PCI network drivers init functions to return the PCIDev, toinform which slot has been hot-plugged.
Also record PCIDevice structure on NICInfo to locate for release on...
qemu: add pci helper functions (Marcelo Tosatti)
Add pci_find_bus/pci_find_device to be used by PCI hotplug.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6592 c046a42c-6fe2-441c-8c8c-71466251a162
hw: remove error handling from qemu_malloc() callers (Avi Kivity)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
Add and use #defines for PCI device classes
This patch adds and uses #defines for PCI device classes and subclases,using a new pci_config_set_class() function, similar to the recentlyadded pci_config_set_vendor_id() and pci_config_set_device_id().
Change since v1: fixed compilation of hw/sun4u.c...
Add Simba device ID
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6465 c046a42c-6fe2-441c-8c8c-71466251a162
Make pci_nic_init() use qemu_setup_nic_model() (Mark McLoughlin)
Add a table of PCI NIC models to pass to qemu_setup_nic_model().
While we're at it, also add a corresponding table of NIC initfunctions.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
PCI: Mask writes to RO bits in the command reg of PCI config space
The Command register in the PCI config space has some read-only bits.Any writes to those bits should be masked out.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
PCI: Mask writes to RO bits in the status reg of PCI config space
The Status register in the PCI config space has some read-only bits.Any writes to those bits should be masked out.
virtio-net support
This adds virtio-net support. This is based on the virtio-net driverthat exists in kvm-userspace. This also adds a new qemu_sendv_packetwhich virtio-net requires.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6073 c046a42c-6fe2-441c-8c8c-71466251a162
pci: add default pci subsystem id for all devices (Gerd Hoffman)
This sets a default PCI subsystem ID for all emulated PCI devices. PCIspecs require this, so do it.
In many cases it is enougth to know the PCI ID to handle a devicecorrectly. Sometimes a device driver must identify the exact piece of...
KVM: Coalesced MMIO support
MMIO exits are more expensive in KVM or Xen than in QEMU because theyinvolve, at least, privilege transitions. However, MMIO writeoperations can be effectively batched if those writes do not have sideeffects.
Good examples of this include VGA pixel operations when in a planar...
Make PCI class description tables const
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5400 c046a42c-6fe2-441c-8c8c-71466251a162
E1000 NIC emulation (Nir Peleg, patch from Dor Laor).Applied %s/^\([^I ]*\)^I/\1 /g on e1000.c and added e1000 to help message.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3949 c046a42c-6fe2-441c-8c8c-71466251a162
Save/load PCI-device, PCI-bus and PIIX3 irq-related state (patches by Uri Lublin.Note that other PCI bridges are not fixed here.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3793 c046a42c-6fe2-441c-8c8c-71466251a162
Add statics and missing #includes for prototypes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
New option -net nic,model=? (Mark Glines)Network documentation update (Mark Glines)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2880 c046a42c-6fe2-441c-8c8c-71466251a162
Know about more PCI device classes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2663 c046a42c-6fe2-441c-8c8c-71466251a162
Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
Eepro100 emulation, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2584 c046a42c-6fe2-441c-8c8c-71466251a162
Fix typo in PCI bridge code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2470 c046a42c-6fe2-441c-8c8c-71466251a162
Devfn number for network PCI cards, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2314 c046a42c-6fe2-441c-8c8c-71466251a162
Fix PCI config space overflow, by Herbert Xu.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2238 c046a42c-6fe2-441c-8c8c-71466251a162
PCI IRC routing fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2185 c046a42c-6fe2-441c-8c8c-71466251a162
Implement sun4u PCI IRQ routing.Allow multiple PCI busses and PCI-PCI bridges.Fix bugs in Versatile PCI implementation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2166 c046a42c-6fe2-441c-8c8c-71466251a162
PCI shared IRQ fix (original patch by andrzej zaborowski).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2165 c046a42c-6fe2-441c-8c8c-71466251a162
PCI save/restore changes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2115 c046a42c-6fe2-441c-8c8c-71466251a162
Add SCSI controller class.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2106 c046a42c-6fe2-441c-8c8c-71466251a162
pcnet nic support (Antony T Curtis)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2036 c046a42c-6fe2-441c-8c8c-71466251a162
Use lookup table for PCI class descriptions.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1927 c046a42c-6fe2-441c-8c8c-71466251a162