Skip to contentSkip to conversation

dom0 linux: support SBDF with "guestdev=" and remove "reassigndev="

PATCH In review Yuji Shimada 3 participants 5 messages Apr 8, 2009 – Apr 10, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dom0 linux: support SBDF with "guestdev=" and remove "reassigndev="

This patch supports SBDF with "guestdev=" boot parameter and removes "reassigndev=" boot parameter.

Currently there are three boot parameters which specifics PCI device for PCI pass-through.

pciback.hide=
guestdev=
reassigndev=

I'd like to simplify them before xen 3.4 is released. To achieve this, I'd like to make "guestdev=" boot parameter support SBDF, and remove "reassigndev=".

When we don't need to reassign resources and use device path, pciback.hide= boot parameter can be used. The parameter is also needed for backward compatibility.

    pciback.hide=(00:01.0)(00:02.0)

When we need to reassign resources or use device path, guestdev= boot parameter can be used. reassign_resources boot parameter is needed to reassign resources, too.

    guestdev=00:01.0,00:02.0 reassign_resources
    guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0
    guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0 reassign_resources

With this patch, Isaku-san will not need to add guestioemuldev boot parameter for IO space multiplexing, though it will be necessary to add a flag and omit func# from guestdev.

Thanks,
--
Yuji Shimada

Documentation/kernel-parameters.txt +3 -8
diff -r e5d3f2fa3428 Documentation/kernel-parameters.txt
@@ -576,8 +576,9 @@ running once the system is up.
 	gt96100eth=	[NET] MIPS GT96100 Advanced Communication Controller
 
 	guestdev=	[PCI,ACPI]
-			Format: <device path>[,<device path>[,...]]
-			Format of device path: <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]
+			Format: {<device path>|<sbdf>}][,{<device path>|<sbdf>}[,...]]
+			Format of device path: <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[,...]]
+			Format of sbdf: [<segment>:]<bus>:<dev>.<func>
 			Specifies PCI device for guest domain.
 			If PCI-PCI bridge is specified, all PCI devices
 			behind PCI-PCI bridge are reserved.
@@ -1364,12 +1365,6 @@ running once the system is up.
 			Run specified binary instead of /init from the ramdisk,
 			used for early userspace startup. See initrd.
 
-	reassigndev=	[PCI]
-			Format: [<segment>:]<bus>:<dev>.<func>[,[<segment>:]<bus>:<dev>.<func>[,...]]
-			Specifies device to reassign page-aligned memory
-			resources. PCI-PCI bridge can be specified, if
-			resource windows need to be expanded.
-
 	reassign_resources
 			[PCI,ACPI] Use guestdev parameter to reassign device's
 			resources.
drivers/pci/Makefile +0 -1
diff -r e5d3f2fa3428 drivers/pci/Makefile
@@ -4,7 +4,6 @@
 
 obj-y		+= access.o bus.o probe.o remove.o pci.o quirks.o \
 			pci-driver.o search.o pci-sysfs.o rom.o setup-res.o
-obj-$(CONFIG_PCI_REASSIGN) += reassigndev.o
 obj-$(CONFIG_PROC_FS) += proc.o
 obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
 
drivers/pci/guestdev.c +271 -154

673 lines not on this page · raw message

drivers/pci/pci.h +3 -1
diff -r e5d3f2fa3428 drivers/pci/pci.h
@@ -102,8 +102,10 @@ pci_match_one_device(const struct pci_de
 }
 
 #ifdef CONFIG_PCI_REASSIGN
+extern void pci_disable_bridge_window(struct pci_dev *dev);
+#endif
+#ifdef CONFIG_PCI_GUESTDEV
 extern int pci_is_reassigndev(struct pci_dev *dev);
-extern void pci_disable_bridge_window(struct pci_dev *dev);
 #else
 #define pci_is_reassigndev(dev) 0
 #endif
drivers/pci/reassigndev.c deleted +0 -87

87 lines not on this page · raw message

#1 lore raw
Quoted 3 lines · Yuji Shimada

With this patch, Isaku-san will not need to add guestioemuldev boot parameter for IO space multiplexing, though it will be necessary to add a flag and omit func# from guestdev.

Either this isn't against linux-2.6.18-xen tip or the patch is corrupted. Hardly any chunks applied with 'patch -p1'.

-- Keir

#2 lore raw
Quoted 8 lines · On Wed, 08 Apr 2009 10:17:13 +0100 Keir Fraser <[email protected]>…
Quoted 3 lines · Yuji Shimada

With this patch, Isaku-san will not need to add guestioemuldev boot parameter for IO space multiplexing, though it will be necessary to add a flag and omit func# from guestdev.

Either this isn't against linux-2.6.18-xen tip or the patch is corrupted. Hardly any chunks applied with 'patch -p1'.

In my environment, my patch applies to linux-2.6.18-xen(changeset:855).

Could you try to apply the attached file? The file is the output of 'hg' command and I tested that the file applies.

Thanks,
--
Yuji Shimada

This patch supports SBDF with "guestdev=" boot parameter and removes "reassigndev=" boot parameter.

Currently there are three boot parameters which specifics PCI device for PCI pass-through.

pciback.hide=
guestdev=
reassigndev=

I'd like to simplify them before xen 3.4 is released. To achieve this, I'd like to make "guestdev=" boot parameter support SBDF, and remove "reassigndev=".

When we don't need to reassign resources and use device path, pciback.hide= boot parameter can be used. The parameter is also needed for backward compatibility.

    pciback.hide=(00:01.0)(00:02.0)

When we need to reassign resources or use device path, guestdev= boot parameter can be used. reassign_resources boot parameter is needed to reassign resources, too.

    guestdev=00:01.0,00:02.0 reassign_resources
    guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0
    guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0 reassign_resources

With this patch, Isaku-san will not need to add guestioemuldev boot parameter for IO space multiplexing, though it will be necessary to add a flag and omit func# from guestdev.

Documentation/kernel-parameters.txt +3 -8
diff -r e5d3f2fa3428 Documentation/kernel-parameters.txt
@@ -576,8 +576,9 @@ running once the system is up.
 	gt96100eth=	[NET] MIPS GT96100 Advanced Communication Controller
 
 	guestdev=	[PCI,ACPI]
-			Format: <device path>[,<device path>[,...]]
-			Format of device path: <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]
+			Format: {<device path>|<sbdf>}][,{<device path>|<sbdf>}[,...]]
+			Format of device path: <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[,...]]
+			Format of sbdf: [<segment>:]<bus>:<dev>.<func>
 			Specifies PCI device for guest domain.
 			If PCI-PCI bridge is specified, all PCI devices
 			behind PCI-PCI bridge are reserved.
@@ -1364,12 +1365,6 @@ running once the system is up.
 			Run specified binary instead of /init from the ramdisk,
 			used for early userspace startup. See initrd.
 
-	reassigndev=	[PCI]
-			Format: [<segment>:]<bus>:<dev>.<func>[,[<segment>:]<bus>:<dev>.<func>[,...]]
-			Specifies device to reassign page-aligned memory
-			resources. PCI-PCI bridge can be specified, if
-			resource windows need to be expanded.
-
 	reassign_resources
 			[PCI,ACPI] Use guestdev parameter to reassign device's
 			resources.
drivers/pci/Makefile +0 -1
diff -r e5d3f2fa3428 drivers/pci/Makefile
@@ -4,7 +4,6 @@
 
 obj-y		+= access.o bus.o probe.o remove.o pci.o quirks.o \
 			pci-driver.o search.o pci-sysfs.o rom.o setup-res.o
-obj-$(CONFIG_PCI_REASSIGN) += reassigndev.o
 obj-$(CONFIG_PROC_FS) += proc.o
 obj-$(CONFIG_PCI_GUESTDEV) += guestdev.o
 
drivers/pci/guestdev.c +271 -154

673 lines not on this page · raw message

drivers/pci/pci.h +3 -1
diff -r e5d3f2fa3428 drivers/pci/pci.h
@@ -102,8 +102,10 @@ pci_match_one_device(const struct pci_de
 }
 
 #ifdef CONFIG_PCI_REASSIGN
+extern void pci_disable_bridge_window(struct pci_dev *dev);
+#endif
+#ifdef CONFIG_PCI_GUESTDEV
 extern int pci_is_reassigndev(struct pci_dev *dev);
-extern void pci_disable_bridge_window(struct pci_dev *dev);
 #else
 #define pci_is_reassigndev(dev) 0
 #endif
drivers/pci/reassigndev.c deleted +0 -87

87 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Re: [PATCH] dom0 linux: support SBDF with "guestdev=" andremove "reassigndev="

In reply to Yuji Shimada
Quoted 22 lines
Quoted 1 line
Quoted 1 line

Yuji Shimada <[email protected]> 08.04.09 10:30 >>>

This patch supports SBDF with "guestdev=" boot parameter and removes "reassigndev=" boot parameter.

Currently there are three boot parameters which specifics PCI device for PCI pass-through.

pciback.hide=
guestdev=
reassigndev=

I'd like to simplify them before xen 3.4 is released. To achieve this, I'd like to make "guestdev=" boot parameter support SBDF, and remove "reassigndev=".

When we don't need to reassign resources and use device path, pciback.hide= boot parameter can be used. The parameter is also needed for backward compatibility.

   pciback.hide=(00:01.0)(00:02.0)
Quoted 7 lines

When we need to reassign resources or use device path, guestdev= boot parameter can be used. reassign_resources boot parameter is needed to reassign resources, too.

   guestdev=00:01.0,00:02.0 reassign_resources
   guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0
   guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0 reassign_resources

Which basically means reassignment of resources will become and all-or- nothing feature rather than a per-device one - is that really intended? It seems like a step backwards to me.

Jan

#4 lore raw

Re: [PATCH] dom0 linux: support SBDF with "guestdev=" andremove "reassigndev="

Quoted 26 lines · On Thu, 09 Apr 2009 11:39:45 +0100 "Jan Beulich" <[email protected]> wrote:
Quoted 26 lines
Quoted 1 line
Quoted 1 line

Yuji Shimada <[email protected]> 08.04.09 10:30 >>>

This patch supports SBDF with "guestdev=" boot parameter and removes "reassigndev=" boot parameter.

Currently there are three boot parameters which specifics PCI device for PCI pass-through.

pciback.hide=
guestdev=
reassigndev=

I'd like to simplify them before xen 3.4 is released. To achieve this, I'd like to make "guestdev=" boot parameter support SBDF, and remove "reassigndev=".

When we don't need to reassign resources and use device path, pciback.hide= boot parameter can be used. The parameter is also needed for backward compatibility.

   pciback.hide=(00:01.0)(00:02.0)

When we need to reassign resources or use device path, guestdev= boot parameter can be used. reassign_resources boot parameter is needed to reassign resources, too.

Quoted 7 lines
Quoted 3 lines
   guestdev=00:01.0,00:02.0 reassign_resources
   guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0
   guestdev=PNP0A08:0-1.0,PNP0A08:0-2.0 reassign_resources

Which basically means reassignment of resources will become and all-or- nothing feature rather than a per-device one - is that really intended? It seems like a step backwards to me.

Reassignment of resources is all-or-nothing feature.
When reassign_resources is specified, all PCI devices specified by "guestdev=" are the targets of reassignment. Please note that PCI devices which are not specified by "guestdev=" are not the targets of reassignment.

To avoid fragmentation of resources, all-or-nothing is better than per-device. On the other hand, if there is a device which cause some issues on reassignment, per-device is needed. But I have not seen such a device yet.

Thanks,
--
Yuji Shimada