Bug 210 - Intel: ISST Optimize PCI device mapping
Summary: Intel: ISST Optimize PCI device mapping
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: ARM (show other bugs) ARM
Version: unspecified
Hardware: x86_64 Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: baolinwang
QA Contact: shuming
URL:
Whiteboard:
Keywords: FeatureBackport
Depends on:
Blocks:
 
Reported: 2021-12-28 09:08 UTC by jiayingbao
Modified: 2022-04-15 14:55 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jiayingbao intel_group 2021-12-28 09:08:29 UTC
backport 2 patch from upstreamk kernel to fix pci device mapping issue:

There is a problem in mapping CPU to a PCI device instance when the
bus numbers are reused in different packages. This was observed on
some Sapphire Rapids systems.

The current implementation reads bus number assigned to a CPU package
via MSR 0x128. This allows to establish relationship between a CPU
and a PCI device. This allows to update power related parameters to a
MMIO offset in a PCI device space which is unique to a CPU. But if
two packages uses same bus number then this mapping will not be unique.

When bus number is reused, PCI device will use different domain number
or segment number. So we need to be aware of this domain information
while matching CPU to PCI bus number. This domain information is not
available via any MSR. So need to use ACPI numa node information.

There is an interface already available in the Linux to read numa
node for a CPU and a PCI device. This change uses this interface
to check the numa node of a match PCI device with bus number.
If the bus number and numa node matches with the CPU's assigned
bus number and numa node, the matched PCI device instance will be
returned to the caller.

It is possible that before Sapphire Rapids, the numa node is not
defined for the Speed Select PCI device in some OEM systems. In this
case to restore old behavior, return the last matched PCI device
for domain 0 unlsess there are more than one matches.

commit:
1e42de8e53d32bbd7a732df49d872a30b4f888b4  aa2ddd24257213bdfd2f65058531810ac57455dc
Comment 1 jiayingbao intel_group 2022-01-04 14:05:57 UTC
patch merged 
https://gitee.com/anolis/cloud-kernel/pulls/65