> -----Original Message-----
> From: Jan Beulich <jbeul...@suse.com>
> Sent: Tuesday, January 26, 2021 9:22 AM
> To: Cooper, Andrew <andrew.coop...@citrix.com>
> Cc: Lengyel, Tamas <tamas.leng...@intel.com>; Roger Pau Monné
> <roger....@citrix.com>; Wei Liu <w...@xen.org>; Nakajima, Jun
> <jun.nakaj...@intel.com>; Tian, Kevin <kevin.t...@intel.com>; Michał
> Leszczyński <michal.leszczyn...@cert.pl>; Tamas K Lengyel
> <ta...@tklengyel.com>; Xen-devel <xen-devel@lists.xenproject.org>
> Subject: Re: [PATCH v7 09/10] xen/vmtrace: support for VM forks
> 
> On 21.01.2021 22:27, Andrew Cooper wrote:
> > From: Tamas K Lengyel <tamas.leng...@intel.com>
> >
> > Implement vmtrace_reset_pt function. Properly set IPT state for VM
> > forks.
> >
> > Signed-off-by: Tamas K Lengyel <tamas.leng...@intel.com>
> > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeul...@suse.com> albeit it strikes me as
> somewhat odd that ...
> 
> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > @@ -2408,6 +2408,16 @@ static int vmtrace_output_position(struct vcpu
> *v, uint64_t *pos)
> >      return v->arch.hvm.vmx.ipt_active;  }
> >
> > +static int vmtrace_reset(struct vcpu *v) {
> > +    if ( !v->arch.hvm.vmx.ipt_active )
> > +        return -EINVAL;
> > +
> > +    v->arch.msrs->rtit.output_offset = 0;
> > +    v->arch.msrs->rtit.status = 0;
> > +    return 0;
> > +}
> 
> ... the function/hook return non-void, yet ...
> 
> > --- a/xen/arch/x86/mm/mem_sharing.c
> > +++ b/xen/arch/x86/mm/mem_sharing.c
> > @@ -1632,6 +1632,8 @@ static int copy_vcpu_settings(struct domain *cd,
> const struct domain *d)
> >              copy_domain_page(new_vcpu_info_mfn, vcpu_info_mfn);
> >          }
> >
> > +        hvm_vmtrace_reset(cd_vcpu);
> 
> ... the only caller doesn't care.

Noted. For now the function could just return void since if IPT is not enabled 
we don't care from a fork reset perspective. But perhaps in the future we want 
to return that information to the toolstack. Haven't decided yet whether that's 
important or not, for now things are OK as-is.

Tamas

Reply via email to