From patchwork Sun Jan 28 04:42:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 767220 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp348064wro; Sat, 27 Jan 2024 20:45:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkAb0wGCGx0hqh0UnTudZVBJUnE6c0EbNlnwh/0JuijofqkjkqTXrTTS/sGNVCHh63e/wc X-Received: by 2002:ad4:4eaf:0:b0:68c:3df8:735e with SMTP id ed15-20020ad44eaf000000b0068c3df8735emr3119078qvb.63.1706417126045; Sat, 27 Jan 2024 20:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706417126; cv=none; d=google.com; s=arc-20160816; b=BZ023so5DZdV7FY20f//vqkNZcRTy/8cocxFAqx3EGS3GhKfPkxr8fHi5KmLMpT/tN BZuGQyQCEbxbgNdseOzONf2m4kDgwt1pab8tXI+tlPSuKdqTFHbxsi/TGIon2dVZuDIv kpTQVuvGN0hjQMixBgxj2wXd8f9lpJBiRJPj15Sc0PBFKELo8dc5WA3nHg+BdGgsQaJh HDRlKPuQ8BH9Djpr9yQpTGiwM3pGLPSsmbuk15xHmqQ6m5daYWk12a9VgfW5FIvh00h/ TGrdwfgHp6tUuyUANkUkHc26l86isAhkeTTvHqMG4T0HXyyT+zjHuR/QUeMlYNM5eQcK Rl2A== 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=4tMFQE97q4aUbL8LMPU5R9Llk18uVwdymUNm4iTykmc=; fh=HPaGXKsmKghdmujZ6SN7T9DPluDP/5SUmo+zFc4N+Vk=; b=WsymPMnvyeFGPEXpXJFrqkkYSAoL+S2G2/2U4aKieFbpMqZW3LnppgkzjrRWAvZP/9 eicqD1RSk5ZJz9Mvvk5i+BtxBvVXI3Tc8rML5dG46IRmyX2TuJMpq0+ddkSkzWT9dC3w t6Q4TZNLABIU2fP7NAIPKSVfdzcyvmIE6ykK5/LyDKRdLMeReX2VFc2X0sP4M0chMi8g cfzytWUeb/IYGoGwplYgZ80TG9XkQNJyOMSDPsHPYA+fiveoG0u959lmZ2z6uuzaf9tA HODknb+PpGbe51xDZ9i0zCdhD/MC3AXWU5ic0N4WrsorSpmhbH0niXY9omdCxO5tvnX8 sYtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WsWMU4Ae; 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 v22-20020a05622a189600b0042a9ca01f30si466620qtc.252.2024.01.27.20.45.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Jan 2024 20:45:26 -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=WsWMU4Ae; 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 1rTx1E-0005tZ-UX; Sat, 27 Jan 2024 23:43:46 -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 1rTx17-0005fp-Ht for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:43:38 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTx15-0004Pq-8P for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:43:36 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5c6bd3100fcso743896a12.3 for ; Sat, 27 Jan 2024 20:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706417014; x=1707021814; 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=4tMFQE97q4aUbL8LMPU5R9Llk18uVwdymUNm4iTykmc=; b=WsWMU4AeaEeZF7zzGIVLcoj/nff1RQBfB53zM4UgAwgG6MHL+i0kkKxAvErUM6q9tO oOVTg6tXIudUJN6fp15d7hIVvxSYYFTs1IfNbg2baXin8ugQsPln8rRDdqJpDDtHoE9P 39W6u8KR+4F30+fUrni9HDEks47vAtVuLPstZFgV1eMlgSjWPfkGNsQZoDgPJ4JBW1+u JW0KWDL/XH5PTk8voiIGJJe5fPLT/c8NA1VsgElO+Vp45hkKMdjgeWNKJzbaaqu1eEPi byAzCgANmQ60TjEUPtFAahkscRrIPJM3+W8bypy97sXQWhcM92Lvr9Tg67dKCU1L51bY Su9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706417014; x=1707021814; 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=4tMFQE97q4aUbL8LMPU5R9Llk18uVwdymUNm4iTykmc=; b=ceTD9EucLUlCYLJaKo2TQu1DvJaPiAeCwH8T8wnbBSUJlWdzjT4uSSCkckjnmerEeN dc4pK/jdXXrB4UCmaHpBVqxhHcXtZAgnry0d5BzlY1T1qMD0Ofm7fWZ36pdIpILyPWaX vy/qbrc8Ku/K4PHsJtXoS7cqiqqAiJ8Zn+KPRf2iugh5adllAnzV2QIQSys4Fj3Viyxd 6MZjs4EgJkCjrcw0FLL+BrvEKFzn0SxMpQydDRHCm327t+M0ZfZ22/5CkLEK+MD5y9zL IIYp6tZP6+C2kXakqHeBtVFFI55ORfoXRmi4D0KDEBfKy/PdKUqmiHWSBGRT8bNKHNqm MJJg== X-Gm-Message-State: AOJu0Yxe6CMvvqGGuuRwkmFUgG6qKMp2NClG37fQCxf/Xs4rsCztuJBK H7UbfZhsDBFL81f/okf4KpKwo/QLGfwYvo4agjdfXDzFa0fVqlGYGMm6+PGGf81yQPmP05erzzJ I7B08lg== X-Received: by 2002:a17:90a:4593:b0:295:2a35:13b8 with SMTP id v19-20020a17090a459300b002952a3513b8mr464876pjg.0.1706417013764; Sat, 27 Jan 2024 20:43:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 20:43:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Anton Johansson , Pavel Dovgalyuk Subject: [PATCH 30/33] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/ Date: Sun, 28 Jan 2024 14:42:10 +1000 Message-Id: <20240128044213.316480-31-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 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Move this x86-specific code out of the generic accel/tcg/. Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240124101639.30056-8-philmd@linaro.org> Signed-off-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 4 ---- target/i386/tcg/sysemu/seg_helper.c | 10 ++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index ce34b737bb..253b1f561e 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 34d10eb173..2eacd694ea 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -773,13 +773,9 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) */ static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_request) { -#if defined(TARGET_I386) - return !(interrupt_request & CPU_INTERRUPT_POLL); -#else const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; return !tcg_ops->need_replay_interrupt || tcg_ops->need_replay_interrupt(interrupt_request); -#endif } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/seg_helper.c index 1cb5a0db45..e6f42282bb 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -127,6 +127,16 @@ void x86_cpu_do_interrupt(CPUState *cs) } } +bool x86_need_replay_interrupt(int interrupt_request) +{ + /* + * CPU_INTERRUPT_POLL is a virtual event which gets converted into a + * "real" interrupt event later. It does not need to be recorded for + * replay purposes. + */ + return !(interrupt_request & CPU_INTERRUPT_POLL); +} + bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { X86CPU *cpu = X86_CPU(cs); diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 8e148e9bc4..5bdcf45199 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -123,6 +123,7 @@ static const TCGCPUOps x86_tcg_ops = { .do_unaligned_access = x86_cpu_do_unaligned_access, .debug_excp_handler = breakpoint_handler, .debug_check_breakpoint = x86_debug_check_breakpoint, + .need_replay_interrupt = x86_need_replay_interrupt, #endif /* !CONFIG_USER_ONLY */ };