From nobody Tue Nov 26 16:25:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706417100; cv=none; d=zohomail.com; s=zohoarc; b=S+Eq8I2CjhIjXsCxlnOtHC+Gh5fmQehnHLtiMbHtTaiwJz4fQagxjg+ae593LzV2qHpQyWzuf8gQg2ksHwOYiBpboZtbPcgqctEIsa5Tb1TUYkiu9aDNWomxa+89wcHy9H+wOLt+D1ZQH51zV0LZZ8hI//Iy2zuaMVOZftPrdL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706417100; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Qg3ZIcWG7UYKvaB8+csAeQhagpxbl+IqGiAj8oTWzCY=; b=B9JwdQZU3q8nDrsEXswOg4D68BUFFH1in5Ro5DFGVyuWCBiFeL1HekI7Dc8IiMeAFrJKznbjndsgAG17mMt6wivFl0xaAxnUizgj0RePeQ0nGIXUPnruDVP4Om5yMM73IYKRS+NuCnhNN0koSJnyWnAAwYSZCoKiW8HoBMr4SGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706417100288583.7846809662506; Sat, 27 Jan 2024 20:45:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTx1G-0005uP-Tm; Sat, 27 Jan 2024 23:43:48 -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 1rTx15-0005SV-BT for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:43:35 -0500 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTx12-0004PZ-TC for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:43:34 -0500 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-595d24ad466so1276761eaf.0 for ; Sat, 27 Jan 2024 20:43:31 -0800 (PST) Received: from stoup.. (ppp121-45-131-89.bri-pow-que-bras31.tpg.internode.on.net. [121.45.131.89]) by smtp.gmail.com with ESMTPSA id w24-20020a17090aaf9800b002906e09e1d1sm5631873pjq.18.2024.01.27.20.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 20:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706417011; x=1707021811; 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=Qg3ZIcWG7UYKvaB8+csAeQhagpxbl+IqGiAj8oTWzCY=; b=StlyHfKMb0LHjd4ZewQe1QsID+2+iuXKlqSeFEdQnS3VgA5Xcnmo0Ol84wvZJQieVU /rjYBqmO2LtTNGaB/g/F3VO5RM86BKl0gIcYVe7hLZhHloybqLyZs6rRpFHvSjZWQ2rN ShfuE1rhSIYGyQGGE8TM8Aje67I70nuoT7/E7/OfqTOuhs94AjtpDf11znZe4kfXLYo1 8B0ew09pDzfc9JdRoCDqoVCw73QrJrfm3MhPDK0zyWqVrfLN0rKi6Y0IJ44dcu8Yto1f ZpYG+39osUPCb7pZvFEsZj0ADmYO1pm715JzB26hz7MQHeR9MemaSwWswy4shTUJq4ap sGYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706417011; x=1707021811; 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=Qg3ZIcWG7UYKvaB8+csAeQhagpxbl+IqGiAj8oTWzCY=; b=D5hRY4HSmg0jE2+JchcC4v9A44TK2eBz7EM2j6SKlnN//967Ac9L0o+z6P0+ciGq0A 522fc5BCcKZeYVGd9ckMMyFKT/uqslNRebTF4ejcBIpHBPYt01IUEN9a6QfaH4gENjYF kjfvTRQgfehkpEeBA3HIaJuLrfjYHErOUtgeaBN/+JMpcciFAlCDVj29Zcau0YmHAO5B 6mLStscW25SKE0yyP5Yr7X3HyJay8TeOFp76n/5oA+QqtY64GhwgSPKCr/eXqhNP49qC ttHhn5zY4f9OC5/Gvm2ruTg3i5v0xnY4lCd5E1ct/kwLGFGn8ryVy/U1Wjt86ZTvibrO qSpg== X-Gm-Message-State: AOJu0YxmVj/+r/yAUD2/C/8XKIOZRpkhKA80bUOutDs/074YelYSf5Wx IbbrYkE3cqtkpa1khRznZXwct/Zl2EiAl6+85bKWUtNQSh4xtfPmMhul0UPX9Kz4y82pMRrKuzG cXr04BA== X-Google-Smtp-Source: AGHT+IHytXqW2/yfFlmP56TDc9ZuGQJGqJl06KeRkEMjv+HymexrcpKzJRPs4wOUYj6o2YToe3TozA== X-Received: by 2002:a05:6358:2910:b0:176:abf:3777 with SMTP id y16-20020a056358291000b001760abf3777mr3576077rwb.28.1706417010678; Sat, 27 Jan 2024 20:43:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anton Johansson , Pavel Dovgalyuk Subject: [PATCH 29/33] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler Date: Sun, 28 Jan 2024 14:42:09 +1000 Message-Id: <20240128044213.316480-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240128044213.316480-1-richard.henderson@linaro.org> References: <20240128044213.316480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc29.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706417101130100001 From: Philippe Mathieu-Daud=C3=A9 In order to make accel/tcg/ target agnostic, introduce the need_replay_interrupt() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Reviewed-by: Pavel Dovgalyuk Message-Id: <20240124101639.30056-7-philmd@linaro.org> Signed-off-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 5 +++++ accel/tcg/cpu-exec.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 3ed279836f..013867b890 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -166,6 +166,11 @@ struct TCGCPUOps { */ bool (*io_recompile_replay_branch)(CPUState *cpu, const TranslationBlock *tb); + /** + * @need_replay_interrupt: Return %true if @interrupt_request + * needs to be recorded for replay purposes. + */ + bool (*need_replay_interrupt)(int interrupt_request); #endif /* !CONFIG_USER_ONLY */ #endif /* NEED_CPU_H */ =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 3aebf46849..34d10eb173 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -771,12 +771,14 @@ static inline bool cpu_handle_exception(CPUState *cpu= , int *ret) * "real" interrupt event later. It does not need to be recorded for * replay purposes. */ -static inline bool need_replay_interrupt(int interrupt_request) +static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_requ= est) { #if defined(TARGET_I386) return !(interrupt_request & CPU_INTERRUPT_POLL); #else - return true; + const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; + return !tcg_ops->need_replay_interrupt + || tcg_ops->need_replay_interrupt(interrupt_request); #endif } #endif /* !CONFIG_USER_ONLY */ @@ -864,7 +866,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, =20 if (tcg_ops->cpu_exec_interrupt && tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { - if (need_replay_interrupt(interrupt_request)) { + if (need_replay_interrupt(cpu, interrupt_request)) { replay_interrupt(); } /* --=20 2.34.1