From patchwork Tue Aug 16 20:33:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 597526 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp2712860maz; Tue, 16 Aug 2022 14:09:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR4gG7ReCAg5IGgWVyzS2s9rbA4MGTbsSu1GxU528+ASh9W1swX1ZsuzKJJuAUpx6+LIeqEd X-Received: by 2002:a05:620a:424e:b0:6ab:96ea:40cb with SMTP id w14-20020a05620a424e00b006ab96ea40cbmr16644927qko.483.1660684144178; Tue, 16 Aug 2022 14:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660684144; cv=none; d=google.com; s=arc-20160816; b=HxEk8gnpjnD+kjpohPWS0PuGBYB7dIijcC2nzLhmodNaogRu77C78w0BInAiX6B76S /51WNRTr65YekMFRF5EsdHsx/BNzrOXiLyyPEdm54mDob6Jg+nEL/DctkENAa7ujMDSk eoiFZSSDLYRxfENspHNykX2+Bdkm6iU97LDYxChVLDiJKpxc3OECLOShIORcHmzjOeY1 +CN2boJSASqBPknwpmjRJWwekGZPI49GuZpS/7aVfBTliy39sdvyO+gWsD3Dfi3//4dr 5Rh71AaSYEZlDdv9v867tS1UG6rAqWNpOGfuXS/zw+Wj74N3QDTdQpGMkNS0rfWT4qVW qYEg== 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=IWlaZaIHC2PGKwPraJEjxrFHVPFHU1XNUZVWkV1OIpk=; b=Mn5Zt41ijFnckgAmxbRkD3X/wkgQmqjsMtTXe1q/8TXTgY0fBqFC39v6sCSVe0b99l yazPsSxiQKp54OWvR0uQmtd2WIKiQw0N0AN7q+Mij8dIDyIxcUAdJabXRCTn018ryzH1 tG09OhPSRmRun/WW7HyU3dVcKpg9VnWNpvZEsMDDOg0n7Qbt4ApI1Ee2BcIEwk/m5cOD ZIbL26+NK6kTa//aDMGQTOHclrCYb+JfFqv3WN0+pfrNv6shp03W7RPAzU7e7jeU+duX 8Z/YHlNGsB80Wg0VA6zCOm9JIXZjq2w+BAspLnnKpYP02FwBCJSG+fd+FKoUvrtkKeSo XQCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BKlIQ+5Y; 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 23-20020ac85657000000b0034355af45d1si6656739qtt.299.2022.08.16.14.09.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Aug 2022 14:09:04 -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=BKlIQ+5Y; 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]:54914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oO3o7-0006PY-Ot for patch@linaro.org; Tue, 16 Aug 2022 17:09:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oO3HE-0005Fc-Ar for qemu-devel@nongnu.org; Tue, 16 Aug 2022 16:35:04 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]:40585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oO3H6-0004d2-PF for qemu-devel@nongnu.org; Tue, 16 Aug 2022 16:35:02 -0400 Received: by mail-ot1-x32b.google.com with SMTP id z22-20020a056830129600b0063711f456ceso8177580otp.7 for ; Tue, 16 Aug 2022 13:34:56 -0700 (PDT) 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; bh=IWlaZaIHC2PGKwPraJEjxrFHVPFHU1XNUZVWkV1OIpk=; b=BKlIQ+5YT+38KuvNo6tgQEW+/xf8+sZekutZ85uXzRqkoemR5TYJz47uA7nIeZyCqe t6mV0Vm8zjf2B4c1EhANRMgBML0stYENP9WAqW2AIURuB0fdbirDOc9x0FQIAKHU7Y9p 1rd+oZ0wS4E3KDLJoNlAavp3MIIbvNSaN12gInYCDo8rOhvG3pIt85kh+4BTUojKiPez dImJLFLbE0GOhoraQBknw3ayJerBpTm2pZrwsQP7BARvYIb20vD+MstQf8Ie7GDXdmHh r5+e0S4bGM/BZZDvvLyHkWCqIG5bLF0bj88UYBDzY+Mkb1z66KiOv4Iwxn01Xmkc9E/j 6TEw== 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; bh=IWlaZaIHC2PGKwPraJEjxrFHVPFHU1XNUZVWkV1OIpk=; b=dpu097ycY2+D5tfcJpy0dm0YcQ7SKC8gXjBR3x5o+L5qpeR4o7n4tPsED620bFbO+h EXj+ank08sbrV9k73VREIrBbm+kRwubLihXY2FSRgtGsdWhV99Fj+hLCPvcLVg6enNOH Gev32IXXlf/345J/QCeFvf0PdaA+b01Bb9vAvDWBjya+aEgmDWXMcygYf1tUEdsG/k2f AAfvLzeYDc8A6hoExY0Hs39WMFijXCUa8ov+KgPvh9dywqoGePcSgPG7CuJy0aTcvt8k IoYYBMwztE/mUk04rgjUWzSsAC+za4spfDDmsQt1bRGGzGIu+ymhl2IJHmA7w+PX/rud D+aQ== X-Gm-Message-State: ACgBeo26vAYewhnRUrmSmaAm+vkZj/lsZVYM7iJGbN0uBCc89OSm/PaF ZeAy4l8/YiYSDwb9f1AeXMwP7NX0Owr3rA== X-Received: by 2002:a05:6830:18d8:b0:638:969c:1eef with SMTP id v24-20020a05683018d800b00638969c1eefmr5486363ote.49.1660682095703; Tue, 16 Aug 2022 13:34:55 -0700 (PDT) Received: from stoup.. ([2605:ef80:80f6:61fa:9bc2:5095:d612:5e22]) by smtp.gmail.com with ESMTPSA id y23-20020a056870b01700b0010ef8ccde67sm2285220oae.13.2022.08.16.13.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 13:34:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, alex.bennee@linaro.org, iii@linux.ibm.com Subject: [PATCH v2 24/33] accel/tcg: Split log_cpu_exec into inline and slow path Date: Tue, 16 Aug 2022 15:33:51 -0500 Message-Id: <20220816203400.161187-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220816203400.161187-1-richard.henderson@linaro.org> References: <20220816203400.161187-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32b; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32b.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=unavailable 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" Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index f7c82a8f2c..d758396bcd 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -283,12 +283,11 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, return tb; } -static inline void log_cpu_exec(target_ulong pc, CPUState *cpu, - const TranslationBlock *tb) +static void log_cpu_exec1(CPUState *cpu, const TranslationBlock *tb) { - if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC)) - && qemu_log_in_addr_range(pc)) { + target_ulong pc = tb_pc_log(tb); + if (qemu_log_in_addr_range(pc)) { qemu_log_mask(CPU_LOG_EXEC, "Trace %d: %p [" TARGET_FMT_lx "/" TARGET_FMT_lx "/%08x/%08x] %s\n", @@ -315,6 +314,13 @@ static inline void log_cpu_exec(target_ulong pc, CPUState *cpu, } } +static inline void log_cpu_exec(CPUState *cpu, const TranslationBlock *tb) +{ + if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC))) { + log_cpu_exec1(cpu, tb); + } +} + static bool check_for_breakpoints(CPUState *cpu, target_ulong pc, uint32_t *cflags) { @@ -412,7 +418,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) return tcg_code_gen_epilogue; } - log_cpu_exec(pc, cpu, tb); + log_cpu_exec(cpu, tb); return tb->tc.ptr; } @@ -435,7 +441,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) TranslationBlock *last_tb; const void *tb_ptr = itb->tc.ptr; - log_cpu_exec(tb_pc_log(itb), cpu, itb); + log_cpu_exec(cpu, itb); qemu_thread_jit_execute(); ret = tcg_qemu_tb_exec(env, tb_ptr);