public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, jlotwo@gmail.com, Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [edk2-devel] [RFC] Ordering of Arm PCI ECAM and MMIO operations
Date: Wed, 1 Nov 2023 21:51:03 +0000	[thread overview]
Message-ID: <0102018b8cde55ad-1703490f-ed69-4b5a-81dc-9bf2a378d064-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <6575.1698869847229215662@groups.io>

On 01/11/2023 20:17, Joe L wrote:
> Thanks for the discussion,
> 
> Are we saying that DataSynchronizationBarrier () before the return 
> from RootBridgeIoPciAccess() is not strong enough to determine that 
> the final ECAM write would have completed? According to Learn the 
> architecture - ARMv8-A memory systems 
> <https://developer.arm.com/documentation/100941/0101/Barriers> the 
> DSB should block "execution of any further instructions, not just 
> loads or stores, until synchronization is complete". To me this means
> that for Arm the DSB will stall any subsequent instructions until the
> completion for the ECAM write is received by the processor.

I honestly can't tell from the wording there whether or not DSB would
guarantee that the configuration space write has completed all the way 
to the target PCIe device (as opposed to e.g. completing as far as the 
host bridge, or to an intermediate PCIe bridge).

I don't know the answer, and it feels like the kind of messy area where 
adding a barrier will definitely reduce the probability of the issue 
occurring but might not guarantee a fix, which is a bad situation to be 
left in.

> Though if an architecture-agnostic solution is desired the readback 
> before returning from RootBridgeIoPciAccess() does make sense.

Personally I like having an architecture-agnostic solution, and I'll be
updating the ECAM driver in iPXE to use the readback approach.

> If the access spanned multiple DWORDs then should a read from the 
> final aligned DWORD in the "buffer" be sufficient?

Quite possibly.  Given that PCIe configuration space accesses are never 
performance-critical, I'm not sure it's worth the optimisation, but I'll 
defer to the people who actually have to implement it in EDK2.

Thanks,

Michael


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110493): https://edk2.groups.io/g/devel/message/110493
Mute This Topic: https://groups.io/mt/102310377/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-11-01 21:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 23:24 [edk2-devel] [RFC] Ordering of Arm PCI ECAM and MMIO operations Joe L
2023-11-01  2:09 ` Pedro Falcato
2023-11-01  9:56   ` Ard Biesheuvel
2023-11-01 12:25     ` Michael Brown
2023-11-01 12:51       ` Ard Biesheuvel
2023-11-01 13:23         ` Michael Brown
2023-11-01 16:41           ` Ard Biesheuvel
2023-11-01 20:17             ` Joe L
2023-11-01 21:51               ` Michael Brown [this message]
2023-11-01 23:07                 ` Pedro Falcato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0102018b8cde55ad-1703490f-ed69-4b5a-81dc-9bf2a378d064-000000@eu-west-1.amazonses.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox