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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC186C4332F for ; Wed, 23 Mar 2022 18:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344057AbiCWSvA (ORCPT ); Wed, 23 Mar 2022 14:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344032AbiCWSu5 (ORCPT ); Wed, 23 Mar 2022 14:50:57 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF89C606DD for ; Wed, 23 Mar 2022 11:49:26 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id d7-20020a17090ad98700b001c6834c71ffso1540995pjv.1 for ; Wed, 23 Mar 2022 11:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=slbs+omTj8xyRVbCkc6cD/g6x3OLZjyKyltZ5xxXewk=; b=JOgyL7wv6R8OMnIGun2hdLU6NtSAivXpQTUW4Tl2D/z/uPw4YxriqKwTLYk4wf590a Bosvzj4LJOxmE8QH5fFPbuBjFziPfr64viJZZ4i217n8OygNOi0pD2YsgwFbt0McL2c7 0h8Jo39B1xmKIrXl0QiL0/kbxUb5HhiIuSKc80XSYXjE9O3ba55Ld4KjVkmu7wWIJV5f 22QzRQTo8Sf7AHBpfaHo+YJwpbXzCRmf+ADazmAxkVP7R8SXsCWXypH9IJCyY11TFkAc GefZsQcIY75ToGGtbqCQy8w24Paf3EUlaCkJJuQ5oCUC2o6CmLHokr6N8Bd0TqHmPoVA QEow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=slbs+omTj8xyRVbCkc6cD/g6x3OLZjyKyltZ5xxXewk=; b=fqe0Ten+toE5RrOg6308n5k2ptycz9hmOdxOMBjx2F0pa+qznKwZhg17NVK58Jp+/s /YRCUkythWXSsqCS1jJyN47Ox2jhbHa812dkMioadBYRw7V36/Qx4XDhoyLvpAPxx+tR KdkRB58rABJLWObUu+po0AyA3Lw2fIWysAbHIY0SWPhj9fcufGWyiMQFSMb2yPjRDkbo BntLyksTYmz96GxpLkaQVm7hItkttaz5qimKtXESgma1iCTO14aWX8aEj3W10iXyGWi0 1QVRbqt5qaRAlzkUm6LWTkh/Dt5+NPnRG9oCddiPY3fJ6yOIdlkTbjS5e0e6dqMbKlPH 4hwQ== X-Gm-Message-State: AOAM531+3nBv68Ruz3K7jB7ccf8dnuTz8YBRBov0hEkD09uUu6+yNOhj 8FEJV8U5TRC2lRj4dFlMsD5woxeToxtq X-Google-Smtp-Source: ABdhPJzlBoaUIUX6DtX8d5f88vHUtRaluCuxp2990xcogvOPaTqSYv2FxYGKeJxvtICOHJJhQtfHlWI0LcxF X-Received: from mizhang-super.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1071]) (user=mizhang job=sendgmr) by 2002:a05:6a00:2310:b0:4fa:7eb1:e855 with SMTP id h16-20020a056a00231000b004fa7eb1e855mr1170187pfh.14.1648061366233; Wed, 23 Mar 2022 11:49:26 -0700 (PDT) Reply-To: Mingwei Zhang Date: Wed, 23 Mar 2022 18:49:11 +0000 In-Reply-To: <20220323184915.1335049-1-mizhang@google.com> Message-Id: <20220323184915.1335049-2-mizhang@google.com> Mime-Version: 1.0 References: <20220323184915.1335049-1-mizhang@google.com> X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog Subject: [PATCH v2 0/4] Verify dirty logging works properly with page stats From: Mingwei Zhang To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Gardon , Mingwei Zhang , David Matlack , Jing Zhang , Peter Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset is to verify if dirty logging works properly by checking page stats from the per-VM interface. We discovered one performance bug in disallowed_hugepage_adjust() which prevents KVM from recovering large pages for the guest. The selftest logic added later could help validate the problem. The patchset borrowes two patches come from Ben's series: "[PATCH 00/13] KVM: x86: Add a cap to disable NX hugepages on a VM" [1], which completes the selftest library functions to use the stats interface. [1] https://lore.kernel.org/all/20220310164532.1821490-2-bgardon@google.com/T/ v2 -> v1: - Update the commit message. [dmatlack] - Update the comments in patch 3/4 to clarify the motivation. [bgardon] - Add another iteration in dirty_log_perf_test to regain pages [bgardon] v1: https://lore.kernel.org/all/20220321002638.379672-1-mizhang@google.com/ Ben Gardon (2): selftests: KVM: Dump VM stats in binary stats test selftests: KVM: Test reading a single stat Mingwei Zhang (2): KVM: x86/mmu: explicitly check nx_hugepage in disallowed_hugepage_adjust() selftests: KVM: use dirty logging to check if page stats work correctly arch/x86/kvm/mmu/mmu.c | 14 +- .../selftests/kvm/dirty_log_perf_test.c | 53 +++++ .../selftests/kvm/include/kvm_util_base.h | 2 + .../selftests/kvm/kvm_binary_stats_test.c | 6 + tools/testing/selftests/kvm/lib/kvm_util.c | 196 ++++++++++++++++++ 5 files changed, 269 insertions(+), 2 deletions(-) -- 2.35.1.1021.g381101b075-goog