From: Ian Campbell Subject: [PATCH 09/13] xen: arm: Set EL1 register width in HCR_EL2 during context switch. Date: Wed, 17 Apr 2013 14:16:45 +0100 Message-ID: <1366204609-32645-9-git-send-email-ian.campbell@citrix.com> References: <1366204591.25579.35.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366204591.25579.35.camel@zakaz.uk.xensource.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: xen-devel@lists.xen.org Cc: julien.grall@citrix.com, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell --- xen/arch/arm/domain.c | 7 +++++++ xen/include/asm-arm/processor.h | 3 +++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 08bb132..20bb6c7 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -203,6 +203,13 @@ static void ctxt_switch_to(struct vcpu *n) isb(); +#ifdef CONFIG_ARM_64 + if ( is_pv32_domain(n->domain) ) + hcr &= ~HCR_RW; + else + hcr |= HCR_RW; +#endif + WRITE_SYSREG(hcr, HCR_EL2); isb(); diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h index 1681ebf..32c441b 100644 --- a/xen/include/asm-arm/processor.h +++ b/xen/include/asm-arm/processor.h @@ -41,6 +41,9 @@ #define HSCTLR_BASE 0x30c51878 /* HCR Hyp Configuration Register */ +#ifdef CONFIG_ARM_64 +#define HCR_RW (1<<31) +#endif #define HCR_TGE (1<<27) #define HCR_TVM (1<<26) #define HCR_TTLB (1<<25) -- 1.7.2.5