Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1025087pxy; Wed, 28 Apr 2021 20:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOhhUouscOwRxVk9OIrZGMVys223ILnG7cNDwb7C5/I+MvVzQQ+zQ4w30tlVIXF7oiWUMZ X-Received: by 2002:a05:6a00:a95:b029:25c:eb77:723a with SMTP id b21-20020a056a000a95b029025ceb77723amr31058460pfl.23.1619667745795; Wed, 28 Apr 2021 20:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619667745; cv=none; d=google.com; s=arc-20160816; b=iNE5Nd2ysRFIh3HI3IWt3NKxvUEvg6nSAmc+CjdmKiciTTB/v+8reXctDc78BNes4n IzSPiLixIVE3BU48NbA8WDwSW14ChA6w/a3CTVFFn0jhrFc9KFTZDwccZodflM2Ft8Wz H11jNF75EOeTZh11zTsp1IXjiluIt+f+REukvsYDFEN5OGQyPKYKyz6oLcGYj1oaq8Wu 5OOIHscEBeIIcndn0lfPa5JBcbUgGAl5SKtcH6L11MTQaEZ4NLM5rUMwQFYVkjYDlRBF zxe5JvsBPkG6kJpiiDHl3OOTGBT2WmNilLKD8NyTkkZRovcgFyhdhcO3ldx+BPnfEt2J STpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=Odht4v1gzQ4wDXZL4NS3OMxbWLkhA7aS5TdrNV/JNFY=; b=lRT1QAGnPZxQG6bs/JcEj1c6DVwJvbR2DSlyBfyNC1e/PDulGGEiK4nVmEWP+tRWyX xxEmY3qx8oWp4TWnTLouzPpBC9rnVtXl5/kYKKHj3Cfl/lGQNQ31KxpzYiuIZyanCIyM MHP4RoA/W3B85wT0scVcYbSz/cteKfwD39v+2/DaM9RyHtDLsUZLzu10uaaXOcXyeS7V UD02hmc9YH1L39Z1fengMqTPkYa2BnUBVukjhYfpzEAdiSJYdhkLfI05ozNDe4fCOflN 1mCDrjl9+1oO/EltuAULrfvYtwFgcx0lCAhwIzGIatbuFwjyr9ZX8OzWzszv6iFZHZ0X L/Rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si1817107pgl.334.2021.04.28.20.42.11; Wed, 28 Apr 2021 20:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236837AbhD2DmX (ORCPT + 99 others); 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