Subject: TLB on R10k

From: Stanislaw Skowronek <[email-masked]>
Date: Tue, 27 Apr 2004 20:07:23 +0200 (MET DST)

Why, in tlb-andes.c, all exception handlers are prefixed with an
ampersand (&) when copying them to main memory, only the r10k fill handler
isn't? I'm getting a blackhole-style crash (no messages, no panic,
interrupts dead as a doornail, nobody knows what is happening) as soon as
I try to jump to usermode.

Stanislaw Skowronek

--<=>--
  Paranoid: one who is truly in touch with reality.

---

From: Thiemo Seufer <[email-masked]>
Date: Tue, 27 Apr 2004 20:33:09 +0200

Stanislaw Skowronek wrote:
> isn't?

Sloppiness, I guess. They resolve to function pointers anyway. But the
flush_icache_range should be fixed to cover all memcpy'ed memory.

Thiemo

---

From: Stanislaw Skowronek <[email-masked]>
Date: Tue, 27 Apr 2004 20:54:25 +0200 (MET DST)

> flush_icache_range should be fixed to cover all memcpy'ed memory.

Yes, I've done it, too. Still gets hung. I wonder why, I have looked at
all exception code and it is 64-bit-clean (except for some bit that is
only compiled on SMP, so I don't really care).

/s

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 27 Apr 2004 21:28:28 +0200

> I try to jump to usermode.

Have you verified that the UX bit is set correctly by your kernel?  BEV
also plays a role but since you survive BogoMIPS it should be right.

  Ralf

---

From: Stanislaw Skowronek <[email-masked]>
Date: Wed, 28 Apr 2004 07:37:06 +0200 (MET DST)

> also plays a role but since you survive BogoMIPS it should be right.

From what I remember, the UX bit is fixed set. I have made the machine
print a '*' (no, I didn't use printk, but since it's my own console
driver I'm pretty sure it can work in interrupts - all it does is
hardware writes) whenever it gets a TLB refill and flushed the TLB before
entering usermode. Guess what, I didn't get a single '*' after ERET. To
verify my method, I've made a single read from the usermode PC from the
kernel, and the '*' appeared. I don't know what's up.

Stanislaw

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 28 Apr 2004 19:27:21 +0200

> kernel, and the '*' appeared. I don't know what's up.

printk can be used in exceptions.

Be careful when changing the TLB exception handlers.  They occupy slots
of just 128 bytes or 32 instructions.  Maybe your debugging code just
extended it beyond that maximum?

  Ralf