All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 4.5] xen/arm64: Make show_registers working even if current is not correctly set
@ 2014-09-30 14:56 Julien Grall
  2014-10-01 10:34 ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Grall @ 2014-09-30 14:56 UTC (permalink / raw)
  To: xen-devel; +Cc: stefano.stabellini, Julien Grall, tim, ian.campbell

The commit 8ab802c "xen/arm: Restricted access to IFSR32_EL2 and FPEXC32_EL2"
introduced the use of the variable current in show_registers.

The variable is not correctly set until Xen has finished to boot.
Therefore any call to show_registers will result to crash Xen.

As the register IFSR32_EL2 is only printed when the registers represent
a guest view, Xen can read the value only for this case.

Signed-off-by: Julien Grall <julien.grall@linaro.org>

---

This is a bug fix for Xen 4.5.
---
 xen/arch/arm/traps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index cda0523..4b4b4e0 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -790,7 +790,7 @@ void show_registers(struct cpu_user_regs *regs)
 #else
     ctxt.far = READ_SYSREG(FAR_EL1);
     ctxt.esr_el1 = READ_SYSREG(ESR_EL1);
-    if ( is_32bit_domain(current->domain) )
+    if ( guest_mode(regs) && is_32bit_domain(current->domain) )
         ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2);
 #endif
     ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-01 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30 14:56 [PATCH for 4.5] xen/arm64: Make show_registers working even if current is not correctly set Julien Grall
2014-10-01 10:34 ` Ian Campbell
2014-10-01 12:18   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.