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

A question of msdcfg.SDICN #116

Open
ZeyueShen opened this issue Dec 5, 2024 · 8 comments
Open

A question of msdcfg.SDICN #116

ZeyueShen opened this issue Dec 5, 2024 · 8 comments

Comments

@ZeyueShen
Copy link

When mmpt.Mode=Bare, according to smmtt spec, mmpt.sdid must be set to 0, which indicates that the current space is not in any supervisor domain. In this case, set msdcfg.SDICN to 0 or a valid number or an invalid number. Will it affect imsic and aplic (hart associated) address access? (Will an exception be reported when msdcfg.SDICN is set to invalid numbe or 0)?

@rsahita
Copy link
Collaborator

rsahita commented Dec 7, 2024

hi @ZeyueShen - these are orthogonal (not interdependent) aspects - MPT can be in bare mode, while the RDSM may specify the SDICN as required.

The rules based on how SDICN is programmed (0, !impl controller OR impl controller) are specified on page 39 of the spec. See text starting with "When SDICN is not the number of an implemented interrupt controller, or is zero then the following rules apply to all privilege modes:"

@ZeyueShen
Copy link
Author

hi @rsahita - Thanks for your reply. According to your explanation, I understand that the choice of SDICN has nothing to do with whether mmpt.Mode is equal to 0.

But I have one more question: msdcfg is used to configure the current supervisor domain. When mmpt.Mode=Bare, mmpt.sdid=0, and supervisor domain in this case is meaningless (because mmpt.Mode=Bare). In this case, the configuration of SDICN is used to configure mmpt.sdid=0. Is this understanding correct? Or maybe my expression is not quite correct, I just want to know whether mmpt.sdid and SDICN are related?

@rock-ifly
Copy link

rock-ifly commented Dec 19, 2024

If Smsdia extension is implemented, then msdcfg.SDICN is non-zero at reset and holds the number of
an implemented supervisor domain interrupt controller.

P39 @ V0.2.0

@rsahita
Copy link
Collaborator

rsahita commented Feb 7, 2025

thanks @rock-ifly and sorry for the delay @ZeyueShen - hope @rock-ifly's response clarified your question.

@Baixyzz
Copy link

Baixyzz commented Feb 14, 2025

@rsahita About this issue,I also have some confusion.
You says:

these are orthogonal (not interdependent) aspects - MPT can be in bare mode, while the RDSM may specify the SDICN as required.

When mmpt.Mode=Bare, according to smmtt spec, mmpt.sdid must be set to 0, which indicates that the current space is a single supervisor domain.When there is only one supervisor domain, there is also only one interrupt controller. So what is the meaning of RDSM specifying the SDICN? ​​In other words, what problems will occur if SDICN is not allowed to be configured?

@SiFiveHolland
Copy link
Collaborator

mmpt.sdid must be set to 0, which indicates that the current space is a single supervisor domain.

This statement is incorrect. SDIDMAX=0 is a valid configuration, meaning all supervisor domains must use SDID 0. This does not limit the number of schedulable supervisor domains; it just means a fence will be required during every supervisor domain context switch. Even if the hardware supports multiple SDIDs, software is not required to use them.

When there is only one supervisor domain, there is also only one interrupt controller.

This is also incorrect. SDID is only relevant to the Smmpt extension. All it affects is the scope of MPT caching. You may notice that there are zero references to SDID in the Smsdia chapter. SDID and SDICN are completely unrelated.

@rock-ifly
Copy link

@rsahita @SiFiveHolland please help us to make it clear,

  1. When mmpt.Mode=Bare, according to smmtt spec, mmpt.sdid must be set to 0, which indicates that the current design has just only one supervisor domain with sdid=0.
    1.1) under this situation mmpt.Mode=Bare, the whole system works with sdid=0, but mpt Check deesn't check the PA since mode=bare.
    1.2) are there any modules works without considering SDID? or does it mean that all the PA must consider mpt with SDID=0?
    1.3) what does the default value of mmpt CSR?
    1.4) is there any chickenbit to close or open the mptcheck function?

  2. when mmpt.mode=Bare, the msdcfg.SDICN has a default vaule N when reset, and N is the ID of a implemented interrupt controller. The system may implement M interrtput controllers, N=1,2,...,M。
    2.1) the interrupt controller N works for sdid=0, and the RDSM can assgin the msdcfg.SDICN with any vaule between 0 and M ?
    2.2) the vaule of msdcfg.SDICN can NOT be changed under mmpt.mode=Bare
    2,3) If 2.1 is right, the RDSM assign msdcfg.SDICN=X(X!=N, 1<=X<=M), what does the interrupt controller X works for?

@gagachang
Copy link

I notice a sentence in page 38 (v0.2.0):

The Smsdia supports the connection of multiple interrupt controllers to a hart, allowing a supervisor
domain to be paired with one of these interrupt controllers.

I am not sure if the spec is intended to restrict only one interrupt controller per supervisor domain.

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

No branches or pull requests

6 participants