Clarify IOFENCE synchronization for I/O MPT Checker configuration updates - #300
Conversation
…ates Configuration changes are only guaranteed to be observed within a bounded but UNSPECIFIED time. Require software to issue IOFENCE after the updates and wait for successful completion before letting through any request that depends on them. Signed-off-by: Abhinav Agarwal <abhinavagarwal1996@gmail.com>
|
Bit of context on why I went with "must" here instead of leaving it at "may use". The bullet a few paragraphs up (chapter6.adoc L106-L110) already does this for MPT entries:
That said, chapter3.adoc L126-L128 says it "may be necessary" to execute
If you'd rather keep it consistent with the |
|
I do not think the MPTINVAL requirement is equivalent to this case. For an SDCL or supervisor-domain configuration update, the specification already requires the I/O MPT Checker to observe the update within a bounded but UNSPECIFIED time. An IOFENCE provides software with an architecturally identifiable synchronization point when one is required. Software may otherwise tolerate the transition period, or batch multiple configuration updates before issuing a single IOFENCE. The proposed wording adds a new requirement that software issue an IOFENCE before permitting a dependent request. The existing architecture does not require software to establish such a synchronization point merely because it modifies a configuration. In addition, “whose handling depends on them” is ambiguous, since every request matching the modified configuration could be said to depend on it. MPT entries are different. An implementation may retain cached MPT information until an applicable MPTINVAL is performed; there is no corresponding bounded-time guarantee for automatic observation of an MPT update. Consequently, MPTINVAL is required when software needs to synchronize an MPT update with the I/O MPT Checker. The statement that software “must use” MPTINVAL specifies the mechanism that must be used to invalidate previous cached copies and perform that synchronization. It does not require software to perform an MPTINVAL after every MPT update. The existing text already defines when software can rely on a configuration update: successful completion of an IOFENCE guarantees that all preceding configuration updates have been observed. It need not additionally require software to use that synchronization mechanism. |
|
Fair point on the distinction. That's the difference, and "whose handling depends on them" was doing too much work anyway. I'll drop it. One thing I'm still unsure about in the required sequence when
What makes the information from step 3 ineligible for step 5? The cache rule allows information valid since the most recent applicable The IOMMU guidelines invalidate after the update is globally visible, which is what made me look. I'm not assuming the mechanisms should match. If something does exclude it, I'm happy to repoint the PR at making that explicit, or just close it. My first instinct was to swap |
|
The correct sequence in this case is to issue the IOFENCE as step 2 and MPTINVAL at step 4. The IOFENCE at step 2 makes the root B visible to the MPT checker. Between step 2 and 4, the implementation may use information cached from either the new MPT or the old MPT. The MPTINVAL at step 4 then invalidates all cached translations and all subsequent translations will be always from root B. In this example, if the page P was denied with the intent to reclaim that page for some other use then software may need to issue a second IOFENCE after the MPTINVAL. That second IOFENCE guarantees that there are no read or writes in flight to the page P. If that second IOFENCE is omitted, then the following could occur a) software puts some data unrelated to SDID S in page P b) that data gets overwritten by a write that was already in flight - post MPT check - somewhere in the fabric or that data gets read by a read that was already in flight and exposes that data. |
|
Thanks, that helps. I'm trying to square it with the text, which says that on an Is the pre-fence one doing something different, like ordering software's stores to the new MPT against the checker's reads of it? |
Modifying a previously valid SDCL rule, or the supervisor domain configurations it references, is only guaranteed to be observed by the I/O MPT Checker within a bounded but UNSPECIFIED time.
IOFENCEalready provides the explicit observation guarantee, but the text only says software "may use" it, so nothing requires the fence before a request that depends on the new configuration is allowed through.This makes it a requirement. The
MPTINVALordering requirement is unchanged.