From patchwork Wed Aug 18 19:19:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 498976 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1001026jab; Wed, 18 Aug 2021 13:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+4zjXi/2SovyF/3U7q2UyBsicx3pFYBeIeYDWE5m4BFRHESnlcPPm/MfbGU9+hYa/NlJ+ X-Received: by 2002:a05:6122:e04:: with SMTP id bk4mr8838483vkb.20.1629317593796; Wed, 18 Aug 2021 13:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629317593; cv=none; d=google.com; s=arc-20160816; b=pF+xT675+gEgl2m8NHpYKxCBpkIIYP9A/ioHmAucesZ39zXoW1TD3TDwxFZfR8qlYP k5SI+0vkfs8vjfRI22FX+HgBy7d7NyKXWr5QKf6Om4UtDd10SrXpo4p7KdZMx8XSbr9V J7dSLl9zp0w1aWOymfI/Ub09+BkreC1rfJRKlNpHurTPPFhpAiJ8XsG/KOIhldaEmJMr 1tEY6I/k/ycwGi6lr1NydXcFHoD9SbvUOCwsYlDvSripW3lD6wNCXMAZdcnsS543qW3f XnmNiSSaS2X2Dte1aRc9oHa+iiIQu1y97U2sBBJhVAEm+Lqx5c9j9I38TQ4hl0T03u0q PF/A== 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:to:from :dkim-signature; bh=1cpsMDhGC9RcGcWm5BcMRPq9nZ7pllN/pajlbOR5Sm8=; b=qlH+0MOyR9ly/Is+31RNujSRPbSXB5apyjbapgR3vd/Z6KdM9RrLu/gUtXXHA/7gOk +t/2zhH8yFziPBH9qu59j4WT2LELIxMYy/cgvkMYAn1MsHjFHnu2UsoV63fv5yYjezCi PPb2Idb7/6xhy6DQ+InF92a5oCfXv6fObpaAYQYFnVuWykWCgOUS6xq55UTphUP9ivmm oVsYA1OsXONc2KqPAv+arrpaxrCjx1hnNr45Bqo1m9v6LQD59ZmHs4Z73gpvvxGOtssm IrxPUNncMk1Xff//woClGUekAkn2muw0wRiT107DyUA7tn2+UztEoIveYnkVh11rUOCc ReXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oxbEo0py; 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 i28si503389vsj.403.2021.08.18.13.13.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Aug 2021 13:13:13 -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=oxbEo0py; 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]:50140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGRw1-0005Jr-7e for patch@linaro.org; Wed, 18 Aug 2021 16:13:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGR9z-0007nP-DD for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:23:35 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:46047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGR9x-0002qJ-Op for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:23:35 -0400 Received: by mail-pf1-x434.google.com with SMTP id t42so618342pfg.12 for ; Wed, 18 Aug 2021 12:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=1cpsMDhGC9RcGcWm5BcMRPq9nZ7pllN/pajlbOR5Sm8=; b=oxbEo0pygBTOkb0waG+IBooSMcA13T9GWsz4x4lOJbte8OM5JorQq1WvMAIK+ZoWg0 Sb8N0OcqS8TAz9MZ3FXWubLV88tbysb/818FW8gH3d/UYfCLG+twbxGQkqhbm8wXvhN1 QHYJSgDUgvpEtPOQUSPLfQHlgvOzA/sh1/T//lSZfUUmmz2U4LkPL6jZ4CsTr64BIjoo 5kjr+4Mfi0bLaQco555CUjMmzEn8lO1UC6bAOdbflRgA7ebb7dmpzuM5aHa5J9Lw1ASA MzstwzxxQiK0CDRQwkT1ppQQd7XAOSh6r30GacZ4TbfOcS9QYk6wWS6f0vAnvuWnW+uI S6cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1cpsMDhGC9RcGcWm5BcMRPq9nZ7pllN/pajlbOR5Sm8=; b=PfiAyZBufXfZ6iiSOW8Zje/xyx9tekE17aphWNScjeajvEHe/Vr//WJ0xNMVfPN/ZY GSGHsFVkTE4ugfscaeAVLnDy+MPb2axLnsUEx9dg+pd7NIadBWQfF7RNx0RS5DXVoiaj hGvY8keYegXckTDRlaAhC6qB5gXMledLdNDLpGArjWvBxP1CuMNVGM21sQ+IR+lb7XXK We9kQGnPdX2isITAHYdLjd21ywZHtPRu7F9MrfEOqiD9C10CpOq93TcjLDVWx0KCi7wi JsrXLzt7cmjitkMhA117VVNHwM24LUvrxRQAcVN+t3QdBZ6B109fyoJL9oRhw00kZzz0 kD3Q== X-Gm-Message-State: AOAM532NvnT3L/e9V0I8zBu5GgFW7OvbnXfkCkcnDD7v5hwf8pBMUprY 4xgVn9OubrtOkFuC522WBrfZhrJ1n06pRw== X-Received: by 2002:a65:448a:: with SMTP id l10mr10266182pgq.313.1629314612078; Wed, 18 Aug 2021 12:23:32 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id w82sm569302pff.112.2021.08.18.12.23.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 12:23:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 57/66] accel/tcg/user-exec: Convert DEBUG_SIGNAL to tracepoint Date: Wed, 18 Aug 2021 09:19:11 -1000 Message-Id: <20210818191920.390759-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818191920.390759-1-richard.henderson@linaro.org> References: <20210818191920.390759-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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.23 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/user-exec.c | 9 +++------ accel/tcg/trace-events | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 6a3fec3002..1c9486c76d 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -27,6 +27,7 @@ #include "exec/helper-proto.h" #include "qemu/atomic128.h" #include "trace/trace-root.h" +#include "trace.h" #include "tcg/tcg-ldst.h" #include "internal.h" @@ -45,8 +46,6 @@ __thread uintptr_t helper_retaddr; -//#define DEBUG_SIGNAL - /* exit the current TB from a signal handler. The host registers are restored in a state compatible with the CPU emulator */ @@ -133,10 +132,8 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info, abort(); } -#if defined(DEBUG_SIGNAL) - printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", - pc, address, is_write, *(unsigned long *)old_set); -#endif + trace_sigsegv(pc, address, is_write, *(unsigned long *)old_set); + /* XXX: locking issue */ /* Note that it is important that we don't call page_unprotect() unless * this is really a "write to nonwriteable page" fault, because diff --git a/accel/tcg/trace-events b/accel/tcg/trace-events index 59eab96f26..d54416f2ee 100644 --- a/accel/tcg/trace-events +++ b/accel/tcg/trace-events @@ -8,3 +8,6 @@ exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=0x%x" # translate-all.c translate_block(void *tb, uintptr_t pc, const void *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p" + +# user-exec.c +sigsegv(uintptr_t pc, uintptr_t addr, int is_write, unsigned long old_set) "pc:0x%"PRIxPTR", addr:0x%"PRIxPTR", w:%d, oldset:0x%lx"