linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC on MCFG Table Support
@ 2018-04-17 16:18 Sinan Kaya
  2018-04-17 20:04 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Sinan Kaya @ 2018-04-17 16:18 UTC (permalink / raw)
  To: Linux PCI, linux-acpi@vger.kernel.org

Hi,

QDT is working with PCI-SIG to revisit some of the spec language ambiguity
on the definition of PCI Segment Group in PCI FW Specification. 

PCI spec is currently requiring a single entry per segment in the MCFG table
with a contiguous 256MB range. 

Based on our research, this rule is being violated in the industry for existing
platforms due to the different ways spec is interpreted.

We are trying to remove this restriction in the spec and have multiple entries
per segment as long as <segment, bus start number, bus end number> tuple is
unique. 

AFAIS, generic ACPI Linux driver already supports this via pci_mcfg_lookup(). 

I also did a prototype and observed that I can enumerate two root ports without
any issues. 

I wanted to seek opinion on whether this is a valid assumption and if I'm missing
something.

Sinan

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

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

* Re: RFC on MCFG Table Support
  2018-04-17 16:18 RFC on MCFG Table Support Sinan Kaya
@ 2018-04-17 20:04 ` Bjorn Helgaas
  2018-04-17 20:09   ` Sinan Kaya
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2018-04-17 20:04 UTC (permalink / raw)
  To: Sinan Kaya; +Cc: Linux PCI, linux-acpi@vger.kernel.org

On Tue, Apr 17, 2018 at 12:18:22PM -0400, Sinan Kaya wrote:
> Hi,
> 
> QDT is working with PCI-SIG to revisit some of the spec language
> ambiguity on the definition of PCI Segment Group in PCI FW
> Specification. 

I assume you're looking at the PCI Firmware Spec, r3.2, sec 4.1.2.  I
agree this could use some clarification.

> PCI spec is currently requiring a single entry per segment in the
> MCFG table with a contiguous 256MB range. 

I see the statement that "Multiple [MCFG] entries corresponding to a
single PCI Segment Group is (sic) not allowed."

Since the MCFG entry contains both the start and end bus number, I
assume it only describes a 256MB range if start == 0 and end == 255
(256 buses * 32 devices * 8 functions * 4K config space = 256MB).

If start > 0 or end < 255, I'd say the entry describes a range smaller
than 256MB, and it would be an error to use space outside that range.

But the existing language says you still only get one entry per
segment group.  It seems reasonable to me to relax that restriction.

> Based on our research, this rule is being violated in the industry
> for existing platforms due to the different ways spec is
> interpreted.
> 
> We are trying to remove this restriction in the spec and have
> multiple entries per segment as long as <segment, bus start number,
> bus end number> tuple is unique. 

I hope you mean the <start, end> tuples are more than just unique;
they shouldn't overlap, i.e., a given <segment, bus number> should
match at most one MCFG entry.

I think it is permissible for a <segment, bus number> to not be
described via MCFG at all for the case of hot-plugged host bridges
that use _CBA instead of MCFG.

> AFAIS, generic ACPI Linux driver already supports this via
> pci_mcfg_lookup(). 

Looks like it to me.  And if it doesn't, it sounds reasonable to fix
it so it does.

Of course, pci_mcfg_lookup() is currently only used by arm64.  I
didn't look at x86 or ia64, which also use MCFG, to see what they
would do with this.

Thanks for working on this!

Bjorn

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

* Re: RFC on MCFG Table Support
  2018-04-17 20:04 ` Bjorn Helgaas
@ 2018-04-17 20:09   ` Sinan Kaya
  0 siblings, 0 replies; 3+ messages in thread
From: Sinan Kaya @ 2018-04-17 20:09 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Linux PCI, linux-acpi@vger.kernel.org

On 4/17/2018 4:04 PM, Bjorn Helgaas wrote:
>> We are trying to remove this restriction in the spec and have
>> multiple entries per segment as long as <segment, bus start number,
>> bus end number> tuple is unique. 
> I hope you mean the <start, end> tuples are more than just unique;
> they shouldn't overlap, i.e., a given <segment, bus number> should
> match at most one MCFG entry.

Agreed, I'm talking about no overlap. 

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

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

end of thread, other threads:[~2018-04-17 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-17 16:18 RFC on MCFG Table Support Sinan Kaya
2018-04-17 20:04 ` Bjorn Helgaas
2018-04-17 20:09   ` Sinan Kaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).