From patchwork Wed May 3 07:22:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678720 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp912852wrs; Wed, 3 May 2023 00:36:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7tlTDWdHaWN2sgQw97GQCCdkFgmgNKjK85zM1zyB+b/09P5YrOhY4+J5cij8fW2K5oW0od X-Received: by 2002:ac8:7fcb:0:b0:3db:7f42:ab0f with SMTP id b11-20020ac87fcb000000b003db7f42ab0fmr30483378qtk.67.1683099401381; Wed, 03 May 2023 00:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099401; cv=none; d=google.com; s=arc-20160816; b=zOKuKHmz7bMIzQ0Z2bnbBHCyeAfBbao+OPyGNwNlLhFJZeJA3PSzNet4K95n2ZB9LF y/YnOA0vAPAak/QwAftiJOoy3ZN0uB9uI7uVJDfo4/oo6CO8NI75T/FL2Ij9iTNcfZ5y kqH8VXXjiV6l7y3RtM5P0apFMlUMKtI1eh48jWknMFIGlxtNDGIkzAJB+RKkO3mpsooW M3aMkZpvSk7BO983v6PYTy04vftaTwDlfrB+43pPnHfewPb5xeyR44Ry28McBmR8CAy1 L9Usnvb4JIc23I/pmLniZRoeNv1agE4TzyQ57sUjFDx+RlOym3nsMN7AYvKiFe8r9t4N WR1w== 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=goIerk8+h2mAmH5cdq9rvqtnI9Xor6Xtsg8O4mT4pEA=; b=oy0+y6IlNBZC9GkEW9MlPA3syIGx1sBrhZyU3FThc3QADW8EwLF2TRisoFti9qTmtQ 2FG+ORPL5Mnm7OmxBR0HnNbQ0DYC9SjCMaz38yGuHFRe+sPOOZcn11gxDCjZiR1THNmq iw/wuosmCe29xd11UEUyLW7trFx9nTWt7wTElC0pNIjHh/WK+0QlMhmeOWTXNdcFWu7N eiBEnMbOH2/yCg68wl1dqfbug/yH/5gRU/5NLlGRQ3DHjMKQAEOeVmvnzPNSZBvp8zgH O2/O5jG351mJtFDuJ9I6XM7QJjnTaNX5ln4ZtOAJ1yYYoSb3LNeL6DJyF1XHUMF8Jlii 2v6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sUFSBIjB; 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 t12-20020a05622a148c00b003eef7ff2cc6si18800478qtx.639.2023.05.03.00.36.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:36:41 -0700 (PDT) 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=sUFSBIjB; 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 1pu6q5-0001TH-6g; Wed, 03 May 2023 03:23:49 -0400 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 1pu6q1-0001AE-07 for qemu-devel@nongnu.org; Wed, 03 May 2023 03:23:45 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6py-0001Rq-Rz for qemu-devel@nongnu.org; Wed, 03 May 2023 03:23:44 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3062b101ae1so2315687f8f.2 for ; Wed, 03 May 2023 00:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683098621; x=1685690621; 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=goIerk8+h2mAmH5cdq9rvqtnI9Xor6Xtsg8O4mT4pEA=; b=sUFSBIjBeOWzgz75CsJ1ZuMH5iM+PXBqugA5anhlyG86tFOn8pdhMTiaQpShHPDN8Y xPQR58IskLw3qhtIs9AQRJyUpC4JlrDeNVqekF7Oy12nmrBr3IPGi+unzH3P2uC8qs4R 7Dv7j44CVlxmGj/wxgUsThvX+OZfwAzolIOJCmiayJBUkijKe1Iki9qcjTDCeKAllPwd CClbvhRkZziJOyxbH4MMSusfa0NJ7bjoheDuMxcutKAcPANUeWroSw/0WmwF8qQAo3bA FTdIbwidzpa9aynE1usqDZCjZ3WQtnQGx5J2rF2OdFHt0IDFkSylv+p7yX2dBjSodQ+C KJDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683098621; x=1685690621; 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=goIerk8+h2mAmH5cdq9rvqtnI9Xor6Xtsg8O4mT4pEA=; b=jOY5YDOrGl8fdoglEoAboLHpjdcMeYy0Y2nE5vsysE01rCQMvNQLpkPiDviDGKSZdA CGSpyleMI5DruYsL0r81UhlRIKRZljhpOUpCCY91SFIuv+Jcmd8zKSXKRim10BZF432N tz93gBNIAXTfoVXgaiORVoMt+h2G5YrN8++I8mjKaQNwIjDSaGYdmBgCSIegN9AqSCUm v1/5A/t6Hgu0OGx3PylSkBRjFzZzwJ9swbZSOidi+C2aheK5Sr5RzCuQg3BfQfwl0dbK j8D41S8wEuotaVvA9zWoKrK+DzgvMW9LNJ/VtnD3U8eTT/bIkVbFmohtS9aaitoGCuPw nuIA== X-Gm-Message-State: AC+VfDyPpcWbcsiDlh5iodWi1uAIasUtnS+QxomWL+jqRaO5BQNQp0ya SQNVp+dS6cwZufs7jI8FOJGbcJBctd9/QtxIQfLxaA== X-Received: by 2002:a5d:5745:0:b0:2f4:a60f:3cd8 with SMTP id q5-20020a5d5745000000b002f4a60f3cd8mr13865266wrw.49.1683098620958; Wed, 03 May 2023 00:23:40 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id b14-20020a05600010ce00b0030627f58325sm9586745wrx.25.2023.05.03.00.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:23:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: ale@rev.ng, philmd@linaro.org, marcel.apfelbaum@gmail.com, wangyanan55@huawei.com, anjo@rev.ng Subject: [PATCH 07/84] accel/tcg: Merge gen_mem_wrapped with plugin_gen_empty_mem_callback Date: Wed, 3 May 2023 08:22:14 +0100 Message-Id: <20230503072331.1747057-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503072331.1747057-1-richard.henderson@linaro.org> References: <20230503072331.1747057-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 As gen_mem_wrapped is only used in plugin_gen_empty_mem_callback, we can avoid the curiosity of union mem_gen_fn by inlining it. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- accel/tcg/plugin-gen.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 5efb8db258..04facd6305 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -202,35 +202,17 @@ static void plugin_gen_empty_callback(enum plugin_gen_from from) } } -union mem_gen_fn { - void (*mem_fn)(TCGv, uint32_t); - void (*inline_fn)(void); -}; - -static void gen_mem_wrapped(enum plugin_gen_cb type, - const union mem_gen_fn *f, TCGv addr, - uint32_t info, bool is_mem) +void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info) { enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info); - gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, type, rw); - if (is_mem) { - f->mem_fn(addr, info); - } else { - f->inline_fn(); - } + gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, PLUGIN_GEN_CB_MEM, rw); + gen_empty_mem_cb(addr, info); tcg_gen_plugin_cb_end(); -} -void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info) -{ - union mem_gen_fn fn; - - fn.mem_fn = gen_empty_mem_cb; - gen_mem_wrapped(PLUGIN_GEN_CB_MEM, &fn, addr, info, true); - - fn.inline_fn = gen_empty_inline_cb; - gen_mem_wrapped(PLUGIN_GEN_CB_INLINE, &fn, 0, info, false); + gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, PLUGIN_GEN_CB_INLINE, rw); + gen_empty_inline_cb(); + tcg_gen_plugin_cb_end(); } static TCGOp *find_op(TCGOp *op, TCGOpcode opc)