From patchwork Tue May 16 19:41:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 682412 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp20565wrt; Tue, 16 May 2023 12:57:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54Z3Zu9ZwLBB2xiFLZYxl841U4DLLBpi+6jD1uS9qU/hb/rskB+n4RJoo3ufToiw2YzeVV X-Received: by 2002:a5d:4004:0:b0:2c5:3cd2:b8e with SMTP id n4-20020a5d4004000000b002c53cd20b8emr27293838wrp.1.1684267057639; Tue, 16 May 2023 12:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684267057; cv=none; d=google.com; s=arc-20160816; b=pAdf0LmEvFM8z6StH9yJnAkaETmvEcUWj5YYlGhD4hz4XTpjBcmbFBPZuphMc1N8tO hrWz393uveBFvUUwJpiznMvAgK16QvTLchknNiDpUIXPbhWm/HcDecMPOB+fVrUK94N/ Pi0FZ2/efZk7dzeRWvIoVg1ZTCUHBBunzUNVB8BYq/S8zjURVZDUlV39J66WvHznySue nvScGKAH7CmRTfrvZZHf+83t+9huj7EWZ22+VHgTbYIto5V1QTHXZkwoWC8h1AyHtQ8q pb8FXcBUDBLh2gwNilEQdaQX9Cs/5cwYlFN7oLDeTeE6cYkG7UOGh9Y8W9/2TX6+t/Jo ZWtg== 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=4fVGxJLZnm/9x1zczI0K5yPA644Oq34wOtBnW72R26I=; b=ACAcaMEAZjI345mjCRSOQUcq0jn7e1ZdYvyC5mNXgV4vlcgSXcCA3z4pEKQYQ1mSCP pc/0cEX31icDxtcacSsbrU8fHcAlZokyrshuOtNOWldTzXr60WqpwzhZyXe8B7PKks8Z xNkPPAj+cOlZZa9sM3iYvdi88UCbVSLmlfhMv383QhmVRWiTeMkUqX/PVRwJ/CSI118Y Y7IdLSY2WwPgArKf0AbFY3xGNG4YWwQ9Yr+btG9iAFow3az5uRP8oBYV0SDhuVCXhlex EHPoBQMFvODn5Vp//cV37s0cIxDHCDe9j9dgB1ipIIGifcLfTY5Bx3JyUNVXSNGK3Riy njEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BPCrYin+; 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 z17-20020adfec91000000b003075e827333si140398wrn.1023.2023.05.16.12.57.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 May 2023 12:57:37 -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=BPCrYin+; 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 1pz0eM-0002mb-Vt; Tue, 16 May 2023 15:47:59 -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 1pz0cI-0000Lm-ED for qemu-devel@nongnu.org; Tue, 16 May 2023 15:45:52 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pz0cC-0003kg-32 for qemu-devel@nongnu.org; Tue, 16 May 2023 15:45:48 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-64ab2a37812so8129768b3a.1 for ; Tue, 16 May 2023 12:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684266339; x=1686858339; 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=4fVGxJLZnm/9x1zczI0K5yPA644Oq34wOtBnW72R26I=; b=BPCrYin+SEGQkYn+HsOVDVVfjGfmjuVns6WVGhROOvX8bruyLMAAVLpwYd5ev2veZZ XsXdvh5L6Dg8Aws5JX0E8TWXKyEzlziUEKr6wCWzFW/9e6im4Jh3IOPbvgPUpN+KUB/G dNpTCRT3vECSvXKI93sGwURUcjCDN7HcOzKc+ZRm5UnyC70Q1r/qXQpViQQeAlCrO/GK iDzcY4HhWSmDMo1bmcAMywXYBtn/HgICcPvzv+RVCwJhgbsoB+2yoIn+U7pogtGefpUB i8YofOGQwQ42lG76k2yU0hDtw7GL46SHr/1955WXIrl0rv21uKDiigmyO/tgMBJYFVmi 6i6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684266339; x=1686858339; 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=4fVGxJLZnm/9x1zczI0K5yPA644Oq34wOtBnW72R26I=; b=I87uvfQYDhU5/Y1kkmsw6GA8V+r3368Y/8DWhcnyHILHJGPWPgSEdYQCBKcCU4xjHI FrN1Md/XfotlmzwlPwSnqAh6wHPOIUSj0re4EZr/fAWjL1m2zhRAxD6GHlBgaSXSrgY9 0R1fo4DQuQJ6FvKSsZw6s2Tib3r6bx8IzhZY0XxkihT8lCJcN+zkiVuXgffpJxyI9FSy +ha+GZuwPUs1g8Xv07Df7tr8eXBQmjjRDF159uq9N9PAhWGxAJW3Jq9Fq/scOQRs6mTV ekOTwz1tvHA74V31lNkEG6kVE6LwcLF5UUs7xEzYMnFyr2mfcyVgbq7oytAjfeM252CL fgOw== X-Gm-Message-State: AC+VfDzK63dP9rD/PnHhuHEorIxlmJX0cPF/f+4X7w99Tys0rfYUNClG JDkXE19i481GPpnDdMzf/1VzRj2l54EJGncfVis= X-Received: by 2002:a17:903:1208:b0:1aa:d235:6dd4 with SMTP id l8-20020a170903120800b001aad2356dd4mr50774163plh.19.1684266339710; Tue, 16 May 2023 12:45:39 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:ec81:440e:33a4:40b9]) by smtp.gmail.com with ESMTPSA id y12-20020a17090abd0c00b002508d73f4e8sm25555pjr.57.2023.05.16.12.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 12:45:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 59/80] accel/tcg: Merge gen_mem_wrapped with plugin_gen_empty_mem_callback Date: Tue, 16 May 2023 12:41:24 -0700 Message-Id: <20230516194145.1749305-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516194145.1749305-1-richard.henderson@linaro.org> References: <20230516194145.1749305-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- 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)