From patchwork Wed May 3 07:20:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678759 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp915122wrs; Wed, 3 May 2023 00:44:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ748pSV0W8kxeNqKrfrpOb5O1Y9b9IGpAJqOdqBFNW50NbpjQ1RHq8pT6vRoOzpwMC7tg8L X-Received: by 2002:a05:6214:518c:b0:5c2:a8b0:d71a with SMTP id kl12-20020a056214518c00b005c2a8b0d71amr8724818qvb.43.1683099855984; Wed, 03 May 2023 00:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099855; cv=none; d=google.com; s=arc-20160816; b=GuR4rL4jbz5GVt5No8PWWsfH/4vmfgoofCrjJ8t4xOmLYB4jbxoXzfpAAJGcYzOBxC oX2wiDJU18gAKy5f00/7FHGxMV7M/EMHaXDyJzv10uoiBp6Hhseqxp8FXWBzKyIJjI4t sHcwt/f9DU2gYs7PIdK8+FH5NZ9N5OqBWkuZx9e6cxN9hxr1nQyo7FzN9pkwwLpLrvaP L700NiXvgUU4XvY5BXueps0Ab4KNJpO2VofrjlZFNxsQnyOU6joIej7j6LXvC88nqdQC hH7xeVgmu+5aaHnx977zaxGsNWtr7f9lnMC8PeiUzPCJwpVhgTe4ElqZ84ZGlUVnx/pM yWVQ== 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=XKOvN7urZ78JPbycVPZZuf7uFzPE/f3i7QAsQfpax6xtDVFBW9zXYRk5dCZBzntmn7 4M0MY+I9iko+ZQLF3vg85tO9bSLiPfFz8sP/8/6NzWBJJh8Vn+LFcsNI889Mal/pfAkv Rwi3+TJAZDu8TOmxiFzeH3STGv0ITA5Dvj3aamxDFMwVISEEMcPtJ9H9TPnTIUmA/ZIi khAeYQDvOFafbJi3GKrws8gFHt/FhuSWmmHkU0XV1eWIcrPq3Jl7mtdZmpsgb19NsvVi lk0uYZ2pfqvSzV9EflsYbtDp9KtbfvUm6tz8FhAICDu028R2g0fNwUCyHbmDBwnvp9o9 gW4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yZKhZ+vX; 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 c13-20020a056214224d00b0056e9871bbc0si18593164qvc.23.2023.05.03.00.44.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:44:15 -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=yZKhZ+vX; 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 1pu6pJ-0007sE-DC; Wed, 03 May 2023 03:23:05 -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 1pu6ox-0006pj-7h for qemu-devel@nongnu.org; Wed, 03 May 2023 03:22:40 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6os-0007Id-IX for qemu-devel@nongnu.org; Wed, 03 May 2023 03:22:38 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f178da21b2so49208695e9.1 for ; Wed, 03 May 2023 00:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683098552; x=1685690552; 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=yZKhZ+vX1mt+kIT9bzZipc7AmEfa5uUtMjtbONrGso8YC6mAFXWxrMhHaTU+fcgjSA vZyh2a1JXaK7khc6F5+BP9C60q1iWnVArNjR2OM9/MJHiihTBzAtbQ68lWj7vfAtC1o0 T1tWjievG5oqOfPUjFPJNrWUgKxCFTEKYW+ZVyGY0UWloWE54S2bR6iebN0V23Lbwv5H WRowBt2ZsBVC7uqgkg9l9lQrA0heWxYCzmO5QqGt+zFY+afpJaKyN5I/VpQIKb1zZhIo 27YftFrA6Oym3uz7300jCFzftCXVLUkDfOSAuVFzNZ69AtFcnOvFVMbqObgMVyQqokr+ rmEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683098552; x=1685690552; 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=aMkerXZLOd0Gx02hhMBUoM7eW+9K4c2GOZ3LVFA1U0wXnVm4wdnlztDP9mLktWBL3n 9Hw6gPOhREVm/F2ihkKWDTTAzUJvuzLbHXuUt9Hmo7mX/8i68yo59Ba4LlT0qZvArPaB KqpiffSjalyw75bXNOqJBoKmh26rUUDRvjbXeroBkat2FOO4PjyQdXIBNFFO7mI7foWm zrVhfu0oyfWc8f5eKkniKycWhM1kRu8AwT4urrqN/Ad7yziPYV5B4dijiNVewLp3usSz 7k1b6rEZtKleqIpGwEVyy1VknVkc/ypLQ4V6wHJM6hpqHwAWTiVKoT6S7P5uj4iyKqSo BuWw== X-Gm-Message-State: AC+VfDyclVVI1GmjwMZ+SmZaG+gXrofkNdgTFhewxjuqCDLKlxgmWXAK 0V9e0YjYbf/ZxrAT1v/bITC2lD9W5UFYc+BGfQAKWw== X-Received: by 2002:a1c:7205:0:b0:3f1:8338:4b8c with SMTP id n5-20020a1c7205000000b003f183384b8cmr14382952wmc.1.1683098551870; Wed, 03 May 2023 00:22:31 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id t4-20020a7bc3c4000000b003f1745c7df3sm962789wmj.23.2023.05.03.00.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:22:31 -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:20:58 +0100 Message-Id: <20230503072221.1746802-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503072221.1746802-1-richard.henderson@linaro.org> References: <20230503072221.1746802-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x335.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 --- 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)