mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 08:03:59 +00:00
parent
533015b93e
commit
c774272366
@ -421,6 +421,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<Genode::Thread>,
|
||||
{
|
||||
PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
|
||||
|
||||
::uint64_t tsc_aux = 0;
|
||||
auto const rc_tsc = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX,
|
||||
&tsc_aux);
|
||||
Assert(rc_tsc == VINF_SUCCESS);
|
||||
|
||||
/* avoid utcb corruption by requesting tpr state early */
|
||||
bool interrupt_pending = false;
|
||||
uint8_t tpr = 0;
|
||||
@ -430,6 +435,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<Genode::Thread>,
|
||||
/* don't call function hereafter which may corrupt the utcb ! */
|
||||
using namespace Nova;
|
||||
|
||||
if (rc_tsc == VINF_SUCCESS) {
|
||||
utcb->mtd |= Mtd::TSC_AUX;
|
||||
utcb->tsc_aux = tsc_aux;
|
||||
}
|
||||
|
||||
utcb->mtd |= Mtd::EIP;
|
||||
utcb->ip = pCtx->rip;
|
||||
|
||||
|
@ -368,6 +368,15 @@ class Vcpu_handler : public Genode::List<Vcpu_handler>::Element
|
||||
_state->tpr_threshold.charge(tpr_priority);
|
||||
}
|
||||
|
||||
{
|
||||
::uint64_t tsc_aux = 0;
|
||||
auto const rcStrict = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX,
|
||||
&tsc_aux);
|
||||
Assert(rcStrict == VINF_SUCCESS);
|
||||
if (rcStrict == VINF_SUCCESS)
|
||||
_state->tsc_aux.charge(tsc_aux);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -261,6 +261,15 @@ template <typename VIRT> void Sup::Vcpu_impl<VIRT>::_transfer_state_to_vcpu(CPUM
|
||||
::memcpy(fpu._buffer, ctx.pXStateR3, sizeof(fpu));
|
||||
});
|
||||
|
||||
{
|
||||
::uint64_t tsc_aux = 0;
|
||||
auto const rcStrict = CPUMQueryGuestMsr(&_vmcpu, MSR_K8_TSC_AUX,
|
||||
&tsc_aux);
|
||||
Assert(rcStrict == VINF_SUCCESS);
|
||||
if (rcStrict == VINF_SUCCESS)
|
||||
state.tsc_aux.charge(tsc_aux);
|
||||
}
|
||||
|
||||
/* do SVM/VMX-specific transfers */
|
||||
VIRT::transfer_state_to_vcpu(state, ctx);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user