• Yuji Shimada's avatar
    PCI: allow assignment of memory resources with a specified alignment · 32a9a682
    Yuji Shimada authored
    This patch allows memory resources to be assigned with a specified
    alignment at boot-time or run-time. The patch is useful when we use PCI
    pass-through, because page-aligned memory resources are required to
    securely share PCI resources with guest drivers.
    
    If you want to assign the resource at boot time, please set
    "pci=resource_alignment=" boot parameter.
    
    This is format of "pci=resource_alignment=" boot parameter:
    
            [<order of align>@][<domain>:]<bus>:<slot>.<func>[; ...]
                    Specifies alignment and device to reassign
                    aligned memory resources.
                    If <order of align> is not specified, PAGE_SIZE is
                    used as alignment.
                    PCI-PCI bridge can be specified, if resource
                    windows need to be expanded.
    
    This is example:
    
            pci=resource_alignment=20@07:00.0;18@0f:00.0;00:1d.7
    
    If you want to assign the resource at run-time, please set
    "/sys/bus/pci/resource_alignment" file, and hot-remove the device and
    hot-add the device.  For this purpose, fakephp or PCI hotplug interfaces
    can be used.
    
    The format of "/sys/bus/pci/resource_alignment" file is the same with
    boot parameter. You can use "," instead of ";".
    
    For example:
    
            # cd /sys/bus/pci
            # echo -n 20@12:00.0 > resource_alignment
            # echo 1 > devices/0000:12:00.0/remove
            # echo 1 > rescan
    Reviewed-by: default avatarAlex Chiang <achiang@hp.com>
    Reviewed-by: default avatarYu Zhao <yu.zhao@intel.com>
    Signed-off-by: default avatarYuji Shimada <shimada-yxb@necst.nec.co.jp>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    32a9a682
setup-res.c 7.29 KB