From patchwork Mon Jan 29 23:01:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 767448 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1119191wro; Mon, 29 Jan 2024 15:10:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/uuf+sQ1m9NQHWMC/RO8zZDQp+i0lsZC0az0w1/saiHEJ1f3basbRzTswdtulYgfX/28s X-Received: by 2002:a05:620a:4d2:b0:783:e9ba:7d33 with SMTP id 18-20020a05620a04d200b00783e9ba7d33mr5164627qks.60.1706569823137; Mon, 29 Jan 2024 15:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706569823; cv=none; d=google.com; s=arc-20160816; b=CZ2GCKk9yhDT7wuapFrvhDsktoshz5anUqjaoLFHJjdN7GY9UdLbEdHSswN30K82Ty zSQRSzpYJBkcASyOu51AndjjGbYVrdxeb9RedLxtTeZt22PEn+JmL8iAfcL6G4y+l1ZV dDl6NnbLUtLXiqM9s2vZyOPZ/WY82PePs3Q8u0ys68YVlDBAAxu/OzXtX5NbBR42iT/U OBbOtl7WYbRqHWxvljsnCDvvf/qFCA5rHa4f9GPCk1HBmM3jhU7NvaW0CADQ1YWpiSyU DQZ0v3aN6lUrv5V0/ijT4cufFBHTUisRL0xS1G1ieFpfnZ5jP54lKU+L2evb8hBgxPpX JFxw== 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=zfMhTQxwxgwjYRWhH0P+ZcfoxncjyISGzQ2K+4rTjEw=; fh=HGG5jZNhe8Q+zQJ9+mddel2c/xsqW3vEoqbd78QYiOw=; b=scewZiOgvfKg/slbE9bRLQT77F3QIFVOPF/zOpTIx2H2yKrtKIcG+zZ77NbqeVF6hY 6fdNMGwWJP6a0peCRKGwcCIOjFf2q/kSZRHwVN2ixIC4wbHstVCq2oRU2EZDCmT2vbFl C+eTKtqcUkp1NwC3jxN2pVZscancyxsOB1lVB81CtAvl5qWuM/ntq734p6K6ggizrEUd RXpWacmNhzbvnHCftpGKTQ4pD+t3CI+VNtET5YV9ZEKy4bfXQ5qWJxJn1CycHn7d37hx VMgw1gWSMNqG3I1ZiYfH3gQqKef9AR+6nGx2LhLK8BbOCsJHfHY+YVVMQw5+Fy2Z+Iew cbcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kfRdOoz+; 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 p2-20020a05620a22a200b00783d074bb1asi4561826qkh.238.2024.01.29.15.10.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2024 15:10:23 -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=kfRdOoz+; 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 1rUahz-0001LV-7b; Mon, 29 Jan 2024 18:06:33 -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 1rUae6-0006sG-Ku for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:35 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUae5-0008WF-27 for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:02:30 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3bd5c4cffefso3816524b6e.1 for ; Mon, 29 Jan 2024 15:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706569348; x=1707174148; 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=kfRdOoz+g2RIk+p6AuS/Cwv2hzBb50eRc64tuheJ0uSUFIaHl/IPFwO7PgbnifufvJ 6Ks7N3rR9wptrNObZG7DGWOymX+AUsc9D7RGo/lXQ9La9FL7GFQU/aXYG1/5/d7Zt/cY /47cR0vMK1nzSujpDs4QWL/4fZjIIyeUCV3hNpY/tT1BWiisSb0+1VYwfQnTMyYvZLRR 7f3NuzdOtv7A92i2z53pIkFUqr/x0uMhyWqjhbWG3DKUamXI1rIQTl+Et695fkziULx0 xRnP/I9+IJyBzJ7CN+uc3B0jXChS7TGQMC+4TQATg2okd2ezH7sbL1QiWzoCeHgZ71fR BX2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706569348; x=1707174148; 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=dtSWOOgJ0KGJ2tu+cQhPlu+bbns1xyzYVU5FbKnPvNwfxxdRWqG/ab2NCDMa1s43Az a3LK2utjMLLobhjvOdV+4Oh4ClHXjULaEKIEtd91C02vFfDDGDxtpGnlmKCVo8NaUE7a b+h35b6qPhzNfZj1AnzO7bdEQreDanISogGREsIa2I30p+JCpgH6E/bT5rY2fxqLEuyG 1vQFJFBpE77TJQOdoUXQS8s3DozpXXMjvEcr8DZA9ktaVVOT4CKTn4baA7Y4i6h6u5Sw SKB5E+R7AgcuZ1DxTrp3K7FIHCoomaTaJi3l6hifMuZIEa/Cl20pSZPKRoEX+jIpBfy5 DxtA== X-Gm-Message-State: AOJu0YxTsL9vA4r0WHIbu+QxZgVq+8rzduHymEgoxhuinYnJhIvZ2JMV mTHdb/av7Fnvp1QaQkB05tu9G9J6l6RtHphjFqhy3tfFAEWHa/FAHuDwWXf5ewS1rJYoauX5pN3 9FqY= X-Received: by 2002:a05:6358:524b:b0:176:91b9:831 with SMTP id c11-20020a056358524b00b0017691b90831mr4710648rwa.63.1706569347855; Mon, 29 Jan 2024 15:02:27 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id r10-20020aa78b8a000000b006ddcf56fb78sm6419368pfd.62.2024.01.29.15.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:02:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Anton Johansson Subject: [PULL 23/31] accel/tcg: Un-inline icount_exit_request() for clarity Date: Tue, 30 Jan 2024 09:01:13 +1000 Message-Id: <20240129230121.8091-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129230121.8091-1-richard.henderson@linaro.org> References: <20240129230121.8091-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x231.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 From: Philippe Mathieu-Daudé Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé 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 */ +static inline bool icount_exit_request(CPUState *cpu) +{ + if (!icount_enabled()) { + return false; + } + if (cpu->cflags_next_tb != -1 && !(cpu->cflags_next_tb & CF_USE_ICOUNT)) { + return false; + } + return cpu->neg.icount_decr.u16.low + cpu->icount_extra == 0; +} + static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { @@ -882,10 +893,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } /* Finally, check if we need to exit to the main loop. */ - if (unlikely(qatomic_read(&cpu->exit_request)) - || (icount_enabled() - && (cpu->cflags_next_tb == -1 || cpu->cflags_next_tb & CF_USE_ICOUNT) - && cpu->neg.icount_decr.u16.low + cpu->icount_extra == 0)) { + if (unlikely(qatomic_read(&cpu->exit_request)) || icount_exit_request(cpu)) { qatomic_set(&cpu->exit_request, 0); if (cpu->exception_index == -1) { cpu->exception_index = EXCP_INTERRUPT;