Skip to contentSkip to conversation

Disentangle PCI from IOMMU maintainership

PATCH In review Roger Pau Monne 2 participants 14 messages Jan 4, 2019 – Jan 7, 2019

lore
Share & tools
lore
#0 lore raw

cover Disentangle PCI from IOMMU maintainership

Hello,

Current arrangement of the PCI code puts it under vendor agnostic IOMMU maintainership, which is IMO not very accurate. The aim of this series is to add a new maintainership section containing the PCI code in Xen, and add myself as reviewer.

Due to my work on PVH Dom0, which makes heavy use of the HVM pci-passthrough infrastructure, I've become acquainted with the PCI code and I think I can help with reviews.

Roger Pau Monne (4):
maintainers: always use hard tabs
x86/passthrough: move io.c to the x86 subfolder x86/passthrough: put the x86 folder under x86 maintainership
pci: add a pci section to the maintainers file

 MAINTAINERS                            | 77 +++++++++++++++-----------
 xen/drivers/passthrough/Makefile       |  3 -
 xen/drivers/passthrough/x86/Makefile   |  1 +
 xen/drivers/passthrough/{ => x86}/io.c |  0
 4 files changed, 45 insertions(+), 36 deletions(-)
 rename xen/drivers/passthrough/{ => x86}/io.c (100%)
Signature · 7 lines
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 1/4 maintainers: always use hard tabs

As that seems to be the prevailing style.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 MAINTAINERS | 66 ++++++++++++++++++++++++++---------------------------
 1 file changed, 33 insertions(+), 33 deletions(-)
MAINTAINERS +33 -33
index 96a0518f49..e99d39eb47 100644
@@ -215,13 +215,13 @@ F:	xen/include/xen/device_tree.h
 F:	xen/drivers/passthrough/device_tree.c
 
 EFI
-M:     Jan Beulich <[email protected]>
-S:     Supported
-F:     xen/arch/x86/efi/
-F:     xen/common/efi/
-F:     xen/include/efi/
-F:     xen/include/asm-x86/efi*.h
-F:     xen/include/asm-x86/x86_*/efi*.h
+M:	Jan Beulich <[email protected]>
+S:	Supported
+F:	xen/arch/x86/efi/
+F:	xen/common/efi/
+F:	xen/include/efi/
+F:	xen/include/asm-x86/efi*.h
+F:	xen/include/asm-x86/x86_*/efi*.h
 
 GDBSX DEBUGGER
 M:	Elena Ufimtseva <[email protected]>
@@ -272,25 +272,25 @@ S:	Odd Fixes
 F:	tools/debugger/kdd/
 
 KEXEC
-M:      Andrew Cooper <[email protected]>
-S:      Supported
-F:      xen/common/{kexec,kimage}.c
-F:      xen/include/{kexec,kimage}.h
-F:      xen/arch/x86/machine_kexec.c
-F:      xen/arch/x86/x86_64/kexec_reloc.S
+M:	Andrew Cooper <[email protected]>
+S:	Supported
+F:	xen/common/{kexec,kimage}.c
+F:	xen/include/{kexec,kimage}.h
+F:	xen/arch/x86/machine_kexec.c
+F:	xen/arch/x86/x86_64/kexec_reloc.S
 
 LIVEPATCH
-M:  Konrad Rzeszutek Wilk <[email protected]>
-M:  Ross Lagerwall <[email protected]>
-S:  Supported
-F:  docs/misc/livepatch.markdown
-F:  tools/misc/xen-livepatch.c
-F:  xen/arch/*/livepatch*
-F:  xen/arch/*/*/livepatch*
-F:  xen/common/livepatch*
-F:  xen/include/asm-*/livepatch.h
-F:  xen/include/xen/livepatch*
-F:  xen/test/livepatch/*
+M:	Konrad Rzeszutek Wilk <[email protected]>
+M:	Ross Lagerwall <[email protected]>
+S:	Supported
+F:	docs/misc/livepatch.markdown
+F:	tools/misc/xen-livepatch.c
+F:	xen/arch/*/livepatch*
+F:	xen/arch/*/*/livepatch*
+F:	xen/common/livepatch*
+F:	xen/include/asm-*/livepatch.h
+F:	xen/include/xen/livepatch*
+F:	xen/test/livepatch/*
 
 MINI-OS
 M:	Samuel Thibault <[email protected]>
@@ -321,9 +321,9 @@ F:	xen/drivers/cpufreq/
 F:	xen/include/acpi/cpufreq/
 
 PUBLIC I/O INTERFACES AND PV DRIVERS DESIGNS
-M:  Konrad Rzeszutek Wilk <[email protected]>
-S:  Supported
-F:  xen/include/public/io/
+M:	Konrad Rzeszutek Wilk <[email protected]>
+S:	Supported
+F:	xen/include/public/io/
 
 PYTHON BINDINGS
 M:	Marek Marczykowski-Górecki <[email protected]>
@@ -498,12 +498,12 @@ F:	tools/xentrace/
 F:	xen/common/trace.c
 
 XSM/FLASK
-M:  Daniel De Graaf <[email protected]>
-S:  Supported
-F:  tools/flask/
-F:  xen/include/xsm/
-F:  xen/xsm/
-F:  docs/misc/xsm-flask.txt
+M:	Daniel De Graaf <[email protected]>
+S:	Supported
+F:	tools/flask/
+F:	xen/include/xsm/
+F:	xen/xsm/
+F:	docs/misc/xsm-flask.txt
 
 THE REST
 M:	Andrew Cooper <[email protected]>
Signature · 7 lines
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw

PATCH 2/4 x86/passthrough: move io.c to the x86 subfolder

In reply to Roger Pau Monne

It makes no sense for io.c to be on the top level passthrough directory, since it's x86 specific.

No functional change.

---
Cc: Jan Beulich <[email protected]>

---
 xen/drivers/passthrough/Makefile       | 3 ---
 xen/drivers/passthrough/x86/Makefile   | 1 +
 xen/drivers/passthrough/{ => x86}/io.c | 0
 3 files changed, 1 insertion(+), 3 deletions(-)
 rename xen/drivers/passthrough/{ => x86}/io.c (100%)
xen/drivers/passthrough/Makefile +0 -3
index d50ab188c8..bcfea66d05 100644
@@ -6,6 +6,3 @@ subdir-$(CONFIG_ARM) += arm
 obj-y += iommu.o
 obj-$(CONFIG_HAS_PCI) += pci.o
 obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
-
-x86-$(CONFIG_HVM) := io.o
-obj-$(CONFIG_X86) += $(x86-y)
xen/drivers/passthrough/x86/Makefile +1 -0
index a70cf9460d..0715ffbc00 100644
@@ -1,2 +1,3 @@
 obj-y += ats.o
 obj-y += iommu.o
+obj-$(CONFIG_HVM) += io.o
xen/drivers/passthrough/x86/io.c renamed from xen/drivers/passthrough/io.c +0 -0
similarity index 100%
rename from xen/drivers/passthrough/io.c
rename to xen/drivers/passthrough/x86/io.c
Signature · 7 lines
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw

PATCH 3/4 x86/passthrough: put the x86 folder under x86 maintainership

In reply to Roger Pau Monne

passthrough/x86 is tied to the x86 code, and as such put it under x86 maintainership.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index e99d39eb47..a40fa61eb2 100644
@@ -257,6 +257,7 @@ F:	xen/drivers/passthrough/
 X:	xen/drivers/passthrough/amd/
 X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
+X:	xen/drivers/passthrough/x86/
 X:	xen/drivers/passthrough/device_tree.c
 F:	xen/include/xen/iommu.h
 
@@ -445,6 +446,7 @@ R:	Roger Pau Monné <[email protected]>
 S:	Supported
 L:	[email protected]
 F:	xen/arch/x86/
+F:	xen/drivers/passthrough/x86/
 F:	xen/include/asm-x86/
 F:	xen/include/public/arch-x86/
 F:	tools/firmware/hvmloader/
Signature · 7 lines
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#11 lore raw

PATCH 4/4 pci: add a pci section to the maintainers file

In reply to Roger Pau Monne

And add myself as reviewer.

---
Cc: Andrew Cooper <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Wei Liu <[email protected]>

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
index a40fa61eb2..8326f55a31 100644
@@ -259,6 +259,7 @@ X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
 X:	xen/drivers/passthrough/x86/
 X:	xen/drivers/passthrough/device_tree.c
+X:	xen/drivers/passthrough/pci.c
 F:	xen/include/xen/iommu.h
 
 KCONFIG
@@ -312,6 +313,14 @@ M:	Wei Liu <[email protected]>
 S:	Supported
 T:	git https://xenbits.xenproject.org/git-http/ovmf.git
 
+PCI
+M:	Jan Beulich <[email protected]>
+R:	Roger Pau Monné <[email protected]>
+S:	Supported
+F:	xen/drivers/passthrough/pci.c
+F:	xen/drivers/pci/
+F:	xen/include/xen/pci*
+
 POWER MANAGEMENT
 M:	Jan Beulich <[email protected]>
 S:	Supported
Signature · 7 lines
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] maintainers: always use hard tabs

In reply to Roger Pau Monne
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

As that seems to be the prevailing style.

Thanks for doing this; I too have been meaning to.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

Re: [PATCH 2/4] x86/passthrough: move io.c to the x86 subfolder

In reply to Roger Pau Monne
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

It makes no sense for io.c to be on the top level passthrough directory, since it's x86 specific.

I'm not sure it really is. It's largely about interrupt arrangements for guests, which (being PCI-related) may or may not be re- usable by Arm once they get to support PCI. I'd like to have an Arm maintainer's view on this before giving an ack here. And once moving it around, changing its name to something more suitable should also be considered.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw

Re: [PATCH 3/4] x86/passthrough: put the x86 folder under x86 maintainership

In reply to Roger Pau Monne
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

passthrough/x86 is tied to the x86 code, and as such put it under x86 maintainership.

It is tied to both, so at the very least I object to ...

MAINTAINERS F: xen/drivers/passthrough/ · line 260

Quoted 7 lines
MAINTAINERS +1 -0
@@ -257,6 +257,7 @@ F:	xen/drivers/passthrough/
 X:	xen/drivers/passthrough/amd/
 X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
+X:	xen/drivers/passthrough/x86/

... this; the Arm entry here is questionable too, imo.

MAINTAINERS R: Roger Pau Monné <[email protected]> · line 449

Quoted 5 lines
MAINTAINERS +1 -0
@@ -445,6 +446,7 @@ R:	Roger Pau Monné <[email protected]>
 S:	Supported
 L:	[email protected] 
 F:	xen/arch/x86/
+F:	xen/drivers/passthrough/x86/

This one's debatable.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#12 lore raw

Re: [PATCH 4/4] pci: add a pci section to the maintainers file

In reply to Roger Pau Monne

MAINTAINERS X: xen/drivers/passthrough/arm/ · line 262

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:
MAINTAINERS +1 -0
@@ -259,6 +259,7 @@ X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
 X:	xen/drivers/passthrough/x86/
 X:	xen/drivers/passthrough/device_tree.c
+X:	xen/drivers/passthrough/pci.c

Much like for patch 3, I'm not convinced this is appropriate.

MAINTAINERS M: Wei Liu <[email protected]> · line 322

Quoted 11 lines
MAINTAINERS +7 -0
@@ -312,6 +313,14 @@ M:	Wei Liu <[email protected]>
 S:	Supported
 T:	git https://xenbits.xenproject.org/git-http/ovmf.git 
 
+PCI
+M:	Jan Beulich <[email protected]>
+R:	Roger Pau Monné <[email protected]>
+S:	Supported
+F:	xen/drivers/passthrough/pci.c
+F:	xen/drivers/pci/
+F:	xen/include/xen/pci*

I'm fine with the last two, but I think truly IOMMU-independent code would better be moved from the file named first to a file in the directory named second.

The whole situation arises from the origin of this code, which back then was needed solely for the purposes of IOMMU management.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw

Re: [PATCH 2/4] x86/passthrough: move io.c to the x86 subfolder

In reply to Jan Beulich
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

It makes no sense for io.c to be on the top level passthrough directory, since it's x86 specific.

I'm not sure it really is. It's largely about interrupt arrangements for guests, which (being PCI-related) may or may not be re- usable by Arm once they get to support PCI.

The file makes heavy usage of x86 only constructs, like hvm_pirq_dpci, hvm_irq_dpci and a lot of x86 specific HVM functions.

This could indeed be used by ARM in the future if such functions and structures are implemented on ARM, but it would certainly require a non-trivial amount of changes to this file and other code.

As it stands now this code is x86 specific, and as such it makes more sense IMO to reside in the x86 sub-folder.

I agree it makes sense to rename, maybe x86/irq.c or x86/interrupt.c?

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw

Re: [PATCH 3/4] x86/passthrough: put the x86 folder under x86 maintainership

In reply to Jan Beulich
Quoted 16 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

passthrough/x86 is tied to the x86 code, and as such put it under x86 maintainership.

It is tied to both, so at the very least I object to ...

MAINTAINERS F: xen/drivers/passthrough/ · line 260

Quoted 7 lines
MAINTAINERS +1 -0
@@ -257,6 +257,7 @@ F:	xen/drivers/passthrough/
 X:	xen/drivers/passthrough/amd/
 X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
+X:	xen/drivers/passthrough/x86/

... this; the Arm entry here is questionable too, imo.

Quoted 7 lines

MAINTAINERS R: Roger Pau Monné <[email protected]> · line 449

Quoted 5 lines
MAINTAINERS +1 -0
@@ -445,6 +446,7 @@ R:	Roger Pau Monné <[email protected]>
 S:	Supported
 L:	[email protected] 
 F:	xen/arch/x86/
+F:	xen/drivers/passthrough/x86/

This one's debatable.

So you would agree to adding xen/drivers/passthrough/x86/ under x86 maintainership as long as it's also left under the generic IOMMU support entry?

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#13 lore raw

Re: [PATCH 4/4] pci: add a pci section to the maintainers file

In reply to Jan Beulich
Quoted 15 lines · Jan Beulich

MAINTAINERS X: xen/drivers/passthrough/arm/ · line 262

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:
MAINTAINERS +1 -0
@@ -259,6 +259,7 @@ X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
 X:	xen/drivers/passthrough/x86/
 X:	xen/drivers/passthrough/device_tree.c
+X:	xen/drivers/passthrough/pci.c

Much like for patch 3, I'm not convinced this is appropriate.

Quoted 4 lines
MAINTAINERS +0 -0
@@ -312,6 +313,14 @@ M:	Wei Liu <[email protected]>
 S:	Supported
 T:	git https://xenbits.xenproject.org/git-http/ovmf.git 
 
Quoted 11 lines

MAINTAINERS M: Wei Liu <[email protected]> · line 322

Quoted 7 lines
MAINTAINERS +7 -0
+PCI
+M:	Jan Beulich <[email protected]>
+R:	Roger Pau Monné <[email protected]>
+S:	Supported
+F:	xen/drivers/passthrough/pci.c
+F:	xen/drivers/pci/
+F:	xen/include/xen/pci*

I'm fine with the last two, but I think truly IOMMU-independent code would better be moved from the file named first to a file in the directory named second.

Let me see if I can find a way to do such movement, I'm not sure how entangled the code is.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

Re: [PATCH 2/4] x86/passthrough: move io.c to the x86 subfolder

In reply to Roger Pau Monné
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 07.01.19 at 13:11, <[email protected]> wrote:
Quoted 7 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

It makes no sense for io.c to be on the top level passthrough directory, since it's x86 specific.

I'm not sure it really is. It's largely about interrupt arrangements for guests, which (being PCI-related) may or may not be re- usable by Arm once they get to support PCI.

The file makes heavy usage of x86 only constructs, like hvm_pirq_dpci, hvm_irq_dpci and a lot of x86 specific HVM functions.

Quoted 6 lines

This could indeed be used by ARM in the future if such functions and structures are implemented on ARM, but it would certainly require a non-trivial amount of changes to this file and other code.

As it stands now this code is x86 specific, and as such it makes more sense IMO to reside in the x86 sub-folder.

Well, as said - I'd like to hear an Arm side opinion first.

Quoted 1 line

I agree it makes sense to rename, maybe x86/irq.c or x86/interrupt.c?

I have a slight preference for the former.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#10 lore raw

Re: [PATCH 3/4] x86/passthrough: put the x86 folder under x86 maintainership

In reply to Roger Pau Monné
Quoted 26 lines
Quoted 1 line
Quoted 1 line · On 07.01.19 at 13:14, <[email protected]> wrote:
Quoted 16 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 04.01.19 at 11:33, <[email protected]> wrote:

passthrough/x86 is tied to the x86 code, and as such put it under x86 maintainership.

It is tied to both, so at the very least I object to ...

MAINTAINERS F: xen/drivers/passthrough/ · line 260

Quoted 7 lines
MAINTAINERS +1 -0
@@ -257,6 +257,7 @@ F:	xen/drivers/passthrough/
 X:	xen/drivers/passthrough/amd/
 X:	xen/drivers/passthrough/arm/
 X:	xen/drivers/passthrough/vtd/
+X:	xen/drivers/passthrough/x86/

... this; the Arm entry here is questionable too, imo.

Quoted 7 lines

MAINTAINERS R: Roger Pau Monné <[email protected]> · line 449

Quoted 5 lines
MAINTAINERS +1 -0
@@ -445,6 +446,7 @@ R:	Roger Pau Monné <[email protected]>
 S:	Supported
 L:	[email protected] 
 F:	xen/arch/x86/
+F:	xen/drivers/passthrough/x86/

This one's debatable.

Quoted 3 lines

So you would agree to adding xen/drivers/passthrough/x86/ under x86 maintainership as long as it's also left under the generic IOMMU support entry?

"Agree" goes to far; I think this is worth considering. I'm also not opposed to leaving things as they are.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel