From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496987403846462.31956264790085; Thu, 8 Jun 2017 22:50:03 -0700 (PDT) Received: from localhost ([::1]:52791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCo6-0001D2-CA for importer@patchew.org; Fri, 09 Jun 2017 01:50:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCbu-0005yy-VQ for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCbt-0001ca-8G for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:27 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:35357) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCbt-0001cW-1s for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:25 -0400 Received: by mail-qt0-x243.google.com with SMTP id x58so13035289qtc.2 for ; Thu, 08 Jun 2017 22:37:24 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=oDRRT5oEJ45GqPMcVa+6Rg35Tdm/DUmqvvnNicEJ5Qw=; b=IzKZpbNe+DTg77ruCgxAd5Yh6uXJqAOeeg1xoANC7LSte89VaJFCeXRc1MueZAIwd8 Bgrwcl1P2As+6YfyXXtAf79qOV1A7dibe6fvpw1bB/b9VnOQqh5FM6wEjykumAWcsXt3 J3b9N+mQzbvwKkpBLZlaDrhhVSGfYvTGZw817kyiM7FMt/6ar1xGGk2Wz1MJ4GmH/uRr GzE8j4+B7P1EGU0KGB8pREk8RQ4qO4tmStNZ+uoklLpoKx4o/hVSlc3buy8teeOlQuQ+ hmQqTIYxFDd/s0C/0DXRu6JP46oG+XLHjpmaxoOYD57r7MBHMM2V+3XGbDRcK2SSwaPE AkZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=oDRRT5oEJ45GqPMcVa+6Rg35Tdm/DUmqvvnNicEJ5Qw=; b=QhSiwWwJQTI0fb7UYlTfR3UzDBNNpzI6oZoOSQd12UTIXgBDIj2Ni0H7xNKFEeemJj p/rsy5f4/2oiKzn1CdIGnSFjmvjvi3vBo1K0HtRmkIi5ucu5i/VehBZM/4racFDkRIae GdQCnKiWXCIXjN7ki/ml+/fR6MVsAoS2ZoarUB12ewiPrVnnG4qAXZGulqYPRvr3lwcb iuX+EcPA2bWHIQhV5k6s1S4Q6uk9Cpvci5Qk4SW1rYxT0vl+jnNM9B1nYS1KFsFgFzBx OSnMVN8NjJTmyQPtBPBOnrhW6Kip5ZqqQ+wtnnQoN8VA1JfL4Tojy1fYR5KpCEBJCDbC 7jsg== X-Gm-Message-State: AKS2vOyn3so6Vz4yEMv7OgE/EezIkJdCAh6E2EXJ2iuDo2nAWjsi+URR jvfAwvOyAR2cwbXPHeA= X-Received: by 10.200.43.217 with SMTP id n25mr52343817qtn.190.1496986644155; Thu, 08 Jun 2017 22:37:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:13 -0700 Message-Id: <20170609053719.26251-2-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 1/7] util: add cacheinfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" Add helpers to gather cache info from the host at init-time. For now, only export the host's I/D cache line sizes, which we will use to improve cache locality to avoid false sharing. Suggested-by: Richard Henderson Suggested-by: Geert Martin Ijewski Tested-by: Geert Martin Ijewski Signed-off-by: Emilio G. Cota Message-Id: <1496794624-4083-1-git-send-email-cota@braap.org> [rth: Move all implementations from tcg/ppc/] Signed-off-by: Richard Henderson --- include/qemu/osdep.h | 3 + tcg/ppc/tcg-target.inc.c | 71 +----------------- util/Makefile.objs | 1 + util/cacheinfo.c | 185 +++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 191 insertions(+), 69 deletions(-) create mode 100644 util/cacheinfo.c diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 1c9f5e2..ee43521 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -470,4 +470,7 @@ char *qemu_get_pid_name(pid_t pid); */ pid_t qemu_fork(Error **errp); =20 +extern int qemu_icache_linesize; +extern int qemu_dcache_linesize; + #endif diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index 8d50f18..1f690df 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -2820,14 +2820,11 @@ void tcg_register_jit(void *buf, size_t buf_size) } #endif /* __ELF__ */ =20 -static size_t dcache_bsize =3D 16; -static size_t icache_bsize =3D 16; - void flush_icache_range(uintptr_t start, uintptr_t stop) { uintptr_t p, start1, stop1; - size_t dsize =3D dcache_bsize; - size_t isize =3D icache_bsize; + size_t dsize =3D qemu_dcache_linesize; + size_t isize =3D qemu_icache_linesize; =20 start1 =3D start & ~(dsize - 1); stop1 =3D (stop + dsize - 1) & ~(dsize - 1); @@ -2844,67 +2841,3 @@ void flush_icache_range(uintptr_t start, uintptr_t s= top) asm volatile ("sync" : : : "memory"); asm volatile ("isync" : : : "memory"); } - -#if defined _AIX -#include - -static void __attribute__((constructor)) tcg_cache_init(void) -{ - icache_bsize =3D _system_configuration.icache_line; - dcache_bsize =3D _system_configuration.dcache_line; -} - -#elif defined __linux__ -static void __attribute__((constructor)) tcg_cache_init(void) -{ - unsigned long dsize =3D qemu_getauxval(AT_DCACHEBSIZE); - unsigned long isize =3D qemu_getauxval(AT_ICACHEBSIZE); - - if (dsize =3D=3D 0 || isize =3D=3D 0) { - if (dsize =3D=3D 0) { - fprintf(stderr, "getauxval AT_DCACHEBSIZE failed\n"); - } - if (isize =3D=3D 0) { - fprintf(stderr, "getauxval AT_ICACHEBSIZE failed\n"); - } - exit(1); - } - dcache_bsize =3D dsize; - icache_bsize =3D isize; -} - -#elif defined __APPLE__ -#include - -static void __attribute__((constructor)) tcg_cache_init(void) -{ - size_t len; - unsigned cacheline; - int name[2] =3D { CTL_HW, HW_CACHELINE }; - - len =3D sizeof(cacheline); - if (sysctl(name, 2, &cacheline, &len, NULL, 0)) { - perror("sysctl CTL_HW HW_CACHELINE failed"); - exit(1); - } - dcache_bsize =3D cacheline; - icache_bsize =3D cacheline; -} - -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -#include - -static void __attribute__((constructor)) tcg_cache_init(void) -{ - size_t len =3D 4; - unsigned cacheline; - - if (sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0)= ) { - fprintf(stderr, "sysctlbyname machdep.cacheline_size failed: %s\n", - strerror(errno)); - exit(1); - } - dcache_bsize =3D cacheline; - icache_bsize =3D cacheline; -} -#endif diff --git a/util/Makefile.objs b/util/Makefile.objs index c6205eb..94d9477 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -20,6 +20,7 @@ util-obj-y +=3D host-utils.o util-obj-y +=3D bitmap.o bitops.o hbitmap.o util-obj-y +=3D fifo8.o util-obj-y +=3D acl.o +util-obj-y +=3D cacheinfo.o util-obj-y +=3D error.o qemu-error.o util-obj-y +=3D id.o util-obj-y +=3D iov.o qemu-config.o qemu-sockets.o uri.o notify.o diff --git a/util/cacheinfo.c b/util/cacheinfo.c new file mode 100644 index 0000000..f987522 --- /dev/null +++ b/util/cacheinfo.c @@ -0,0 +1,185 @@ +/* + * cacheinfo.c - helpers to query the host about its caches + * + * Copyright (C) 2017, Emilio G. Cota + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" + +int qemu_icache_linesize =3D 0; +int qemu_dcache_linesize =3D 0; + +/* + * Operating system specific detection mechanisms. + */ + +#if defined(_AIX) +# include + +static void sys_cache_info(int *isize, int *dsize) +{ + *isize =3D _system_configuration.icache_line; + *dsize =3D _system_configuration.dcache_line; +} + +#elif defined(_WIN32) + +static void sys_cache_info(int *isize, int *dsize) +{ + SYSTEM_LOGICAL_PROCESSOR_INFORMATION *buf; + DWORD size =3D 0; + BOOL success; + size_t i, n; + + /* Check for the required buffer size first. Note that if the zero + size we use for the probe results in success, then there is no + data available; fail in that case. */ + success =3D GetLogicalProcessorInformation(0, &size); + if (success || GetLastError() !=3D ERROR_INSUFFICIENT_BUFFER) { + return; + } + + n =3D size / sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); + size =3D n * sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); + buf =3D g_new0(SYSTEM_LOGICAL_PROCESSOR_INFORMATION, n); + if (!GetLogicalProcessorInformation(buf, &size)) { + goto fail; + } + + for (i =3D 0; i < n; i++) { + if (buf[i].Relationship =3D=3D RelationCache + && buf[i].Cache.Level =3D=3D 1) { + switch (buf[i].Cache.Type) { + case CacheUnified: + *isize =3D *dsize =3D buf[i].Cache.LineSize; + break; + case CacheInstruction: + *isize =3D buf[i].Cache.LineSize; + break; + case CacheData: + *dsize =3D buf[i].Cache.LineSize; + break; + default: + break; + } + } + } + fail: + g_free(buf); +} + +#elif defined(__APPLE__) \ + || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# include +# if defined(__APPLE__) +# define SYSCTL_CACHELINE_NAME "hw.cachelinesize" +# else +# define SYSCTL_CACHELINE_NAME "machdep.cacheline_size" +# endif + +static void sys_cache_info(int *isize, int *dsize) +{ + /* There's only a single sysctl for both I/D cache line sizes. */ + long size; + size_t len =3D sizeof(size); + if (!sysctlbyname(SYSCTL_CACHELINE_NAME, &size, &len, NULL, 0)) { + *isize =3D *dsize =3D size; + } +} + +#else +/* POSIX */ + +static void sys_cache_info(int *isize, int *dsize) +{ +# ifdef _SC_LEVEL1_ICACHE_LINESIZE + *isize =3D sysconf(_SC_LEVEL1_ICACHE_LINESIZE); +# endif +# ifdef _SC_LEVEL1_DCACHE_LINESIZE + *dsize =3D sysconf(_SC_LEVEL1_DCACHE_LINESIZE); +# endif +} +#endif /* sys_cache_info */ + +/* + * Architecture (+ OS) specific detection mechanisms. + */ + +#if defined(__aarch64__) + +static void arch_cache_info(int *isize, int *dsize) +{ + if (*isize =3D=3D 0 || *dsize =3D=3D 0) { + unsigned ctr; + + /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1, + but (at least under Linux) these are marked protected by the + kernel. However, CTR_EL0 contains the minimum linesize in the + entire hierarchy, and is used by userspace cache flushing. */ + asm volatile("mrs\t%0, ctr_el0" : "=3Dr"(ctr)); + if (*isize =3D=3D 0) { + *isize =3D 4 << (ctr & 0xf); + } + if (*dsize =3D=3D 0) { + *dsize =3D 4 << ((ctr >> 16) & 0xf); + } + } +} + +#elif defined(_ARCH_PPC) && defined(__linux__) + +static void arch_cache_info(int *isize, int *dsize) +{ + if (*isize =3D=3D 0) { + *isize =3D qemu_getauxval(AT_ICACHEBSIZE); + } + if (*dsize =3D=3D 0) { + *dsize =3D qemu_getauxval(AT_DCACHEBSIZE); + } +} + +#else +static void arch_cache_info(int *isize, int *dsize) { } +#endif /* arch_cache_info */ + +/* + * ... and if all else fails ... + */ + +static void fallback_cache_info(int *isize, int *dsize) +{ + /* If we can only find one of the two, assume they're the same. */ + if (*isize) { + if (*dsize) { + /* Success! */ + } else { + *dsize =3D *isize; + } + } else if (*dsize) { + *isize =3D *dsize; + } else { +#if defined(_ARCH_PPC) + /* For PPC, we're going to use the icache size computed for + flush_icache_range. Which means that we must use the + architecture minimum. */ + *isize =3D *dsize =3D 16; +#else + /* Otherwise, 64 bytes is not uncommon. */ + *isize =3D *dsize =3D 64; +#endif + } +} + +static void __attribute__((constructor)) init_cache_info(void) +{ + int isize =3D 0, dsize =3D 0; + + sys_cache_info(&isize, &dsize); + arch_cache_info(&isize, &dsize); + fallback_cache_info(&isize, &dsize); + + qemu_icache_linesize =3D isize; + qemu_dcache_linesize =3D dsize; +} --=20 2.9.4 From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496986823328503.20876068757934; Thu, 8 Jun 2017 22:40:23 -0700 (PDT) Received: from localhost ([::1]:52736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCei-0008SR-QO for importer@patchew.org; Fri, 09 Jun 2017 01:40:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCbv-000614-NM for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCbu-0001co-Ca for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:27 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:36845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCbu-0001ck-7R for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:26 -0400 Received: by mail-qt0-x244.google.com with SMTP id s33so13043720qtg.3 for ; Thu, 08 Jun 2017 22:37:26 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AsCQswCx954j+sAL1Aci2LW/E9SdgngUR02mJs6IvBM=; b=eUhpCy7LBfNGmzi28ja4EzYQcXef/RFjh2O/Kgn1F9qeDWpctbgmpwf+gNTzZbH98Z wjimBV51LIHLSQOZz1W4VNFUAgkgBV3FXPHtvS/fCPr4HXGfZbTc+GE2Z5wK7cIzunog uzHENZqOzKAC1rYNBOluiFjIXzgP+LgVSdKNj9xPVKUYNoiZHMen4JXmHUsWSbFlUrEp 70MI1E0KbTcvo0A3jaB/HS+AaslqGujy714srsMFnymXoqchMc7je6Kxz/Fk3q0FoP/r Jjtrnx1DIiafuL46+0+XIV5gWcg/teHr4rMp8Vgj2OIFHQ/JhGjiW6PjwYW4/++saoEv Mzxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AsCQswCx954j+sAL1Aci2LW/E9SdgngUR02mJs6IvBM=; b=bO0yU9/PXOyCTbJl3wQubE21f64xhoxQph0G+wsjE/5S8bXLgq0zzDukYoVUSTt2yO JONJdjiOq0IT6dTcx1D5gB9OEEalMNEPPZ836Uy4OrZqeCVI/t97O5vN2nVqaOp2sRYx rh7Aih5nD7TBgGjhX1W0kFKnx08SX8jl3ZZdbaQO+cCHVHCewqkliDD4ZCjVyemwraCE oDPCSuPtIfbbnNxUmd2juEmbsaZ2vH3pV0L7WyTZn1tv+ChPPGVG+jBGtO5KjzcQBAxA VB+00B/GIRjDyicsVTdbZogvLvqajtOHosA9iJ7ky3zGwQ3njVeC0tw3/gweUiz7rxsn FISg== X-Gm-Message-State: AKS2vOyJBb0yzPRzQLK8+Y/3G//H8M2j9jdT2GkhaVGvR/canTL28+Vy q7Onr2yAcFt2rk8ijKg= X-Received: by 10.237.50.4 with SMTP id y4mr31083362qtd.50.1496986645468; Thu, 08 Jun 2017 22:37:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:14 -0700 Message-Id: <20170609053719.26251-3-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v5 2/7] tcg: allocate TB structs before the corresponding translated code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" Allocating an arbitrarily-sized array of tbs results in either (a) a lot of memory wasted or (b) unnecessary flushes of the code cache when we run out of TB structs in the array. An obvious solution would be to just malloc a TB struct when needed, and keep the TB array as an array of pointers (recall that tb_find_pc() needs the TB array to run in O(log n)). Perhaps a better solution, which is implemented in this patch, is to allocate TB's right before the translated code they describe. This results in some memory waste due to padding to have code and TBs in separate cache lines--for instance, I measured 4.7% of padding in the used portion of code_gen_buffer when booting aarch64 Linux on a host with 64-byte cache lines. However, it can allow for optimizations in some host architectures, since TCG backends could safely assume that the TB and the corresponding translated code are very close to each other in memory. See this message by rth for a detailed explanation: https://lists.gnu.org/archive/html/qemu-devel/2017-03/msg05172.html Subject: Re: GSoC 2017 Proposal: TCG performance enhancements Message-ID: <1e67644b-4b30-887e-d329-1848e94c9484@twiddle.net> Suggested-by: Richard Henderson Reviewed-by: Pranith Kumar Signed-off-by: Emilio G. Cota Message-Id: <1496790745-314-3-git-send-email-cota@braap.org> [rth: Simplify the arithmetic in tcg_tb_alloc] Signed-off-by: Richard Henderson --- include/exec/tb-context.h | 3 ++- tcg/tcg.c | 20 ++++++++++++++++++++ tcg/tcg.h | 2 +- translate-all.c | 39 ++++++++++++++++++++++++--------------- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/include/exec/tb-context.h b/include/exec/tb-context.h index c7f17f2..25c2afe 100644 --- a/include/exec/tb-context.h +++ b/include/exec/tb-context.h @@ -31,8 +31,9 @@ typedef struct TBContext TBContext; =20 struct TBContext { =20 - TranslationBlock *tbs; + TranslationBlock **tbs; struct qht htable; + size_t tbs_size; int nb_tbs; /* any access to the tbs or the page table must use this lock */ QemuMutex tb_lock; diff --git a/tcg/tcg.c b/tcg/tcg.c index 564292f..3559829 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -383,6 +383,26 @@ void tcg_context_init(TCGContext *s) } } =20 +/* + * Allocate TBs right before their corresponding translated code, making + * sure that TBs and code are on different cache lines. + */ +TranslationBlock *tcg_tb_alloc(TCGContext *s) +{ + uintptr_t align =3D qemu_icache_linesize; + TranslationBlock *tb; + void *next; + + tb =3D (void *)ROUND_UP((uintptr_t)s->code_gen_ptr, align); + next =3D (void *)ROUND_UP((uintptr_t)(tb + 1), align); + + if (unlikely(next > s->code_gen_highwater)) { + return NULL; + } + s->code_gen_ptr =3D next; + return tb; +} + void tcg_prologue_init(TCGContext *s) { size_t prologue_size, total_size; diff --git a/tcg/tcg.h b/tcg/tcg.h index 5ec48d1..9e37722 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -697,7 +697,6 @@ struct TCGContext { here, because there's too much arithmetic throughout that relies on addition and subtraction working on bytes. Rely on the GCC extension that allows arithmetic on void*. */ - int code_gen_max_blocks; void *code_gen_prologue; void *code_gen_epilogue; void *code_gen_buffer; @@ -756,6 +755,7 @@ static inline bool tcg_op_buf_full(void) /* tb_lock must be held for tcg_malloc_internal. */ void *tcg_malloc_internal(TCGContext *s, int size); void tcg_pool_reset(TCGContext *s); +TranslationBlock *tcg_tb_alloc(TCGContext *s); =20 void tb_lock(void); void tb_unlock(void); diff --git a/translate-all.c b/translate-all.c index b3ee876..bb094ad 100644 --- a/translate-all.c +++ b/translate-all.c @@ -781,12 +781,13 @@ static inline void code_gen_alloc(size_t tb_size) exit(1); } =20 - /* Estimate a good size for the number of TBs we can support. We - still haven't deducted the prologue from the buffer size here, - but that's minimal and won't affect the estimate much. */ - tcg_ctx.code_gen_max_blocks - =3D tcg_ctx.code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE; - tcg_ctx.tb_ctx.tbs =3D g_new(TranslationBlock, tcg_ctx.code_gen_max_bl= ocks); + /* size this conservatively -- realloc later if needed */ + tcg_ctx.tb_ctx.tbs_size =3D + tcg_ctx.code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE / 8; + if (unlikely(!tcg_ctx.tb_ctx.tbs_size)) { + tcg_ctx.tb_ctx.tbs_size =3D 64 * 1024; + } + tcg_ctx.tb_ctx.tbs =3D g_new(TranslationBlock *, tcg_ctx.tb_ctx.tbs_si= ze); =20 qemu_mutex_init(&tcg_ctx.tb_ctx.tb_lock); } @@ -828,13 +829,20 @@ bool tcg_enabled(void) static TranslationBlock *tb_alloc(target_ulong pc) { TranslationBlock *tb; + TBContext *ctx; =20 assert_tb_locked(); =20 - if (tcg_ctx.tb_ctx.nb_tbs >=3D tcg_ctx.code_gen_max_blocks) { + tb =3D tcg_tb_alloc(&tcg_ctx); + if (unlikely(tb =3D=3D NULL)) { return NULL; } - tb =3D &tcg_ctx.tb_ctx.tbs[tcg_ctx.tb_ctx.nb_tbs++]; + ctx =3D &tcg_ctx.tb_ctx; + if (unlikely(ctx->nb_tbs =3D=3D ctx->tbs_size)) { + ctx->tbs_size *=3D 2; + ctx->tbs =3D g_renew(TranslationBlock *, ctx->tbs, ctx->tbs_size); + } + ctx->tbs[ctx->nb_tbs++] =3D tb; tb->pc =3D pc; tb->cflags =3D 0; tb->invalid =3D false; @@ -850,8 +858,10 @@ void tb_free(TranslationBlock *tb) Ignore the hard cases and just back up if this TB happens to be the last one generated. */ if (tcg_ctx.tb_ctx.nb_tbs > 0 && - tb =3D=3D &tcg_ctx.tb_ctx.tbs[tcg_ctx.tb_ctx.nb_tbs - 1]) { - tcg_ctx.code_gen_ptr =3D tb->tc_ptr; + tb =3D=3D tcg_ctx.tb_ctx.tbs[tcg_ctx.tb_ctx.nb_tbs - 1]) { + size_t struct_size =3D ROUND_UP(sizeof(*tb), qemu_icache_linesize); + + tcg_ctx.code_gen_ptr =3D tb->tc_ptr - struct_size; tcg_ctx.tb_ctx.nb_tbs--; } } @@ -1666,7 +1676,7 @@ static TranslationBlock *tb_find_pc(uintptr_t tc_ptr) m_max =3D tcg_ctx.tb_ctx.nb_tbs - 1; while (m_min <=3D m_max) { m =3D (m_min + m_max) >> 1; - tb =3D &tcg_ctx.tb_ctx.tbs[m]; + tb =3D tcg_ctx.tb_ctx.tbs[m]; v =3D (uintptr_t)tb->tc_ptr; if (v =3D=3D tc_ptr) { return tb; @@ -1676,7 +1686,7 @@ static TranslationBlock *tb_find_pc(uintptr_t tc_ptr) m_min =3D m + 1; } } - return &tcg_ctx.tb_ctx.tbs[m_max]; + return tcg_ctx.tb_ctx.tbs[m_max]; } =20 #if !defined(CONFIG_USER_ONLY) @@ -1874,7 +1884,7 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fpr= intf) direct_jmp_count =3D 0; direct_jmp2_count =3D 0; for (i =3D 0; i < tcg_ctx.tb_ctx.nb_tbs; i++) { - tb =3D &tcg_ctx.tb_ctx.tbs[i]; + tb =3D tcg_ctx.tb_ctx.tbs[i]; target_code_size +=3D tb->size; if (tb->size > max_target_code_size) { max_target_code_size =3D tb->size; @@ -1894,8 +1904,7 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fpr= intf) cpu_fprintf(f, "gen code size %td/%zd\n", tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer, tcg_ctx.code_gen_highwater - tcg_ctx.code_gen_buffer); - cpu_fprintf(f, "TB count %d/%d\n", - tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.code_gen_max_blocks); + cpu_fprintf(f, "TB count %d\n", tcg_ctx.tb_ctx.nb_tbs); cpu_fprintf(f, "TB avg target size %d max=3D%d bytes\n", tcg_ctx.tb_ctx.nb_tbs ? target_code_size / tcg_ctx.tb_ctx.nb_tbs : 0, --=20 2.9.4 From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496987168818704.6700406645571; Thu, 8 Jun 2017 22:46:08 -0700 (PDT) Received: from localhost ([::1]:52767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCkJ-0005lq-39 for importer@patchew.org; Fri, 09 Jun 2017 01:46:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCbw-00063B-Ax for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCbv-0001dB-JE for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:28 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:34723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCbv-0001d3-FX for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:27 -0400 Received: by mail-qt0-x242.google.com with SMTP id o21so13030628qtb.1 for ; Thu, 08 Jun 2017 22:37:27 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=suOvBjYsdyzgDadyYZ3dijcg+kPPRJEFebrn14pDwhU=; b=qxq6dN7gtjspEz4d1u6mdVyTT6yodQchL6khOrDYhFBMyoI0GHwGURg8ufHWB/jEYQ NF0zZVb29w+ZrNlKbWShEapXqXNrigBu0AhSEKI0zRDfPjg6c08pgmK0reqSrFAS1oC/ +ospJ/EiLABGIAAddbBBrL0rwacStvzJcbcTLVymchWPcVUi1DBXg9xFMh+fAyLQDi+d 6BU/0sncqfGI6XZGXEBg0rJpvYFHUIttT+pOqBnM5BP6xK4eUDbj1pQx4Hj4mzc63EFs DDF6PeVTL/W1JVXf9vNNJZzDhPdMKCHdjsRDA2rw85WsMkqZ8d9rXyBpOlKWfT2SuvXX pWFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=suOvBjYsdyzgDadyYZ3dijcg+kPPRJEFebrn14pDwhU=; b=IAwWGitwEPNuATgx2qUYKZMyhr2b1l4rJPfr+Z2P4FqHqGO7vxXZOk1unYIy1C4Qwc diishXWOO174Uv5zpUTq6Imc71PIawxl/0vRVsqsxG0YZ1LZcKm4AA0BCGB8gZNGDoqw iVc2TyZ2jYHVKHO3590eos//IbHWG48QfMnDdLY8K5mNWxzhnhtQebaKqqK+TV3Nwfpt IbOMXuI9gAsYuBhDAFL+9UYhG6G4d+suVbc0GPIVX9nndYpHsfhKkYIHjLOxhvXcpT3n JyvWBZp3a7tZA1QbpPZ5zwU4wEiWGNY22tA9yOkDYvllOkRIl9Ytl+YGR9JIyLSOWEa3 OIcQ== X-Gm-Message-State: AKS2vOw48LyLuHuZ+bNKxwV9EP3NhiX+FrKpbne/18ZerjLsBNprnkh8 IFsInA3bwo5ZC2KPnhU= X-Received: by 10.200.9.93 with SMTP id z29mr39462098qth.102.1496986646711; Thu, 08 Jun 2017 22:37:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:15 -0700 Message-Id: <20170609053719.26251-4-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v5 3/7] tcg/aarch64: Use ADR in tcg_out_movi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The new placement of the TB means that we can use one insn to load the return value for exit_tb returning the TB pointer. Tested-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 5f18545..1fa3bcc 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -616,7 +616,12 @@ static void tcg_out_movi(TCGContext *s, TCGType type, = TCGReg rd, /* Look for host pointer values within 4G of the PC. This happens often when loading pointers to QEMU's own data structures. */ if (type =3D=3D TCG_TYPE_I64) { - tcg_target_long disp =3D (value >> 12) - ((intptr_t)s->code_ptr >>= 12); + tcg_target_long disp =3D value - (intptr_t)s->code_ptr; + if (disp =3D=3D sextract64(disp, 0, 21)) { + tcg_out_insn(s, 3406, ADR, rd, disp); + return; + } + disp =3D (value >> 12) - ((intptr_t)s->code_ptr >> 12); if (disp =3D=3D sextract64(disp, 0, 21)) { tcg_out_insn(s, 3406, ADRP, rd, disp); if (value & 0xfff) { --=20 2.9.4 From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496986968072907.8001896280986; Thu, 8 Jun 2017 22:42:48 -0700 (PDT) Received: from localhost ([::1]:52749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCh4-0002L1-Kn for importer@patchew.org; Fri, 09 Jun 2017 01:42:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCbx-00067Q-Ms for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCbw-0001dY-MN for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:29 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:33537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCbw-0001dP-Hv for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:28 -0400 Received: by mail-qt0-x242.google.com with SMTP id w1so12993122qtg.0 for ; Thu, 08 Jun 2017 22:37:28 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=v2veKfHhEayApjwYm11wqpDdF+adv8/+qfr6Y9YSduc=; b=u/V4ylQeH3WK99oFt5fzJmPJp7d5l9yXh13UBK8rwQH7DVxUCh+cBBvlSJoZnLlJtN IAz2ngSBKbOIaeBjhelrw1W4mHQ4kMpHGlMdm+7KqH9szUUBKimX2dDm3MjLsfstSAr3 HZgW601wggQOehFNKDTlP7mK8j1oygIe5+4YtiObBRAwdghokgFnQ93YyVI3YPY9NAE2 5RbqimcK6r4AwpUT9G66+sxtULtjSLfUEI28Vu8vjhJG98dCgFEv8A3RY8z0hz6IJvl0 zyrej/x/HwJexVsjo0u2LxUW4/+D3aGmE2vt9bsMYFDFTbrNCDFeDxoLpsPbVWRERta8 goGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=v2veKfHhEayApjwYm11wqpDdF+adv8/+qfr6Y9YSduc=; b=hYsqkl2ZMQyJh8zxD53JH56z09E7+zRoxisAsg08VZ1Q8BVlPHHD9mwfldvoRdKJWq t+3Ji0YPKiLiHt/kv0cGvH8E5n+drbA3ep6bYFpahWLvElkES2eizblMg3Rc6g8PmYIc Vidg/43KVnTztCXZw3m7KysHIvnwOwPe6zghy2D5yDmUJFfVkMRaI7WF9zosAOrr5jcr mFd+tDQjSR4KVu4faNxSgEzO47volu/WZEaxpgOPI1Sn0qxzjJpahTzs4LkVUde+ykUb N/ITBVw1JjpS6yIAqeAlxiARSrjPzEqvDsUTMIKl2o0JZ8cX84ma6i6Up5+lhyFah19h 3yzw== X-Gm-Message-State: AODbwcA/l1jfIp3CG8yrQvVlshJSsg/R/mJXt5HgiAqmUq+iFXyI/f1y fZuWZ+0/lYVhFgz5wdU= X-Received: by 10.237.62.8 with SMTP id l8mr48040648qtf.20.1496986647873; Thu, 08 Jun 2017 22:37:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:16 -0700 Message-Id: <20170609053719.26251-5-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v5 4/7] tcg/arm: Use indirect branch for goto_tb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 5 +---- tcg/arm/tcg-target.inc.c | 17 ++--------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 87ae10b..724ec73 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -301,7 +301,7 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(= CPUState *cpu, #define CODE_GEN_AVG_BLOCK_SIZE 150 #endif =20 -#if defined(__arm__) || defined(_ARCH_PPC) \ +#if defined(_ARCH_PPC) \ || defined(__x86_64__) || defined(__i386__) \ || defined(__sparc__) || defined(__aarch64__) \ || defined(__s390x__) || defined(__mips__) \ @@ -401,9 +401,6 @@ static inline void tb_set_jmp_target1(uintptr_t jmp_add= r, uintptr_t addr) #elif defined(__aarch64__) void aarch64_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr); #define tb_set_jmp_target1 aarch64_tb_set_jmp_target -#elif defined(__arm__) -void arm_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr); -#define tb_set_jmp_target1 arm_tb_set_jmp_target #elif defined(__sparc__) || defined(__mips__) void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr); #else diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index 9f5cb66..fce382f 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -1026,16 +1026,6 @@ static void tcg_out_call(TCGContext *s, tcg_insn_uni= t *addr) } } =20 -void arm_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr) -{ - tcg_insn_unit *code_ptr =3D (tcg_insn_unit *)jmp_addr; - tcg_insn_unit *target =3D (tcg_insn_unit *)addr; - - /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush= */ - reloc_pc24_atomic(code_ptr, target); - flush_icache_range(jmp_addr, jmp_addr + 4); -} - static inline void tcg_out_goto_label(TCGContext *s, int cond, TCGLabel *l) { if (l->has_value) { @@ -1665,11 +1655,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpco= de opc, } break; case INDEX_op_goto_tb: - if (s->tb_jmp_insn_offset) { - /* Direct jump method */ - s->tb_jmp_insn_offset[args[0]] =3D tcg_current_code_size(s); - tcg_out_b_noaddr(s, COND_AL); - } else { + tcg_debug_assert(s->tb_jmp_insn_offset =3D=3D 0); + { /* Indirect jump method */ intptr_t ptr =3D (intptr_t)(s->tb_jmp_target_addr + args[0]); tcg_out_movi32(s, COND_AL, TCG_REG_R0, ptr & ~0xfff); --=20 2.9.4 From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496987116050546.9438727690736; Thu, 8 Jun 2017 22:45:16 -0700 (PDT) Received: from localhost ([::1]:52759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCjS-0004w4-FK for importer@patchew.org; Fri, 09 Jun 2017 01:45:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCby-0006Ay-JC for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCbx-0001ds-Rw for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:30 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:33539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCbx-0001dm-Np for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:29 -0400 Received: by mail-qt0-x242.google.com with SMTP id w1so12993154qtg.0 for ; Thu, 08 Jun 2017 22:37:29 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gtx8v0a7RDShL/b6uJTCkn6FjFgPVuofukKKY2oheps=; b=Wv729DiBRB6cyuzX6RVRDeanxFhSZu8AOH4LqddOIqlSegv6KZ+MOflEVTdC7owIt6 OCd/JRipbHA8nmoC7DrX3fgk7hDwYveN8jR3XxsobPcnOweYAxW2k8/Jn0nNBYlA8htv gkAk3U+FDX7gYWVCeS68tifOZzKoth9HIYV7egDoZ7Rwrp1pIFwDyXu/o2+pDubGvTkj NdPCJF99HFCBmA2UuznLAn8FQw8Cs7mriGGMtLX/zHSqqQlP/jz1/ypEVxtmwj0Cn1tT A6cQt+y9+0dgnaE3MvRbfWGduq2A93L5mIJkxosxlL0XeKVRW31vTQ4N+koFxcv3NnFm rZog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=gtx8v0a7RDShL/b6uJTCkn6FjFgPVuofukKKY2oheps=; b=aJUSZGqPlKhZZgOstWjavyyhsabtha100seglZ8rEs6cjBU1Ufn+i7R91P+3/Ng2D2 mLni2PFakKYrLZoN2CjRJqK2wdNti0F7zJo+trBKNEoan2Xfjx7Wo8YeyNbqM3hiKY1G DHjX5t3KjVEDgOcrIlHUlwSg3U+svhhZEwfWg4wXD25M5hVqPI+cLuH/X4Z9kp7JRGAF qYm4EvDsDZr9CbLB/jk/QglWSrfYYK6kmL4HH+xPJJhCV1VMew134ty6Jm1hqSBQjApB kqrxY0OuGYCeTrDx1RZ8k6Z+XPL5q9fAnnw/Qhbi32Ypc23ksE6mJWSRJgVeOf3Hhy2u l4iQ== X-Gm-Message-State: AODbwcBtgRbTmUN8xNRpeNMcLiaQyzQxbjy2fYpyp6UpkEgQHljMkGix XRxoVd6Sxa2ukffFngY= X-Received: by 10.200.50.68 with SMTP id y4mr29627212qta.108.1496986649083; Thu, 08 Jun 2017 22:37:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:17 -0700 Message-Id: <20170609053719.26251-6-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v5 5/7] tcg/arm: Remove limit on code buffer size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since we're no longer using a direct branch, we have no limit on the branch distance. Signed-off-by: Richard Henderson --- translate-all.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/translate-all.c b/translate-all.c index bb094ad..966747a 100644 --- a/translate-all.c +++ b/translate-all.c @@ -523,8 +523,6 @@ static inline PageDesc *page_find(tb_page_addr_t index) # define MAX_CODE_GEN_BUFFER_SIZE (32u * 1024 * 1024) #elif defined(__aarch64__) # define MAX_CODE_GEN_BUFFER_SIZE (128ul * 1024 * 1024) -#elif defined(__arm__) -# define MAX_CODE_GEN_BUFFER_SIZE (16u * 1024 * 1024) #elif defined(__s390x__) /* We have a +- 4GB range on the branches; leave some slop. */ # define MAX_CODE_GEN_BUFFER_SIZE (3ul * 1024 * 1024 * 1024) --=20 2.9.4 From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496987466995668.859122605451; Thu, 8 Jun 2017 22:51:06 -0700 (PDT) Received: from localhost ([::1]:52798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCp7-0001oF-P3 for importer@patchew.org; Fri, 09 Jun 2017 01:51:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCc0-0006D7-7M for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCbz-0001eC-Hd for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:32 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:35364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCbz-0001e6-DH for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:31 -0400 Received: by mail-qt0-x242.google.com with SMTP id x58so13035554qtc.2 for ; Thu, 08 Jun 2017 22:37:31 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lLjU86hOuYj5usrE9MTf7p6U4d883mbdUoUP9fm2UWU=; b=qE/KzdWtIyTIFyCarywfULrVdv3V6H890ocZ5ULLjigaSDsQ/WjOZ9twXNRq3ORmqo EQknOkLGE8gUxQ83nDuTydKtUF25NkCCLK5twAzd3v4D1fkcEO1bY4O+W0ZhjyCdrNKk 5r0NeTLwcKDilk9Zjbahh3JujwS1+j/c27lH52kr6amq6xqdTEBvJrcbzIjphsuDf44i WhxPPnrzjLKuokyRSIG/oi683G+t/isuhcqaxNGVHWWCNTt/j4Fu+K4AzfAUNkRrEt2T hbbofwmis2B+djER6YD+6rSTRrVsuIzSdtHyaxWGw/e4kZhMUNb6hEa+enE2ypHAr4qy 8KCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lLjU86hOuYj5usrE9MTf7p6U4d883mbdUoUP9fm2UWU=; b=H08Cqc47sl2cK0lmuFvppTVwzk8RCzVmm8xwqTZ0/KLHjt6YrrSiDzAk3zp++I6nMB bzX9MyEKaNcXM/2NZTNtNVIdA/FucznXSUo69Ic3MGrf0cnwmM2+E1SYiUKCw6fcJZkz HSRZ9xSWcBGEwaOLTSY2ieYWKro6IfCc92ATaIHMdCmgaz/hvCBzdF4sxHa1wj1RaR7k YKcUmWBt8OIYZcGzHwY9at/0800IbgsgpIf3YNCrIkIYTuumR4PUVOfPpeMlKTT2+W3h jXOfWgLt7OaqmzwGnY7GlYhs6erYNIu2TqZdVAtCSxBdk2in22Ke5ay4LiH9b5dVLoCA 0hug== X-Gm-Message-State: AODbwcCFVt/SRZ9wg4gI8Xu2BGrgJ1PRjBLE7nq8nyvLfsvmbbgsawn4 Yy6jn4dUiY4ja6gQ9H8= X-Received: by 10.237.52.163 with SMTP id x32mr36985346qtd.188.1496986650317; Thu, 08 Jun 2017 22:37:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:18 -0700 Message-Id: <20170609053719.26251-7-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v5 6/7] tcg/arm: Try pc-relative addresses for movi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.inc.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index fce382f..18708b1 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -418,25 +418,39 @@ static inline void tcg_out_dat_imm(TCGContext *s, =20 static void tcg_out_movi32(TCGContext *s, int cond, int rd, uint32_t arg) { - int rot, opc, rn; - - /* For armv7, make sure not to use movw+movt when mov/mvn would do. - Speed things up by only checking when movt would be required. - Prior to armv7, have one go at fully rotated immediates before - doing the decomposition thing below. */ - if (!use_armv7_instructions || (arg & 0xffff0000)) { - rot =3D encode_imm(arg); + int rot, opc, rn, diff; + + /* Check a single MOV/MVN before anything else. */ + rot =3D encode_imm(arg); + if (rot >=3D 0) { + tcg_out_dat_imm(s, cond, ARITH_MOV, rd, 0, + rotl(arg, rot) | (rot << 7)); + return; + } + rot =3D encode_imm(~arg); + if (rot >=3D 0) { + tcg_out_dat_imm(s, cond, ARITH_MVN, rd, 0, + rotl(~arg, rot) | (rot << 7)); + return; + } + + /* Check for a pc-relative address. This will usually be the TB, + or within the TB, which is immediately before the code block. */ + diff =3D arg - ((intptr_t)s->code_ptr + 8); + if (diff >=3D 0) { + rot =3D encode_imm(diff); if (rot >=3D 0) { - tcg_out_dat_imm(s, cond, ARITH_MOV, rd, 0, - rotl(arg, rot) | (rot << 7)); + tcg_out_dat_imm(s, cond, ARITH_ADD, rd, TCG_REG_PC, + rotl(diff, rot) | (rot << 7)); return; - } - rot =3D encode_imm(~arg); + } + } else { + rot =3D encode_imm(-diff); if (rot >=3D 0) { - tcg_out_dat_imm(s, cond, ARITH_MVN, rd, 0, - rotl(~arg, rot) | (rot << 7)); + tcg_out_dat_imm(s, cond, ARITH_SUB, rd, TCG_REG_PC, + rotl(-diff, rot) | (rot << 7)); return; - } + } } =20 /* Use movw + movt. */ --=20 2.9.4 From nobody Sun Feb 8 18:38:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496987308904932.3988601244191; Thu, 8 Jun 2017 22:48:28 -0700 (PDT) Received: from localhost ([::1]:52785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCmZ-0008Fc-HZ for importer@patchew.org; Fri, 09 Jun 2017 01:48:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJCc3-0006GU-Gw for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJCc0-0001eW-Ln for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:35 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:34729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJCc0-0001eP-HL for qemu-devel@nongnu.org; Fri, 09 Jun 2017 01:37:32 -0400 Received: by mail-qt0-x243.google.com with SMTP id o21so13030893qtb.1 for ; Thu, 08 Jun 2017 22:37:32 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id q41sm61161qtc.8.2017.06.08.22.37.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CZuOQA8z7S/McZqGqhuzohMvsuyDE6ISLie/MXe2Pzg=; b=E34kaEzxUFVGtdSXijEJH4p71NY0O7Vu6KYG3v0DdoeaqYtYqPvsFtyRtOscHCa0WD NyhGUrWPg3zgsVqIFZCHSqMGjqR/FpjxGHUJY8JJzmW4yBuRaMVzlcRF0Wtw9Rf6EoRh bGKkoI15CGpNucp3BL+hv+2MRCPV7uv13NBDNQ7v5/xV10wp2zgTbF2w05yPsePoh+j3 1P+DKs4bHmvsN3X+jh5QdQg7cpXW27gTgortXfTLTjPbNED2n/5pEyDSE81bXFSX3kCZ FyCVJ4mi41/Yfmda1YX67PM9jRu4RZbRwOGhXYRjtM+uq/9EuSFr+69pCtGZfM6Bq4Bw Z6hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CZuOQA8z7S/McZqGqhuzohMvsuyDE6ISLie/MXe2Pzg=; b=FkzBTwBt4eCZfJSXEHY1S5gah5RXE/RPgsmj6PkRFk5UOJC39sby7XOgVtcie2XkDu 21baR6aGKPcvPhHG3q3Zz4zKWs6SGmv+AGZkUDSUJhPECXT870ZH6BLxn1Smk0aD0vS0 xJTJZ9FpJ4jQsUZtmtSXT5ydQ84vPJs4Z7UMj3cLExIacSrzf4MZt3+851UZ68MMNR1G XDzBg6HFnZ+qXfrILvuCh/FoOLMZbTC9l7DTPfmOlzv7kBjk/H4CdDY4OALr5jc5+c7f Tg3S/dV/cwPtdxr82mRJu8Faxr6MxlPvMyCy3T06IlKovGRZ3l7CQR5v3AJ1ufIgYwSM wigQ== X-Gm-Message-State: AKS2vOxBWfpDpeKuv9BNiLWOESIEU0MN4w/kWl7QJjy98XqpdwK/3Taw EmAoI7iPbfk26T9boH8= X-Received: by 10.200.57.60 with SMTP id s57mr6350841qtb.141.1496986651869; Thu, 08 Jun 2017 22:37:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 22:37:19 -0700 Message-Id: <20170609053719.26251-8-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609053719.26251-1-rth@twiddle.net> References: <20170609053719.26251-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v5 7/7] tcg/arm: Use ldr (literal) for goto_tb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The new placement of the TB means that we can use one insn to load the goto_tb destination directly from the TB. Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.inc.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index 18708b1..b640fb9 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -1669,14 +1669,27 @@ static inline void tcg_out_op(TCGContext *s, TCGOpc= ode opc, } break; case INDEX_op_goto_tb: - tcg_debug_assert(s->tb_jmp_insn_offset =3D=3D 0); { /* Indirect jump method */ - intptr_t ptr =3D (intptr_t)(s->tb_jmp_target_addr + args[0]); - tcg_out_movi32(s, COND_AL, TCG_REG_R0, ptr & ~0xfff); - tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, ptr & 0xff= f); + intptr_t ptr, dif, dil; + TCGReg base =3D TCG_REG_PC; + + tcg_debug_assert(s->tb_jmp_insn_offset =3D=3D 0); + ptr =3D (intptr_t)(s->tb_jmp_target_addr + args[0]); + dif =3D ptr - ((intptr_t)s->code_ptr + 8); + dil =3D sextract32(dif, 0, 12); + if (dif !=3D dil) { + /* The TB is close, but outside the 12 bits addressable by + the load. We can extend this to 20 bits with a sub of a + shifted immediate from pc. In the vastly unlikely event + the code requires more than 1MB, we'll use 2 insns and + be no worse off. */ + base =3D TCG_REG_R0; + tcg_out_movi32(s, COND_AL, base, ptr - dil); + } + tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, base, dil); + s->tb_jmp_reset_offset[args[0]] =3D tcg_current_code_size(s); } - s->tb_jmp_reset_offset[args[0]] =3D tcg_current_code_size(s); break; case INDEX_op_goto_ptr: tcg_out_bx(s, COND_AL, args[0]); --=20 2.9.4