diff options
| author | Kevin Loughlin <kevinloughlin@google.com> | 2026-10-21 18:34:24 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-10-26 23:45:42 +0300 |
| commit | dd87bafc40adb36d96e2bcc96ae1be464709db69 (patch) | |
| tree | 0a11f2c84aaef9a4f2bf0a5a14d565ed2af2e2b4 /MdePkg/Library/DynamicStackCookieEntryPointLib/UefiApplication | |
| parent | 01bd046e7b4bf3087821945a480c9ec90c6fb35a (diff) | |
| download | edk2-master.tar.xz | |
VisitingAPciInstance() currently reads the entire 64-byte PCI_TYPE00
configuration header (16 32-bit reads per device) on every invocation of
VisitAllPciInstances(). Under virtualization (especially confidential
computing guests such as SEV-SNP and TDX where each config-space access
triggers a #VC/#VE exit to the VMM), reading all 16 DWORDs per device
across multiple BDS passes adds significant unnecessary exit overhead:
1. SetPciIntLine() only inspects the 1-byte InterruptPin register
(PCI_INT_PIN_OFFSET, 0x3D). Convert SetPciIntLine() to a
PROTOCOL_INSTANCE_CALLBACK invoked via VisitAllInstancesOfProtocol()
that reads PCI_INT_PIN_OFFSET directly with a single 8-bit read,
eliminating 15 config-space reads per PCI device during
PciAcpiInitialization().
2. With SetPciIntLine() converted, all remaining VisitAllPciInstances()
callbacks (DetectAndPreparePlatformPciDevicePath() and
ConnectRecursivelyIfPciMassStorage()) only inspect fields within the
16-byte PCI_DEVICE_INDEPENDENT_REGION (Pci.Hdr). Update
VisitingAPciInstance() to read only sizeof (Pci.Hdr) / sizeof (UINT32)
(4 DWORDs instead of 16) while zeroing the remainder of PCI_TYPE00.
Signed-off-by: Kevin Loughlin <kevinloughlin@google.com>
Diffstat (limited to 'MdePkg/Library/DynamicStackCookieEntryPointLib/UefiApplication')
0 files changed, 0 insertions, 0 deletions
