[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 0/2] x86/pci: MMCFG improvements and always use it if available



Le 07/01/2026 à 18:25, Roger Pau Monné a écrit :
> On Wed, Jan 07, 2026 at 04:54:55PM +0000, Teddy Astie wrote:
>> Currently, Xen uses legacy method to access the configuration space unless 
>> the
>> access cannot be made with it, where Xen fallbacks to MMCFG. This is not 
>> really
>> great, as MMCFG is more flexible and doesn't require a dedicated lock, so it 
>> would
>> be preferable to use it whenever possible.
>>
>> Teddy Astie (2):
>>    x86/pci: Improve pci_mmcfg_{read,write} error handling
>>    x86/pci: Prefer using mmcfg for accessing configuration space
>
> AFAICT Linux is using the same approach as Xen to perform PCI
> accesses.  Registers below 256 on segment 0 are accessed using the
> legacy method (IO ports), while the extended space is accessed using
> MMCFG.  Do you know the reason for this?  I fear there might be
> legacy devices/bridges (or root complexes?) where MMCFG is not
> working as expected?
>

There is apparently a errata on some K8 chipset according to FreeBSD
code that uses MMCFG whenever possible.

https://github.com/freebsd/freebsd-src/blob/main/sys/amd64/pci/pci_cfgreg.c#L261-L277

> I think we need to understand why Xen (and Linux) do it this way so it
> can be properly justified why it's safe to switch to a different
> approach.
>
> Thanks, Roger.
>



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.