RFC PCI bus support
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest15 patches 54 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | Update ioremap() prototype to conform to the Linux onelib/ lib/ lib/ | +9 | 1 reply | |
| 2/15 | x86: Add basic ioremap() implementationlib/ lib/ | +17 | 1 reply | |
| 3/15 | x86/vmexit: Make use of ioremap()x86/ | +3 | 2 replies | |
| 4/15 | pci: Fix indentation in generic PCI fileslib/ lib/ | +19 | 3 replies | |
| 5/15 | pci/x86: Rename pci_config_read() to pci_config_readl()lib/ lib/ | +5 | 3 replies | |
| 6/15 | pci/x86: Add remaining PCI configuration space accessorslib/ | +21 | 1 reply | |
| 7/15 | pci: Add pci_probe() and pci_shutdown()lib/ lib/ lib/ | +16 | 3 replies | |
| 8/15 | pci: Rework pci_bar_addr()lib/ lib/ lib/ | +87 | 5 replies | |
| 9/15 | pci: Add pci_bar_set()lib/ lib/ | +9 | 4 replies | |
| 10/15 | pci: Add pci_print() and pci_type_desc()lib/ lib/ lib/ | +76 | 7 replies | |
| 11/15 | pci/x86: Adopt PCI framework changeslib/ x86/ | +6 | 1 reply | |
| 12/15 | Factor out generic architecture codelib/ lib/ lib/ +5 more | +79 | 8 replies | |
| 13/15 | pci/arm: Add generic ECAM host supportarm/ arm/ lib/ +2 more | +435 | 5 replies | |
| 14/15 | pci: Add pci-testdev PCI bus test devicelib/ lib/ | +195 | 5 replies | |
| 15/15 | pci/arm: Add pci-testdev PCI device operation testarm/ arm/ arm/ | +14 | 5 replies |
Reviews trailers per patch
3 of 15 patches have a Reviewed-by or Acked-by.
| Patch | Andrew Jones | Thomas Huth |
|---|---|---|
| 1/15 | ||
| 2/15 | ||
| 3/15 | ||
| 4/15 | ||
| 5/15 | R-b | R-b |
| 6/15 | R-b | |
| 7/15 | ||
| 8/15 | ||
| 9/15 | R-b | |
| 10/15 | ||
| 11/15 | ||
| 12/15 | ||
| 13/15 | ||
| 14/15 | ||
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH RFC 00/15] PCI bus support
Hi Andrew,
This is PCI test RFC. The code is far from done, but all (re)work suggestions are present and up to comments.
One major idea we discussed is missing from this RFC. That is switching from 'pcidevaddr_t' to 'struct pci_dev *' for accessing PCI devices (and further down the chain - busses and bridges). The reasons are:
- the amount of altered code is quite big already and I would like first to check if the suggested changes are reasonable, before introducing further changes;
- the current implementation with 'pcidevaddr_t' does not seem likable to me, but it is the minimalistic indeed. So I would like to take the last chance to assess the trade-off between 'nice' and 'small' implementations;
Few highlights regarding the new implementation:
- many, but not all your previous comments were addressed -
I tried to fix most important ones;
- patch 'Factor out generic architecture code' most likely is not this series specific. It seems architectures do contain a code that could be factored out Linux-style;
- I did not put much thought into generic and x86 reworks. I only focused on PCI changes while putting off possible following decent implementation;
- an all-in-one helper:
bool pci_get_bar(void *conf, int bar, pci_res_type_t *type,
u64 *addr, u64 *size, bool *is64);
got replaced with a set of interfaces, which are less handy,
but seems what you were after:
phys_addr_t pci_bar_addr(pcidevaddr_t dev, int bar_num);
phys_addr_t pci_bar_size(pcidevaddr_t dev, int bar_num);
bool pci_bar_is64(pcidevaddr_t dev, int bar_num);
bool pci_bar_is_memory(pcidevaddr_t dev, int bar_num);
bool pci_bar_is_valid(pcidevaddr_t dev, int bar_num);- a need to translate PCI bus address to CPU physical address led to introduction of a new arch-specific interface:
phys_addr_t pci_xlate_addr(pcidevaddr_t dev, uint64_t pci_addr);
An arch would have to override this one in case PCI addresses and CPU physical addresses are not identical. Linux does it once - when creates a list of PCI resources. By contrast, this RFC calls pci_xlate_addr() each time pci_bar_addr() is called. That lets to avoid extra data structures;
Alexander Gordeev (15):
Update ioremap() prototype to conform to the Linux one
x86: Add basic ioremap() implementation x86/vmexit: Make use of ioremap()
pci: Fix indentation in generic PCI files pci/x86: Rename pci_config_read() to pci_config_readl() pci/x86: Add remaining PCI configuration space accessors
pci: Add pci_probe() and pci_shutdown()
pci: Rework pci_bar_addr()
pci: Add pci_bar_set()
pci: Add pci_print() and pci_type_desc() pci/x86: Adopt PCI framework changes
Factor out generic architecture code
pci/arm: Add generic ECAM host support
pci: Add pci-testdev PCI bus test device pci/arm: Add pci-testdev PCI device operation test
arm/Makefile.common | 7 +- arm/pci-test.c | 27 +++++ arm/run | 10 +- lib/alloc.h | 7 -- lib/arm64/asm/pci.h | 29 +++++ lib/asm-generic/io.h | 59 ++++++++- lib/asm-generic/pci.h | 29 ++++- lib/libcflat.h | 7 ++ lib/pci-host-generic.c | 321 +++++++++++++++++++++++++++++++++++++++++++++++++ lib/pci-host-generic.h | 57 +++++++++ lib/pci-testdev.c | 188 +++++++++++++++++++++++++++++ lib/pci.c | 182 +++++++++++++++++++++++++--- lib/pci.h | 19 ++- lib/x86/asm/page.h | 1 + lib/x86/asm/pci.h | 27 ++++- lib/x86/io.c | 12 ++ lib/x86/io.h | 41 +++++-- lib/x86/smp.h | 4 - lib/x86/vm.c | 1 - lib/x86/vm.h | 12 +- x86/eventinj.c | 7 +- x86/kvmclock.c | 1 + x86/vmexit.c | 16 ++- 23 files changed, 980 insertions(+), 84 deletions(-) create mode 100644 arm/pci-test.c create mode 100644 lib/arm64/asm/pci.h create mode 100644 lib/pci-host-generic.c create mode 100644 lib/pci-host-generic.h create mode 100644 lib/pci-testdev.c create mode 100644 lib/x86/asm/page.h
Signature · 1 line
1.8.3.1