mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vipin Sharma <vipinsh@google.com>
To: seanjc@google.com, pbonzini@redhat.com, bgardon@google.com,
	dmatlack@google.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vipin Sharma <vipinsh@google.com>
Subject: [Patch v2 4/5] KVM: x86/mmu: Remove handle_changed_spte_dirty_log()
Date: Fri,  3 Feb 2023 11:28:21 -0800	[thread overview]
Message-ID: <20230203192822.106773-5-vipinsh@google.com> (raw)
In-Reply-To: <20230203192822.106773-1-vipinsh@google.com>

Remove handle_changed_spte_dirty_log() as there is no code flow which
sets leaf SPTE writable and hit this path.

Signed-off-by: Vipin Sharma <vipinsh@google.com>
---
 arch/x86/kvm/mmu/tdp_mmu.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index 18630a06fa1f..afe0dcb1859e 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -345,24 +345,6 @@ static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level)
 		kvm_set_pfn_accessed(spte_to_pfn(old_spte));
 }
 
-static void handle_changed_spte_dirty_log(struct kvm *kvm, int as_id, gfn_t gfn,
-					  u64 old_spte, u64 new_spte, int level)
-{
-	bool pfn_changed;
-	struct kvm_memory_slot *slot;
-
-	if (level > PG_LEVEL_4K)
-		return;
-
-	pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte);
-
-	if ((!is_writable_pte(old_spte) || pfn_changed) &&
-	    is_writable_pte(new_spte)) {
-		slot = __gfn_to_memslot(__kvm_memslots(kvm, as_id), gfn);
-		mark_page_dirty_in_slot(kvm, slot, gfn);
-	}
-}
-
 static void tdp_account_mmu_page(struct kvm *kvm, struct kvm_mmu_page *sp)
 {
 	kvm_account_pgtable_pages((void *)sp->spt, +1);
@@ -614,8 +596,6 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
 	__handle_changed_spte(kvm, as_id, gfn, old_spte, new_spte, level,
 			      shared);
 	handle_changed_spte_acc_track(old_spte, new_spte, level);
-	handle_changed_spte_dirty_log(kvm, as_id, gfn, old_spte,
-				      new_spte, level);
 }
 
 /*
@@ -727,8 +707,6 @@ static u64 _tdp_mmu_set_spte(struct kvm *kvm, int as_id, tdp_ptep_t sptep,
 
 	__handle_changed_spte(kvm, as_id, gfn, old_spte, new_spte, level, false);
 	handle_changed_spte_acc_track(old_spte, new_spte, level);
-	handle_changed_spte_dirty_log(kvm, as_id, gfn, old_spte, new_spte,
-				      level);
 	return old_spte;
 }
 
-- 
2.39.1.519.gcb327c4b5f-goog


  parent reply	other threads:[~2023-02-03 19:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 19:28 [Patch v2 0/5] Optimize clear dirty log Vipin Sharma
2023-02-03 19:28 ` [Patch v2 1/5] KVM: x86/mmu: Make separate function to check for SPTEs atomic write conditions Vipin Sharma
2023-02-06 22:09   ` Ben Gardon
2023-02-06 23:17   ` David Matlack
2023-02-03 19:28 ` [Patch v2 2/5] KVM: x86/mmu: Optimize SPTE change flow for clear-dirty-log Vipin Sharma
2023-02-06 22:06   ` Ben Gardon
2023-02-06 23:34     ` David Matlack
2023-02-07 17:29     ` Vipin Sharma
2023-02-06 23:41   ` David Matlack
2023-02-07 17:36     ` Vipin Sharma
2023-02-07 17:47       ` David Matlack
2023-02-08 23:44         ` Vipin Sharma
2023-02-06 23:53   ` David Matlack
2023-02-07 17:41     ` Vipin Sharma
2023-02-03 19:28 ` [Patch v2 3/5] KVM: x86/mmu: Optimize SPTE change for aging gfn range Vipin Sharma
2023-02-06 22:17   ` Ben Gardon
2023-02-07 17:48     ` Vipin Sharma
2023-02-06 23:56   ` David Matlack
2023-02-07 17:50     ` Vipin Sharma
2023-02-03 19:28 ` Vipin Sharma [this message]
2023-02-06 23:59   ` [Patch v2 4/5] KVM: x86/mmu: Remove handle_changed_spte_dirty_log() David Matlack
2023-02-07 17:51     ` Vipin Sharma
2023-02-03 19:28 ` [Patch v2 5/5] KVM: x86/mmu: Merge all handle_changed_pte* functions Vipin Sharma
2023-02-06 22:33   ` Ben Gardon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230203192822.106773-5-vipinsh@google.com \
    --to=vipinsh@google.com \
    --cc=bgardon@google.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®