lkml.org 
[lkml]   [2000]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] 2.4.0-test2: %cr4 in a register dump

Linus,

They are correctly checking for PGE bits in the feature flags. Some 486
processors and all Pentium and above support 4MB Page Extensions and IO
breakpoints. If a processor has these bits set, it's a safe assumption
that a CR4 register is present to enable debugging extensions (since
this is how they are enabled). I did not see a check for CMPXCHG8,
WriteCombining, or IO breakpoints in this code section to determine is a
CR4 register is present.

The "textbook" method from Intel is attached in a code snippet from
MANOS (which I copied verbatim from an Intel manual for detecting CR4.

:-)

Jeff

Linus Torvalds wrote:
>
> 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/[unhandled content-type:application/x-unknown-content-type-vxdfile]
\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans