All of lore.kernel.org
 help / color / mirror / Atom feed
* PCI support check in pcibios_init()
@ 2016-03-23 10:34 Adrian-Ken Rueegsegger
  2016-03-23 10:34 ` [RFC PATCH] x86/PCI: Refine " Adrian-Ken Rueegsegger
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian-Ken Rueegsegger @ 2016-03-23 10:34 UTC (permalink / raw)
  To: linux-pci; +Cc: ken

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

[1] - https://muen.codelabs.ch/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RFC PATCH] x86/PCI: Refine PCI support check in pcibios_init()
  2016-03-23 10:34 PCI support check in pcibios_init() Adrian-Ken Rueegsegger
@ 2016-03-23 10:34 ` Adrian-Ken Rueegsegger
  2016-04-12  4:47   ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian-Ken Rueegsegger @ 2016-03-23 10:34 UTC (permalink / raw)
  To: linux-pci; +Cc: ken

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.

Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
---
 arch/x86/pci/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 8fd6f44..50b123d 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -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;
 	}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] x86/PCI: Refine PCI support check in pcibios_init()
  2016-03-23 10:34 ` [RFC PATCH] x86/PCI: Refine " Adrian-Ken Rueegsegger
@ 2016-04-12  4:47   ` Bjorn Helgaas
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2016-04-12  4:47 UTC (permalink / raw)
  To: Adrian-Ken Rueegsegger; +Cc: linux-pci

On Wed, Mar 23, 2016 at 11:34:29AM +0100, Adrian-Ken Rueegsegger wrote:
> 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.
> 
> Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>

Applied to pci/enumeration for v4.7, thanks!

> ---
>  arch/x86/pci/common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
> index 8fd6f44..50b123d 100644
> --- a/arch/x86/pci/common.c
> +++ b/arch/x86/pci/common.c
> @@ -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;
>  	}
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-12  4:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 10:34 PCI support check in pcibios_init() Adrian-Ken Rueegsegger
2016-03-23 10:34 ` [RFC PATCH] x86/PCI: Refine " Adrian-Ken Rueegsegger
2016-04-12  4:47   ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.