From patchwork Mon Sep 21 12:27:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Desnogues X-Patchwork-Id: 33988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1ECACB7B6B for ; Mon, 21 Sep 2009 22:28:48 +1000 (EST) Received: from localhost ([127.0.0.1]:46773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mpi0Y-0002NP-LH for incoming@patchwork.ozlabs.org; Mon, 21 Sep 2009 08:28:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mphzt-0002Mv-Jc for qemu-devel@nongnu.org; Mon, 21 Sep 2009 08:28:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mphzt-0002Mg-15 for qemu-devel@nongnu.org; Mon, 21 Sep 2009 08:28:01 -0400 Received: from [199.232.76.173] (port=49259 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mphzs-0002Md-Te for qemu-devel@nongnu.org; Mon, 21 Sep 2009 08:28:00 -0400 Received: from fg-out-1718.google.com ([72.14.220.156]:20475) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mphzs-00082X-Ih for qemu-devel@nongnu.org; Mon, 21 Sep 2009 08:28:00 -0400 Received: by fg-out-1718.google.com with SMTP id e21so723222fga.10 for ; Mon, 21 Sep 2009 05:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=cko/QS9syDpcE6TArjKVlq2D4vPQpT7GAmPcAXxe2qU=; b=JbmKrmGQkA93JbOqfcv6Eyj2q0YN4i7aMSGRCW7iWtI2BCyhy8+SWkikmXsGbM2B80 A68Xw7YIAtcMG96iSnECtCon230kwwDs0q5AbY/JmGKq1Ia0Vi1C2nzPqBnGgv3YUiDh lsGMXO4ERCPc7q8SgDRnzXUfhoAK1qzsvgHlo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=RXN+whJywnm9E+53tfkby9a7jZe29A7rfuHjidlsXuVMtlMKlimZYXjJl5f68ZYU56 i26YBLKU2XJeopEV0iXrZRF5vjIabWpV2D+phAKGOoIU+jN5ZnqD1rkM8qjXpA2ls+zV s3jyxOHUKHF62uLuYMa5l0Pv+wgcpeXIMxs+M= MIME-Version: 1.0 Received: by 10.86.184.35 with SMTP id h35mr4586426fgf.18.1253536079298; Mon, 21 Sep 2009 05:27:59 -0700 (PDT) Date: Mon, 21 Sep 2009 14:27:59 +0200 Message-ID: <761ea48b0909210527i6ed97be5s4208d7a0227d9de5@mail.gmail.com> From: Laurent Desnogues To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH] ARM host: fix generated blocks linking X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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);