From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BC41CD4851 for ; Wed, 13 May 2026 12:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K5pR5dIEiyI2IhEwpIjV7S758FzWFodXLFfsDvh/wjo=; b=CFAlfZd2ktqsaT 14m+8DuPjYvFk4pTzrKjbmKyKZImdXVk0TbYwqe1PnL2sGIN/SNyt18qDfPJn3G0Q8N2ihX3o736X zEQOXuD9p7Sv3NNLAy1x51V56QO8ajQC/rsNNxWJaZH/wIb5shQmXoS+5qFgexkVwxBMe4XdcvaMd +R8Yj3vKAsUPlrg75MzgCB3na9kNdZrV9RgvTBF6tkC97bq/veENFkRhTAMPRdUVAqdLv91UyM7DG c9UHrmshzvUZLrzd1r4w6jCA9ZkDWF0zGop6GnB5CrCprUGBE14H8htVZld6tgYqKbqGtznFAvC76 mAMos7D1/eSlrV1cMKJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wN8iZ-00000002UOf-1STv; Wed, 13 May 2026 12:29:39 +0000 Received: from m16.mail.163.com ([220.197.31.3]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wN8iV-00000002ULb-3ovs; Wed, 13 May 2026 12:29:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From: Content-Type; bh=rki0N/LpUp9snFOn/spm1BVi6skoI5EoYdbrvY3VzsA=; b=QhTKJVHKC4yJSk2JANCGSgPcBKawo7jIM5dU9QNbsX6C0x5LcyI0TQ+6CCWKzi dE6n7uy/laAWFIAC4D+WaYZybda87AJsM0oVnZScdNjo5LQBHWa5QeSe0gRlDeEh qjCp7NlN11g7uIQswjYgZhNqOr5VK5zNqMO3a6F2vwQWU= Received: from [IPV6:240e:38c:8516:b200:c068:c931:3eaf:6c76] (unknown []) by gzga-smtp-mtada-g0-4 (Coremail) with SMTP id _____wB30cdFbgRqe32jBA--.12714S2; Wed, 13 May 2026 20:27:50 +0800 (CST) Message-ID: Date: Wed, 13 May 2026 20:27:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] KVM: selftests: Add unit to dirty_log_test To: Sean Christopherson , wu.fei9@sanechips.com.cn Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, anup@brainfault.org, atish.patra@linux.dev, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, pbonzini@redhat.com, shuah@kernel.org References: <202605111849442561v1a0B_7W1L2Z-ENusLaP@zte.com.cn> <202605111130.64BBUXDN013040@mse-fl2.zte.com.cn> Content-Language: en-US From: Wu Fei In-Reply-To: X-CM-TRANSID: _____wB30cdFbgRqe32jBA--.12714S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw13JFy8CryDCFW3Zr13urg_yoW8Kr4UpF WSgFyjkr1kAFyrC3Z2ya1YqF1FyFW5ArWUJa4rt345ua98WrsrWr1xKa4rZasrCr1fXr12 yrWDK347Gwn7uaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UonQUUUUUU= X-Originating-IP: [240e:38c:8516:b200:c068:c931:3eaf:6c76] X-CM-SenderInfo: pdwz3wlhl6il2tof0z/xtbCzQlJ6moEbklR1wAA3o X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260513_052936_316012_5CFE3B5E X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 5/13/26 08:03, Sean Christopherson wrote: > On Mon, May 11, 2026, wu.fei9@sanechips.com.cn wrote: >> Currently dirty_log_test hardcodes usleep 1ms in each interval, which >> could be too short for guest to write and fault in enough pages, then >> there is less chance to test the write protection mechanism, especially >> in the case of (log_mode != LOG_MODE_DIRTY_RING). > > But when log_mode != LOG_MODE_DIRTY_RING, the individual sleep time is largely > meaningless, because the test won't reap the bitmaps for iterations > 0. > > if (i && host_log_mode != LOG_MODE_DIRTY_RING) > continue; > The first usleep matters in the case of KVM_DIRTY_LOG_INITIALLY_SET. The dirty bitmap is not precise in the first get_dirty_log, all pages are marked as dirty but most of them are not populated in page table, this creates the situation I mentioned in the cover letter. "when the range to wp is [0xfffff01fc000, 0xfffff023c000) , if found_leaf of 0xfffff01fc000 returns false and page_size is 2MB, it skips the whole range, but it's possible to have valid entries in [0xfffff0200000, 0xfffff023c000), so only [0xfffff01fc000, 0xfffff0200000) can be skipped safely." >> >> Unit is introduced to replace the default 1ms if specified in command >> line. The following test can't trigger failure on my riscv vm: > > Failure of what? And does the failure really not reproduce with a higher interval? On riscv, it fails to write protect some pages with valid page table entry then loses track of dirty pages. Higher interval doesn't help because only the first usleep matters, after the first collect_dirty_pages, all dirty pages are tracked precisely then there is no such problem. > >> >> # ./dirty_log_test -m 21 -M clear-log >> >> By enlarging unit, it fails every time: > > "unit" is way too vague. Even looking at the code, it's not clear to me what > you intended a "unit" to be. I'm not entirely opposed to providing the user with > more control over the innards of the test, but the interface needs to be somewhat > intuitive. Basically, a unit is the time of one usleep(), any suggestions? Thanks, Fei. > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv