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 X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D555FC43461 for ; Thu, 29 Apr 2021 03:41:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A890361433 for ; Thu, 29 Apr 2021 03:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236909AbhD2DmX (ORCPT ); Wed, 28 Apr 2021 23:42:23 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:17049 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbhD2DmW (ORCPT ); Wed, 28 Apr 2021 23:42:22 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FW1S16H0DzPvQL; Thu, 29 Apr 2021 11:38:25 +0800 (CST) Received: from DESKTOP-5IS4806.china.huawei.com (10.174.187.224) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 11:41:25 +0800 From: Keqian Zhu To: , , Paolo Bonzini , Sean Christopherson , Ben Gardon CC: Subject: [PATCH v3 0/2] KVM: x86: Enable dirty logging lazily for huge pages Date: Thu, 29 Apr 2021 11:41:13 +0800 Message-ID: <20210429034115.35560-1-zhukeqian1@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.224] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Currently during start dirty logging, if we're with init-all-set, we write protect huge pages and leave normal pages untouched, for that we can enable dirty logging for these pages lazily. Actually enable dirty logging lazily for huge pages is feasible too, which not only reduces the time of start dirty logging, also greatly reduces side-effect on guest when there is high dirty rate. Thanks, Keqian Changelog: v3: - Discussed with Ben and delete RFC comments. Thanks. Keqian Zhu (2): KVM: x86: Support write protect gfn with min_level KVM: x86: Not wr-protect huge page with init_all_set dirty log arch/x86/kvm/mmu/mmu.c | 38 ++++++++++++++++++++++++++------- arch/x86/kvm/mmu/mmu_internal.h | 3 ++- arch/x86/kvm/mmu/page_track.c | 2 +- arch/x86/kvm/mmu/tdp_mmu.c | 16 ++++++++++---- arch/x86/kvm/mmu/tdp_mmu.h | 3 ++- arch/x86/kvm/x86.c | 37 +++++++++----------------------- 6 files changed, 57 insertions(+), 42 deletions(-) -- 2.23.0