Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/811242/?format=api
{ "id": 811242, "url": "http://patchwork.ozlabs.org/api/1.2/patches/811242/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170907224051.21518-15-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-15-richard.henderson@linaro.org>", "list_archive_url": null, "date": "2017-09-07T22:40:42", "name": "[PULL,14/23] tcg/sparc: Use constant pool for movi", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "ec251e9f6e2c411aea0869ed22ab4576ff676e9b", "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-15-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/811242/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811242/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=\"DTF7DrSt\"; 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 3xpFyc2RNDz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 8 Sep 2017 08:50:00 +1000 (AEST)", "from localhost ([::1]:42546 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 1dq5cU-0001hz-El\n\tfor incoming@patchwork.ozlabs.org; Thu, 07 Sep 2017 18:49:58 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:52230)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1dq5U8-00039U-Vy\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:26 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1dq5U4-0008IK-9a\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:21 -0400", "from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:32923)\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 1dq5U4-0008I1-2e\n\tfor qemu-devel@nongnu.org; Thu, 07 Sep 2017 18:41:16 -0400", "by mail-pf0-x229.google.com with SMTP id y29so860349pff.0\n\tfor <qemu-devel@nongnu.org>; Thu, 07 Sep 2017 15:41:15 -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.41.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 07 Sep 2017 15:41:13 -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=VckR6G8VPrq0GOmaJPbnP93dBEfN3HLPmvmvcRM4IWU=;\n\tb=DTF7DrSt7mPWu+RNcM6sal5Fb9PxWETIPQMOFIcy1OymCD0oKre594uonn8/s2gXKi\n\tEGI0e6PmeE7lCKRUQUuxUjkCVMskd/5DzHaMaf3WrJzIeATZLNTu3k6JbHJbXm7Dbvb2\n\tGzGEPYwfrHo3pKnHYGi0vdwyS4twaUY2cxEQk=", "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=VckR6G8VPrq0GOmaJPbnP93dBEfN3HLPmvmvcRM4IWU=;\n\tb=sOFvlqoSPpLyEX9r2Ruu2oU51YWmvSCYRJux5PGfNSzKEuedoFafcMy8zgPsydihSs\n\tknQ3/djlihrppuJH7X+mugZqdnHbb9U43sPXxvNkfrcRuCpQy+PBofAZMLLvH0o4QBB1\n\tVTTzjJgizHTiyUHJd2I2gW4e/jFZx0K8Y5LlV/CZbrzsZyJ/x3bS+hgpMUyFEREAqIAu\n\tGdlMGclYvH2aGn6+2FCQFH3db5YNnxLBI5gnJSkglt6JgmGfSjeB8RZx+fPkWylppnf9\n\tS4CE+CdZp2bSMSgPFv8Afs8WrfsT3qPwp8TFV400hGCCrCqxt/zWIbaXfCh3xydZwIps\n\thekQ==", "X-Gm-Message-State": "AHPjjUgKZuNydvEAzsGxPXwqGh0Dy7/GaJ/pP6MTdWrU31+X5erPy6nf\n\tbKI2czu1yJ7n/kSSWuB6rg==", "X-Google-Smtp-Source": "ADKCNb68/T24mW6po1TsPmkHb2+PD3ICI0o8ur0X4HVER5ZMEj/X4F+qVersYGwAQNYFHSastY/4HA==", "X-Received": "by 10.101.67.2 with SMTP id j2mr949323pgq.182.1504824074754;\n\tThu, 07 Sep 2017 15:41:14 -0700 (PDT)", "From": "Richard Henderson <richard.henderson@linaro.org>", "To": "qemu-devel@nongnu.org", "Date": "Thu, 7 Sep 2017 15:40:42 -0700", "Message-Id": "<20170907224051.21518-15-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:c00::229", "Subject": "[Qemu-devel] [PULL 14/23] tcg/sparc: Use constant pool for movi", "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\nSigned-off-by: Richard Henderson <rth@twiddle.net>\n---\n tcg/sparc/tcg-target.h | 2 ++\n tcg/sparc/tcg-target.inc.c | 77 +++++++++++++++++++++++++++++++++-------------\n 2 files changed, 58 insertions(+), 21 deletions(-)", "diff": "diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h\nindex da98743817..d8339bf010 100644\n--- a/tcg/sparc/tcg-target.h\n+++ b/tcg/sparc/tcg-target.h\n@@ -175,4 +175,6 @@ static inline void flush_icache_range(uintptr_t start, uintptr_t stop)\n \n void tb_target_set_jmp_target(uintptr_t, uintptr_t, uintptr_t);\n \n+#define TCG_TARGET_NEED_POOL_LABELS\n+\n #endif\ndiff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.inc.c\nindex 7d73c25347..bd7c1461c6 100644\n--- a/tcg/sparc/tcg-target.inc.c\n+++ b/tcg/sparc/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 \"%g0\",\n@@ -292,33 +294,46 @@ static inline int check_fit_i32(int32_t val, unsigned int bits)\n static void patch_reloc(tcg_insn_unit *code_ptr, int type,\n intptr_t value, intptr_t addend)\n {\n- uint32_t insn;\n+ uint32_t insn = *code_ptr;\n+ intptr_t pcrel;\n \n- tcg_debug_assert(addend == 0);\n- value = tcg_ptr_byte_diff((tcg_insn_unit *)value, code_ptr);\n+ value += addend;\n+ pcrel = tcg_ptr_byte_diff((tcg_insn_unit *)value, code_ptr);\n \n switch (type) {\n case R_SPARC_WDISP16:\n- if (!check_fit_ptr(value >> 2, 16)) {\n- tcg_abort();\n- }\n- insn = *code_ptr;\n+ assert(check_fit_ptr(pcrel >> 2, 16));\n insn &= ~INSN_OFF16(-1);\n- insn |= INSN_OFF16(value);\n- *code_ptr = insn;\n+ insn |= INSN_OFF16(pcrel);\n break;\n case R_SPARC_WDISP19:\n- if (!check_fit_ptr(value >> 2, 19)) {\n- tcg_abort();\n- }\n- insn = *code_ptr;\n+ assert(check_fit_ptr(pcrel >> 2, 19));\n insn &= ~INSN_OFF19(-1);\n- insn |= INSN_OFF19(value);\n- *code_ptr = insn;\n+ insn |= INSN_OFF19(pcrel);\n+ break;\n+ case R_SPARC_13:\n+ /* Note that we're abusing this reloc type for our own needs. */\n+ if (!check_fit_ptr(value, 13)) {\n+ int adj = (value > 0 ? 0xff8 : -0x1000);\n+ value -= adj;\n+ assert(check_fit_ptr(value, 13));\n+ *code_ptr++ = (ARITH_ADD | INSN_RD(TCG_REG_T2)\n+ | INSN_RS1(TCG_REG_TB) | INSN_IMM13(adj));\n+ insn ^= INSN_RS1(TCG_REG_TB) ^ INSN_RS1(TCG_REG_T2);\n+ }\n+ insn &= ~INSN_IMM13(-1);\n+ insn |= INSN_IMM13(value);\n break;\n+ case R_SPARC_32:\n+ /* Note that we're abusing this reloc type for our own needs. */\n+ code_ptr[0] = deposit32(code_ptr[0], 0, 22, value >> 10);\n+ code_ptr[1] = deposit32(code_ptr[1], 0, 10, value);\n+ return;\n default:\n- tcg_abort();\n+ g_assert_not_reached();\n }\n+\n+ *code_ptr = insn;\n }\n \n /* parse target specific constraints */\n@@ -474,12 +489,24 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret,\n return;\n }\n \n- if (USE_REG_TB && !in_prologue) {\n- intptr_t diff = arg - (uintptr_t)s->code_gen_ptr;\n- if (check_fit_ptr(diff, 13)) {\n- tcg_out_arithi(s, ret, TCG_REG_TB, diff, ARITH_ADD);\n- return;\n+ if (!in_prologue) {\n+ if (USE_REG_TB) {\n+ intptr_t diff = arg - (uintptr_t)s->code_gen_ptr;\n+ if (check_fit_ptr(diff, 13)) {\n+ tcg_out_arithi(s, ret, TCG_REG_TB, diff, ARITH_ADD);\n+ } else {\n+ new_pool_label(s, arg, R_SPARC_13, s->code_ptr,\n+ -(intptr_t)s->code_gen_ptr);\n+ tcg_out32(s, LDX | INSN_RD(ret) | INSN_RS1(TCG_REG_TB));\n+ /* May be used to extend the 13-bit range in patch_reloc. */\n+ tcg_out32(s, NOP);\n+ }\n+ } else {\n+ new_pool_label(s, arg, R_SPARC_32, s->code_ptr, 0);\n+ tcg_out_sethi(s, ret, 0);\n+ tcg_out32(s, LDX | INSN_RD(ret) | INSN_RS1(ret) | INSN_IMM13(0));\n }\n+ return;\n }\n \n /* A 64-bit constant decomposed into 2 32-bit pieces. */\n@@ -1058,6 +1085,14 @@ 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+ int i;\n+ for (i = 0; i < count; ++i) {\n+ p[i] = NOP;\n+ }\n+}\n+\n #if defined(CONFIG_SOFTMMU)\n /* Perform the TLB load and compare.\n \n", "prefixes": [ "PULL", "14/23" ] }