Skip to content

Commit

Permalink
Merge pull request #1373 from riscv/1372-chapter-71-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wmat committed Apr 29, 2024
2 parents 704d8a6 + 491f57f commit 903996c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/smcntrpmf.adoc
Expand Up @@ -4,12 +4,12 @@
[[intro]]
=== Introduction

The cycle and instret counters serve to support user mode self-profiling usages, wherein a user can read the counter(s) twice and compute the delta(s) to evaluate user software performance and behavior. Currently, these counters are not filtered by privilege mode, and thus they continue to increment while traps (e.g., page faults or interrupts) to more privileged code are handled. This causes two problems:
The cycle and instret counters serve to support user mode self-profiling usages, wherein a user can read the counter(s) twice and compute the delta(s) to evaluate user software performance and behavior. By default, these counters are not filtered by privilege mode, and thus they continue to increment while traps (e.g., page faults or interrupts) to more privileged code are handled. This causes two problems:

* It introduces unpredictable noise to the counter values observed by the user.
* It leaks information about privileged software execution to user mode.

This proposal remedies these issues by introducing privilege mode filtering for the cycle and instret counters.
Smcntrpmf remedies these issues by introducing privilege mode filtering for the cycle and instret counters.

[[csrs]]
=== CSRs
Expand Down

0 comments on commit 903996c

Please sign in to comment.