From: Linus Torvalds <torvalds@cs.Helsinki.FI>
Subject: Re: test patch for random crashes
Date: Tue, 16 Apr 1996 08:52:09 +0300 (EET DST) [thread overview]
Message-ID: <4c7bf230b8a9ea2572026d76070e61b3.axp-list@archive.invalid> (raw)
In-Reply-To: <m0u8pwR-00025dC@atheist.tamu.edu>
On Mon, 15 Apr 1996, Richard Henderson wrote:
>
> Those of you who were, like me, experiencing random program
> crashes, e.g. "touch" on bootup, should try the following.
> It seems to have worked for me on my eb164.
Aieee.. I was afraid of that.
I was hoping that the 21164 kept the instruction cache tagged by ITLB
entries, because that is what the eb164 PAL-code seems to imply (it's not
implied in any of my documentation, but comparing PAL-code for ev4 and
ev5 based machines I assumed it was true).
The ev4(ev45) palcode does an instruction cache invalidate automatically
when you invalidate ITLB entries, and the ev5 PAL-code doesn't do that. I
hoped that that was because the hardware automatically does the right
thing (and invalidates only the icache entries that are invalidated by
the itlb flush), but that is obviously not true if this patch helps.
Damn, this is actually one place where the alpha PAL-code design is
completely broken: there is no way to invalidate only user-mode icache,
even though the hardware has the support for it (imb() invalidates all of
the icache, even though we only want to do it for non-ASN pages). I'd
also like a page-granular icache invalidate. Oh, well..
> --- pgtable.h.orig Sat Apr 6 19:37:13 1996
> +++ pgtable.h Mon Apr 15 09:49:08 1996
> @@ -12,11 +12,11 @@
> #include <asm/system.h>
>
> /* Caches aren't brain-dead on the alpha. */
> -#define flush_cache_all() do { } while (0)
> -#define flush_cache_mm(mm) do { } while (0)
> -#define flush_cache_range(mm, start, end) do { } while (0)
> -#define flush_cache_page(vma, vmaddr) do { } while (0)
> -#define flush_page_to_ram(page) do { } while (0)
> +#define flush_cache_all() imb()
> +#define flush_cache_mm(mm) imb()
> +#define flush_cache_range(mm, start, end) imb()
> +#define flush_cache_page(vma, vmaddr) imb()
> +#define flush_page_to_ram(page) imb()
>
> /*
> * Flush current user mapping.
The above patch flushes a lot too much, but I guess that's better than
being buggy. I'll try to come up with a nicer way to do this. We should
potentially be able to flush in a more controlled manner by doing
get_mmu_context(current); /* get new ASN number */
switch_to_self(current); /* do a swpctx to ourself */
(that also takes care of the tlb flush). Anyway, thanks for pinpointing
this bug (it was high on my list of suspects, but I was hoping that it
wouldn't turn out to be this one).
Linus
next prev parent reply other threads:[~1996-04-16 5:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-04-15 15:11 test patch for random crashes Richard Henderson
1996-04-16 5:52 ` Linus Torvalds [this message]
1996-04-16 21:32 ` Jim Paradis
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox