lkml.org 
[lkml]   [2017]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 9/9] KVM: x86: Implement Intel Processor Trace context switch
From
Date
On 27/11/2017 21:24, Luwei Kang wrote:
> + if (pt_mode == PT_MODE_HOST_GUEST) {
> + u32 eax, ebx, ecx, edx;
> +
> + cpuid_count(0x14, 1, &eax, &ebx, &ecx, &edx);

Since it's used in many places, it's better if you cache CPUID[14,1].EAX.

Thanks,

Paolo

> + memset(&vmx->pt_desc, 0, sizeof(vmx->pt_desc));
> + vmx->pt_desc.addr_num = eax & 0x7;
> + /* Bit[6~0] are forced to 1, writes are ignored. */
> + vmx->pt_desc.guest.output_mask = 0x7F;
> + vmcs_write64(GUEST_IA32_RTIT_CTL, 0);
> + }

\
 
 \ /
  Last update: 2017-11-30 13:28    [W:0.139 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site