forked from rivosinc/salus
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Additional changes for Sscdeleg support... #1
Open
atulkharerivos
wants to merge
15
commits into
main
Choose a base branch
from
topic/sscdel_additional_changes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0439d98
to
950cbc6
Compare
In preparation for forwarding debug console SBI calls to a VM's host, and thus requiring that the buffer be in shared memory, have the user of the SBI debug console provide the memory that will be used for buffering console output in the call to set_as_console(). Signed-off-by: Andrew Bresticker <[email protected]>
In preparation for forwarding the debug console SBI calls from the guest TVM to the host, have GuestVm put its debug console buffer in a shared memory region that it converts at boot. Signed-off-by: Andrew Bresticker <[email protected]>
Forward PutString calls to the VM's host. For the host VM, we pin the memory backing the buffer that is to be printed while we write it to the console. For Tellus, we confirm that the buffer is in shared memory before we go print it. Signed-off-by: Andrew Bresticker <[email protected]>
Like the debug console, this should get forwarded to the VM's host rather than having Salus print directly to the console. Signed-off-by: Andrew Bresticker <[email protected]>
For certain ECALLs (for now, just debug console) from guest VMs, we want to forward the call to the host and have the host provide the return value. Do this by taking the A0/A1 values from the guest GPRs in the shared memory area when running the vCPU after it exits due to a forwarded ECALL, just like we do for emulated MMIO loads. Signed-off-by: Andrew Bresticker <[email protected]>
This adds support for the previously missing PMU Raw event type.
This doesn't contain any functional change, and centralizes the logic for PMU counter configuration, start, and stop into vm_pmu.rs.
This adds a bug fix to translate the uinh/sinh passed by the TVM into :vuinh/vsinh before passing them to M-mode.
crosvm has dropped the assertions crate in favor of the more commonly used static_assertions crate. This change does the same for salus. This breaks the only local dep in sbi which will allow that crate to be pulled out and re-used more easily. Signed-off-by: Dylan Reid <[email protected]>
See: rust-lang/rust#105572 Trait implementations adding more restrictive constrains to a trait definition will soon be an error. Luckily, it doesn't seem that this 'static lifetime bound is needed by `PageBox` so remove it to make newer versions of rust happy. Signed-off-by: Dylan Reid <[email protected]>
I meant to do monthly updates, but this went to almost two months, so it's time. Signed-off-by: Dylan Reid <[email protected]>
atishp04
approved these changes
Jan 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
50f293b
to
70d7cb2
Compare
A recent refactoring of the PMU counter logic had introduced a latent bug that was exposed by a code change that introduced an additional context switch between counter configuration and start. The gist is that on the outbound path, the code change was causing the internal bookkeeping to revert it back to the non-configured state, meaning that the subsequent call to start the counter would fail. This fixes the issue by introducing helper functions that help distinguish between the internal code paths required required for context switch operations, and SBI calls initiated by the VM.
This adds code to detect support for the Supervisor Counter Delegation proposal.
This adds CSR definitions and register bitfields for the CSRs defined the Supervisor Counter Delegation proposal.
On platforms with support for Supervisor Counter Delegation, PMU functionality can be handled entirely in the HS-mode, thereby obviating the need SBI calls to M-mode. The changes seamlessly support both Sscdeleg and legacy platforms.
70d7cb2
to
53bb81c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the offline discussion, the initial PR for the Supervisor Delegation Counter proposal (Sscdeleg) was split into two separate PRs.
Note that the functionality requires additional QEMU+OpenSBI changes (see below).