]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: p2m: Don't need to restore the state for an idle vCPU.
authorJulien Grall <julien.grall@arm.com>
Thu, 28 Jul 2016 14:20:15 +0000 (15:20 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 29 Jul 2016 00:42:21 +0000 (17:42 -0700)
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 <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c

index 7e524fe19ad7052bdbcbb828d3a4974f925f1bc0..aff59067b79d06e8a7d81fa731f69298fcd764b0 100644 (file)
@@ -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();