-
Notifications
You must be signed in to change notification settings - Fork 28
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
Forward debug console to host #190
Forward debug console to host #190
Conversation
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]>
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.
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.
Would be nice to drop legacy console soon so we can stop dealing with it.
For return values, I feel a0/a1 is fine, it's simple and VMMs will already have to support that pattern for non-TEE use cases.
LGTM, thanks.
Forward debug console ECALLs (DBCN and legacy
put_char
) to a VM's host instead of handling console output directly within Salus. For guest TVMs, this means that that buffer to be printed must reside in memory shared with the host VM.put_char
calls to the host, respectively.Looking for opinions on the forwarding of ECALL return values. Currently I'm just using A0/A1 from the shared memory area, which means the host will have to know which ECALLs for which it's expected to provide a return value. Other options I considered are: setting a flag (in shared memory?) that indicates to the host that it needs to provide a return value, or having a separate
sbi_return
struct in the shared memory area where the host puts the return value (with sentinel values to indicate whether or not the TSM is expecting to find something there).Fixes #146