From patchwork Sun Apr 28 21:49:11 2024 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: 792911 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1417540wrh; Sun, 28 Apr 2024 14:51:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWzhJXLR4509MIjdjeeLo6DwHLVc/3tYEKQLG6QOwm+x6WFz53+eVv3aj2NN6D/DowYfi/2kRK3+cXkAk11k/Qw X-Google-Smtp-Source: AGHT+IGVJM95p4Ta9MUbtWuNktTEm4XqQsGj1/CZqyZh8LZSJgsu5UwEXbZ4LOmw+vjXGkmqj1kB X-Received: by 2002:ac8:5956:0:b0:43a:daca:2ebb with SMTP id 22-20020ac85956000000b0043adaca2ebbmr1937470qtz.30.1714341060850; Sun, 28 Apr 2024 14:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714341060; cv=none; d=google.com; s=arc-20160816; b=quc8U++R3g44mXIt3tWNgtFrnF5svXFTZZVueKlEmNNOuw8jiVyv0wsduJvL9oUfuW Pe40Ai4YMVzSexrnFlXFrPVdAyr+EDtIWQ5fVaa4WqMyK4/Vec6dmo6dozM6zcxQUQNr 3iZUjACd4Vxnl+ARXd4mzxq+6jYFeh/Lex2eh0oUUzax2G3B0KpFQJIrs+ulJkWnE9yB Owf21I8qZG1/WKGz4WuHVi5t7+zjUUBS3ojwHgLdIg+4Hc+jXu3TDDcL+rQg1HluT6bQ xIkiLfSWEGKlKPaOiaiT7p/XWuaJdRHD2A+NYsJ0WH86hHSPLg+YxA3iEjpWp2JujKKb Gbpg== 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=5vkuOqkqjEkB9PdGqDT2q032XYrx9jU6/rWVH+r61ws=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=XC1tewmOJ0iYB5jT/axi4k0ACRXmt9fKr5Anb2mq1U+GXyFwGxW69OdC7rWQlXQm5t 9f80SV+IWbEkieEEBLDpeGF/7Yv5pJmKYhzpJMAhRDy/ZnvqkQBp2T6TI5gKC5ojSEh8 bMutFPqralGhO/S/YKUm5E0sAknYj0rCHb4jXWh2ZpSUHxiaGhVjTyYJBu1J7lHuTZsc gwX/ndQBCxQHASoAfMlu3rd/2at7BCl9NpIJm0uOJGShIte+nXgnBqu1+IfS9Gspq4MS kNSP4X8XHoNV+HF0DkTG8B98BfLMO6KVok5/G2X4Ysg3qBWpCVqmKobD0SLR2VvDjVvS ZVVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dbOj8tNP; 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 hg23-20020a05622a611700b00436e0ec2559si24798782qtb.468.2024.04.28.14.51.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 14:51:00 -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=dbOj8tNP; 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 1s1CPY-00034E-M5; Sun, 28 Apr 2024 17:50:18 -0400 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 1s1CPW-00033y-Ds for qemu-devel@nongnu.org; Sun, 28 Apr 2024 17:50:14 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1CPP-0001Iz-92 for qemu-devel@nongnu.org; Sun, 28 Apr 2024 17:50:08 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2db13ca0363so59890321fa.3 for ; Sun, 28 Apr 2024 14:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714341005; x=1714945805; 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=5vkuOqkqjEkB9PdGqDT2q032XYrx9jU6/rWVH+r61ws=; b=dbOj8tNPy8Wo+JN3IQ4HIDARKLVOD2WQjE/2t0JU+D4p8nExcfD/hdhLA2Lkk/LPIZ m6OhfOwGeUAUBSWu6ZKEFbV9gWADGAZUP2ccZkveT0ZZanz8ZDLGnhfjiS5G1EsV5pbQ Uc8CxwuA+TiuM/jYK0Q7lx6+7OxlWhqMKouGGiACyd1tI1YUlqnN5yOPvCDwJfIvpkPx zjDPu8LGhM9c+TCIg0jrGCvMc1UgxmP+qN47qVC/uD/CPxpOEk80uDnXYqAYJso1oK1t 267B5laN0h2vwrG+D7Zq//4OTKowIOleld7M+5ttwNtH5kblgKhtOlz8zEduooWqMHiq 5l/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714341005; x=1714945805; 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=5vkuOqkqjEkB9PdGqDT2q032XYrx9jU6/rWVH+r61ws=; b=XcWW1d2VxqKXXJtLOrI4zWLEfD9dKUglkBVfG5EGrjxRDeAO3ObVjKw0YhmVIEUaos j6fO4+5Oq0Ku/f7Hn9jHlsldgpqGaH2aoz3B7tganODskIuYR0yx/3Jk96I7MRFK3XjT Xf0OkwXGeyxV3QZu4iZZ0gXOv4FWDaQvqSUW3/Mu2uZlmdZYhSirHvyoYZPDIegixjEo Tx7qHcbKnIkuPJVy3w+y9oqRrMc3usuGheSr6kz4UewClcMv4po3cMsydvKZDXM6oR7M mMlWfpdQ19dD2AWcbGv6T/J7kP2jkBMHOdI6MyIMT9YKzBqJhKP1I4uRQX4Kd0kpBMdy zMAQ== X-Gm-Message-State: AOJu0YyGUE4da7yk57XB9poiQQXNwgWouGU+Eti2H8P52xcePKmaykcK 7py4ygz/qXKAS1ba43mqEHOnzxxwg3ElHampCHnnO+HT6kEBIG54GKwQxTzsQFISuaKZ44bPchP Q X-Received: by 2002:a05:6512:45c:b0:51c:2c7e:ac92 with SMTP id y28-20020a056512045c00b0051c2c7eac92mr7068746lfk.23.1714341004957; Sun, 28 Apr 2024 14:50:04 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id z13-20020a170906434d00b00a51e5813f4fsm13361600ejm.19.2024.04.28.14.50.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 14:50:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 08/12] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_tb() Date: Sun, 28 Apr 2024 23:49:11 +0200 Message-ID: <20240428214915.10339-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240428214915.10339-1-philmd@linaro.org> References: <20240428214915.10339-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=philmd@linaro.org; helo=mail-lj1-x236.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.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 Do not open-code cpu_loop_exit_requested(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/cpu-exec.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 225e5fbd3e..c18a7e2b85 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -900,8 +900,6 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, vaddr pc, TranslationBlock **last_tb, int *tb_exit) { - int32_t insns_left; - trace_exec_tb(tb, pc); tb = cpu_tb_exec(cpu, tb, tb_exit); if (*tb_exit != TB_EXIT_REQUESTED) { @@ -910,8 +908,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, } *last_tb = NULL; - insns_left = qatomic_read(&cpu->neg.icount_decr.u32); - if (insns_left < 0) { + if (cpu_loop_exit_requested(cpu)) { /* Something asked us to stop executing chained TBs; just * continue round the main loop. Whatever requested the exit * will also have set something else (eg exit_request or @@ -928,7 +925,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, /* Ensure global icount has gone forward */ icount_update(cpu); /* Refill decrementer and continue execution. */ - insns_left = MIN(0xffff, cpu->icount_budget); + int32_t insns_left = MIN(0xffff, cpu->icount_budget); cpu->neg.icount_decr.u16.low = insns_left; cpu->icount_extra = cpu->icount_budget - insns_left;