microsoft / mu_basecore

Project Mu BaseCore
https://microsoft.github.io/mu/
Other
242 stars 124 forks source link

MdeModulePkg/PciHostBridgeDxe: Add readback after final Cfg-Write. [Rebase & FF] #988

Closed apop5 closed 3 months ago

apop5 commented 3 months ago

Description

On AARCH64, there is no ordering guarantee between configuration space (ECAM) writes and memory space reads (MMIO). ARM AMBA CHI only guarantees ordering for reads and writes within a single address region, however, on some systems MMIO and ECAM may be split into separateaddress regions.

A problem may arise when an ECAM write is issued a completion before a subsequent MMIO read is issued and receives a completion.

For example, a typical PCI software flow is the following:

  1. ECAM write to device command register to enable memory space
  2. MMIO read from device memory space for which access was enabled in step 1.

There is no guarantee that step 2. will not begin before the completion of step 1. on systems where ECAM/MMIO are specified as separate address regions, even if both spaces have the memory attributes device-nGnRnE.

Cherry-Pick the following commits:

df867f63aa

How This Was Tested

Tested on a AARCH64 platform.

Integration Instructions

N/A

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (release/202405@9ef7a3e). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/202405 #988 +/- ## ================================================= Coverage ? 0.12% ================================================= Files ? 628 Lines ? 218219 Branches ? 326 ================================================= Hits ? 268 Misses ? 217829 Partials ? 122 ``` | [Flag](https://app.codecov.io/gh/microsoft/mu_basecore/pull/988/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | Coverage Δ | | |---|---|---| | [MdeModulePkg](https://app.codecov.io/gh/microsoft/mu_basecore/pull/988/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft) | `0.12% <ø> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=microsoft#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.