[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 21/34] x86/mm: p2m_flush and nvcpu_flush are HVM only



On Wed, Aug 22, 2018 at 03:14:12PM +0100, Wei Liu wrote:
> On Tue, Aug 21, 2018 at 02:01:12AM -0600, Jan Beulich wrote:
> > >>> On 17.08.18 at 17:12, <wei.liu2@xxxxxxxxxx> wrote:
> > > p2m_flush is only called by HAP code, nvcpu_flush is only useful for
> > > nestedhvm, both of which depend on HVM support.
> > > 
> > > Enclose their code in CONFIG_HVM. Add assertions.
> > 
> > But why do you put the #ifdef-s inside the functions, rather than
> > around them? From what you say, without CONFIG_HVM no caller
> > should exist.
> > 
> > Jan
> > 
> > > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> > > ---
> > >  xen/arch/x86/mm/p2m.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
> > > index 1089b86..1a04b34 100644
> > > --- a/xen/arch/x86/mm/p2m.c
> > > +++ b/xen/arch/x86/mm/p2m.c
> > > @@ -1785,10 +1785,13 @@ p2m_flush_table(struct p2m_domain *p2m)
> > >  void
> > >  p2m_flush(struct vcpu *v, struct p2m_domain *p2m)
> 
> This is called by HAP code which I didn't put under CONFIG_HVM yet.
> 
> I will see about reworking that part to put HAP under CONFIG_HVM.
> 
> > >  {
> > > +#if CONFIG_HVM
> > > +    ASSERT(is_hvm_vcpu(v));
> > >      ASSERT(v->domain == p2m->domain);
> > >      vcpu_nestedhvm(v).nv_p2m = NULL;
> > >      p2m_flush_table(p2m);
> > >      hvm_asid_flush_vcpu(v);
> > > +#endif
> > >  }
> > >  
> > >  void
> > > @@ -1839,8 +1842,11 @@ static void assign_np2m(struct vcpu *v, struct 
> > > p2m_domain *p2m)
> > >  
> > >  static void nvcpu_flush(struct vcpu *v)
> 
> This is referenced by another HVM function. Maybe I can reshuffle code a
> bit more to make it work.

It appears that more code can be put under CONFIG_HVM. I have done that.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.