[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lightning] PPC problem
From: |
Paolo Bonzini |
Subject: |
Re: [Lightning] PPC problem |
Date: |
Thu, 09 Oct 2008 10:19:35 +0200 |
User-agent: |
Thunderbird 2.0.0.17 (Macintosh/20080914) |
Eli Barzilay wrote:
> There was a PPC problem that we've just fixed, and I'm forwarding it
> here in case it's not fixed in the lightning repository:
>
> (Quoting Matthew Flatt)
>
> The problem was a bug in lightning's icache-flushing code (used by the
> JIT) It could walk one word past the end of an allocated page onto an
> unallocated page. The bug was exposed by yesterday's change to the way
> that memory is allocated to hold JIT-generated native code.
>
> The fix is in "lightning/ppc/funcs.h": subtract 1 from `end' here:
>
> end -= ((long) end - 1) & (cache_line_size - 1);
Thanks, here's what I applied:
diff --git a/lightning/ppc/funcs.h b/lightning/ppc/funcs.h
index 9f3df90..ae9301f 100644
--- a/lightning/ppc/funcs.h
+++ b/lightning/ppc/funcs.h
@@ -67,6 +67,9 @@ jit_flush_code(void *start, void *end)
break;
}
+ /* Point end to the last byte being flushed. */
+ end =(void*)( (long)(end - 1));
+
start =(void*)( (long)start - (((long) start) & (cache_line_size - 1)));
end =(void*)( (long)end - (((long) end) & (cache_line_size - 1)));
Paolo