From patchwork Wed Aug 22 07:19:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 10572627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1367B5A4 for ; Wed, 22 Aug 2018 07:20:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F24D82A982 for ; Wed, 22 Aug 2018 07:20:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E69622A994; Wed, 22 Aug 2018 07:20:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CBE82A982 for ; Wed, 22 Aug 2018 07:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728207AbeHVKns (ORCPT ); Wed, 22 Aug 2018 06:43:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727845AbeHVKns (ORCPT ); Wed, 22 Aug 2018 06:43:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0237C40216EA for ; Wed, 22 Aug 2018 07:20:11 +0000 (UTC) Received: from xz-x1.redhat.com (ovpn-12-149.pek2.redhat.com [10.72.12.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6EE72026D74; Wed, 22 Aug 2018 07:20:01 +0000 (UTC) From: Peter Xu To: kvm@vger.kernel.org Cc: Paolo Bonzini , peterx@redhat.com, =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= , "Dr . David Alan Gilbert" Subject: [PATCH v2 0/5] kvm: selftest: add dirty logging test Date: Wed, 22 Aug 2018 15:19:55 +0800 Message-Id: <20180822072000.24471-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 22 Aug 2018 07:20:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 22 Aug 2018 07:20:11 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'peterx@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP v2: - tune the parameters a bit (32 loops, 10ms interval) to let the test run ~1sec [Paolo] - pass in extra mem pages in vm_create_default() [Paolo] - add simple statistics on bits checked - allow to specify parameters via argc/argv - free bmap_track, which I forgot; rename to host_bmap_track Add a simple test for existing dirty logging facility. Please have a look, thanks. Peter Xu (5): tools: introduce test_and_clear_bit kvm: selftest: unify the guest port macros kvm: selftest: include the tools headers kvm: selftest: pass in extra memory when create vm kvm: selftest: add dirty logging test tools/include/linux/bitmap.h | 17 + tools/testing/selftests/kvm/Makefile | 5 +- .../selftests/kvm/cr4_cpuid_sync_test.c | 32 +- tools/testing/selftests/kvm/dirty_logging.c | 305 ++++++++++++++++++ .../testing/selftests/kvm/include/kvm_util.h | 46 ++- .../testing/selftests/kvm/include/test_util.h | 2 - tools/testing/selftests/kvm/lib/kvm_util.c | 58 ++++ tools/testing/selftests/kvm/lib/x86.c | 18 +- tools/testing/selftests/kvm/set_sregs_test.c | 2 +- tools/testing/selftests/kvm/state_test.c | 32 +- tools/testing/selftests/kvm/sync_regs_test.c | 21 +- .../selftests/kvm/vmx_tsc_adjust_test.c | 43 +-- 12 files changed, 475 insertions(+), 106 deletions(-) create mode 100644 tools/testing/selftests/kvm/dirty_logging.c