Skip to contentSkip to conversation

dom0 linux: Reserve device for guest with device path

PATCH In review Yuji Shimada 2 participants 4 messages Dec 25, 2008 – Jan 5, 2009

lore
Share & tools
lore
#0 lore raw

cover dom0 linux: Reserve device for guest with device path

This series of patches add the function to dom0 linux to reserve PCI device for guest domain with device path. Following is example of device path.

        PNP0A03:100-1c.1-00.0

Currently if we assign PCI device to guest domain, we have to specify PCI device with "pciback.hide=" boot parameter. If PCI device has small memory resource and BIOS does not assign page-aligned memory resource, we have to specify PCI device with "reassigndev=" boot parameter also.

"pciback.hide=" and "reassigndev=" use SBDF(Segment#, Bus#, Device#, Function#). Segment# and Bus# can be changed at boot time. So they are not suitable for specifying PCI device at boot time.

My patches integrate "pciback.hide=" and "reassigndev=" into one "guestdev=" boot parameter. So we have to specify only one boot parameter. The format of device path is following.

        <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]

Device path is not changed at boot time. So it is suitable for specifying PCI device at boot time.

My patches add "reassign_resources" boot parameter too. If reassignment is needed, please set it.

Following is example of dom0 linux's boot parameter.

        reassign_resources guestdev=PNP0A03:100-1c.1-00.0,PNP0A03:100-1d.7

The series consists of following patches.

1. Expose HID,UID,SEG,BBN of PCI root bridge via sysfs.
2. Add "guestdev=" boot parameter.
3. Bind PCI back driver to PCI device specified by "guestdev=".
4. Cleanup function name relating resource reassignment.

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada.

#1 lore raw

Please find attached a example script to convert SBDF to device path.

The script can be executed as follows.

# chmod 755 device_path.py
# device_path.py 07:00.0
PNP0A03:100-1c.1-00.0

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada

Quoted 52 lines · On Thu, 25 Dec 2008 16:08:01 +0900 Yuji Shimada <[email protected]>…

This series of patches add the function to dom0 linux to reserve PCI device for guest domain with device path. Following is example of device path.

        PNP0A03:100-1c.1-00.0

Currently if we assign PCI device to guest domain, we have to specify PCI device with "pciback.hide=" boot parameter. If PCI device has small memory resource and BIOS does not assign page-aligned memory resource, we have to specify PCI device with "reassigndev=" boot parameter also.

"pciback.hide=" and "reassigndev=" use SBDF(Segment#, Bus#, Device#, Function#). Segment# and Bus# can be changed at boot time. So they are not suitable for specifying PCI device at boot time.

My patches integrate "pciback.hide=" and "reassigndev=" into one "guestdev=" boot parameter. So we have to specify only one boot parameter. The format of device path is following.

        <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]

Device path is not changed at boot time. So it is suitable for specifying PCI device at boot time.

My patches add "reassign_resources" boot parameter too. If reassignment is needed, please set it.

Following is example of dom0 linux's boot parameter.

        reassign_resources guestdev=PNP0A03:100-1c.1-00.0,PNP0A03:100-1d.7

The series consists of following patches.

1. Expose HID,UID,SEG,BBN of PCI root bridge via sysfs.
2. Add "guestdev=" boot parameter.
3. Bind PCI back driver to PCI device specified by "guestdev=".
4. Cleanup function name relating resource reassignment.

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada.

Quoted 4 lines

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

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

#2 lore raw
Quoted 7 lines · Yuji Shimada

Please find attached a example script to convert SBDF to device path.

The script can be executed as follows.

# chmod 755 device_path.py
# device_path.py 07:00.0
PNP0A03:100-1c.1-00.0

When I run this script it fails because /sys/firmware/acpi/namespace/ is missing, I have checked kernel options and I cannot see why it is not here, do you have any suggestion as to what I need to enable?

I am using 2.6.27.

andy

Quoted 73 lines

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada

Quoted 52 lines · On Thu, 25 Dec 2008 16:08:01 +0900 Yuji Shimada <[email protected]>…

This series of patches add the function to dom0 linux to reserve PCI device for guest domain with device path. Following is example of device path.

        PNP0A03:100-1c.1-00.0

Currently if we assign PCI device to guest domain, we have to specify PCI device with "pciback.hide=" boot parameter. If PCI device has small memory resource and BIOS does not assign page-aligned memory resource, we have to specify PCI device with "reassigndev=" boot parameter also.

"pciback.hide=" and "reassigndev=" use SBDF(Segment#, Bus#, Device#, Function#). Segment# and Bus# can be changed at boot time. So they are not suitable for specifying PCI device at boot time.

My patches integrate "pciback.hide=" and "reassigndev=" into one "guestdev=" boot parameter. So we have to specify only one boot parameter. The format of device path is following.

        <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]

Device path is not changed at boot time. So it is suitable for specifying PCI device at boot time.

My patches add "reassign_resources" boot parameter too. If reassignment is needed, please set it.

Following is example of dom0 linux's boot parameter.

        reassign_resources guestdev=PNP0A03:100-1c.1-00.0,PNP0A03:100-1d.7

The series consists of following patches.

1. Expose HID,UID,SEG,BBN of PCI root bridge via sysfs.
2. Add "guestdev=" boot parameter.
3. Bind PCI back driver to PCI device specified by "guestdev=".
4. Cleanup function name relating resource reassignment.

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada.

Quoted 4 lines

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

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

#3 lore raw
Quoted 6 lines · On Fri, 26 Dec 2008 17:33:20 +0000 "Andrew Lyon" <[email protected]> wrote:
Quoted 4 lines · Yuji Shimada

Please find attached a example script to convert SBDF to device path.

The script can be executed as follows.

Quoted 7 lines
Quoted 3 lines
# chmod 755 device_path.py
# device_path.py 07:00.0
PNP0A03:100-1c.1-00.0

When I run this script it fails because /sys/firmware/acpi/namespace/ is missing, I have checked kernel options and I cannot see why it is not here, do you have any suggestion as to what I need to enable?

device_path.py depends on the following patch, and it is for linux-2.6.18-xen.hg.

[PATCH 1/4] dom0 linux: Expose HID, UID, SEG, BBN of PCI root bridge via sysfs.

Please download the source code from linux-2.6.18-xen.hg, and apply the patch to the code. Then build and install normally, and execute device_path.py on dom0 linux.

Quoted 1 line

I am using 2.6.27.

ACPI driver is changed from 2.6.18, and the directory where PCI root bridge resides is changed.

    2.6.18:
        /sys/firmware/acpi/namespace/ACPI/_SB

    2.6.27:
        /sys/bus/acpi/devices

I don't think it is difficult to create the patches for linux-2.6.27-xen.hg. It is easy to make device_path.py support two versions of dom0 linux.

Thanks,
--
Yuji Shimada

Quoted 80 lines

andy

Quoted 63 lines

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada

Quoted 52 lines · On Thu, 25 Dec 2008 16:08:01 +0900 Yuji Shimada <[email protected]>…

This series of patches add the function to dom0 linux to reserve PCI device for guest domain with device path. Following is example of device path.

        PNP0A03:100-1c.1-00.0

Currently if we assign PCI device to guest domain, we have to specify PCI device with "pciback.hide=" boot parameter. If PCI device has small memory resource and BIOS does not assign page-aligned memory resource, we have to specify PCI device with "reassigndev=" boot parameter also.

"pciback.hide=" and "reassigndev=" use SBDF(Segment#, Bus#, Device#, Function#). Segment# and Bus# can be changed at boot time. So they are not suitable for specifying PCI device at boot time.

My patches integrate "pciback.hide=" and "reassigndev=" into one "guestdev=" boot parameter. So we have to specify only one boot parameter. The format of device path is following.

        <hid>[:<uid>]-<dev>.<func>[-<dev>.<func>[...]]

Device path is not changed at boot time. So it is suitable for specifying PCI device at boot time.

My patches add "reassign_resources" boot parameter too. If reassignment is needed, please set it.

Following is example of dom0 linux's boot parameter.

        reassign_resources guestdev=PNP0A03:100-1c.1-00.0,PNP0A03:100-1d.7

The series consists of following patches.

1. Expose HID,UID,SEG,BBN of PCI root bridge via sysfs.
2. Add "guestdev=" boot parameter.
3. Bind PCI back driver to PCI device specified by "guestdev=".
4. Cleanup function name relating resource reassignment.

I will take a vacation from 27 Dec. to 4 Jan. I will not be able to respond to a mail.

Thanks,
--
Yuji Shimada.

Quoted 10 lines
Quoted 4 lines

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

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

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