Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CBQRI support for supervisor domains #39

Merged
merged 6 commits into from
Mar 21, 2024
Merged

Conversation

ved-rivos
Copy link
Collaborator

No description provided.

chapter9.adoc Outdated
{bits: 4, name: 'SRL'},
{bits: 4, name: 'SML'},
{bits: 4, name: 'SQRID'},
{bits: 4, name: 'MQRID'},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is the reason to define dedicated fields for SQRID and MQRID that MQRID shall be automatically conveyed as soon as the hart switches into M-mode? In other word, MQRID is supposed to be tied to a fixed value (different from any SQRID), whereas SQRID is intended to be reprogrammed upon switching to a different SD? If so, a clarification would help.

The mttp register introduces SDIDs to differentiate SDs. There is no definition for an MDID while M-mode is active. It does not seem to be consistent to have different definitions (SQRID+MQRID vs SDID only).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is the reason to define dedicated fields for SQRID and MQRID that MQRID shall be automatically conveyed as soon as the hart switches into M-mode?

The QRID, RCID, and MCID are carried with each request made by the hart to the corresponding shared resource. The shared resource may be a cache, a memory, a TLB, execution resources within a core, power rails, etc. When execution is with M-mode privilege, the MQRID is conveyed with such requests.

If so, a clarification would help.

Will add.

The mttp register introduces SDIDs to differentiate SDs. There is no definition for an MDID while M-mode is active. It does not seem to be consistent to have different definitions (SQRID+MQRID vs SDID only).

That is intentional. The mttp register holds the root of the memory tracking table and the SDID is used to tag translations to more efficiently synchronize updates to the MTT with the hart execution. There is no MTT active for M-mode execution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The QRID, RCID, and MCID are carried with each request made by the hart to the corresponding shared resource. The shared resource may be a cache, a memory, a TLB, execution resources within a core, power rails, etc. When execution is with M-mode privilege, the MQRID is conveyed with such requests.

If so, a clarification would help.

Will add.

Thanks!

The mttp register introduces SDIDs to differentiate SDs. There is no definition for an MDID while M-mode is active. It does not seem to be consistent to have different definitions (SQRID+MQRID vs SDID only).

That is intentional. The mttp register holds the root of the memory tracking table and the SDID is used to tag translations to more efficiently synchronize updates to the MTT with the hart execution. There is no MTT active for M-mode execution.

SDs can be run in bare mode without active MTT....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDs can be run in bare mode without active MTT....

When executing in a SD, MTT is always active and there is no way to disable it. However, the memory protection provided by MTT may be effectively disabled by setting the Mode to Bare - a Bare MTT is still an MTT. To draw an analogue, when V=1 (execution in a virtual machine), two-stage address translation is always in effect though either of the stages can be effectively disabled by setting the mode to Bare.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included this note:

The MQRID is typically selected once at startup by the RDSM to designate the
QRI utilized by the RDSM itself. Conversely, the SQRID may be updated during
the process of switching SDs, to denote the QRI allocated to that specific SD by
the RDSM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ved-rivos : Thanks for adding the note. Looks good to me.

Regarding above ID discussion: the point I was trying to make: Smqosid introduces dedicated QRIDs for M-mode and non-M-mode in order to identify resource allocation configurations and monitor resource usage for any type of CPU transaction. The introduction of MQRID is justified by the fact that for suitable CBQRI support shared resource/capacity controllers need to differentiate M-Mode transactions from those originating from any supervisor domain. Given that MQRID is typically a value that is fixed at startup (see above), the MQRID does not convey more information than the transaction privilege level itself. In other words: conveying MQIRD is equivalent to conveying M-mode privilege level.
On the other hand, SmMTT does not define an M-mode ID (as opposed to SDID) to tag M-mode transactions. The latter does not imply any need for applying MTT checks in M-mode, it only indicates that SmMTT does not consider M-mode transactions for the scope of supervisor domains. But with CBQRI, a distinction SQRID vs MQRID is introduced. Maybe there is some subtlety that I have missed so far.

Copy link
Collaborator Author

@ved-rivos ved-rivos Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the QRID, RCID, and MCID are intended to be carried with the request, the SDID is not an ID that is intended to be carried with requests. It is also a hart local ID used to identify the SD executing on a hart and not required to be globally unique across all SDs i.e. it does not flow on the bus.

chapter9.adoc Outdated Show resolved Hide resolved
chapter9.adoc Show resolved Hide resolved
Copy link
Collaborator

@rsahita rsahita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple comments

@rsahita
Copy link
Collaborator

rsahita commented Mar 18, 2024

@eckhard-delfs-qualcomm are you ok with the updates?

@rsahita rsahita merged commit 44e9138 into riscv:main Mar 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants