Re: Remember my ill-fated i386 smp pmap optimizations?

2002-07-10 Thread Peter Wemm

Peter Wemm wrote:
> John Baldwin wrote:
> > 
> > On 08-Jul-2002 Peter Wemm wrote:
> > > A few months ago, I had a bit of a disaster with some pmap optimizations.
> > > After committing, all hell broke loose.  It was backed out completely.
> > > 
> > > I finally found the problem (diff cleaned up to highlight the problem):
> > > 
> > > pmap_mapdev()
> > > ...
> > > for (tmpva = va; size > 0; ) {
> > > pte = vtopte(tmpva);
> > > *pte = pa | PG_RW | PG_V | pgeflag;
> > > size -= PAGE_SIZE;
> > > tmpva += PAGE_SIZE;
> > > -   pa += PAGE_SIZE;
> > > }
> > > invltlb();
> > > 
> > > Excuse me while I go outside and shoot myself.
> > 
> > Hahahaha!
> > 
> > Glad to see you have fixed them. :)
> 
> Unfortunately, there are still more problems. :-(

> I've still got to find this one though:
> 
> TPTE at 0xbfca01f0  IS ZERO @ VA 2807c000
> panic: bad peter
> 
> db> trace
> panic(c043087f,bfca01f0,2807c000,1,c040e9d7) at panic+0x84
> pmap_remove_pages(c15d6ed0,0,bfc0,115,c028aee0) at pmap_remove_pages+0x9c
> exit1(c15d5180,8b,c6,c24a0d04,0) at exit1+0x4f0
> sigexit(c15d5180,b,c040fbb1,6e9,0) at sigexit+0x1b9
> postsig(b,0,c0413100,e4,400) at postsig+0x11b
> ast(d3aa5d48) at ast+0x328
> doreti_ast() at doreti_ast+0x1a

ARGH!  I think I found this one too. :-/

I think the fix [relative to the patch] is:
pmap_pte_quick()
...
/* are we current address space or kernel? */
if (pmap == kernel_pmap || frame == (PTDpde & PG_FRAME))
return PTmap + index;
newpf = pde & PG_FRAME;
if (((*PMAP1) & PG_FRAME) != newpf) {
*PMAP1 = newpf | PG_RW | PG_V;
-   pmap_invalidate_page(pmap, (vm_offset_t) PADDR1);
+   pmap_invalidate_page(kernel_pmap, (vm_offset_t) PADDR1);
}
return PADDR1 + (index & (NPTEPG - 1));

*blush*.  (read pmap_invalidate_page() in the diff to see why)

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Remember my ill-fated i386 smp pmap optimizations?

2002-07-09 Thread Thyer, Matthew

> John Baldwin wrote:
> > 
> > On 08-Jul-2002 Peter Wemm wrote:

[snip]
 
> > > Excuse me while I go outside and shoot myself.
> > 
> > Hahahaha!
> > 
> > Glad to see you have fixed them. :)
>
> Unfortunately, there are still more problems. :-(
>
> I have found some of them.  And what is really scary is that I have
> verified that some of what Terry has been FUD'ing(*) about for our TLB
> (mis)management is actually correct. :-(  We have code that simply will
not
> work (ie: vm86 will explode when doing VESA calls) if certain accidental
> conditions that mask the bugs no longer occur.

Probably why my Pentium-III 866 locks up (with a continuous beep from the
PC speaker) when I switch virtual consoles (no X running) when doing disk
I/O and one console is running the standard 80x25 and the other is running
132x60.

Seems to happen every time so far and has done so for several months.

It doesn't happen on my Celeron 450 Slot-1 (actually a 300a running
at 100Mhz FSB instead of 66MHz) with an Nvidia TNT2 16MB, Western digital
something 20GB also using 80x25 and 132x60.  (also GENERIC kernel and
v.new -CURRENT).

The P-III 866 has an Nvidia GeForce2 MX400 64MB, IBM 120GXP 40GB drive,
very new -CURRENT and GENERIC kernel.

extract of /boot/loader.conf has:
hw.ata.wc="1"
hw.ata.tags="1"   <--- This line not on the Celeron 450 box as
vesa_load="YES"the WD drive cant do tagged command queing

extract of /etc/rc.conf has:
font8x16="cp437-8x16.fnt"
font8x14="cp437-8x14.fnt"
font8x8="cp437-8x8.fnt"

--
 Matthew Thyer Phone:  +61 8 8259 7249
 Science Corporate Information Systems Fax:+61 8 8259 5537
 Defence Science and Technology Organisation, Edinburgh
 PO Box 1500 EDINBURGH South Australia 5111

 IMPORTANT: This email remains the property of the Australian Defence
 Organisation and is subject to the jurisdiction of section 70 of the
 CRIMES ACT 1914.  If you have received this email in error, you are
 requested to contact the sender and delete the email.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Remember my ill-fated i386 smp pmap optimizations?

2002-07-09 Thread Sheldon Hearn

On (2002/07/08 13:52), Peter Wemm wrote:

> I have found some of them.  And what is really scary is that I have
> verified that some of what Terry has been FUD'ing(*) about for our TLB
> (mis)management is actually correct. :-(

Ha!  Justice!


All those who slapped me around on IRC for defending Terry can now mail
me postal details privately so that I can send you a hat to eat.


:-)

Ciao,
Sheldon.

PS: For the humour impaired, this is meant in a playful spirit and
shouldn't be used as a platform for axe grinding.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Remember my ill-fated i386 smp pmap optimizations?

2002-07-08 Thread Peter Wemm

John Baldwin wrote:
> 
> On 08-Jul-2002 Peter Wemm wrote:
> > A few months ago, I had a bit of a disaster with some pmap optimizations.
> > After committing, all hell broke loose.  It was backed out completely.
> > 
> > I finally found the problem (diff cleaned up to highlight the problem):
> > 
> > pmap_mapdev()
> > ...
> > for (tmpva = va; size > 0; ) {
> > pte = vtopte(tmpva);
> > *pte = pa | PG_RW | PG_V | pgeflag;
> > size -= PAGE_SIZE;
> > tmpva += PAGE_SIZE;
> > -   pa += PAGE_SIZE;
> > }
> > invltlb();
> > 
> > Excuse me while I go outside and shoot myself.
> 
> Hahahaha!
> 
> Glad to see you have fixed them. :)

Unfortunately, there are still more problems. :-(

I have found some of them.  And what is really scary is that I have
verified that some of what Terry has been FUD'ing(*) about for our TLB
(mis)management is actually correct. :-(  We have code that simply will not
work (ie: vm86 will explode when doing VESA calls) if certain accidental
conditions that mask the bugs no longer occur.

I've still got to find this one though:

TPTE at 0xbfca01f0  IS ZERO @ VA 2807c000
panic: bad peter

db> trace
panic(c043087f,bfca01f0,2807c000,1,c040e9d7) at panic+0x84
pmap_remove_pages(c15d6ed0,0,bfc0,115,c028aee0) at pmap_remove_pages+0x9c
exit1(c15d5180,8b,c6,c24a0d04,0) at exit1+0x4f0
sigexit(c15d5180,b,c040fbb1,6e9,0) at sigexit+0x1b9
postsig(b,0,c0413100,e4,400) at postsig+0x11b
ast(d3aa5d48) at ast+0x328
doreti_ast() at doreti_ast+0x1a

This also happens from a plain exit() syscall.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



RE: Remember my ill-fated i386 smp pmap optimizations?

2002-07-08 Thread John Baldwin


On 08-Jul-2002 Peter Wemm wrote:
> A few months ago, I had a bit of a disaster with some pmap optimizations.
> After committing, all hell broke loose.  It was backed out completely.
> 
> I finally found the problem (diff cleaned up to highlight the problem):
> 
> pmap_mapdev()
> ...
> for (tmpva = va; size > 0; ) {
> pte = vtopte(tmpva);
> *pte = pa | PG_RW | PG_V | pgeflag;
> size -= PAGE_SIZE;
> tmpva += PAGE_SIZE;
> -   pa += PAGE_SIZE;
> }
> invltlb();
> 
> Excuse me while I go outside and shoot myself.

Hahahaha!

Glad to see you have fixed them. :)

-- 

John Baldwin <[EMAIL PROTECTED]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Remember my ill-fated i386 smp pmap optimizations?

2002-07-08 Thread Julian Elischer



On Mon, 8 Jul 2002, David Xu wrote:

> 
> sorry for a bit OT, but why are pmap_mapdev and pmap_unmapdev still using
> old C language parameter style? I saw other functions in pmap using ANSI
> C style.
> 

because until recently it was not 'kosher' to change them, but thank god
we have now got past that lunacy, now it's just because no-one has
committed changes to do it (yet).

julian


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Remember my ill-fated i386 smp pmap optimizations?

2002-07-08 Thread David Xu


Gartner: Apache is vulnerable, we recommend switching back to IIS to protect yourselves
- Original Message - 
From: "Peter Wemm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 08, 2002 2:28 PM
Subject: Remember my ill-fated i386 smp pmap optimizations?


> A few months ago, I had a bit of a disaster with some pmap optimizations.
> After committing, all hell broke loose.  It was backed out completely.
> 
> I finally found the problem (diff cleaned up to highlight the problem):
> 
> pmap_mapdev()
> ...
> for (tmpva = va; size > 0; ) {
> pte = vtopte(tmpva);
> *pte = pa | PG_RW | PG_V | pgeflag;
> size -= PAGE_SIZE;
> tmpva += PAGE_SIZE;
> -   pa += PAGE_SIZE;

:(

> }
> invltlb();
> 
> Excuse me while I go outside and shoot myself.
> 
> Cheers,
> -Peter
> --
> Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> "All of this is for nothing if we don't go to the stars" - JMS/B5

sorry for a bit OT, but why are pmap_mapdev and pmap_unmapdev still using
old C language parameter style? I saw other functions in pmap using ANSI
C style.

David Xu



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message