Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/811232/?format=api
{ "id": 811232, "url": "http://patchwork.ozlabs.org/api/1.2/patches/811232/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170907224051.21518-5-richard.henderson@linaro.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170907224051.21518-5-richard.henderson@linaro.org>", "list_archive_url": null, "date": "2017-09-07T22:40:32", "name": "[PULL,04/23] tcg/i386: Store out-of-range call targets in constant pool", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "bdce6641bd269432a6ddf1671b519133b6255ace", "submitter": { "id": 72104, "url": "http://patchwork.ozlabs.org/api/1.2/people/72104/?format=api", "name": "Richard Henderson", "email": "richard.henderson@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170907224051.21518-5-richard.henderson@linaro.org/mbox/", "series": [ { "id": 2073, "url": "http://patchwork.ozlabs.org/api/1.2/series/2073/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2073", "date": "2017-09-07T22:40:28", "name": "[PULL,01/23] tcg: Move USE_DIRECT_JUMP discriminator to tcg/cpu/tcg-target.h", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2073/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811232/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811232/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"SBJD/udz\"; dkim-atps=neutral" ], "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpFwt5lk2z9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 8 Sep 2017 08:48:30 +1000 (AEST)", "from localhost ([::1]:42541 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dq5b2-0000W9-Sx\n\tfor incoming@patchwork.ozlabs.org; Thu, 07 Sep 2017 18:48:28 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:51969)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1dq5Tu-0002xY-5U\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:10 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1dq5Tp-000843-Id\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:06 -0400", "from mail-pg0-x236.google.com ([2607:f8b0:400e:c05::236]:33212)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <richard.henderson@linaro.org>)\n\tid 1dq5Tp-00083V-Cf\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:01 -0400", "by mail-pg0-x236.google.com with SMTP id t3so1832918pgt.0\n\tfor <qemu-devel@nongnu.org>; Thu, 07 Sep 2017 15:41:01 -0700 (PDT)", "from bigtime.twiddle.net (97-126-108-236.tukw.qwest.net.\n\t[97.126.108.236]) by smtp.gmail.com with ESMTPSA id\n\th19sm770678pfh.142.2017.09.07.15.40.58\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 07 Sep 2017 15:40:58 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=daMSdqMbQuDE4qwwdspqIaJ34DPgPJe16DeZ0MUqsHw=;\n\tb=SBJD/udzGS6O7LRdXlb75Ry24Fp5dFFrzLGlJhDE302XvbNazE67qBdjv73nfctlDC\n\tKutfV2ZLzbfUCB89WucE4maAZICZz+3jUbARahZvQXbED1dzJju/0sYcBgwZqD6sAdQd\n\t7AacvqSp5Wk3w50nobkElvY0QQ5oldM5gBnCE=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=daMSdqMbQuDE4qwwdspqIaJ34DPgPJe16DeZ0MUqsHw=;\n\tb=Nm4FxHCUkb+wMpBcCbShEMQ2HCb9gBnPqmFDf3x1IIWYYmGgfUF+hOjXrvmXIXdigO\n\tqA2txqKt/m+yAhB2VlGN/qwoACR8xLdvEXkJqQ/twXCMTmMv8ePeDVw5qpAhaFOrB+Je\n\tksTxaZ783kOy4V+NuhZbKDvTMMr2mjV2iueUkkHRbtK7XuHaDLxjm74PLn7Uf2+89dh9\n\t/BfYPvZy89U3Sn6p/z99MgqDbBr3JP73cK8sagRVtlJvncNBTppCyTZtRxE++87DSb0Z\n\tiJIZlNDs7FwwPE7EUiF/pNr/2wF9Yuqz+WgCmsl5ais+6tas3BVi1oQWzsRom16EqtI2\n\tTvLQ==", "X-Gm-Message-State": "AHPjjUgWigKtISjOlKdTWd2afMTDqGbxL4NSiST/izYeQwgk6/FRsuoH\n\to23xG+A+0otGlvPQWAkFbg==", "X-Google-Smtp-Source": "ADKCNb50pmjHwiFsMkL6m8hX/bfOjZELvV9WlmZAOpVIV01TAlsn6Frm7qtamlSfNO5mJfjtd4Q6mQ==", "X-Received": "by 10.99.105.196 with SMTP id e187mr937282pgc.360.1504824060061; \n\tThu, 07 Sep 2017 15:41:00 -0700 (PDT)", "From": "Richard Henderson <richard.henderson@linaro.org>", "To": "qemu-devel@nongnu.org", "Date": "Thu, 7 Sep 2017 15:40:32 -0700", "Message-Id": "<20170907224051.21518-5-richard.henderson@linaro.org>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170907224051.21518-1-richard.henderson@linaro.org>", "References": "<20170907224051.21518-1-richard.henderson@linaro.org>", "X-detected-operating-system": "by eggs.gnu.org: Genre and OS details not\n\trecognized.", "X-Received-From": "2607:f8b0:400e:c05::236", "Subject": "[Qemu-devel] [PULL 04/23] tcg/i386: Store out-of-range call targets\n\tin constant pool", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "peter.maydell@linaro.org, Richard Henderson <rth@twiddle.net>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "From: Richard Henderson <rth@twiddle.net>\n\nAlready it saves 2 bytes per call, but also the constant pool\nentry may well be shared across multiple calls.\n\nSigned-off-by: Richard Henderson <rth@twiddle.net>\n---\n tcg/i386/tcg-target.h | 1 +\n tcg/i386/tcg-target.inc.c | 18 +++++++++++++++---\n 2 files changed, 16 insertions(+), 3 deletions(-)", "diff": "diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h\nindex 11ee7fadd1..b89dababf4 100644\n--- a/tcg/i386/tcg-target.h\n+++ b/tcg/i386/tcg-target.h\n@@ -189,5 +189,6 @@ static inline void tb_target_set_jmp_target(uintptr_t tc_ptr,\n #ifdef CONFIG_SOFTMMU\n #define TCG_TARGET_NEED_LDST_LABELS\n #endif\n+#define TCG_TARGET_NEED_POOL_LABELS\n \n #endif\ndiff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c\nindex 1a1ad96906..5231056fd3 100644\n--- a/tcg/i386/tcg-target.inc.c\n+++ b/tcg/i386/tcg-target.inc.c\n@@ -22,6 +22,8 @@\n * THE SOFTWARE.\n */\n \n+#include \"tcg-pool.inc.c\"\n+\n #ifdef CONFIG_DEBUG_TCG\n static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {\n #if TCG_TARGET_REG_BITS == 64\n@@ -1180,9 +1182,14 @@ static void tcg_out_branch(TCGContext *s, int call, tcg_insn_unit *dest)\n tcg_out_opc(s, call ? OPC_CALL_Jz : OPC_JMP_long, 0, 0, 0);\n tcg_out32(s, disp);\n } else {\n- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R10, (uintptr_t)dest);\n- tcg_out_modrm(s, OPC_GRP5,\n- call ? EXT5_CALLN_Ev : EXT5_JMPN_Ev, TCG_REG_R10);\n+ /* rip-relative addressing into the constant pool.\n+ This is 6 + 8 = 14 bytes, as compared to using an\n+ an immediate load 10 + 6 = 16 bytes, plus we may\n+ be able to re-use the pool constant for more calls. */\n+ tcg_out_opc(s, OPC_GRP5, 0, 0, 0);\n+ tcg_out8(s, (call ? EXT5_CALLN_Ev : EXT5_JMPN_Ev) << 3 | 5);\n+ new_pool_label(s, (uintptr_t)dest, R_386_PC32, s->code_ptr, -4);\n+ tcg_out32(s, 0);\n }\n }\n \n@@ -2595,6 +2602,11 @@ static void tcg_target_qemu_prologue(TCGContext *s)\n #endif\n }\n \n+static void tcg_out_nop_fill(tcg_insn_unit *p, int count)\n+{\n+ memset(p, 0x90, count);\n+}\n+\n static void tcg_target_init(TCGContext *s)\n {\n #ifdef CONFIG_CPUID_H\n", "prefixes": [ "PULL", "04/23" ] }