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

From: Linus Torvalds (torvalds@transmeta.com)
Date: Wed Jul 05 2000 - 15:08:39 EST


On Tue, 4 Jul 2000 willy@vodka.thepuffingroup.com wrote:

> On Tue, Jul 04, 2000 at 04:58:58PM +0200, Maciej W. Rozycki wrote:
> > - 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");
>
> this is aesthetically bogus. i think you should always print CR4,
> no matter whether it's 0 or not.

If I remember correctly, there are CPU's out there that will bomb out
horribly when you access %cr4 if the register doesn't exist.

Do I remember wrong?

I'd certainly agree with printing out cr4 even if it would be zero, I just
disagree very much with adding a register read to the dump output that may
cause an infinite regression of traps..

                Linus

-
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:17 EST