x86/traps: avoid using current too early on boot

Early on boot, current has the sentinel value 0xfffff000.  Blindly using it in
show_registers() causes a nested failure and no useful information printed
from an early crash.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Andrew Cooper authored and Jan Beulich committed 2015-06-25 14:57:04 +02:00
1 parent 319e431e40
commit 142473cfce
1 file changed
+1 -1
+1 -1
View File
@@ -86,7 +86,7 @@ void show_registers(const struct cpu_user_regs *regs)
struct cpu_user_regs fault_regs = *regs;
unsigned long fault_crs[8];
enum context context;
struct vcpu *v = current;
struct vcpu *v = system_state >= SYS_STATE_smp_boot ? current : NULL;
if ( guest_mode(regs) && has_hvm_container_vcpu(v) )
{
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.