[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180503113909.52osvumzlueetsn4@um.fi.intel.com>
Date: Thu, 3 May 2018 14:39:09 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Luwei Kang <luwei.kang@...el.com>
Cc: kvm@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, x86@...nel.org, pbonzini@...hat.com,
rkrcmar@...hat.com, linux-kernel@...r.kernel.org, joro@...tes.org,
peterz@...radead.org, chao.p.peng@...ux.intel.com
Subject: Re: [PATCH v7 08/13] KVM: x86: Add Intel processor trace context for
each vcpu
On Thu, May 03, 2018 at 08:08:38PM +0800, Luwei Kang wrote:
> From: Chao Peng <chao.p.peng@...ux.intel.com>
>
> Add a data structure to save Intel Processor Trace context.
> It mainly include the value of Intel PT host/guest MSRs
> and guest CPUID information.
I'd say that code and data should be in the same patch.
> Signed-off-by: Chao Peng <chao.p.peng@...ux.intel.com>
> Signed-off-by: Luwei Kang <luwei.kang@...el.com>
> ---
> arch/x86/kvm/vmx.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 27cf417..9a5c26d 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -597,6 +597,23 @@ static inline int pi_test_sn(struct pi_desc *pi_desc)
> (unsigned long *)&pi_desc->control);
> }
>
> +struct pt_ctx {
> + u64 ctl;
> + u64 status;
> + u64 output_base;
> + u64 output_mask;
> + u64 cr3_match;
> + u64 addrs[MSR_IA32_RTIT_ADDR_COUNT];
> +};
> +
> +struct pt_desc {
> + u64 ctl_bitmask;
> + u32 range_cnt;
> + u32 caps[PT_CPUID_REGS_NUM * PT_CPUID_LEAVES];
> + struct pt_ctx host;
> + struct pt_ctx guest;
> +};
> +
> struct vcpu_vmx {
> struct kvm_vcpu vcpu;
> unsigned long host_rsp;
> @@ -693,6 +710,8 @@ struct vcpu_vmx {
> */
> u64 msr_ia32_feature_control;
> u64 msr_ia32_feature_control_valid_bits;
> +
> + struct pt_desc pt_desc;
> };
>
> enum segment_cache_field {
> --
> 1.8.3.1
>
Powered by blists - more mailing lists