From nobody Tue Nov 26 16:47:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706417108; cv=none; d=zohomail.com; s=zohoarc; b=d1Wb8n4uvqc9BJsjmUvgkjrG+8q/iOSoSYc2OGzfYQpU0ppur6clZ7U9YUD1iJw72Af8NhN1CaxtM3jT7hYJufcNnB/TCPd2NbKwfO1CTxzcAQxTTZwIl/LD0u5OjfdaCqvPj3ecCIhehzidqtvwejIs8/cTRF5nXr4No532d5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706417108; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; b=Pbddx5hwMaH4rvN7woLyQxhizt0DaZEzfTPmDE6veQmk01juFdYyD36/mSukpZ11nP8LF9fVLCGgiyS7a5BwXrPML4FyuWxkqLqGYXxxkD1opq0GqH/YxcQuhJRMT7Y1kKpwv9baTS8o+sqYoURjn+LHs6dhJog9RtgR5OggTtk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706417108371933.4397488208317; Sat, 27 Jan 2024 20:45:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTx0w-00059o-Tc; Sat, 27 Jan 2024 23:43: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 1rTx0u-00058j-Qg for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:43:24 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTx0t-0004OC-2E for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:43:24 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-290d59df3f0so1351615a91.2 for ; Sat, 27 Jan 2024 20:43:22 -0800 (PST) Received: from stoup.. (ppp121-45-131-89.bri-pow-que-bras31.tpg.internode.on.net. [121.45.131.89]) by smtp.gmail.com with ESMTPSA id w24-20020a17090aaf9800b002906e09e1d1sm5631873pjq.18.2024.01.27.20.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 20:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706417002; x=1707021802; 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=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; b=T7y1ebxaIU/WGVJL0aecfKq+bcNOYUHaHSk/DfSC3zaIoFaglj0uSdOl05AtdTgTvI 5iaOjEi0vimG2jYNlOac8go+brs0MsESjYmeLLL3TtWiGq8xk0ZLAiW8d3fODN5/+x1V WsrXElBk8qwZBT5Pyin0nGL8ragHJRxIu1JdY5rCxSY+wNiGTV+Cl6Ae9CZVxxoJZdnu dEhU55u/R6K32ElRvmzUOn6Bv8+5qma79YTXlbAW5Jvsd6Y1XbzROMBghto+Vt54qz3a RlUUhYSuByhU9BugpkWZX1RwCPQeMzfjKHu0gIAjeejIUr0Lhg1GLI9Rs2gscmh22DRx DZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706417002; x=1707021802; 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=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; b=j8Ku3xNgP1aBBGDmnsLsvFLFn9s5mDo11aorlq0jfKBxoXmWW1f7Q3h3Dw6rMihf1M rgvGsu9WehRqzGHvNyfcl0Xl5LvTtkcDlLQI1dOSMPdS3uYxW0ysW2LuvH47j/CUmTct 6zBMx41Ovbey81Ixf1M3IR++MOb01FAGz+thPZV+pESTrJSZbFcdcEjvUU4nTaoMHpIi a4Rjzn9Ahowc7DqDg1Xq4caA2z48R3fgPv6Nb15aTs3Sw9CEMtiEwR5PbY8UVysy8geA xRlIRCbo7xlWJf2xcTWJA3S8Y4gY+hP3m+GT4sYbzWgjdV1WAXZiGec1pUHrWKmvzmMb ppig== X-Gm-Message-State: AOJu0YyS5TPjP2SNIqrsSPB8u07QmsolK1KVreMPDSUvvvcmk90ATyVv Udbn1aI9jz8DyLYkwmJJI5Ng00dU7oUMSPa15+mdOuVTQ3h5iuNnvByj/s8Eer0FIHKKoHIkRfF 9dY3J4g== X-Google-Smtp-Source: AGHT+IFt+x+DQT2Oi6Fi2cZra8uEXcbNk4SD2wfKUGSSUS2B+/rqkiIQwYQzs3Z/1PxO9pzA2IASrQ== X-Received: by 2002:a17:90a:b398:b0:290:f7a7:333d with SMTP id e24-20020a17090ab39800b00290f7a7333dmr1569016pjr.36.1706417001755; Sat, 27 Jan 2024 20:43:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PATCH 25/33] accel/tcg: Un-inline icount_exit_request() for clarity Date: Sun, 28 Jan 2024 14:42:05 +1000 Message-Id: <20240128044213.316480-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240128044213.316480-1-richard.henderson@linaro.org> References: <20240128044213.316480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706417108823100001 From: Philippe Mathieu-Daud=C3=A9 Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-5-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 950dad63cb..f2535a2991 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -777,6 +777,17 @@ static inline bool need_replay_interrupt(int interrupt= _request) } #endif /* !CONFIG_USER_ONLY */ =20 +static inline bool icount_exit_request(CPUState *cpu) +{ + if (!icount_enabled()) { + return false; + } + if (cpu->cflags_next_tb !=3D -1 && !(cpu->cflags_next_tb & CF_USE_ICOU= NT)) { + return false; + } + return cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0; +} + static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { @@ -882,10 +893,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } =20 /* Finally, check if we need to exit to the main loop. */ - if (unlikely(qatomic_read(&cpu->exit_request)) - || (icount_enabled() - && (cpu->cflags_next_tb =3D=3D -1 || cpu->cflags_next_tb & CF_= USE_ICOUNT) - && cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0))= { + if (unlikely(qatomic_read(&cpu->exit_request)) || icount_exit_request(= cpu)) { qatomic_set(&cpu->exit_request, 0); if (cpu->exception_index =3D=3D -1) { cpu->exception_index =3D EXCP_INTERRUPT; --=20 2.34.1