-
Notifications
You must be signed in to change notification settings - Fork 221
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
[PMP tests] Does 'sfence-vma' needed after write pmpcfg register ? #609
Comments
TLBs only need refreshing if changes have been made to page tables I would
think.
Your example doesn't update any page table entries, and doesn't use the TLB
(unless status.MPRV is set).
My intepretation would be that "implemented" in this case also encompasses
bare mode and mmode without MRPV being set (I think there is a subtle
distinction between those two cases)
…On Thu, Feb 6, 2025 at 8:30 AM ansyser ***@***.***> wrote:
When working in M mode and MMU is not enabled, is it necessary to execute
the sfence-vma instruction with rs1=x0 and rs2=x0 to refresh the TLB after
writing the PMP control status registers? The RISC-V manual describes the
operation after configuring PMP registers as follows: "If page-based
virtual memory is not implemented, memory accesses check the PMP settings
synchronously, so no sfence.vma is need". How should we understand the
phrase 'page-based virtual memory' in this sentence? Does it only refer to
MMU, or does it also include TLB?
Taking "pmp64-TOR-RWX.S" as an example:
/* Assigning addresses to PMP address registers */
LA(x4, PMPADDRESS0) // Value to be stored in pmpaddr0
srl x4, x4, PMP_SHIFT // Shift right by 2 times
csrw pmpaddr0, x4 // Updated pmpaddr0
sfence.vma x0, x0 // need to add?
nop // Added nop in case of trap
—
Reply to this email directly, view it on GitHub
<#609>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJQMOXGY6R2ZWRELA5D2OLJMXAVCNFSM6AAAAABWSRGT5WVHI2DSMVQWIX3LMV43ASLTON2WKOZSHAZTINBUGM4TENQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I found an issue in riscv-isa-manual, seems if our core support sv39/48,and working in m-mode, or in s-mode with satp.mode=bare, software needs to use an sfence.vma to sync PMP changes.
|
When working in M mode and MMU is not enabled, is it necessary to execute the sfence-vma instruction with rs1=x0 and rs2=x0 to refresh the TLB after writing the PMP control status registers? The RISC-V manual describes the operation after configuring PMP registers as follows: "If page-based virtual memory is not implemented, memory accesses check the PMP settings synchronously, so no sfence.vma is need". How should we understand the phrase 'page-based virtual memory' in this sentence? Does it only refer to MMU, or does it also include TLB?
Taking "pmp64-TOR-RWX.S" as an example:
The text was updated successfully, but these errors were encountered: