From patchwork Thu Sep 28 19:41:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 727094 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp94111wrt; Thu, 28 Sep 2023 12:42:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2BXM5AVB65NXe++UirovubQBWoBk8v3FuPl+hPfO5grhhKo+WyWoyqS5ES27ffoNMeFhd X-Received: by 2002:a05:620a:2454:b0:775:6cf8:8da8 with SMTP id h20-20020a05620a245400b007756cf88da8mr1945018qkn.32.1695930137802; Thu, 28 Sep 2023 12:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695930137; cv=none; d=google.com; s=arc-20160816; b=N9qC3uArxE8sTFyPSTNtIB5YomA/E0sY4c9HcN//U+Yy0u4VSVITZRQj3gUw9kUume ZcBFqnNApy7aoXZsYVN+tQEwpZSIjfEWHFfuHjfp2rS/AzYhaQBzcV5j+AWB/+E8Rs6s GLxR3O/ThfBAKCAifoxRiSQ1Fx5mOisjMnfuKFzHzPiuNEcV6kdq1gGRjEf8jEsNsJKE FOLmUhRlZFb5ojNfyFuNF8OVgyzStBm1im5eBq8f8m5g2LAE9TpTHv8ZG4sP+IZdkHL8 BbjehQvd/y2yFcXSZhN6V1KOvhyQ0pVIjmzzIEna9Y0TpGM06X6VVoHMXdlMBBpOWTKl 58DA== 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=Pino+Pzpra8kDOPi8wLUPqIV+r06yGcltlj2T5gxEf8=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=JmMWWQKnNAve22FcDVsvL7aNRBa9+JrkKDx6sLtmHDDk62SAZ4B0e1i+KywcW+RjqV wx7a8RAEmW6EaXDRecfbFVerJu7o8Prp0iITmpe7iBbt1uKDMaG2EEO5f3DF+FY1MQpL JuxxIR/JfQPRq4X2f6G9Yn7Ki6RxqiKCZ6IbFda82Wh6Y9+aolqsgpA3vM83OJUa6cUz di35k3kC8oF7ElxbmJWN4H5klnyaGY0JwaEaJhW+ZTzGiLtW7bHlSskiKkgxU0O8MQEn XcFoajR7EC93LujcrNaqCO0GXBiiKJy3FYfv3c82ajV5NNjmrXCYfXmnKd9GyFfriY8B WvUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wdM2an+v; 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 v2-20020a05620a0f0200b00773e067451csi9449977qkl.644.2023.09.28.12.42.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Sep 2023 12:42:17 -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=wdM2an+v; 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 1qlwtk-0007yX-6d; Thu, 28 Sep 2023 15:42:08 -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 1qlwti-0007wW-Nb for qemu-devel@nongnu.org; Thu, 28 Sep 2023 15:42:06 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qlwth-0007yW-4p for qemu-devel@nongnu.org; Thu, 28 Sep 2023 15:42:06 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c735473d1aso11371255ad.1 for ; Thu, 28 Sep 2023 12:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695930123; x=1696534923; 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=Pino+Pzpra8kDOPi8wLUPqIV+r06yGcltlj2T5gxEf8=; b=wdM2an+vUAPytuALdj2EXtNsEv4Um8Q4jpLk16ZgHxyMUd2wCoZtVPAOmUs+pnBDBK Klcb2Dkh6vO7ungXAzU1Xo6lDnmQBWgREFMR3p37p6TR7bYT6GNQpqyq01VCCfWz70uj N+yksgmX40emRnVDisNSpKpErAKRJmAdb5MBFFBo7Giv7x2szweSzkHd6TbwF8mo1UTj JdPpzHPiWXkDkKkxOdtVYMKVeia8123/M5Jc17sVudIaYsSWjrcas4OVP/rrpKvAJB4k YuUsaMkiMmAdIhQ4sS++tgCPATLAABj7Ht2yBugQaM2FAZbNQEGXMb5LYWohARywyQzu fhqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695930123; x=1696534923; 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=Pino+Pzpra8kDOPi8wLUPqIV+r06yGcltlj2T5gxEf8=; b=t6nK0a9ZKGSi+rDQKm83H5O8NxbZzMTQ8vmT02iEDEeEN6H/8dVnp2jdNMHQ9HR6xi FFIMHB9fPVENdrj48uVkAgAfHag4N6Cody6Hxm3o0XkARK6GK+1eW7ylwSkaI9yNaCpH +dzZRUsFbRxKf2EhIC08qtCiWu7tc8h6Onb+s17n+YM22YqcCMSOyLDtAQdNECjS4tPy Sq3xHtu2j8P+ZxMmWJDdwpZcP6O943LXS/kg+g0N1nRX3l2CxPNoD6Dzrl74XA29Tv+q PHQyF1cA/J5mCfyXfdMG2CBqVS1hPpdktbb8KMGW5umYI8ottvF0KJz7H/f/Uc2CzHuB sE0A== X-Gm-Message-State: AOJu0Yw7Sqfcu4B/fNekLF3ulEgZKhz4lYRbuOr9kfWv+TZ422GmQ212 Ls4GV7zpEXOO4ZqlycNHdy/8J9hw4o6dljmNZFk= X-Received: by 2002:a17:903:2344:b0:1c5:6dbc:7938 with SMTP id c4-20020a170903234400b001c56dbc7938mr2397915plh.69.1695930122652; Thu, 28 Sep 2023 12:42:02 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id x23-20020a170902821700b001b80d399730sm15273450pln.242.2023.09.28.12.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 12:42:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 5/6] accel/tcg: Always set CF_LAST_IO with CF_NOIRQ Date: Thu, 28 Sep 2023 12:41:55 -0700 Message-Id: <20230928194156.237351-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928194156.237351-1-richard.henderson@linaro.org> References: <20230928194156.237351-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Without this we can get see loops through cpu_io_recompile, in which the cpu makes no progress. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e2c494e75e..c724e8b6f1 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -720,7 +720,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) && cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra == 0) { /* Execute just one insn to trigger exception pending in the log */ cpu->cflags_next_tb = (curr_cflags(cpu) & ~CF_USE_ICOUNT) - | CF_NOIRQ | 1; + | CF_LAST_IO | CF_NOIRQ | 1; } #endif return false; diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 32ae8af61c..0c3e227409 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1083,7 +1083,8 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc) if (current_tb_modified) { /* Force execution of one insn next time. */ CPUState *cpu = current_cpu; - cpu->cflags_next_tb = 1 | CF_NOIRQ | curr_cflags(current_cpu); + cpu->cflags_next_tb = + 1 | CF_LAST_IO | CF_NOIRQ | curr_cflags(current_cpu); return true; } return false; @@ -1153,7 +1154,8 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages, if (current_tb_modified) { page_collection_unlock(pages); /* Force execution of one insn next time. */ - current_cpu->cflags_next_tb = 1 | CF_NOIRQ | curr_cflags(current_cpu); + current_cpu->cflags_next_tb = + 1 | CF_LAST_IO | CF_NOIRQ | curr_cflags(current_cpu); mmap_unlock(); cpu_loop_exit_noexc(current_cpu); }