xen/arm64: Make show_registers working even if current is not correctly set

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>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Julien Grall authored and Ian Campbell committed 2014-10-01 12:10:52 +01:00
1 parent 3e802c6ca1
commit 0e96ab2691
1 file changed
+1 -1
+1 -1
View File
@@ -791,7 +791,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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.