From patchwork Tue Jan 14 11:38:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 857257 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1874936wrc; Tue, 14 Jan 2025 03:48:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXgUSqzghDfUbUPRZK+HzIXxt2eJpjL41cJDXcCLacdyLHmeUR79urMsGfGNHlWKnKL98dFKg==@linaro.org X-Google-Smtp-Source: AGHT+IFALZwe0CcD2eIy/kuaXNVh1ch75F7AamXgfX+8bN176o5EuejzHUnuc0KlxnFHj4EPZ9k/ X-Received: by 2002:a05:622a:314:b0:467:8783:e48b with SMTP id d75a77b69052e-46c7107a577mr395525191cf.35.1736855329264; Tue, 14 Jan 2025 03:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736855329; cv=none; d=google.com; s=arc-20240605; b=iMtqEp0lcH7ybSseycn9PpXk6E9GhxMloe8qLGayZt2qX4jCXcLg0uQevbW3jLo1gD 90iQxISEwXh5kVhL3tR2WPTaO7T2TjXKivPDOvvcAVrH/XcgVA0Kofjl5apkJSP46Yat jgQgDZa/4hPVg8PNHKF7VbD1iPQuzDDPSXnfSeEm4HMW8/H0/zF+9lR7IzaSIPTvzDVs iR4cOMNjM7p/Tm9Yt5qjl6eU2Op9Hw7H941QnWnuiD+NO6M0AITgpuyYKvYI3WOnykMX 0QuH4oIkj/B6zBGVV5hiys0tSf4ccDatMKTaJnkJXC1JBlyZaB4PIVllN12RUXz9GPET Tn/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=/xR1sdOln5uQTQB+HehunftAymFm05ADSFOJij2asec=; fh=XrfCJIUfNBYVi7vCweIUlcQ4k6L+PakXC6kR8AW7IK0=; b=GUtqnNUdK+mYSJUUZBYxjjLM7HZOcvMFM1a3OnELiVqa0X5SRA1KP0CxMtjPt6M3xz AL4uV+y9fLH3vSBwsLRE2wcYLfgZGflUNoMXTAqrSSX1r1Z6E/GKU05HbZBCjEQVYlkY mA5nOJ07PbQV+Ez4qBxfZiGeq0MHOsdL2UJ5II1ZSRw9tp99iWXW8n/JZTY6hfteclqv Yka4Hm3yfcyB5RDjo/tiQOgZygAlurK+rfErkU1KNrXrR5T3d49UnTVyqPi3PcyGRezu DRG35Tv1eFqfhFwHLhpRry4o8rGLsgk/Mx6TfpjsEkYObTjZ8eA4yZ93QaBy1gg3KzH9 n2Xw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EaQs7UOe; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873316a9si120183881cf.36.2025.01.14.03.48.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jan 2025 03: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=EaQs7UOe; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOm-0004yW-RM; Tue, 14 Jan 2025 06:47:58 -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 1tXfNs-0004L3-0V for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:00 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNo-0006eO-Ry for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43623f0c574so38382035e9.2 for ; Tue, 14 Jan 2025 03:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855215; x=1737460015; 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=/xR1sdOln5uQTQB+HehunftAymFm05ADSFOJij2asec=; b=EaQs7UOe2XDLXKsvyOQBTo3sy9Zf8+cZxyi0VEmopAH1giOqeLA24yHQwmzs/WK77w bw2Xk38cUrMg1kAz7j/dSzkuhjNX/DuMwh9xoQGv5+WUG24N3Py3snrrIPEwbWbQk1oi nolRvxepG0Xvylbzhe3NWZJpRzIX3IOU2aYRtcdtc+NKl4Kcds+R/ueQsxzbRMxHVMnl HvpS1Cz+bgI6Kn3EkVhlqxlM6DoGmXxkzL5MtbOwcaqWzulFg0ejPVCRrk15gk4FWytZ qA+Y6GvX9UG+S0BQ9Spl+HjooZWfhaCo1GkIULtFWl7f1B13R3fraeTQ3W5Lh+pcLrUj mvyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855215; x=1737460015; 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=/xR1sdOln5uQTQB+HehunftAymFm05ADSFOJij2asec=; b=M1zF60UfKdnOefb/I0x01RwKGFpO7lTEUmbtryqgGZXlukD+wqQVu//zJaq0wvstdx k6gLyB0M1qDE4lRX8pvB+PA+ub4RHkB04/F+xSp81D3ZgpI05l7uUr5+f9E8P2ryjzN2 WRQHOqO7L+NOQLBmZsmWwuzNxcxegqHoe/Cf4Yn/Z/xByio8K7a48+CHdHFgM/+n67t9 QIqZYIUgBggDOQiFggXbZ7OQoZ2ORLcashoCjCz5KDhtAqDHwW50SGmOa7aRNkdCOnzp T5P5htXxOkuwlQ+JFe6+bFd02k5ZYm63OK2zv8ajVx81DL3jm5Eec4pdY65Lr8Yks5zT Vg7g== X-Gm-Message-State: AOJu0YwlfGssMjDPC4ukeeYU2Pmv0gq1PHeZoFwjzG4FUVBmb5hAPOpB le2MVpto/aFOAvfMh6AyxZiifhyY0Bumk66mX1QRvi8+wpeK9a3U9PsZrK6WbqI= X-Gm-Gg: ASbGncuxVQaar/uqjb20HWDYtTQdK+ve3qBcvSyWODTuY1vci5rrR6YgVCStfoChUxl ziJe91wucceDwGfhRDCbpMbEhQU11fes3X7bGRd3yeIKVS2hH2bV5H7BcOKkWgPvsS7JarijoAv v2inh+YYk2pXNg2qhtCH4+HXlp9MtrS21F0WXOgpA0zWixdf4BN7cX9ttceNf5mTcu7vER5BdD5 GOhRXGDp08oi/Z6x9LArS5rQE75ITqcW6vCQYDQw4tKCnAK1q9xEWY= X-Received: by 2002:a05:600c:1f86:b0:436:51bb:7a43 with SMTP id 5b1f17b1804b1-436ee0f8af6mr184610285e9.5.1736855215052; Tue, 14 Jan 2025 03:46:55 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c16c4c12sm7808995e9.3.2025.01.14.03.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D07B65FA4B; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Julian Ganz , Richard Henderson , Paolo Bonzini Subject: [PATCH v2 22/37] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile Date: Tue, 14 Jan 2025 11:38:06 +0000 Message-Id: <20250114113821.768750-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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 While it would be technically correct to allow an IRQ to happen (as the offending instruction never really completed) it messes up instrumentation. We already take care to only use memory instrumentation on the block, we should also suppress IRQs. Message-Id: <20250109170619.2271193-23-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Reviewed-by: Julian Ganz Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Julian Ganz --- accel/tcg/translate-all.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 453eb20ec9..d56ca13cdd 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -633,9 +633,10 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) * Exit the loop and potentially generate a new TB executing the * just the I/O insns. We also limit instrumentation to memory * operations only (which execute after completion) so we don't - * double instrument the instruction. + * double instrument the instruction. Also don't let an IRQ sneak + * in before we execute it. */ - cpu->cflags_next_tb = curr_cflags(cpu) | CF_MEMI_ONLY | n; + cpu->cflags_next_tb = curr_cflags(cpu) | CF_MEMI_ONLY | CF_NOIRQ | n; if (qemu_loglevel_mask(CPU_LOG_EXEC)) { vaddr pc = cpu->cc->get_pc(cpu);