From: Julien Grall Date: Thu, 28 Jul 2016 14:20:15 +0000 (+0100) Subject: xen/arm: p2m: Don't need to restore the state for an idle vCPU. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~666 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cfd7f424ebe40a5efa49efddd88859b0fb1d5abe;p=xen.git xen/arm: p2m: Don't need to restore the state for an idle vCPU. The function p2m_restore_state could be called with an idle vCPU in arguments (when called by construct_dom0). However, we will never return to EL0/EL1 in this case, so it is not necessary to restore the p2m registers. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 7e524fe19a..aff59067b7 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -127,6 +127,9 @@ void p2m_restore_state(struct vcpu *n) { register_t hcr; + if ( is_idle_vcpu(n) ) + return; + hcr = READ_SYSREG(HCR_EL2); WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2); isb();