PCI support check in pcibios_init()
Hi,
We are running Linux as a VM on top of the Muen Separation Kernel [1], where we only allow PCI config space access of pass-through devices via MMCONFIG. In this use case the PCI support check in pcibios_init() fails as raw_pci_ops is not set:
int __init pcibios_init(void)
{
if (!raw_pci_ops) {
printk(KERN_WARNING "PCI: System does not support PCI\n");
return 0;
}
...
}As a consequence device resources are not allocated since the following call to pcibios_resource_survey() is skipped. Extending the check to also consider raw_pci_ext_ops (see patch) leads to the proper resource allocation in our use case.
Is the described change the correct solution or is there a particular reason to only check raw_pci_ops in pcibios_init()?
Regards,
Adrian
RFC PATCH 1/1 x86/PCI: Refine PCI support check in pcibios_init()
Also consider raw_pci_ext_ops when validating if a system has PCI support. This leads to proper resource allocation via pcibios_resource_survey() in the case where PCI config space is exclusively accessed through MMCONFIG.
--- arch/x86/pci/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/pci/common.c +1 -1
@@ -517,7 +517,7 @@ void __init pcibios_set_cache_line_size(void)int __init pcibios_init (void ) { -if (!raw_pci_ops) { +if (!raw_pci_ops && !raw_pci_ext_ops) {printk (KERN_WARNING "PCI: System does not support PCI\n" );return 0 ; }
Signature · 1 line
2.1.4
Bjorn Helgaas
AppliedRe: [RFC PATCH] x86/PCI: Refine PCI support check in pcibios_init()
Quoted 6 lines · Adrian-Ken Rueegsegger
Also consider
raw_pci_ext_opswhen validating if a system has PCI support. This leads to proper resource allocation viapcibios_resource_survey()in the case where PCI config space is exclusively accessed through MMCONFIG.Signed-off-by Adrian-Ken Rueegsegger <[email protected]>
Applied to pci/enumeration for v4.7, thanks!
Quoted 24 lines
--- arch/x86/pci/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/pci/common.c +1
-1@@ -517,7 +517,7 @@ void __init pcibios_set_cache_line_size(void)int __init pcibios_init (void ) { -if (!raw_pci_ops) { +if (!raw_pci_ops && !raw_pci_ext_ops) {printk (KERN_WARNING "PCI: System does not support PCI\n" );return 0 ; }Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html