[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 202/437: Ensure the end argument of __clear_cache is pag
From: |
Andy Wingo |
Subject: |
[Guile-commits] 202/437: Ensure the end argument of __clear_cache is page aligned. |
Date: |
Mon, 2 Jul 2018 05:14:18 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 066db584c9e3d0b367ea94401373072735335fa2
Author: pcpa <address@hidden>
Date: Mon Apr 8 18:00:36 2013 -0300
Ensure the end argument of __clear_cache is page aligned.
* lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache
aligning to the next page boundary the end argument. It may
actually truncate it.
---
ChangeLog | 6 ++++++
lib/jit_arm.c | 3 ++-
lib/jit_ppc.c | 3 ++-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a174e64..fe265f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-08 Paulo Andrade <address@hidden>
+
+ * lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache
+ aligning to the next page boundary the end argument. It may
+ actually truncate it.
+
2013-03-29 Paulo Andrade <address@hidden>
* include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c,
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index c4fe59e..07223e5 100644
--- a/lib/jit_arm.c
+++ b/lib/jit_arm.c
@@ -1563,7 +1563,8 @@ _emit_code(jit_state_t *_jit)
patch_at(_jitc->patches.ptr[offset].kind & ~arm_patch_node, word,
value);
}
- __clear_cache(_jit->code.ptr, _jit->pc.uc);
+ word = sysconf(_SC_PAGE_SIZE);
+ __clear_cache(_jit->code.ptr, (void *)((_jit->pc.w + word) & -word));
return (_jit->code.ptr);
}
diff --git a/lib/jit_ppc.c b/lib/jit_ppc.c
index a09b24f..1f1c6b4 100644
--- a/lib/jit_ppc.c
+++ b/lib/jit_ppc.c
@@ -1346,7 +1346,8 @@ _emit_code(jit_state_t *_jit)
patch_at(_jitc->patches.ptr[offset].inst, word);
}
- __clear_cache(_jit->code.ptr, _jit->pc.uc);
+ word = sysconf(_SC_PAGE_SIZE);
+ __clear_cache(_jit->code.ptr, (void *)((_jit->pc.w + word) & -word));
return (_jit->code.ptr);
}
- [Guile-commits] 177/437: Correct reference to dangling pointer and better note bounds checking, (continued)
- [Guile-commits] 177/437: Correct reference to dangling pointer and better note bounds checking, Andy Wingo, 2018/07/02
- [Guile-commits] 167/437: Change type of return of jit_arg* and argument to jit_getarg*, Andy Wingo, 2018/07/02
- [Guile-commits] 168/437: Add new extensive float comparison and conversion test case, Andy Wingo, 2018/07/02
- [Guile-commits] 192/437: Correct SPARC optimized assembly example in documentation, Andy Wingo, 2018/07/02
- [Guile-commits] 93/437: subtract 1 from the final byte being flushed in PPC jit_flush_code, Andy Wingo, 2018/07/02
- [Guile-commits] 176/437: Add the new jit_name call to mark function boundaries, Andy Wingo, 2018/07/02
- [Guile-commits] 146/437: Add several arithmetic and branch tests cases., Andy Wingo, 2018/07/02
- [Guile-commits] 191/437: Add updated sparc example from lightning 1.2c documentation., Andy Wingo, 2018/07/02
- [Guile-commits] 151/437: Add new varargs test and correct related test case failures in all ports., Andy Wingo, 2018/07/02
- [Guile-commits] 198/437: Remove non optional gmp dependency., Andy Wingo, 2018/07/02
- [Guile-commits] 202/437: Ensure the end argument of __clear_cache is page aligned.,
Andy Wingo <=
- [Guile-commits] 197/437: Adapt PowerPC port to work in Darwin 32 bit and Linux 64 bit., Andy Wingo, 2018/07/02
- [Guile-commits] 184/437: Implement the "live" code to explicitly tell a register is live., Andy Wingo, 2018/07/02
- [Guile-commits] 149/437: Make all current test cases pass in Darwin PowerPC., Andy Wingo, 2018/07/02
- [Guile-commits] 113/437: Change JIT_REXTMP, JIT_R, JIT_V to use 64-bit registers, Andy Wingo, 2018/07/02
- [Guile-commits] 173/437: Add filename and line number annotation abstraction., Andy Wingo, 2018/07/02
- [Guile-commits] 201/437: Do not start over jit generation if can safely grow buffer size., Andy Wingo, 2018/07/02
- [Guile-commits] 152/437: Remove most type casts and compile test tool silently with -Wall, Andy Wingo, 2018/07/02
- [Guile-commits] 208/437: Implement fpr register arguments and minor extra fixes., Andy Wingo, 2018/07/02
- [Guile-commits] 211/437: Correct the cvt.tst test case on Itanium., Andy Wingo, 2018/07/02
- [Guile-commits] 187/437: Correct regression with float arguments in arm hardp, Andy Wingo, 2018/07/02