From patchwork Wed Jan 24 10:16:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765635 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036536wrx; Wed, 24 Jan 2024 02:18:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPS4NqTcJs/q7vadL1XQ+EllRI2b84LfoB8dBz8A3aTFYFm55jFSg4tnrsooqNB4hKNdQD X-Received: by 2002:a05:6808:2e91:b0:3bd:4b70:d73 with SMTP id gt17-20020a0568082e9100b003bd4b700d73mr1713477oib.65.1706091520378; Wed, 24 Jan 2024 02:18:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091520; cv=none; d=google.com; s=arc-20160816; b=sLTDrlrQFdqEzSHJb0yz/AKPKF0Wvo9JQ4Y439DurFF8zoMx4DTPjiR4626S6utQVi xWKC4G3Ze5JVcp1WlMHG6ngl4XdgXQHpqimH3F3fqWOGRRvfiMgJPlpeul7HLExZpyGq UdOo9OGL0OZwjc0c/3dcAiOxmzKjf8p9rB3iRz7GIuCVO3TzUJZf/EMMKI8XdRkvveFH 0xnRLsZ68gN44t2zgxU4g+DiqkTAabgRizI4VtMdgp7HhjODdoxY9yVt+QL1mxvf8Msh NTvTlPZs6uPWSpaWdE3eBsUQXZsRzH1r6oUrLzyfTjjcUKlh37ETcafW+kSKHx5mztNZ J14Q== 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=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; fh=yZPlqbZbDw4iG+IYYt39v7EQyQGjesk+yOnAkxYYWcQ=; b=LLU5qaUSnp1rp8eZX7VMvb2Tk9/pgnigWdhULdvw1GFREkN6P+yinIzy3FNRCeKXor kby6cAHLkzK2XDyMCWf8SM14DZMg26YwtBDtlnhoegd/Hy8hGDTRpfJvyCaoVnntXgB9 LZQmBYVpG29W0nnYg2UR9oynoH/rHNYX3N17/fXFCm7/swjzmTVPyCW/JWVnesmWmCs5 rZISV0253/gHfn7SN/yxPim6G9j5attphjQwJQLqqEusnNf6BfbC6TGhFS3BkdWruuY4 XXwDpqNKLseTY2dsvxb/ZmEDl1tNAnFIVcFUz/8kFf/TLvOdJ8KPL2hUlrhiKGMS6rIb XUFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vF5HjYUh; 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 l7-20020ae9f007000000b0078389ccf071si9514911qkg.77.2024.01.24.02.18.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:40 -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=vF5HjYUh; 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 1rSaKG-0003tu-7w; Wed, 24 Jan 2024 05:17:44 -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 1rSaK2-0003SI-Mq for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:36 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaK0-0003qp-FA for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:30 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50eac018059so7354495e87.0 for ; Wed, 24 Jan 2024 02:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091446; x=1706696246; 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=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=vF5HjYUhFRqo+nUDh6iMa6JuEAek56ZT22nnNj2rBAFQ1+t1IGfEPKhlASRNo7H6rM AZ5vT1QGztdH0bRjZE1sTMvW78ilTMW4EIiSUVGv9uwC7GKUuBkesWzubUVhUepLEDqG wEr8L5WHSDEMK0asNrTy2DVr7vrbsezzGOY+OXVA5zAORDMkxLMxDd6fZF8Voxq038Q3 YxLXEoaRR6TZ71GJxHl3SZjILYb4iJM548F8GA6kTllkCP+LvDINghkf5fsDTyEiqdM+ 0ocAvyq3ahnBF3DqLEGV69kzb7gVVSvVlCKgVNQaMePBlMY6M5lK/TXfxLTYvu9BQQY7 768w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091446; x=1706696246; 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=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=Nxlz4NIMA9jTsVsim1bysPvi6btjRNpS4IECCp+DRbfL+XnbDj2QsG+1b2hf6pVI/q x38Ptb15dVX6MmhHD6zgN+tovWYWdHd65DhmSPjn8ZwVrBf7sjY29PDw1uCkDrDHh75z XUGZHzt92GooIoVN/5hcfLBHBXgxJbhV4Pd0QXlzESzZe/cwE0+RqOcsOML4Xnax4gLH DbO+osYeTwbHSQTMdg6VLQBvb4iaP0VzEZvkMhcCtbgxnv/O0rRDzka62FM5xwNl78eW /kySI6XulJBiwyN0QSzQNbM7v46Jlbvw0EgJOGul/7HzSSs7mRIQCwzLpfLitH0GY+Bf mffQ== X-Gm-Message-State: AOJu0YyeNw4XW8Bnyfac9903EYynqNEZgY4vOQPRUSHlIUmiMjUiFaLH t4I7S8mc/VZ0VJwt42BpJ191rhTKGqwofM+rLjPt9y25MuICvdyg5BDTj0haozc= X-Received: by 2002:ac2:5b5e:0:b0:510:ab6:e418 with SMTP id i30-20020ac25b5e000000b005100ab6e418mr1156806lfp.33.1706091445750; Wed, 24 Jan 2024 02:17:25 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id t19-20020a1709067c1300b00a2cab4514a2sm14281787ejo.133.2024.01.24.02.17.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost Subject: [PATCH 7/9] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/ Date: Wed, 24 Jan 2024 11:16:37 +0100 Message-ID: <20240124101639.30056-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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 Move this x86-specific code out of the generic accel/tcg/. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 9 --------- target/i386/tcg/sysemu/seg_helper.c | 10 ++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 12 insertions(+), 9 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 4ab7d6c896..5a978a9e72 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -768,21 +768,12 @@ static inline bool cpu_handle_exception(CPUClass *cc, CPUState *cpu, int *ret) } #ifndef CONFIG_USER_ONLY -/* - * 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. - */ static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_request) { -#if defined(TARGET_I386) - return !(interrupt_request & CPU_INTERRUPT_POLL); -#else if (!cc->tcg_ops->need_replay_interrupt) { return true; } return cc->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 e1405b7be9..255d56d4c3 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -123,6 +123,7 @@ static const struct 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 */ };