#
80e8b3d8 |
| 10-Jun-2021 |
Cornelia Huck <cohuck@redhat.com> |
header guards: clean up some stragglers
Some headers had been missed during the initial header guard standardization.
Signed-off-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Laurent Vivier <l
header guards: clean up some stragglers
Some headers had been missed during the initial header guard standardization.
Signed-off-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20210610135937.94375-2-cohuck@redhat.com>
show more ...
|
#
68cf12d2 |
| 27-Mar-2017 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add BAR sanity checks
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Andrew J
pci: Add BAR sanity checks
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
show more ...
|
#
cb026028 |
| 28-Feb-2017 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Make PCI API consistent wrt using struct pci_dev
Complete conversion of PCI API so all functions that imply the underlying device does exist would use struct pci_dev as a handle, not pcidevaddr
pci: Make PCI API consistent wrt using struct pci_dev
Complete conversion of PCI API so all functions that imply the underlying device does exist would use struct pci_dev as a handle, not pcidevaddr_t.
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
show more ...
|
#
78609f0e |
| 28-Feb-2017 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Turn struct pci_dev into device handle for PCI functions
Currently struct pci_dev is used for caching PCI device info used by some functions. This update turns the struct into device handle tha
pci: Turn struct pci_dev into device handle for PCI functions
Currently struct pci_dev is used for caching PCI device info used by some functions. This update turns the struct into device handle that will be used by nearly all existing and future APIs.
As result of this change a pci_dev should be initialized with pci_dev_init() and pci_scan_bars() becomes redundant.
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
show more ...
|
#
c4b7d52a |
| 16-Jan-2017 |
Andrew Jones <drjones@redhat.com> |
lib/pci: expose pci_dev_print
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
|
#
cdccea7c |
| 16-Jan-2017 |
Andrew Jones <drjones@redhat.com> |
lib/pci: generalize pci_cap_walk
Increase the utility of pci_cap_walk by allowing the caller to supply the table of cap handlers via a single handler, which implements all the cases of interest.
Si
lib/pci: generalize pci_cap_walk
Increase the utility of pci_cap_walk by allowing the caller to supply the table of cap handlers via a single handler, which implements all the cases of interest.
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
show more ...
|
#
19daf1c5 |
| 30-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: introduce pci_msi_set_enable()
Generalize this function out of pci_setup_msi(), then it can be further used to enable INTx (or, disable MSI).
Signed-off-by: Peter Xu <peterx@redhat.com> Signed
pci: introduce pci_msi_set_enable()
Generalize this function out of pci_setup_msi(), then it can be further used to enable INTx (or, disable MSI).
Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
352096c7 |
| 30-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: introduce pci_intx_line()
To fetch INTx irq line number.
Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
903b0516 |
| 12-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: add msi support for 32/64bit address
pci_cap_walk() is provided to allow walk through all the capability bits for a specific PCI device. If a cap handler is provided, it'll be triggered if the
pci: add msi support for 32/64bit address
pci_cap_walk() is provided to allow walk through all the capability bits for a specific PCI device. If a cap handler is provided, it'll be triggered if the cap is detected along the cap walk.
MSI cap handler is the first one supported. We can add more cap handler in the future.
Meanwhile, pci_setup_msi() API is provided to support basic 32/64 bit address MSI setup.
Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
92d2c192 |
| 12-Dec-2016 |
Peter Xu <peterx@redhat.com> |
x86: intel-iommu: add dmar test
DMAR test is based on QEMU edu device. A 4B DMA memory copy is carried out as the simplest DMAR test.
Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paol
x86: intel-iommu: add dmar test
DMAR test is based on QEMU edu device. A 4B DMA memory copy is carried out as the simplest DMAR test.
Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
66082ed6 |
| 12-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: provide pci_enable_defaults()
One helper function to set/clear specific bit in PCI_COMMAND register is introduced. Then, provide a function to do most of the common PCI init work.
Suggested-by
pci: provide pci_enable_defaults()
One helper function to set/clear specific bit in PCI_COMMAND register is introduced. Then, provide a function to do most of the common PCI init work.
Suggested-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
e954ce23 |
| 12-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: provide pci_scan_bars()
Let's provide a more general way to scan PCI bars, rather than read the config registers every time.
Then let x86/vmexit.c leverage pci_scan_bars()
Reviewed-by: Andrew
pci: provide pci_scan_bars()
Let's provide a more general way to scan PCI bars, rather than read the config registers every time.
Then let x86/vmexit.c leverage pci_scan_bars()
Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
4d6cefa9 |
| 12-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: introduce struct pci_dev
To extend current PCI framework, we need a per-device struct to store device specific information. Time to have a pci_dev struct. Most of the current PCI APIs are conve
pci: introduce struct pci_dev
To extend current PCI framework, we need a per-device struct to store device specific information. Time to have a pci_dev struct. Most of the current PCI APIs are converted to use this pci_dev object as the first argument. Currently it only contains one field "bdf", which is the bdf of current device.
For a few APIs like pci_config_*() ops or pci_find_dev(), I kept the old interface (use PCI BDF value rather than "struct pci_dev") since they can be used in a open context that without any specific PCI device.
Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7d4c532d |
| 12-Dec-2016 |
Peter Xu <peterx@redhat.com> |
pci: fix missing extern for pci_testdev()
Suggested-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
e4125c0c |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add pci-testdev PCI bus test device
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Sign
pci: Add pci-testdev PCI bus test device
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <aa209d81d593909bfaf89bb3a91ff7f33f8441a8.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
33d78b07 |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add generic ECAM host support
Unlike x86, other architectures using generic ECAM PCI host do not have a luxury of PCI bus initialized by a BIOS and ready to use at start. Thus, we need allocate
pci: Add generic ECAM host support
Unlike x86, other architectures using generic ECAM PCI host do not have a luxury of PCI bus initialized by a BIOS and ready to use at start. Thus, we need allocate and assign resources to all devices, much like an architecture's firmware would do.
There is no any sort of resource management for memory and io spaces, since only ones-per-BAR allocations are expected and no deallocations at all.
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Suggested-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <6488b060e4cbbead5a5ec525a53d65773ceb5f87.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
e4611520 |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add pci_print()
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Suggested-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Andrew Jon
pci: Add pci_print()
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Suggested-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <b261e0c3fbfafaa4c38793d4ae632a667f46fb16.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
e1cad5c8 |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add pci_dev_exists()
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alex
pci: Add pci_dev_exists()
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <bbe2afcf1701fa8905d910e141c922e2b058073f.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
647f92c7 |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add pci_bar_set_addr()
Because the counterpart to pci_bar_set_addr() setter is pci_bar_addr() getter, these names become inconsistent. Rename pci_bar_addr() to pci_bar_get_addr() also to make t
pci: Add pci_bar_set_addr()
Because the counterpart to pci_bar_set_addr() setter is pci_bar_addr() getter, these names become inconsistent. Rename pci_bar_addr() to pci_bar_get_addr() also to make the resulting names conform to each other.
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <ce732680ee4989d1b2b26361a2c02d24b8bef37b.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
2455ef20 |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Rework pci_bar_addr()
This update makes pci_bar_addr() interface 64 bit BARs aware and introduces a concept of PCI address translation.
An architecutre should implement pci_translate_addr() in
pci: Rework pci_bar_addr()
This update makes pci_bar_addr() interface 64 bit BARs aware and introduces a concept of PCI address translation.
An architecutre should implement pci_translate_addr() interface in order to provide mapping between PCI bus address and CPU physical address.
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <11145b9c19a61b4f585b3fabf5b2c64299aa89ff.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
fa80a74d |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Add 'extern' to public function declarations
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.
pci: Add 'extern' to public function declarations
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <24c5c29c3bbd3fed9091efa8586c90068037f168.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
ebb58e7e |
| 07-Nov-2016 |
Alexander Gordeev <agordeev@redhat.com> |
pci: Fix coding style in generic PCI files
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Re
pci: Fix coding style in generic PCI files
Cc: Thomas Huth <thuth@redhat.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Message-Id: <6bb1283e3dfd4c3e8c4b1ebcdd4e08485bc4c507.1478512824.git.agordeev@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
d3a8ad49 |
| 18-Jan-2016 |
Andrew Jones <drjones@redhat.com> |
lib/pci: make PCIDEVADDR_INVALID truly invalid
dev addr 0 is valid, just not for the pci-testdev (since the host bridge is already there). So, while it's not a problem, let's "fix" it anyway.
Sugge
lib/pci: make PCIDEVADDR_INVALID truly invalid
dev addr 0 is valid, just not for the pci-testdev (since the host bridge is already there). So, while it's not a problem, let's "fix" it anyway.
Suggested-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-9-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
289ebf8f |
| 18-Jan-2016 |
Andrew Jones <drjones@redhat.com> |
x86: share pci-testdev hdr in common lib
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-8-git-send-email-drjones@redh
x86: share pci-testdev hdr in common lib
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-8-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
456c55bc |
| 18-Jan-2016 |
Andrew Jones <drjones@redhat.com> |
x86: move x86/pci to the common lib
Also move pci_config_read into asm/pci.h
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <14531400
x86: move x86/pci to the common lib
Also move pci_config_read into asm/pci.h
Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Radim KrÄmář <rkrcmar@redhat.com> Message-Id: <1453140064-9040-7-git-send-email-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|