Subject: Re: sync i386 pmap with amd64
To: YAMAMOTO Takashi <>
From: Bang Jun-Young <>
List: port-i386
Date: 07/25/2004 03:14:47
YAMAMOTO Takashi wrote:
> hi,
> > >
> > 
> > I'd say I don't like most of it for the following reasons:
> > 
> > - license complication for no actual benefit.
> > - Most of the patch is just to replace "PD" and "PT" with "L2" and "L1",
> >   respectively. I'd say "if it ain't broken, don't fix it." for this case.
> >   Personally, "PD" and "PT" are easier to read, or at least, less confusing.
> actually, there's some benefits.
> 	- low cost to maintain.  (by sharing code with amd64 eventually)
> 	- a step to support PAE.

Even with AMD64, "PD" and "PT" are still officially used. Only "PDP" is
added for PAE and 64-bit virtual-physical address translation. Why do you
want to replace the official terms with non-official ones? In other words,
why can't amd64 pmap changed so it shares more code with i386 and better
meets the techdocs?

> > - why is a single leal instruction replaced with two movl/addl
> >   instructions? There are a couple more places with similar changes.
> to be similar with amd64 version.
> these code isn't worth to optimize, IMHO.

Those are not worth deoptimizing, either, IMHO. The same question can be
raised here as well: why can't amd64 code changed instead?

In fact, I don't know if a single leal is faster than a movl/addl pair.
But you should make a more reasonable argument if you want to modify the
code that way.

> > - have no idea why '1ULL' is replace '1' here. '1' is perfectly fine
> >   with the 32-bit world, AFAIK.
> 1ULL is also perfectly fine.

Could you give a brief description on why the following change is needed?

      9 -#define        KERNBASE        ((u_long)KERNBASE_LOCORE)
     10 +#define        KERNBASE        (1UL * KERNBASE_LOCORE)