mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-20 08:03:56 +00:00
nova: support transfer of IA32_TSC_AUX MSR for vCPUs
The 32-bit MSR is returned by rdtscp in ecx register and used to detect the CPU ID the timestamp was taken on. Issue #4314
This commit is contained in:
committed by
Christian Helmuth
parent
f4e52863c0
commit
533015b93e
@ -135,6 +135,7 @@ struct Nova_vcpu : Rpc_client<Vm_session::Native_vcpu>, Noncopyable
|
||||
mtd |= Nova::Mtd::INJ;
|
||||
mtd |= Nova::Mtd::STA;
|
||||
mtd |= Nova::Mtd::TSC;
|
||||
mtd |= Nova::Mtd::TSC_AUX;
|
||||
mtd |= Nova::Mtd::EFER;
|
||||
mtd |= Nova::Mtd::PDPTE;
|
||||
mtd |= Nova::Mtd::SYSCALL_SWAPGS;
|
||||
@ -316,6 +317,10 @@ void Nova_vcpu::_read_nova_state(Nova::Utcb &utcb, unsigned exit_reason,
|
||||
state().tsc_offset.charge(utcb.tsc_off);
|
||||
}
|
||||
|
||||
if (utcb.mtd & Nova::Mtd::TSC_AUX) {
|
||||
state().tsc_aux.charge(utcb.tsc_aux);
|
||||
}
|
||||
|
||||
if (utcb.mtd & Nova::Mtd::EFER) {
|
||||
state().efer.charge(utcb.read_efer());
|
||||
}
|
||||
@ -508,6 +513,11 @@ void Nova_vcpu::_write_nova_state(Nova::Utcb &utcb)
|
||||
utcb.tsc_off = state().tsc_offset.value();
|
||||
}
|
||||
|
||||
if (state().tsc_aux.charged()) {
|
||||
utcb.mtd |= Nova::Mtd::TSC_AUX;
|
||||
utcb.tsc_aux = state().tsc_aux.value();
|
||||
}
|
||||
|
||||
if (state().efer.charged()) {
|
||||
utcb.mtd |= Nova::Mtd::EFER;
|
||||
utcb.write_efer(state().efer.value());
|
||||
|
Reference in New Issue
Block a user