From patchwork Thu Jan 16 16:02:51 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: 857909 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp280679wrb; Thu, 16 Jan 2025 08:12:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWBigINdECcXYDEmniyM2+DIy7g6asYkF8AuTVnA9UzV3efSPxVK4N25X/9ded9i370MxVL7g==@linaro.org X-Google-Smtp-Source: AGHT+IGPVlUnB3gm/fFkrcM28e4cBSOJE97qDgo3mXsVnoNTxodaIwdchZbjHDBkcIHy/mtrRiSQ X-Received: by 2002:a05:620a:8215:b0:7bd:bafc:32b0 with SMTP id af79cd13be357-7bdbafc364bmr2556754085a.47.1737043941907; Thu, 16 Jan 2025 08:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737043941; cv=none; d=google.com; s=arc-20240605; b=FQ5BwOhfxUCoU2Z2rza8gyuNe9xVdDgGHjucj4PpUyjAnhC7n6F4z10BO0mNaAyi4N L9kHDSMEnk1feQ9YdKX/YXZk4wbdEe3C6soPz+xWUJ5kE2W5XJHg4GRRLHYMWn2zny53 LPZRMFlZlsJvvyKnaslSrfA+dALan/sNL3XBC18rFxOioJOu/293fScB8UUlq+o5TVe5 /CMEYW90J281mUFh6E5BHuaa5cEdPjP1lqRzIjCEKelz7YoatBgbC3XpKXA+el4P/Ft/ 9vHZN2g2xYyy/eOVqB1RuZewyca4OwDnzB34wKP1kU37mSC9l9tk9ngCUlUCmqM74wtF AcAQ== 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=Zfjt0bva8uZbgMJcH/Ob/DsvSQK7NPA0HN/eaTtupr4=; b=KKOAIBrAtLJl4/FUcCTi9lAxkjF1sFTnG2uRCXiOeu7oSCbe0pK+bK1UO4cMVz4kel UMlhZNs9oXMX0NhOkuIVNx1W6p4At+Uo61UB0lHG/JEHXtLP1JRC6sBqxkpbyp6x7K3g FoIKq2bq5EVTagk3ywu3KbwTK5ECND49rnz9cWHrrSZ8Zl/1X0rM/1riOaN824I/JqSC Bn+xEZZuf0g4I05+8vokCVqhwZucRUs8Mb55yAcCnWKEJmbeEm54iao1kl74jfER4FmS ptZ1TOtKVtcHOdFxQXrcHx7qs/rs40Q7gVJESIr1KQA8PokDiqxppDNNa8HP4kixAay+ iuag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iiuoRKLj; 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 af79cd13be357-7be614cbf1asi39548285a.441.2025.01.16.08.12.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Jan 2025 08:12:21 -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=iiuoRKLj; 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 1tYSTh-0003PL-UP; Thu, 16 Jan 2025 11:12:18 -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 1tYSTd-00039R-PV for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:12:14 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYSTb-0004RC-OV for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:12:13 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436281c8a38so7429425e9.3 for ; Thu, 16 Jan 2025 08:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737043929; x=1737648729; 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=iiuoRKLjGRlVmkwluMh+Asqh6FoeT+QL4DXxM+4o1etriMpjfzBECAMoj6EDQIrc5N W8viv+cJNTDsi1p5uvGHAg0ityNpCPCW9ZTbhZeFbfKsM06kefgb3gTmnQ60zlbNi6te /sWa1m8+wehnX3X4zJuwRT9MMBZbYzEwqiPxIKiEvaY6AKpGM0z2F63UnqIYJW41y2It ZZyRhW8hcuKzaO57wMs9coMyLwCDur4QrAiX1AcgeAkacNvywNZUl+aAmGhXNMCq9R5R rOHCsKnoWik+ffveQR/LpJ9E4whSaBy6QyfJDtpZhJKz8sxuPBNy4cuRFo3Ed88gylpm utKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737043929; x=1737648729; 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=Vf5NloSW5QaTO/PDH3wa0ATxXspXnddSXo3ZMVvAl87G58AOgwu5ieuIZhBqD9qzQ5 RaLGdOJ6K6KqYAfyIJ3Vd0CK0bdcc0j8uEgJF7JRYVAMCI3g3bfnZUitrAE1SF9dKcIw EdvmHaFoZmzSEU3VGT8soGWqLdDpSKqKHTL36tNpwddmTEz+XeBtnfe64iLrJ8HYxVnp MYj3GPcAooDz6k9flAb6othKgoCIv+ReYGIrAkLir8T83OlRStlSIBMAwXG/tpN850Jz ARe8lIWWdkm7nrPWofM+81ECnL6E+SQgm3j/tOP0mKzZM39I8EPcjPysH+39PMnylkUH ntjg== X-Gm-Message-State: AOJu0YzcOyExrxfd2h+NiMcgo+QLPIlyw9Dcde3xX1/WrD5E2YJ9HwDA XlmrR9xCqDzRvyUbCHnXUg/nVTvlndLuud3BC26RWPMTMVQ+F3pX4zg0MDo35oE= X-Gm-Gg: ASbGnctNS71yAiYHypdFD92iUZtK/wC+CxGa50OmIiiYsTMmYDs4+LL0PyugvRiEHJ8 3XBvaOW8KWGjeswaL5gEmFYAHQ4VwU76WshHKywAuSmH5Kkqt2cLRqXpwKRAoLLCTKOhgp+KDCA lNQv1kIhh1LUPJ2WQ4pZ2eJJwKdqIQjlPOG2kFkfYhN/RyNMP1nkKoXneELnE6SsnNtDaNV0+yv vCzBHBudZfa+tiwv/21GQJaABSqI+JcALx4nmPj75OHpLNGI6PO4qs= X-Received: by 2002:a5d:59af:0:b0:385:f677:859b with SMTP id ffacd0b85a97d-38a872f7fbdmr34031511f8f.10.1737043929538; Thu, 16 Jan 2025 08:12:09 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf322ad74sm242024f8f.56.2025.01.16.08.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 08:12:09 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 99552608C3; Thu, 16 Jan 2025 16:03:08 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Yuri Benditovich , Jason Wang , Cleber Rosa , "Dr. David Alan Gilbert" , Peter Xu , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Stefano Garzarella , qemu-arm@nongnu.org, Michael Roth , Laurent Vivier , Mahmoud Mandour , Andrew Melnychenko , Konstantin Kostiuk , Kyle Evans , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , John Snow , David Hildenbrand , Fabiano Rosas , Alexandre Iooss , Eric Blake , =?utf-8?q?Alex_Benn=C3=A9e?= , Vladimir Sementsov-Ogievskiy , Pierrick Bouvier , Kevin Wolf , Peter Maydell , Laurent Vivier , "Michael S. Tsirkin" , Thomas Huth , Warner Losh , =?utf-8?q?Dan?= =?utf-8?q?iel_P=2E_Berrang=C3=A9?= , Julian Ganz Subject: [PATCH v3 22/37] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile Date: Thu, 16 Jan 2025 16:02:51 +0000 Message-Id: <20250116160306.1709518-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250116160306.1709518-1-alex.bennee@linaro.org> References: <20250116160306.1709518-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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=unavailable 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);