lkml.org 
[lkml]   [2018]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 09/13] KVM: x86: Implement Intel Processor Trace context switch
From
Date
On 04/05/2018 12:29, Alexander Shishkin wrote:
> On Thu, May 03, 2018 at 08:08:39PM +0800, Luwei Kang wrote:
>> +static void pt_guest_enter(struct vcpu_vmx *vmx)
>> +{
>> + if (pt_mode == PT_MODE_HOST || pt_mode == PT_MODE_HOST_GUEST)
>> + rdmsrl(MSR_IA32_RTIT_CTL, vmx->pt_desc.host.ctl);
>> +
>> + if (pt_mode == PT_MODE_HOST_GUEST &&
>> + vmx->pt_desc.guest.ctl & RTIT_CTL_TRACEEN) {
>> + wrmsrl(MSR_IA32_RTIT_CTL, 0);
>> + pt_save_msr(&vmx->pt_desc.host, vmx->pt_desc.range_cnt);
>> + pt_load_msr(&vmx->pt_desc.guest, vmx->pt_desc.range_cnt);
>> + }
>> +}
>> +
>> +static void pt_guest_exit(struct vcpu_vmx *vmx)
>> +{
>> + if (pt_mode == PT_MODE_HOST_GUEST &&
>> + vmx->pt_desc.guest.ctl & RTIT_CTL_TRACEEN) {
>> + pt_save_msr(&vmx->pt_desc.guest, vmx->pt_desc.range_cnt);
>> + pt_load_msr(&vmx->pt_desc.host, vmx->pt_desc.range_cnt);
>> + }
>> +
>> + if (pt_mode == PT_MODE_HOST || pt_mode == PT_MODE_HOST_GUEST)
>> + wrmsrl(MSR_IA32_RTIT_CTL, vmx->pt_desc.host.ctl);
>> +}
>
> This means that a host PT event won't get the guest traces and won't get
> any notification as to what'd happened or why. At the minimum we need to
> send a PARTIAL AUX record at the pt_guest_enter(), when we turn the host
> tracing off.

How do you do that? :)

Paolo

\
 
 \ /
  Last update: 2018-05-04 23:50    [W:0.058 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site