From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 6/6] xen: arm: Ensure HCR_EL2.RW is set correctly when building dom0 Date: Wed, 23 Oct 2013 11:39:05 +0100 Message-ID: <5267A749.1090809@linaro.org> References: <1381416204.17758.36.camel@kazak.uk.xensource.com> <1381416225-31043-6-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1381416225-31043-6-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , xen-devel@lists.xen.org Cc: tim@xen.org, Pranavkumar Sawargaonkar , Anup Patel , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 10/10/2013 03:43 PM, Ian Campbell wrote: > copy_to_user and friends rely on this, since the address transalation > functions (guest VA -> MFN) will truncate VA to the appropriate size. > > Signed-off-by: Ian Campbell Acked-by: Julien Grall > --- > xen/arch/arm/domain_build.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index fb1fa56..e3ea3f0 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -875,6 +875,13 @@ int construct_dom0(struct domain *d) > > /* The following loads use the domain's p2m */ > p2m_load_VTTBR(d); > +#ifdef CONFIG_ARM_64 > + d->arch.type = kinfo.type; > + if ( is_pv32_domain(d) ) > + WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2); > + else > + WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2); > +#endif > > kernel_load(&kinfo); > dtb_load(&kinfo); > @@ -888,9 +895,6 @@ int construct_dom0(struct domain *d) > > regs->pc = (register_t)kinfo.entry; > > -#ifdef CONFIG_ARM_64 > - d->arch.type = kinfo.type; > -#endif > > if ( is_pv32_domain(d) ) > { > -- Julien Grall