All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/15] PCI bus support
@ 2016-04-11 11:04 Alexander Gordeev
  2016-04-11 11:04 ` [PATCH RFC 01/15] Update ioremap() prototype to conform to the Linux one Alexander Gordeev
                   ` (14 more replies)
  0 siblings, 15 replies; 70+ messages in thread
From: Alexander Gordeev @ 2016-04-11 11:04 UTC (permalink / raw)
  To: kvm; +Cc: Alexander Gordeev, Thomas Huth, Andrew Jones

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;


Cc: Thomas Huth <thuth@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>

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

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2016-05-31 20:27 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 11:04 [PATCH RFC 00/15] PCI bus support Alexander Gordeev
2016-04-11 11:04 ` [PATCH RFC 01/15] Update ioremap() prototype to conform to the Linux one Alexander Gordeev
2016-04-11 11:34   ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 02/15] x86: Add basic ioremap() implementation Alexander Gordeev
2016-04-11 11:45   ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 03/15] x86/vmexit: Make use of ioremap() Alexander Gordeev
2016-04-11 11:46   ` Andrew Jones
2016-04-11 12:02     ` Alexander Gordeev
2016-04-11 11:04 ` [PATCH RFC 04/15] pci: Fix indentation in generic PCI files Alexander Gordeev
2016-04-11 11:50   ` Andrew Jones
2016-04-11 12:06     ` Alexander Gordeev
2016-04-11 12:21       ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 05/15] pci/x86: Rename pci_config_read() to pci_config_readl() Alexander Gordeev
2016-04-11 11:51   ` Andrew Jones
2016-04-13 12:55   ` Thomas Huth
2016-04-14 13:13     ` Alexander Gordeev
2016-04-11 11:04 ` [PATCH RFC 06/15] pci/x86: Add remaining PCI configuration space accessors Alexander Gordeev
2016-04-14  7:29   ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 07/15] pci: Add pci_probe() and pci_shutdown() Alexander Gordeev
2016-04-14  7:45   ` Thomas Huth
2016-04-14 13:23     ` Alexander Gordeev
2016-04-22 15:04       ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 08/15] pci: Rework pci_bar_addr() Alexander Gordeev
2016-04-13 13:28   ` Thomas Huth
2016-04-13 17:46     ` Alexander Gordeev
2016-04-13 18:05       ` Andrew Jones
2016-04-22 15:20   ` Andrew Jones
2016-04-22 15:22   ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 09/15] pci: Add pci_bar_set() Alexander Gordeev
2016-04-13 15:01   ` Thomas Huth
2016-04-13 16:38   ` Andrew Jones
2016-04-13 18:39     ` Alexander Gordeev
2016-04-14  7:30       ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 10/15] pci: Add pci_print() and pci_type_desc() Alexander Gordeev
2016-04-14  7:43   ` Thomas Huth
2016-04-14  8:34     ` Alexander Gordeev
2016-04-14  8:41       ` Thomas Huth
2016-04-14  9:42         ` Andrew Jones
2016-04-22 15:35   ` Andrew Jones
2016-05-18  9:03     ` Alexander Gordeev
2016-05-23 15:10       ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 11/15] pci/x86: Adopt PCI framework changes Alexander Gordeev
2016-04-22 15:37   ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 12/15] Factor out generic architecture code Alexander Gordeev
2016-04-14  7:50   ` Thomas Huth
2016-04-14  8:16     ` Alexander Gordeev
2016-04-22 15:40     ` Andrew Jones
2016-04-22 16:14       ` Alexander Gordeev
2016-04-22 15:54   ` Andrew Jones
2016-04-22 16:35     ` Alexander Gordeev
2016-04-26  8:24     ` Alexander Gordeev
2016-04-26  9:37       ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 13/15] pci/arm: Add generic ECAM host support Alexander Gordeev
2016-04-22 17:07   ` Andrew Jones
2016-05-29 19:54     ` Alexander Gordeev
2016-05-30  6:12       ` Andrew Jones
2016-05-30  6:28   ` Alexander Gordeev
2016-05-30  6:40     ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 14/15] pci: Add pci-testdev PCI bus test device Alexander Gordeev
2016-04-22 17:23   ` Andrew Jones
2016-05-23  8:02     ` Alexander Gordeev
2016-05-23 15:17       ` Andrew Jones
2016-05-29 17:48         ` Alexander Gordeev
2016-05-30  6:09           ` Andrew Jones
2016-04-11 11:04 ` [PATCH RFC 15/15] pci/arm: Add pci-testdev PCI device operation test Alexander Gordeev
2016-04-22 17:33   ` Andrew Jones
2016-05-29 20:03     ` Alexander Gordeev
2016-05-30  6:15       ` Andrew Jones
2016-05-31 20:13         ` Alexander Gordeev
2016-05-31 20:27           ` Andrew Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.