From patchwork Thu Jan 9 17:06:19 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: 855981 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335423wra; Thu, 9 Jan 2025 09:09:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1BTeUfsK1oHMrOiJfXUui315FZPkd3rZDdim5/e4Yo1CmdeCdZ/RcMsD8VoFVrj/V0q1ayA==@linaro.org X-Google-Smtp-Source: AGHT+IGNCEg6nVZt5jpcVJS4tl+utOGwxB9mvYsTm6ZqCJrPtCzrqOgymO6Xgk1y0T5tKhLvW4xF X-Received: by 2002:ad4:5c68:0:b0:6dd:4c5f:b3d1 with SMTP id 6a1803df08f44-6df9b1f6e3amr99995026d6.3.1736442560679; Thu, 09 Jan 2025 09:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442560; cv=none; d=google.com; s=arc-20240605; b=RuqxL+uEmS1l8MilFZqcnWloObp/6g5eraotXWUpgg9cb6llxa3Ov5BfCjE5u6Aa2O dDvaVw2LV5odyUodu8mURyxQ+Mkjyr4sGvGGhpG4CQjTEoT+uAFfyErOaBECDZc/vM01 SrbokkCWVXLFK/69GH/SW/Dz6zWVXxJWDKpMDlEKk0pU+Oc+XLKFeM8D8XFaJMQZcFcD H56Zs6v+DdLc4AMKt244G7LPKbmxeTZQa4c36lBIXzWnYFbbj/Fo9nK+jOFVBJI0ASoK 76GILweHvuawV06IposXvJE6GukdrPlkB/pW6viE1XEeGRSjMSIC4FOFnyc9X4ZtDkv9 zCJw== 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=jXTY3v0Mhju7JfKzKJdD6zSDlC5CNwIYMzPHdmiHijQ=; fh=onwucmYDX4VceK/ziU87Fr6Xxl9vysp3UUXfHgDJfKs=; b=KZgrcQMxm4i+wmXx875cVNVk3DQqIToq5O5BsEn09xrLpK5LOkqDu7Xb0a1iDqajRu Suao0nLMJ/4LFQNjif3oVDdz0SEif7uZJKLn11/vocrqUCLXJq3jB0thoE7q+05Ybb4G L5FB0b+q1ZYi8cQu1VXbg/YkSpPVvy0RhKdqjbSyJkJ3aJBrL/guLaxY06+Cc25WjnRJ rt2CWFwkVQTZ/BEYimX0PU4g/y4/5yPqxDkNqvFteUn4XoMzesp4D4QD7A2m83gkOItC SqAnaFPyZ/8AUVBh2bvP82qCXBwCiQHPxYe86+bT/5OBmBgt0Lmzy2LCYbLk3Bm9whvz n9ig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YIZlH3Jk; 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 6a1803df08f44-6dfae015ff1si171016d6.453.2025.01.09.09.09.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:09:20 -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=YIZlH3Jk; 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 1tVvzj-0004no-31; Thu, 09 Jan 2025 12:06:55 -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 1tVvzd-0004kk-MR for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:50 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzc-00071s-3W for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:49 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d122cf8dd1so1733411a12.2 for ; Thu, 09 Jan 2025 09:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442407; x=1737047207; 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=jXTY3v0Mhju7JfKzKJdD6zSDlC5CNwIYMzPHdmiHijQ=; b=YIZlH3JkcQBP1MHBIF0VovJFD6kmK2LSJ9wHwh3HoNyKYdQwVKUZA9+cWlsvS/PTOK lZ+IixtcvwNj4umhOsWM38Vsb5MkklTFkqGCy4uzfBgQYPNMJfKIyMdN5CGg7/qfhBg5 zpQCspUGUIaej6uhO/Oi3JBonpqblV8PVZFjZnpCJ1eCYPmyvfWLm7JgpW2CBc7ckKgq zF7tAjgE/bjritQfMHP7vuw1zrocB4Wy6M4Ekf+nc9bjQ4zlp5AkYCDMJ7O+qUUnuCL7 sN0DfwlAlvgWHXHR6bJBCssDtciSruXrQQNjdPMT3LEWvAaIhSkjPowD+g21WZ94WE/7 Z3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442407; x=1737047207; 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=jXTY3v0Mhju7JfKzKJdD6zSDlC5CNwIYMzPHdmiHijQ=; b=Uo1Ju3dAX5aaLYqg9Uy0G/69KKY93y6LjhA338xQfvZSEb4RGjWi+/OZ5lWvePdhBV GO5hQvC/TEdGjso6ticrIr5jwsxf3jtfyz3kmnRSwyfLeaNbcoep+ujD1Eh7OpQ+fNXn Klv2plsn0yO4i162lGqzVR41xyX1fMpL4t2KLABXqp3UkzEyo6ooIMitOB4/pFNujJ// f7BatzTmaKHnwQaGWgH6IJt26QxXvLPV/MRu0xujsW8Cky/P3fOGbQPJgGKTfRCqL5oH hoTLgEW7rw6tfJJ3SoFy4JL01aIio/s17euPfVm/B2lPPkYD++QE5/0Cs46K6kO+bBn8 9R+g== X-Gm-Message-State: AOJu0YwgXZ8a+iclfBO9RQwOTvKIPzF6Hi4eM/7sGFIPqHBQpj6LABhh rEUzYiLwdMIlDxJT771fTWx+8neZwla25sW/TILaGnkPrjdM2hQVfuxZDuIKcBI= X-Gm-Gg: ASbGncse2QaTLafFsDokLHriVnXKyU5BKHfDch28edgyfSW7yl+boXvaJ3fsYLhjh/D xsLbZLBVpmPvZqlElnBP7rBis4m6w67Q1FohPzuZsMHqINON2lEc4FKAr2BFkqy92wyklBgwdPo APtpDc15P8bXH5BWNgJzqTO4f6RMC2/9RdqrUdqFxTkNWqq8NJxp1VFFG5kqy6CfuSXAcI2NSh9 Utdf3s8ztYj1Xz6TyXzDTXLwyf4d08zZIJzrnrcMXvJj8DatuPMWvc= X-Received: by 2002:a05:6402:270d:b0:5d2:728f:d5f8 with SMTP id 4fb4d7f45d1cf-5d972e4dcddmr6326742a12.27.1736442406671; Thu, 09 Jan 2025 09:06:46 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99046a17fsm782811a12.62.2025.01.09.09.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:40 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D898C61546; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= , Julian Ganz Subject: [PATCH 22/22] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile Date: Thu, 9 Jan 2025 17:06:19 +0000 Message-Id: <20250109170619.2271193-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.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. Signed-off-by: Alex Bennée Cc: Richard Henderson Cc: Julian Ganz Reviewed-by: Pierrick Bouvier --- 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);