Re: Athlon/VIA Kernel Experimentation (mmx.c)

Seth Goldberg
2001-05-04T16:58:19Z

Doh. I feel like a moron. Thanks.. will do...

--S

Brian Gerst wrote:
>
> Seth Goldberg wrote:
> >
> > Hi,
> >
> > I implemented a small check loop at the end of the fast_page_copy
> > routine in mmx.c for the Athlon. Booting the resulting kernel
> > yields an interesting result. Every single time, the kernel
> > panics RIGHT AFTER it frees unused kernel memory from bootup.
> > I encourage those of you with the same problem to try this and report
> > when it panics.
> >
> > Here is my patch to mmx.c: (sorry about the long lines)
> > -----------------------------------------------------cut here
> > diff -r linux-ref/arch/i386/lib/mmx.c linux/arch/i386/lib/mmx.c
> > 204a205,216
> > >
> > > {
> > > register int x = 0;
> > > /* do mem compares to ensure written == read */
> > > for ( /* initted above */; x < (4096/sizeof(int)); x++ )
> > > {
> > > if ( ((int *)to)[x] != ((int *)from)[x] ) {
> > > panic("fast_page_copy: dest value @ 0x%lx (%x) does not equal source value @ %lx (%x)!\n",
> > > (long) to, ((int *)to)[x], (long) from, ((int *) from)[x] );
> > > }
> > > }
> > > }
> > -----------------------------------------------------cut here
> >
> > Wouldn't it be correct to say that because it is panicking, the
> > page copy was not completed properly?
>
> No, you are comparing the following two pages... from and to are
> incremented as the copy proceeds. Subtract PAGE_SIZE from them before
> comparing.
>
> --
>
> Brian Gerst