Age | Commit message (Collapse) | Author | Files | Lines |
|
Only two callers of pci_create_simple/pci_register_device bothered
to check the return value. Other cases were prone to crashing with
spurious NULL pointer dereferences.
Make QEMU exit with an error message when devfn is attempted to
be duplicated, also applies to case when the bus is full. Remove
checks.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
|
|
Change 260c0cd3d985e51b15870ff47e17b7b930efbda1
(pci: use range helper functions) introduced a
bug which made pci cirrus vga on mips malta
(and maybe other pci devices) fail.
Don't change addr - its original value is needed
by ranges_overlap() and range_covers().
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
- 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.
- initialize wmask more for header type 01.(bridge header type)
Without those wmasks, linux was confused not boot,
and lspci was confused not to print out expected IO/memory range.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
clean up pci_default_write_config() by the range helper functions.
Suggested by Michael S. Tsirkin <mst@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
make pci_info_device() print out bridge's filtering value like
io base/limit, subbus and subordinate bus.
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>
|
|
When updated ROM expantion address of header type 0, it missed
to update mappings.
Add PCI_ROM_ADDRESS check whether to call pci_update_mappings()
Also update pci mapping when PCI_ROM_ADDRESS1 is written for header type 1.
pci_update_mapping() path isn't performance critical,
so call it even independent of header type.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
This patch implements pci bridge filtering.
TODO: currently almost all the map funcions assumes
filtered_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
addr & (size - 1) != 0.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
split out device iteration logic from pci_for_each_device().
factored out function, pci_for_each_device_under_bus() will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
Remove one indentation of pci_update_mappings.
Just for cosmetics, no logic change.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
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>
|
|
Move pci host stuff from pci.c to pci_host.c.
And add some comments.
Later pcie host bridge functions will be defined in pcie_host.c
not to bloat pci.c.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
factor out the logic which converts io port address into pci device
and offset in PCI configuration space.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
This patch sorts out/enhances pci code to track pci bus topology
more accurately.
- Track host bus bridge with pci domain number. Although the
current qemu implementation supports only pci domian 0 yet.
- Track pci bridge parent-child relationship.
When looking down from pci host bus for pci sub bus, be aware of
secondary bus/subordinate bus.
Thus pci configuration transaction is more accurately emulated.
This patch adds new member to PCIBus to track pci bus topology.
Since qdev already tracks down bus relationship, those new member
wouldn't be necessary.
However it would be addressed later because not all the pci device
isn't converted to qdev yet.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
Since It can be retrieved from pci configuration space,
the member is unnecessary.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
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 area
pointed 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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
This patch is preliminary for 64bit bar.
For 64bit bar support, change pcibus_t which represents
pci bus addr/size from uint32_t to uint64_t.
And also change FMT_pcibus for printf.
In pci_update_mapping() checks 32bit overflow.
So the check must be updated too.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
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.
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>
|
|
This patch is preliminary for 64 bit BAR support.
Introduce dedicated type, pcibus_t, to represent pci bus address/size
instead of uint32_t.
Later this type will be changed to uint64_t.
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>
|
|
make pci_bar() aware of header type 1. When PCI_ROM_SLOT
it should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)
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>
|
|
make constants for pci base address match pci_regs.h by
renaming 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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
This patch cleans up pci_default_read_config() removing
ugly length and range check.
Suggested by "Michael S. Tsirkin" <mst@redhat.com>
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>
|
|
use pci_set_word() for pci command register.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
- use symbolic constant
- use helper function pci_set_xxx()
- removed lines which initializes to 0.
It is unnecessary because it is already zeroed.
- add some comments on command registers.
Some initial values are suspicious because they seems to
be specific to apb_pci.c which is the only user of pci bridge right now.
For now don't touch those values to avoid breakage.
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>
|
|
use pci_[gs]et_{byte, word, long}() to access pci configuration
space.
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>
|
|
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>
|
|
use PCI_SLOT() and PCI_FUNC() where appropriate instead of
direct use of bit operation.
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>
|
|
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
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>
|
|
add missing ## in PCI_DPRINTF() to compile.
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>
|
|
* commit '59c7b155aa6e1cbfe8a92e2322ea59ab31965c10': (81 commits)
posix-aio-compat: Split out posix_aio_process_queue
monitor: Convert do_closefd() to QObject
monitor: Convert do_getfd() to QObject
monitor: Convert do_eject() to QObject
monitor: Convert do_pci_device_hot_remove() to QObject
monitor: Convert do_migrate_cancel() to QObject
monitor: Convert do_migrate_set_speed() to QObject
monitor: Convert do_migrate() to QObject
monitor: Convert do_physical_memory_save() to QObject
monitor: Convert do_memory_save() to QObject
lsi_scsi: port to vmstate
vmstate: Add VMSTATE_BUFFER_UNSAFE
vmware_vga: port to vmstate
vmware_vga: the support to change dinamically depth is not there
vmware_vga: scratch is really an array of uint32_t
vmware_vga: remove !EMBED_STDVGA code
vmware_vga: qemu_malloc() returns void *
vmware_vga: Remove uselss casts from void *
vmware_vga: Pass pci_vmsga_state_t arg no VGACommonState
vga: remove unused vga_common_save/load
...
Conflicts:
posix-aio-compat.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
* commit '9ad4531e1e00b996ba55de04d6ecfb4d02a9fd7c':
kill dead nic unplug code.
zap DeviceState->nd
Conflicts:
hw/pci-hotplug.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
* commit 'a783cc3e551158854c15c6d121f29433a2810e85':
ne2k_pci: use qdev properties for configuration.
prepare pci nic init path for qdev property configuration.
qdev: add qdev_prop_exists()
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
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>
|
|
Initialization path will work with both converted and not-converted
drivers, so we can convert drivers one by one.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
* commit 'dea7b3b95a0e6b88e0647e7afc8b6a7b5675fbb1':
net: remove id field from NICInfo
net: handle id= parameter for -net
net: remove unused qemu_handler_true()
net: pass monitor handle to client init functions
hotplug: safely iterate bus's sibling list while removing a device
eepro100: Remove unused device status entries
winwave: ADC support
audio: remove last remnants of _t
winwave: make error logging more consistent
winwave: follow the rules when closing the output device
configure: clean temporary executable files even on Windows
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
Just use the name field instead since we now use the id paramater as
the name, if supplied. Only implication with this change is that if
id is not supplied, the value of the name paramater is used as an
id.
Patchworks-ID: 35512
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
* commit '1215c6e7615897e4a0bfd6867b762a47fc34f37f':
Move generation of config-host.h to Makefile from configure
Don't include config-host.mak from inside config.mak
CRIS: Update PR_EDA on TLB faults.
Clean up test for qdev_init() failure
Warn if value of qdev_init() isn't checked
Make isa_create() terminate program on failure
New qdev_init_nofail()
Check return value of qdev_init()
Make qdev_init() destroy the device on failure
Unbreak USB autoconnect filters
tcg: improve output log
target-i386: fix ARPL
configure and Makefile are not generated in qemu
Don't use implicit rules for Makefile
optionrom: create .PHONY variable
add build-all to .PHONY rules
optionrom: remove use of implicit RM variable
AIOLIBS is not used anywhere
qdev: move comment
Conflicts:
Makefile
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
* commit '0f457d91c41047f0f22c2e6965fbd154c5cd07d9':
qemu/pci: make pci not depend on msix
qemu/pci: clarify pci config load routine
Conflicts:
hw/pci.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Upstream now has tests for irqchip_in_kernel. It differs from our
signature, as it does not take any parameter. For consistency, convert
our usage. Also, use a field in KVMState to store it, so we can have the
exact same function as qemu upstream does.
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
Conflicts:
net.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
Like qdev_init(), but terminate program via hw_error() instead of
returning an error value.
Use it instead of qdev_init() where terminating the program on failure
is okay, either because it's during machine construction, or because
we know that failure can't happen.
Because relying in the latter is somewhat unclean, and the former is
not always obvious, it would be nice to go back to qdev_init() in the
not-so-obvious cases, only with proper error handling. I'm leaving
that for another day, because it involves making sure that error
values are properly checked by all callers.
Patchworks-ID: 35168
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
But do so only where it may actually fail. Leave the rest for the
next commit.
Patchworks-ID: 35167
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
Making pci device cleanup msix automatically makes pci.c depend on
msix.c, which is IMO messy. Since devices do msix_init it's easy and
natural for them to also do msix_uninit.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
PCI load routine has to be called with size equal to 256 (otherwise it
will 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>
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
This reverts commit 0148fde54c2478ea8a47c8dbfe4c0fb8bda4d996.
As requested by Luiz.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
This reverts commit c0b1905b285800cfd1a797347efeac8338bfa655. It breaks
Windows XP install autotest - Windows seems to drop to lose hibernate
support with this patch.
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit '499cf1027f9387081f73767c7872c9123896817c':
Rename pci_create_noinit() to pci_create()
pci_create() is now unused, remove it
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit '07caea315a85ebfe90851f9c2e4ef3fdd24117b5':
Fix pci_add nic not to exit on bad model
Make it obvious that pci_nic_init() can't fail
Fix pci_add storage not to exit on bad first argument
Fix pci_vga_init() not to ignore bus argument
set correct CS seg limit and flags on sipi
Set revision in eeprom correctly for 82557 versions.
restore CFLAGS check for conflict and fix recursive CFLAGS issue
virtio-pci: return error if virtio_console_init fails
qdev: show name of device that fails init
vnc: Set invalid buffer pointers to NULL
eepro100: Don't allow guests to fail assertions
qcow2: Increase maximum cluster size to 2 MB
qemu/virtio-pci: remove unnecessary check
Conflicts:
hw/pc.c
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
* commit '5a1fc5e8529afb6041a3dfa406a94c187d2afc1d':
qemu: clean up target page usage in msix
fix comment on cpu_register_physical_memory_offset
qemu/pci: reset device registers on bus reset
qemu/pci: refactor code/symbolic constants
qemu/virtio: fix reset with device removal
qemu/qdev: type safety in reset handler
serial: convert isa to qdev
qdev: don't crash on unset drive properties.
floppy: move dma setup + drive connect to fdctrl_init_common()
floppy: add drive properties.
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
allow if=none for drive_add
refactor drive_hot_add
drive cleanup fixes.
Conflicts:
hw/msix.c
hw/pci.h
Signed-off-by: Avi Kivity <avi@redhat.com>
|