From patchwork Fri Dec 30 00:02:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 637858 Delivered-To: patch@linaro.org Received: by 2002:a17:906:1189:b0:7d5:1b03:224a with SMTP id n9csp4174499eja; Thu, 29 Dec 2022 16:23:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXtw/eXi1zQQNI8p6lhHRmPP0/VqemT6IOQrCtKVaQgUYsvGBV+NXRQIEI2bZyVFTALhDmuh X-Received: by 2002:a0c:e50f:0:b0:4c7:1c35:22f2 with SMTP id l15-20020a0ce50f000000b004c71c3522f2mr38055457qvm.32.1672359795003; Thu, 29 Dec 2022 16:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672359794; cv=none; d=google.com; s=arc-20160816; b=oWQuaDrboOwbU2nX9Z2WBnq1C3zBNU84CAEWH7/2LRhrxP9cCRnk21jScQ5yJrbXsy 6J5ZCVeHqs6g/1PgA3OVQWdNxGsTiAwX997GNgI23rufeClzAHqAMgs/HnVQKwSqdMlE 8+aRRGlm5VCa6LJtqQq6TUzcSRGA+cxLGVM0p+6QotQ3sFkpbp2AnpZyKRC70p9EmjCk AesqG3y9wZu8YzPblyY4wsPgNaBVYhA56HZxniRQiq0+fBrLWvpYNXgzzxPlQ3mOTUEl W+64eP5rsfUEtCyO9gk6bUSrEebFlsVct0fqCzAhknWkYaCwueJKs/CdcLzoTIiwCeto nM7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mg8MgGwO6jjwnW8nsumFgvs1cdVJMS+XlnPx9WvPnOA=; b=JZtgkzTYikhR2UK3glcZisixTBrJYG0f+9POLzFfAH7G9LFOPyZIpToAhjy99kDug6 YKr+J7KmrUtMZjGrj2zJpezAAt2aSRp/q4jd1OTB2bhx/6VQ98EZ1fUFz/3iE0N0mSKQ cBPPKwm3JL2ZQHiVz55Bk8MsccdVrW1kNaeTwQM4nLwzNq9M1YLZ/jvAazmwKR156VO2 ySNI1gRseF2RxuMsE5EIL/JdmLBrAgsHfONBENJ+7VpZMC4Jxot3kNIkQSzo6jbD5C/v xdPL75JjTvavzfKHqSSc13ucPwPdadiwSNrnpyCr2Gx3SiFibbM2kO3dlbNNWa1kq3f9 Tz0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pEOa2wPa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jx7-20020a0562142b0700b004c70a196fefsi8945673qvb.580.2022.12.29.16.23.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2022 16:23:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pEOa2wPa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pB2sM-0003rw-Qb; Thu, 29 Dec 2022 19:03:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pB2rX-00039O-4w for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:03:05 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pB2rS-0002k6-68 for qemu-devel@nongnu.org; Thu, 29 Dec 2022 19:03:02 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d15so20366259pls.6 for ; Thu, 29 Dec 2022 16:02:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mg8MgGwO6jjwnW8nsumFgvs1cdVJMS+XlnPx9WvPnOA=; b=pEOa2wPaBsS3NLwY8gsUY2XRYZ4dG/tsoWx5c3orahVx6Y7lejdgvBFdHKCFayk6cB Hj/NLOY8YEU1lRVQ2yOaBAxTxkvJEm8GC1k547Z0U2Fk7QHrZHllcW8KBI9mMDqTZK2K T+/LWriI9vw6/wynBbd1rHDizAy2oEgGUKRShO1V3wWZtwytnEdJaTxJXs1QdgB4ITGi KLf7QDHveGiaauoaxUZyN9U+4mRcRP/yJXieNrLbG9tCSlrzOdj3ijowLY7QEw0Otrtv 2qGpRRvezhQ3PYGZJ9e4fGj9rgawDvGScO4zbEHrWp/u2Ol4QHJKFvJTQdfpuuL287Cs 3GFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mg8MgGwO6jjwnW8nsumFgvs1cdVJMS+XlnPx9WvPnOA=; b=Wj/G1y63Czx0/h2QWqASKQFv7/9eaiqtlCl//7/CcaKXd3V1nrHvsLiSlMc/yERwN2 T0ZYceSwtvDIE4EdQvRxW2PXrMyF4ylvNh5/ZU/kCBYdXmRwRTX6h/BYH80nLTjjOWr6 10sRH+zQgjAnwd9uV0K16gXhbMZqtub4UFjULu29RZ9hwnfzXhdtkUjVgw68QKbZhAdV NWDxUf4vHJz0c7fEL2h/XdlIPG7PpLPznj50EbFR9HCOmVC/Bcv8dG+zevahCL621Ygs 5SGOu50/a4gz/M1bj8CFI0/nhfyqQovoco251v3G4tswQEtDuTwd0IjVNeB216/e9mBO fTtw== X-Gm-Message-State: AFqh2koJXPs+Vphdaz1frBrsEfuQnrQBREtTkWeRTIXbJK/uYO1FwZOg iB3l1Zl7M+grIq6X7EHbtvSrBeKr7lEl+Y1Z X-Received: by 2002:a17:902:da86:b0:188:f570:7bdf with SMTP id j6-20020a170902da8600b00188f5707bdfmr42104367plx.40.1672358574143; Thu, 29 Dec 2022 16:02:54 -0800 (PST) Received: from stoup.. (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id j14-20020a170903028e00b00192849e1d0asm7343953plr.116.2022.12.29.16.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 16:02:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PULL 34/47] accel/tcg/plugin: Use copy_op in append_{udata,mem}_cb Date: Thu, 29 Dec 2022 16:02:08 -0800 Message-Id: <20221230000221.2764875-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221230000221.2764875-1-richard.henderson@linaro.org> References: <20221230000221.2764875-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Better to re-use the existing function for copying ops. Acked-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 77e6823d6b..a6aaacd053 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -415,11 +415,11 @@ static TCGOp *append_udata_cb(const struct qemu_plugin_dyn_cb *cb, op = copy_const_ptr(&begin_op, op, cb->userp); /* copy the ld_i32, but note that we only have to copy it once */ - begin_op = QTAILQ_NEXT(begin_op, link); - tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32); if (*cb_idx == -1) { - op = tcg_op_insert_after(tcg_ctx, op, INDEX_op_ld_i32); - memcpy(op->args, begin_op->args, sizeof(op->args)); + op = copy_op(&begin_op, op, INDEX_op_ld_i32); + } else { + begin_op = QTAILQ_NEXT(begin_op, link); + tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32); } /* call */ @@ -462,11 +462,11 @@ static TCGOp *append_mem_cb(const struct qemu_plugin_dyn_cb *cb, op = copy_const_ptr(&begin_op, op, cb->userp); /* copy the ld_i32, but note that we only have to copy it once */ - begin_op = QTAILQ_NEXT(begin_op, link); - tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32); if (*cb_idx == -1) { - op = tcg_op_insert_after(tcg_ctx, op, INDEX_op_ld_i32); - memcpy(op->args, begin_op->args, sizeof(op->args)); + op = copy_op(&begin_op, op, INDEX_op_ld_i32); + } else { + begin_op = QTAILQ_NEXT(begin_op, link); + tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32); } /* extu_tl_i64 */