lkml.org 
[lkml]   [2018]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 11/13] KVM: x86: Implement Intel Processor Trace MSRs read/write
From
Date
On 04/05/2018 12:11, Alexander Shishkin wrote:
>> + */
>> + if ((data & RTIT_CTL_TRACEEN) && !(data & RTIT_CTL_TOPA) &&
>> + !(data & RTIT_CTL_FABRIC_EN) &&
>> + !__pt_cap_get(vmx->pt_desc.caps, PT_CAP_single_range_output))
> You seem to be doing a lot of __pt_cap_get()s on each wrmsr. Did you consider
> decoding the capabilities once and storing the decoded values instead, so
> that in functions like these you can access them by
>
> if (vmx->pt_desc.caps[PT_CAP_single_range_output]) ...
>
> ?

Or pt_cap_get could use a switch statement in pt_cap_get and make it
__always_inline. The argument is always a constant except for pt_cap_show.

What you say is also a possibility though. Are you okay with adding a
PT_CAP_first_unused at the end of enum pt_capabilities, so that the
array can be sized?

Thanks,

Paolo

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