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

CVM Development #3980

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

CVM Development #3980

wants to merge 22 commits into from

Conversation

yxtx1994
Copy link

@yxtx1994 yxtx1994 commented Dec 4, 2024

  • Add bitmap module in MMU for memory isolation
  • Add memory encryption module based on AXI protoco
  • We can don't using these modules by setting the option HasCVMExtension&HasMEMencryption to false

yxtx1994 and others added 20 commits December 2, 2024 15:04
…|| ishptw)

[fix] the signal “toLLPTW” gen logic(s2xlate === noS2xlate || s2xlate === onlyStage1)
[fix] the handle flow of jmp_bitmap_check and s2xlate === onlyStage2 request in PTW
[feat] Add the option to implement the Memenc module in CVMconfig
…ption module

[feat] delete unnecessary parameters in Soc
[feat] Add lock logic for CSR MCVM.BME&BMA when BME is valid.
[feat] Add BCLARE bit in CSR MCVM used for clear bitmap cache
[fix] bitmap req merge logic of enq entry and after lookup cache entry
[feat] remove bitmapReg clear logic in PTWCache for *fence, add clear logic when refill l0&sp
[fix] latch and update more state when PTW get jmp_bitmap_check req
[fix] l0BitmapReg wakeup uses pte_index without OHToUInt
[fix] bmppn compare and need_addr_check logic in LLPTW
@Tang-Haojin Tang-Haojin marked this pull request as draft December 4, 2024 08:28
@good-circle good-circle marked this pull request as ready for review December 9, 2024 03:38
* See the Mulan PSL v2 for more details.
***************************************************************************************/

// See LICENSE.SiFive for license details.
Copy link
Member

Choose a reason for hiding this comment

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

What's this? Is this code derived from rocket-chip?

Copy link
Author

Choose a reason for hiding this comment

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

This code dose not derived from rocket-chip, just import some packages of rocket-chip.
I didn't know if I should add a license for this, so I left it for now.
If it is not needed, I will delete it.

Copy link
Member

Choose a reason for hiding this comment

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

import package does not need to add a license

* See the Mulan PSL v2 for more details.
***************************************************************************************/

// See LICENSE.SiFive for license details.
Copy link
Member

Choose a reason for hiding this comment

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

This as well.

Copy link
Author

Choose a reason for hiding this comment

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

Same response as the last conversation.

Comment on lines +554 to +555
val res_pmp = pmp_match_res(leaveHitMux, io.req.valid)(req.addr(PMPAddrBits-PMPKeyIDBits-1, 0), req.size, io.check_env.pmp, io.check_env.mode, lgMaxSize)
val res_pma = pma_match_res(leaveHitMux, io.req.valid)(req.addr(PMPAddrBits-PMPKeyIDBits-1, 0), req.size, io.check_env.pma, io.check_env.mode, lgMaxSize)
Copy link
Member

Choose a reason for hiding this comment

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

Is this behaviour correct when CVM is disabled?

Copy link
Author

Choose a reason for hiding this comment

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

When "HasCVMExtension = Some(true)", the actual physical address bit width change to "PAddrBits-KeyIDBits".
In this config, if CVM is disabled, the KeyID must be "0" and PMP/PMA only need to check actual physical address bit.
When "HasCVMExtension = Some(false)", KeyIDBits should be set to "0"(I will fix it in file SoC.scals).

Copy link
Member

Choose a reason for hiding this comment

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

I suggest adding some comments about what a KeyID is and what it does under the abovementioned circumstances.

Copy link
Author

Choose a reason for hiding this comment

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

I agree with your suggestion and I will add relevant comments in the next commit.

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