From patchwork Thu Dec 7 15:45:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 751077 Delivered-To: patch@linaro.org Received: by 2002:adf:a499:0:b0:333:3a04:f257 with SMTP id g25csp502989wrb; Thu, 7 Dec 2023 07:48:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpzlJp0ENSBmJVPwbGSNaSn9yXAoj8dgAsYiq8VG35AQJOdqno5BLpSe65BhQTxRDb5yEX X-Received: by 2002:a05:6214:5809:b0:67a:c107:2f74 with SMTP id mk9-20020a056214580900b0067ac1072f74mr2834359qvb.8.1701964129671; Thu, 07 Dec 2023 07:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964129; cv=none; d=google.com; s=arc-20160816; b=ggPWzanwnLbmBIak24+SCXDWKz42QYqUJgS5fyNmrCWhsON4/3kzA70ahyhByUhkyW ZkFs2a1tFBZgUFHrjR+isAur5QVndAvzy0OFAtdp+YaCzLxWtkk1nxidhQvTBiecQlLh AR0VnuNaOp8ifotne5NYPLJfv6seTI/CXZcM5EwxPnnFqvtN0JLzJA1Ty2o4gTNvX50l DpO2eCfpjPdIjNe/iOjqB/f6FDtAs9AGVDj7Rvxh8jIhsWuwayurOf34c4nbMG0TBOZR mNF95MkprfpIV/ogUC71Voko8i2U5KnEenzdzbs4WyOjZPa4PzKX8NN2EuI12DKCGqWc GzsA== 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=pwehzbql2APDeG+wQ20PBY5aWPTjdNYBgHCWKgUCJ14=; fh=A8ftaDMzewcMA0xKw++MSYMuCBPymoWdeCEx+9KcU8w=; b=W0B/WSO7srUJqfGDNHkOQra+zbUcPdoqkySj7ZD+eyvtpXfZoESgqKWvgAZHxk++sO KNUUUeG+ENwE+QS8rqtG4IAa0rarcDUZz1+NHHMGJriA8Evin3wHEuUWJByBUFPfZ2aO q7qNX/PIH4Rt+VlWrM2OmO8IeMM0kXDssNjuA7MJJo46BFHCFqTYD9Cj/Ro8TxaEo7P9 IJgt4P3yPU6ziBOaZRfDSdoX9EGhOt5MQHlcbB6DHWCkIxyiyNX6W0eW4UKPbmR3yEO8 X642ylzRPullY72u1Z1gbm3C7os9UmpCxaPeWqygHRurqvY/9HXz0mlX7RAlX5BSPkcn p0Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mUX6v3vp; 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 f11-20020a05620a12eb00b0077dcb1fd81csi1404949qkl.637.2023.12.07.07.48.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Dec 2023 07:48:49 -0800 (PST) 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=mUX6v3vp; 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 1rBGa3-0000nC-Du; Thu, 07 Dec 2023 10:46:27 -0500 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 1rBGZw-0000i0-Cc for qemu-devel@nongnu.org; Thu, 07 Dec 2023 10:46:21 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBGZq-0002AL-Bs for qemu-devel@nongnu.org; Thu, 07 Dec 2023 10:46:19 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-54c74b3cd4cso2315971a12.1 for ; Thu, 07 Dec 2023 07:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701963971; x=1702568771; darn=nongnu.org; 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=pwehzbql2APDeG+wQ20PBY5aWPTjdNYBgHCWKgUCJ14=; b=mUX6v3vp20TDI8rGeV3wmX1CvCwE0D97UZzCS/m4Cqkmf0dePOambbUezlALs1o4gm DxN4HX4C7cLorKX9TKqruXUxURVI54D29xRT/heARAqAkYQ8IzSa3dXFmNqw1dfNSsHO zbAry8azt8szyC1WLtWhVTD8pjAbdAFLz9FEYTeVNS4j7sGN+Kg1hW+DGovrv1CJAU9T goqLu25arS3XbBNpNZFWMgsva8ggUYwcI5WYgL532J3gt7TBb5COP9jc3gK6Qd9Ot6mb mWNgTrfNEl4T+QkdgXY+VA3+JyZawyhjdYXDuFKLazMSCByXgLR0yz6cwU6IANMTVAF9 Rkew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701963971; x=1702568771; 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=pwehzbql2APDeG+wQ20PBY5aWPTjdNYBgHCWKgUCJ14=; b=oNC++3vx28GF5Dq7ApdwErxzbY3axyurJy8AEtfMAa3mPQaPaeGSUYQjcsY0kc4o6S 9hSnbbZU4LLsBj1VtrKkocdCEIgeCczIb8INaX1Hjl14ORR/ATPcoqmt23C6uLUH+u16 3TqkUiifHD03FzGMKd0qKu6SuYWgb/q7e0NvZTrhzIJRCx1Ta4tIroee+He3FnoAbQTH xZVcAvfQNZBEOMK/XLbRB45EQgExHT4lX76qjBJmPAiTQtk0SrBfyUH16RUgddIn7qDC kQmF6DbsbfbqFRv46ifJnp2pPCDPaT9FbIocL/8DunxNTv5BULr8+cnhCfxdyi1/Ug12 5OJw== X-Gm-Message-State: AOJu0YwokUTD+rVqrmYhx1O/YEd6IwGqP3jv3723fpgx4GG+64g+b4Ik PR+oNmOY6FdLwPkqW+PPAeiI/DEj3mROAF49EXE= X-Received: by 2002:a50:bb03:0:b0:54c:553e:67f5 with SMTP id y3-20020a50bb03000000b0054c553e67f5mr3540189ede.8.1701963971415; Thu, 07 Dec 2023 07:46:11 -0800 (PST) Received: from m1x-phil.lan ([176.187.202.111]) by smtp.gmail.com with ESMTPSA id b1-20020a50ccc1000000b0054ce5c00e74sm923565edj.88.2023.12.07.07.46.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 07 Dec 2023 07:46:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Pavel Dovgalyuk , Fam Zheng , Stefan Hajnoczi , Richard Henderson , qemu-block@nongnu.org, Paolo Bonzini , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 3/5] util/async: Only call icount_notify_exit() if icount is enabled Date: Thu, 7 Dec 2023 16:45:48 +0100 Message-ID: <20231207154550.65087-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231207154550.65087-1-philmd@linaro.org> References: <20231207154550.65087-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- stubs/icount.c | 2 +- util/async.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/stubs/icount.c b/stubs/icount.c index f8e6a014b8..a5202e2dd9 100644 --- a/stubs/icount.c +++ b/stubs/icount.c @@ -43,7 +43,7 @@ void icount_account_warp_timer(void) { abort(); } - void icount_notify_exit(void) { + abort(); } diff --git a/util/async.c b/util/async.c index 8f90ddc304..9007642c27 100644 --- a/util/async.c +++ b/util/async.c @@ -94,13 +94,15 @@ static void aio_bh_enqueue(QEMUBH *bh, unsigned new_flags) } aio_notify(ctx); - /* - * Workaround for record/replay. - * vCPU execution should be suspended when new BH is set. - * This is needed to avoid guest timeouts caused - * by the long cycles of the execution. - */ - icount_notify_exit(); + if (unlikely(icount_enabled())) { + /* + * Workaround for record/replay. + * vCPU execution should be suspended when new BH is set. + * This is needed to avoid guest timeouts caused + * by the long cycles of the execution. + */ + icount_notify_exit(); + } } /* Only called from aio_bh_poll() and aio_ctx_finalize() */