From nobody Mon Feb 9 02:55:35 2026 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=1768562403; cv=none; d=zohomail.com; s=zohoarc; b=KhwgWEv3oH3idkAcZ8v5VVfcCCJslv3IKq3w+60dLCvWRXQ275CT26rLvC73ggAxd3fI8+roQxxxGRlA0NV5+vYwg6HQiTiUPiLT1muUf+5j/BZqHqzuWkheOg1O+BrIOkegxxtxRhmI6dRpbsV94qWw5eirK5Snhxw8v7J/GaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768562403; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=WfSQMk2tCldH+NAueyqDiyPdeTJe21wGRoHBYtyMmPw=; b=dRfgYPBYN/N7AOZxcsULyse9EMw5qgTjCyMYCnl0mEAMPksKXPD26qTCbtxlX3MC/Goe6Xi6iW6RTGRWbDCo7nONdaxGHPaBsSRN2ArgFD2JLF8CY0+k7Vy4v+Z6RuBiEUtX0kw/VHYYQJfa4U+VT+Hi2/I5b8vseS5Vv0uwxDA= 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 176856240314012.475405593107439; Fri, 16 Jan 2026 03:20:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vghrq-0001Yk-2b; Fri, 16 Jan 2026 06:19:50 -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 1vghrl-0001S6-TW for qemu-devel@nongnu.org; Fri, 16 Jan 2026 06:19:45 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vghrk-0006Oh-BF for qemu-devel@nongnu.org; Fri, 16 Jan 2026 06:19:45 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4801c2fae63so9710585e9.2 for ; Fri, 16 Jan 2026 03:19:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356997e79asm4687171f8f.33.2026.01.16.03.19.41 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Jan 2026 03:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768562382; x=1769167182; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WfSQMk2tCldH+NAueyqDiyPdeTJe21wGRoHBYtyMmPw=; b=PLvqKtKisdvEl8LX4DO3ERyIIvNBiMQFXHVzBgFaLzrmcgZO+82r+9WDCgoY3PYPEn weudgWhW1xyUe81NH2yyhhc+bQ2OOQS/oIZypeHeiiVCzdvdeNGXS9o753aFGYTIcfck vvPjphEh2EHyXYY7+aYEpsGR0EGQ4QmazvrKjI5seLjzqCAWvqDJrz4hyczbnlQ6Nh32 8F3Vw3xTmLW0dm9/YgJf4QpflvnaVa1dAeRcjqbHjLuQX+lvZtO9bR9fXiDWjtaNJPdD xE49z2xuQ4DYSilPreJR6xJg3ORiS+o7utXFRdFVgQZSirRVzrY+NIzhg7IbG2uJWkTM kJxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768562382; x=1769167182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WfSQMk2tCldH+NAueyqDiyPdeTJe21wGRoHBYtyMmPw=; b=ub2Ljr0IjYCHJXmFR9nK3HDWfSx0knsWLvkIiSvjw1BSOqTuh+/flRIo19YhrnxS3I bS8innV1yjufEQUcGDZ07ICmxwZL38x8YD018UbJ/G9lpDDQ9Wc8vrabnum1qQgem1Ij JTwN0XLHnAQal7eBWcz0pHieN94hABZmzyLv2Zzj2WD6/8DEsNVupiFaGHYC9X7mh2hk YYzQynYOBj9Z3X4poSO1I3NNucLXdyOFG86s43OEnrCh5wBxKXgwZbZncKblkxhfX5gB ZDK1/5AI4l5odktE0RVr3ulwbqQDis7+05AW1Val3Hk9UEMENSsKNaxwINZflEtlis8c ISoQ== X-Gm-Message-State: AOJu0YwT+cA4Z+H/2qcjkg4pIKqlueq2ViAD056MiYfN3Sld/DBAj+VW 9Ye9oNHA96+9xk/HpPk7vLIupN2FnM4hn+KBBJmv8pK4m3DvtLEGGiKSIJHnmxN2eTPdLfCY6ZV g/EDAs1g= X-Gm-Gg: AY/fxX4QQUh5iaLIh8oA4cfO0AwQXGLPaq/BeyoPcI+cgB6wV7Davu/j3qp5sEYUQ0V smBqvXUP8bpAqBIyYX0tHBmzed3WVLdTRkwwFHPZKJovOGN00zv4et4cF6fCaHRPOdti9DXoOhQ kS7XjMaFYue8aj34uUOKG5yHv3I1N+enZ2Kl2jdL67vkX0seEdgyQUco8tkqKqbHAlx9QM3yJzL W3fUysGPTrIB0IyZUpzsjGHyDTEmfXWywfFeUSlJMkMEjUL9yobtk/cWltEFVMMo82JAQqR+JCD zLnQw8X3wrTuBMsI1yMM9irCFVPidhN0rGeMG8bkx8TdyEeRRaIb/JsaRyE/B1iGZ0Z+u4arMIf wObdUYl0Jc6+cgtQ2Ku9DUxJp6mZGnl4oDfUVmP6FLcb1ISn3YLiw7D7SKqrHnGljoMBgSUJxYl RaKghn/W2kyRSycJkLboacv/kvwf0e/51MMToIbkODmERsM4FLVDvs7P1+XDIh X-Received: by 2002:a05:600c:354a:b0:479:3a86:dc1f with SMTP id 5b1f17b1804b1-4801e3503c2mr27264325e9.37.1768562382575; Fri, 16 Jan 2026 03:19:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/30] accel/hvf: Move hvf_log_sync to hvf_log_clear Date: Fri, 16 Jan 2026 12:17:51 +0100 Message-ID: <20260116111807.36053-15-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260116111807.36053-1-philmd@linaro.org> References: <20260116111807.36053-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 (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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: qemu development 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: 1768562404039158501 From: Richard Henderson Right idea, wrong hook. log_sync is called before using dirty bit data (which for hvf is already up-to-date), whereas log_clear is called before cleaning the range. Signed-off-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Message-ID: <20260112103034.65310-8-philmd@linaro.org> --- accel/hvf/hvf-all.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index bbb0403d246..3b6b9d6ea6a 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -224,12 +224,13 @@ static void hvf_log_stop(MemoryListener *listener, } } =20 -static void hvf_log_sync(MemoryListener *listener, - MemoryRegionSection *section) +static void hvf_log_clear(MemoryListener *listener, + MemoryRegionSection *section) { /* - * sync of dirty pages is handled elsewhere; just make sure we keep - * tracking the region. + * The dirty page bits within section are being cleared. + * Some number of those pages may have been dirtied and + * the write permission enabled. Reset the range read-only. */ hvf_protect_clean_range(section->offset_within_address_space, int128_get64(section->size)); @@ -254,7 +255,7 @@ static MemoryListener hvf_memory_listener =3D { .region_del =3D hvf_region_del, .log_start =3D hvf_log_start, .log_stop =3D hvf_log_stop, - .log_sync =3D hvf_log_sync, + .log_clear =3D hvf_log_clear, }; =20 static int hvf_accel_init(AccelState *as, MachineState *ms) --=20 2.52.0