Re: Milo/Linux on the EB164

Linus Torvalds (Linus.Torvalds@cs.Helsinki.FI)
Wed, 3 Jan 1996 21:04:57 +0200


Great to hear that Linux works on the 21164 too, David. Now I just have
to convince people to send me one ;-)

"Ka'plaagh 03-Jan-1996 1502 +0000": "Milo/Linux on the EB164" (Jan 3, 15:57):
>
> (2) VMLINUX
>
> The problem where some images worked and others didn't was indeed a
> problem with page table turning. The tbiap() call only flushes PTE
> entries with ASNs matching the current process/thread's ASN and
> copy_thread() in process.c was not setting up an ASN number in the PCB.
> It now does, it uses the pid which was set before it is called.

What does a task switch do in PAL-code for the 21164?

The reason I'm asking is that you obviously can't use the full pid as
the ASN, as ASN's are only 7-bit on the 21164 (?), and pids are 15 bits.
So if the task-switch does something like

if (oldasn != newasn)
mtpr zero, asn_tlb_zap

to invalidate the TLB entries, the above will fail when we switch
between two processes that have the same ASN numbers despite obviously
having different pids.

On the other hand, if the PAL-code does something like

zap_asn_tlb(old_asn)

then just using the pid would be ok (matching ASN numbers would just
result in non-optimal TLB usage rather than incorrect code).

> The system gets a memory access and hangs when I try to configure a
> kernel build. It will, however, happily mount disks, copy things around,
> do "top" and so on. So, it's *fairly* solid. If I can easily fix it
> then I will.

Now, another problem is that Linux assumes that the PAL-code "tbisi"
will invalidate _all_ TLB entries that match the right page, not just
the current ASN. Is that the case with your PAL-code?

The reason is simply that when we share a page with some other process,
we need to invalidate that _other_ processes TLB entry for the page
because we probably marked it copy-on-write in the other process. So a
tbisi that invalidates just the current process is useless.

There may be other pitfalls like this, which might explain some
problems.

Linus