kernel: Print gs alongside other registers in panic

This commit is contained in:
K. Lange 2021-10-25 18:23:33 +09:00
parent 4a9cad3363
commit 1bb382de12
1 changed files with 8 additions and 0 deletions

View File

@ -129,6 +129,14 @@ static void dump_regs(struct regs * r) {
r->r12, r->r13, r->r14, r->r15,
r->cs, r->ss, r->rflags, r->int_no, r->err_code
);
uint32_t gs_base_low, gs_base_high;
asm volatile ( "rdmsr" : "=a" (gs_base_low), "=d" (gs_base_high): "c" (0xc0000101) );
uint32_t kgs_base_low, kgs_base_high;
asm volatile ( "rdmsr" : "=a" (kgs_base_low), "=d" (kgs_base_high): "c" (0xc0000102) );
dprintf(" gs=0x%08x%08x kgs=0x%08x%08x\n",
gs_base_high, gs_base_low, kgs_base_high, kgs_base_low);
spin_unlock(dump_lock);
}