Signficant bugfix to my emulator

Mouse <[email protected]>
Newsgroups gmane.os.netbsd.ports.vax
Message-ID <[email protected]>
I think at least a few of you are doing things with my MicroVAX-II
emulator.  Those of you who are might want to pull the latest version.

I had it hang when doing a certain compile.  Investigating, I found it
was livelocking, repeatedly taking the same translation-not-valid fault
on the same instruction, calling pmap_simulref, returning to userland,
and taking the same fault.

Adding a TBIA to pmap_simulref fixed this.  But, looking at what it
did, that shouldn't make any difference, because all it does is set
some valid bits.  Digging more, it turned out I was entering invalid
PTEs in the TB!  (The TB is defined to never cache info from invalid
PTEs.)

So I added two things: (1) I check that PTE_V is set before making TB
entries, and (2) there is a firewall test when making TB entries, to
ensure invalid PTEs don't slip in.  (I also took the TBIA back out from
pmap_simulref, but that's not part of the emulator proper.)

There also may be assorted other changes, depending on when you last
pulled.

Curiously, fixing this also fixed a *substantial* performance problem
that's been bothering me for quite some time.  (The perceived symptom
was that simple commands would take multiple seconds to start.)

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.