lkml.org 
[lkml]   [2018]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu
Date
> > +static void pt_guest_enter(struct vcpu_vmx *vmx) {
> > + if (pt_mode == PT_MODE_SYSTEM)
> > + return;
> > +
> > + /* Save host state before VM entry */
> > + rdmsrl(MSR_IA32_RTIT_CTL, vmx->pt_desc.host.ctl);
> > +
> > + /*
> > + * Set guest state of MSR_IA32_RTIT_CTL MSR (PT will be disabled
> > + * on VM entry when it has been disabled in guest before).
> > + */
> > + vmcs_write64(GUEST_IA32_RTIT_CTL, vmx->pt_desc.guest.ctl);
> > +
> > + if (vmx->pt_desc.guest.ctl & RTIT_CTL_TRACEEN) {
> > + wrmsrl(MSR_IA32_RTIT_CTL, 0);
> > + pt_save_msr(&vmx->pt_desc.host, vmx->pt_desc.addr_range);
> > + pt_load_msr(&vmx->pt_desc.guest, vmx->pt_desc.addr_range);
> > + }
> > +}
>
> From my side this is still a NAK, because [1].
>
> [1] https://marc.info/?l=kvm&m=153847567226248&w=2
>

This place is save the host PT status and load the guest PT status before VM-entry when working in Host-Guest mode.

Thanks,
Luwei Kang

\
 
 \ /
  Last update: 2018-10-25 02:06    [W:0.098 / U:14.620 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site