-
Notifications
You must be signed in to change notification settings - Fork 80
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
Added code to get the tsc time on HW-isolated VMs (TDX) - Issue 345. #346
base: main
Are you sure you want to change the base?
Conversation
openhcl/openhcl_boot/src/main.rs
Outdated
@@ -508,6 +511,18 @@ const fn zeroed<T: FromZeroes>() -> T { | |||
unsafe { core::mem::MaybeUninit::<T>::zeroed().assume_init() } | |||
} | |||
|
|||
/// Get the tsc ref time for hw isolated vms in 100ns | |||
#[allow(unused_variables)] | |||
fn get_hw_tsc_time(isolation: IsolationType) -> u64 { |
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.
@smalis-msft do you know what it would take to do the same on SNP?
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.
Might be a better question for @sluck-msft? I haven't dug into the SNP docs nearly deep enough to know off the top of my head
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.
@adi-bhandari or @daaltobe maybe?
isolationType, SingleThreaded into minimal_rt
into a match statement. Added UNSAFE comments around static mut variable.
In the current implementation, boot times are reported in the device tree only for non-hw-isolated vms by calling tsc refcount.
On TDX-based VMs, tsc ref time is calculated by: