History | View | Annotate | Download (14.1 kB)
pci: prepare irq code for interrupt state
This rearranges code in preparation for interrupt stateimplementation.Changes: - split up bus walk away from interrupt handling into a subroutine - change irq_state from an array to bitmask - verify that irq_state values are 0 or 1 on load...
pci: interrupt status bit implementation
interrupt status is a mandatory feature in PCI spec,so devices must implement it to be spec compliant.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
pci: interrupt disable bit support
Interrupt disable bit is mandatory in PCI spec.Implement it to make devices spec compliant.
pci: move apb specific stuff to apb_pci.c
pci code had a TODO to move apb specificpci bridge initialization to apb_pci.Implement this and remove the TODO.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: pci bridge related clean up.
- fix bridge prefetchable memory accesser to check 64bit or not.- use pcibus_t consistently instead mixing pcibus_t and uint64_t.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: remove unused constants
This patch removes unused constants committed byfb23162885f7fd8cf7334bed22c25ac32c7d8b9d.
pci: remove some unnecessary comment in pci.h
This patch removes some comment which should go into commit login pci.h.
pci: s/pci_find_host_bus/pci_find_root_bus/g
This patch renames pci_find_host_bus() to pci_find_root_bus()as suggested by "Michael S. Tsirkin" <mst@redhat.com>.
pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h
Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]so the declaration of pci_data_{read, write}() should be inpci_host.hThis patch moves them from pci.h to pci_host.h for consistency....
pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren'tdefined in pci.h. Clean up moving thingsto appropriate headers, and update all users.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: initialize pci config headers depending it pci header type.
- Only sets default subsystem id for header type 00.(normal header type) because header type 01 doesn't have subsystem id, and uses the register for other purpose. So setting default subsystem id doesn't make sense....
pci: implement pci bridge filtering.
This patch implements pci bridge filtering.
TODO: currently almost all the map funcions assumesfiltered_size size and addr & ~(size - 1) addr.However with bridge filtering, they aren't always true.Teach them such cases, such that filtered_size < size and...
pci: 64bit bar support.
implemented pci 64bit bar support.The tricky bit is pci_update_mapping().An OS is allowed to set the BAR such that OS can't address the areapointed by BAR. It doesn't make sense, though.In that case, don't map the BAR.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pci: make pci configuration transaction more accurate.
This patch sorts out/enhances pci code to track pci bus topologymore accurately.- Track host bus bridge with pci domain number. Although the current qemu implementation supports only pci domian 0 yet....
pci_host: change the signature of pci_data_{read, write}.
change the first argument, void opaque to PCIBus *sof the pci_data_{read, write}.They aren't used as direct callback so the argument typedon't have to be void. So change it to the right type....
pci: pcie host and mmcfg support.
This patch adds common routines for pcie host bridge and pcie mmcfg.This will be used by q35 based chipset emulation.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: add helper functions to check ranges overlap.
add helper function to check ranges overlap suggested byMichael S. Tsirkin <mst@redhat.com>.His original suggestion was to use [first, last], however I chosento use offset, length pair, i.e. [offset, offset + length)...
pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t
This patch is preliminary for 64 bit BAR support.Introduce dedicated type, pcibus_t, to represent pci bus address/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: introduce FMT_PCIBUS for printf format for pcibus_t.
This patch is preliminary for 64bit BAR.Later pcibus_t will be changed from uint32_t to uint64_t.Introduce FMT_PCIBUS for printf format for pcibus_t.
pci: typedef pcibus_t as uint64_t instead of uint32_t.
This patch is preliminary for 64bit bar.For 64bit bar support, change pcibus_t which representspci bus addr/size from uint32_t to uint64_t.And also change FMT_pcibus for printf.
In pci_update_mapping() checks 32bit overflow....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci: make pci_bar() aware of header type 1.
make pci_bar() aware of header type 1. When PCI_ROM_SLOTit should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)
pci: introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.and use it.
pci: define a constant to represent a unmapped bar and use it.
define a constant to represent a unmapped bar instead of -1 and use it.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: helper functions to access PCIDevice::config
add helper functions to get/set PCIDevice::configThose will be used later.
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....
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: clean up target page usage in msix
Since cpu_register_phys_memory does not require size to be a multiple oftarget page size, simply make msix page size 0x1000. Do this in msix,reverting part of 5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we nolonger have to pass target page around....
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.
Signed-off-by: Michael S. Tsirkin <mst@redhat.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.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
support inplace allocation for pci bus, split irq init.
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....
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>
Compile msix only once
Get page size in device init.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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>
eepro100: Clean code which sets the PCI device id
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev/scsi: add scsi bus support to qdev, convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,......
qdev/usb: convert ohci.
Drop num_ports argument for usb_ohci_init_pci(), everybodycalls it with num_ports == 3, so it is pointless.
Convert ohci pci device into qdev.TODO: convert non-pci ohci adapters.
You can add a OHCI USB Controller to your virtual pc now using...
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>
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....
Add version_id to PCIDevice.
It is needed for VMState
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: 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....
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.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
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/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....
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....
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>
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....
PCI qdev support
Signed-off-by: Paul Brook <paul@codesourcery.com>
LSI SCSI qdev conversion
PCI network qdev conversion
Remove vga_ram_size
The vga_ram_size argument to machine init functions always has the samevalue, and is ignored by many machines (including SPARC32 which has anobsolete ifdef for VGA_RAM_SIZE).
Remove it and push VGA_RAM_SIZE into vga_int.h.
use PCI_HEADER_TYPE.
use symbolic value instead of 0x0e and related value.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Clean up VGA ram allocation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7063 c046a42c-6fe2-441c-8c8c-71466251a162
Clean some PCI defines (Stefan Weil)
this patch adds some more defines from linux/pci_regs.h tohw/pci.h. There is now no longer a need to define them ineepro100.c, so they were removed there.
Some defines from linux/pci_regs.h had similar, but notthe same defines in hw/pci.h (PCI_REVISION_ID / PCI_REVISION,...
Add and use remaining #defines for PCI device IDs (Stuart Brady)
This patch adds and uses #defines for the remaining hardcoded PCIdevice IDs. It also moves definitions taken from linux/pci_ids.hinto a separate header (hw/pci_ids.h), removes the 'RTL' from...
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...
kvm/powerpc: Add freescale pci controller's support
This patch add the emulation of freescale's pci controller for MPC85xx platform.
Signed-off-by: Liu Yu <yu.liu@freescale.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6661 c046a42c-6fe2-441c-8c8c-71466251a162
qemu: PCI device, disk and host network hot-add / hot-remove (Marcelo Tosatti)
Add monitor command to hot-add PCI devices (nic and storage).
Syntax is:
pci_add pci_addr=[[<domain>:]<bus>:]<slot> nic|storage params
It returns the domain, bus and slot for the newly added device on success....
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: 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.
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@6592 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...
Update #defines for PCI vendor and device IDs from OpenBIOS and Linux
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6490 c046a42c-6fe2-441c-8c8c-71466251a162
Add Simba device ID
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6465 c046a42c-6fe2-441c-8c8c-71466251a162
Define PCI vendor and device IDs in pci.h (Stuart Brady)
This patch defines PCI vendor and device IDs in pci.h (matching thosefrom Linux's pci_ids.h), and uses those definitions where appropriate.
Change from v1: Introduces pci_config_set_vendor_id() / pci_config_set_device_id()...
Add macro for virtio-console PCI device ID (Mark McLoughlin)
Also use the existing macro for the PCI vendor ID
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6439 c046a42c-6fe2-441c-8c8c-71466251a162
graphical_console_init change (Stefano Stabellini)
Patch 5/7
This patch changes the graphical_console_init function to return anallocated DisplayState instead of a QEMUConsole.
This patch contains just the graphical_console_init change and few othermodifications mainly in console.c and vl.c....
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>...
Add EBUS bridge
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6266 c046a42c-6fe2-441c-8c8c-71466251a162
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.
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...
SH4: kill a few warnings
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5938 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
Add -drive parameter, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 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