Subject: Re: evbppc reserved-tlb cleanup
To: Simon Burge <simonb@NetBSD.org>
From: Jachym Holecek <freza@dspfpga.com>
List: port-powerpc
Date: 11/29/2006 20:58:01
# Simon Burge 2006-11-26:
> Jachym Holecek wrote:
> > # Jachym Holecek 2006-10-31:
> > > The patch below changes evbppc to map just 0 upto endkernel to make sure
> > > the trap code has everything it could possibly need. Looks OK to commit?
> >
> > As Simon noted, this is wrong, we must map console/devices after
> > (vaddr_t)roundup(physmem, 16MB) so that pmap_tlbmiss() continues
> > to work. Updated patch below, does it look OK this time?
>
> You patch wedged my Walnut pretty much straight away. I've tracked this
> down to:
Oops, sorry :-(. Fortunately, I've recently ordered a 405GPr evaluation
board, so I'll have a testing platform handy in a few weeks (my Virtex is
mostly in the HW department these days).
> + if (ctx != KERNEL_PID || (va < ctob((vaddr_t)physmem))) {
>
> The "va < ctob(...)" should be "va >= ctob(...)". That said, I think
> I'd prefer to commit something like:
>
> if (ctx != KERNEL_PID || (va >= VM_MIN_KERNEL_ADDRESS)) {
>
> My reasoning is:
>
> - There will be never be a kernel VA less than VM_MIN_KERNEL_ADDRESS.
>
> - This saves a load of the physmem variable and an instruction or two
> of arithmetic in a critical path.
>
> Sound good?
Fine with me. That's a lot how the code used to work ~forever, except
testing against VM_MIN_KERNEL_ADDRESS is more readable than a numeric
constant.
> With this change, the rest of your patch (all the evbppc parts)
> works.
Commited, thanks for the review.
-- Jachym