[patch] 2.4.0-test2: %cr4 in a register dump

From: Maciej W. Rozycki (macro@ds2.pg.gda.pl)
Date: Tue Jul 04 2000 - 09:58:58 EST


Hi,

 It looks like Linux makes more and more use of the %cr4 register. But it
is not included in a register dump. I use the following patch to include
the register in the dump. The code tries to approximate the %cr4 presence
condition by cpuid flags and is hopefully obvious. It applies cleanly to
2.4.0-test2. So far I used it to verify the "notsc" option works as
expected.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

diff -u --recursive --new-file linux-2.4-test1.macro/arch/i386/kernel/process.c linux-2.4-test1/arch/i386/kernel/process.c --- linux-2.4-test1.macro/arch/i386/kernel/process.c Fri May 26 22:24:15 2000 +++ linux-2.4-test1/arch/i386/kernel/process.c Tue May 30 00:54:34 2000 @@ -342,7 +342,7 @@ void show_regs(struct pt_regs * regs) { - long cr0 = 0L, cr2 = 0L, cr3 = 0L; + long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; printk("\n"); printk("EIP: %04x:[<%08lx>]",0xffff & regs->xcs,regs->eip); @@ -359,7 +359,15 @@ __asm__("movl %%cr0, %0": "=r" (cr0)); __asm__("movl %%cr2, %0": "=r" (cr2)); __asm__("movl %%cr3, %0": "=r" (cr3)); - printk("CR0: %08lx CR2: %08lx CR3: %08lx\n", cr0, cr2, cr3); + printk("CR0: %08lx CR2: %08lx CR3: %08lx", cr0, cr2, cr3); + if (current_cpu_data.x86_capability & + (X86_FEATURE_VME | X86_FEATURE_DE | X86_FEATURE_PSE | + X86_FEATURE_TSC | X86_FEATURE_PAE | X86_FEATURE_MCE | + X86_FEATURE_PGE | X86_FEATURE_FXSR | X86_FEATURE_XMM)) { + __asm__("movl %%cr4, %0": "=r" (cr4)); + printk(" CR4: %08lx\n", cr4); + } + printk("\n"); } /*

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:15 EST