From patchwork Mon Sep 21 12:27:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ARM host: fix generated blocks linking Date: Mon, 21 Sep 2009 02:27:59 -0000 From: Laurent Desnogues X-Patchwork-Id: 33988 Message-Id: <761ea48b0909210527i6ed97be5s4208d7a0227d9de5@mail.gmail.com> To: qemu-devel@nongnu.org Hello, this patch fixes the linking of generated blocks on an ARM host. No need to say this brings a very nice speedup :-) Laurent Signed-off-by: Laurent Desnogues diff --git a/exec-all.h b/exec-all.h index 51519ff..daafc78 100644 --- a/exec-all.h +++ b/exec-all.h @@ -208,7 +208,9 @@ static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr #endif /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */ - *(uint32_t *)jmp_addr |= ((addr - (jmp_addr + 8)) >> 2) & 0xffffff; + *(uint32_t *)jmp_addr = + (*(uint32_t *)jmp_addr & ~0xffffff) + | (((addr - (jmp_addr + 8)) >> 2) & 0xffffff); #if QEMU_GNUC_PREREQ(4, 1) __clear_cache((char *) jmp_addr, (char *) jmp_addr + 4);