From nobody Sat Nov 15 15:29:48 2025 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=1751381276; cv=none; d=zohomail.com; s=zohoarc; b=mgPBtiA+U+IFXQfK+iXJ0gsJb+PrWN/K1mcyTwgekRKxHtf+vO6hUJZCbMwHX+X/IOBWHM7Odp9MGpD2R2rL45jMvWaSMcKfY83rVlORGfT9J4yyniF1h+kImyifc9yW+jntaSsPcHOAp2lQMxBqN5YZg7S7oFeq9CybabiCojY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751381276; 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=MRl+/jVdTWn/SE6FcpjjRNWIdDFt+7efEy/k/a0kODs=; b=TLYU9Ir1gqh9+crsp4N5VLw/Mgtki3lU07bbOi82BJd6deMwzfqOqN1Sj8EJzCpbsLK7KZRf9sq970Jwj6zve4uSO3lNfyb6ZEX/jxiQyiMpvdDQOPdo0OQ7hvqxctjp1JUMrcbSdfBkJfJmAGQXM6g9H2DimukzpOh9hVTrdwk= 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 1751381276585915.9725160296538; Tue, 1 Jul 2025 07:47:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uWcDB-0002lW-TH; Tue, 01 Jul 2025 10:43:54 -0400 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 1uWcCu-0002PJ-0t for qemu-devel@nongnu.org; Tue, 01 Jul 2025 10:43:36 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uWcCo-000754-F7 for qemu-devel@nongnu.org; Tue, 01 Jul 2025 10:43:35 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4531e146a24so34769875e9.0 for ; Tue, 01 Jul 2025 07:43:30 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-453941c67c2sm124253035e9.5.2025.07.01.07.43.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 01 Jul 2025 07:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751381006; x=1751985806; 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=MRl+/jVdTWn/SE6FcpjjRNWIdDFt+7efEy/k/a0kODs=; b=waVpAmTKk95pCsl8Yf+z+YXm7fPNxG0ChGHwwfJWUOH/WJrm0s3KFO5u95gAM7qgzv plEbgS8iLu/svQgYgBtDnHMNB5DhiEaXQC3CyZQ+JO39Q3WMHl1AlXtq88nU5ZxTaQUt Zq2EzcqVw57YB9Uh26V+V1RDBSpQcutiNau61ASk9r20jkvL8Ra0OAk77n183bBpSvh+ 9Cg3ABE4FWGiK3x0RJQVW0sJk+GkW5Fc7kErKjhHL6pwhwLgU1zVKqOfEk9CL++z0Mii gpk52wnco4BN4BcOST3iVrj2mRun6TZb18JHbcbUGe1hCt6e0CNLf8JBpOZg3HOxzkMU 7MGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751381006; x=1751985806; 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=MRl+/jVdTWn/SE6FcpjjRNWIdDFt+7efEy/k/a0kODs=; b=QQKqQkwlLSEyMHuC9WaPPwhyB7YwnjucGuHMROHcGxVFFLbGgKkCArCS9WQ5X39iay tBrMYw6Z/VFHiahaj6kvl2xilRGbpKjMrBbK3kk5VWYtWTuld4lB49IVkeGLbBShxXuA FTeQDTw7s03a0VCtmwP4E5dBZyROIsaPPy2JZsevk/CAgOhyAaMBqEBaK+mXYw58R3ox /umcf1x2U3+stZ0257CtdWjy/0WeHm5H+Ld6/BQtYRk6BApxNLLUK+JmzAAvcJAT+Er0 2JvAKb97GeVUIJh/pa9VBGBtrI9h1/7AS8gFDG6KT6BoXz/cliwwZTNE17OFvoIKhutl J3aA== X-Gm-Message-State: AOJu0YyUXnsubcK1iYbkgyjhXym0DheOV8oU5mXJQSMF3MPCOFLMpyk1 XM15sIqUhzRVbrdnFahmpOO/ews+qsTjWhhb7S6wBdCDd2HI2j2TrChvKRFnG/J5CWbtNhqIYy5 KIJ1a X-Gm-Gg: ASbGncsDGF1E37T2edAk5rHkf4H6PgkvhmaN0YBm1dO6BbkXLzyxunsgQbYGRGf8QRe 6bPvswooVJgxHXlzFC45G99pspJ0L0UnFNYOo8yRjAPLJ12LQ6CLRNuZ8qSNnqTbfYUyrxAo1WU BvP02m65eCE5H2Ihl7Kz0405fjRQWl4nUnX4c7XeH5KIUVBVHw5Ow9rBUEdKqedn6FLD5QO1VX2 uGSY+XfxX41ViDraAe03gZ33gYLub8i2l8iSIUo6JSon03IQ9qybGbRWwOy0MyyhG/XyRMfFAHc IaC/fIT+pSJbuMTKh3Q/NtAmxLS8yd56cJkZ1Z9sbMb7MqiYn05owQVt301Bzu4D0ZMTbX+qMBU VB2MPMR1ousOK86o0vLeMqUliDjSNoFk/++cc X-Google-Smtp-Source: AGHT+IFxWp6nbGft+2Udb6trDd3chSg8KN721L6q7FT0sfnWydH1/CQo33anu/jWB4LOlYZ8Ipbeug== X-Received: by 2002:a05:600c:4e09:b0:450:c210:a01b with SMTP id 5b1f17b1804b1-4538eeb8e0amr207871345e9.17.1751381006363; Tue, 01 Jul 2025 07:43:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , Julian Armistead , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 35/68] accel/whpx: Replace @dirty field by generic CPUState::vcpu_dirty field Date: Tue, 1 Jul 2025 16:39:43 +0200 Message-ID: <20250701144017.43487-36-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250701144017.43487-1-philmd@linaro.org> References: <20250701144017.43487-1-philmd@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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1751381277528116600 No need for accel-specific @dirty field when we have a generic one in CPUState. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/whpx/whpx-all.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 821167a2a77..f812aa36c46 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -237,7 +237,6 @@ struct AccelCPUState { uint64_t tpr; uint64_t apic_base; bool interruption_pending; - bool dirty; =20 /* Must be the last field as it may have a tail */ WHV_RUN_VP_EXIT_CONTEXT exit_ctx; @@ -836,7 +835,7 @@ static HRESULT CALLBACK whpx_emu_setreg_callback( * The emulator just successfully wrote the register state. We clear t= he * dirty state so we avoid the double write on resume of the VP. */ - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; =20 return hr; } @@ -1391,7 +1390,7 @@ static int whpx_last_vcpu_stopping(CPUState *cpu) /* Returns the address of the next instruction that is about to be execute= d. */ static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exit_context_valid) { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { /* The CPU registers have been modified by other parts of QEMU. */ return cpu_env(cpu)->eip; } else if (exit_context_valid) { @@ -1704,9 +1703,9 @@ static int whpx_vcpu_run(CPUState *cpu) } =20 do { - if (cpu->accel->dirty) { + if (cpu->vcpu_dirty) { whpx_set_registers(cpu, WHPX_SET_RUNTIME_STATE); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 if (exclusive_step_mode =3D=3D WHPX_STEP_NONE) { @@ -2054,9 +2053,9 @@ static int whpx_vcpu_run(CPUState *cpu) =20 static void do_whpx_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data a= rg) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { whpx_get_registers(cpu); - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } } =20 @@ -2064,20 +2063,20 @@ static void do_whpx_cpu_synchronize_post_reset(CPUS= tate *cpu, run_on_cpu_data arg) { whpx_set_registers(cpu, WHPX_SET_RESET_STATE); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 static void do_whpx_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg) { whpx_set_registers(cpu, WHPX_SET_FULL_STATE); - cpu->accel->dirty =3D false; + cpu->vcpu_dirty =3D false; } =20 static void do_whpx_cpu_synchronize_pre_loadvm(CPUState *cpu, run_on_cpu_data arg) { - cpu->accel->dirty =3D true; + cpu->vcpu_dirty =3D true; } =20 /* @@ -2086,7 +2085,7 @@ static void do_whpx_cpu_synchronize_pre_loadvm(CPUSta= te *cpu, =20 void whpx_cpu_synchronize_state(CPUState *cpu) { - if (!cpu->accel->dirty) { + if (!cpu->vcpu_dirty) { run_on_cpu(cpu, do_whpx_cpu_synchronize_state, RUN_ON_CPU_NULL); } } @@ -2226,7 +2225,7 @@ int whpx_init_vcpu(CPUState *cpu) } =20 vcpu->interruptable =3D true; - vcpu->dirty =3D true; + vcpu->vcpu_dirty =3D true; cpu->accel =3D vcpu; max_vcpu_index =3D max(max_vcpu_index, cpu->cpu_index); qemu_add_vm_change_state_handler(whpx_cpu_update_state, env); --=20 2.49.0