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

Re: [Xen-devel] [PATCH] xen: arm: force guest memory accesses to cacheable when MMU is disabled



On Wed, 2014-01-08 at 12:43 +0000, Stefano Stabellini wrote:
> On Wed, 8 Jan 2014, Ian Campbell wrote:
> > On Tue, 2014-01-07 at 20:39 +0000, Stefano Stabellini wrote:
> > > > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > > > index 124cccf..104d228 100644
> > > > --- a/xen/arch/arm/domain.c
> > > > +++ b/xen/arch/arm/domain.c
> > > > @@ -219,6 +219,11 @@ static void ctxt_switch_to(struct vcpu *n)
> > > >      else
> > > >          hcr |= HCR_RW;
> > > >  
> > > > +    if ( n->arch.sctlr & SCTLR_M )
> > > > +        hcr &= ~(HCR_TVM|HCR_DC);
> > > > +    else
> > > > +        hcr |= (HCR_TVM|HCR_DC);
> > > > +
> > > >      WRITE_SYSREG(hcr, HCR_EL2);
> > > >      isb();
> > > 
> > > Is this actually needed? Shouldn't HCR be already correctly updated by
> > > update_sctlr?
> > 
> > Not if we are switching back and forth between two guests which are in
> > different states.
> 
> I didn't realize that HCR is not properly saved and restored during
> context switch. Maybe it is worth doing that instead? If nothing else
> for simplicity?

Yes. We ended up here because originally the HCR content was completely
static.

I'm a little concerned about making this change for 4.4, mostly because
I'd need to reliably track down the right places to initialise
v->arch.hcr and the correct contents.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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