Skip to content

Commit 8ef228c

Browse files
Lai Jiangshansean-jc
authored andcommitted
KVM: x86/mmu: Set mmu->sync_page as NULL for direct paging
mmu->sync_page for direct paging is never called. And both mmu->sync_page and mm->invlpg only make sense in shadow paging. Setting mmu->sync_page as NULL for direct paging makes it consistent with mm->invlpg which is set NULL for the case. Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Link: https://lore.kernel.org/r/20230216154115.710033-5-jiangshanlai@gmail.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 51dddf6 commit 8ef228c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,12 +1789,6 @@ static void mark_unsync(u64 *spte)
17891789
kvm_mmu_mark_parents_unsync(sp);
17901790
}
17911791

1792-
static int nonpaging_sync_page(struct kvm_vcpu *vcpu,
1793-
struct kvm_mmu_page *sp)
1794-
{
1795-
return -1;
1796-
}
1797-
17981792
#define KVM_PAGE_ARRAY_NR 16
17991793

18001794
struct kvm_mmu_pages {
@@ -4510,7 +4504,7 @@ static void nonpaging_init_context(struct kvm_mmu *context)
45104504
{
45114505
context->page_fault = nonpaging_page_fault;
45124506
context->gva_to_gpa = nonpaging_gva_to_gpa;
4513-
context->sync_page = nonpaging_sync_page;
4507+
context->sync_page = NULL;
45144508
context->invlpg = NULL;
45154509
}
45164510

@@ -5198,7 +5192,7 @@ static void init_kvm_tdp_mmu(struct kvm_vcpu *vcpu,
51985192
context->cpu_role.as_u64 = cpu_role.as_u64;
51995193
context->root_role.word = root_role.word;
52005194
context->page_fault = kvm_tdp_page_fault;
5201-
context->sync_page = nonpaging_sync_page;
5195+
context->sync_page = NULL;
52025196
context->invlpg = NULL;
52035197
context->get_guest_pgd = get_cr3;
52045198
context->get_pdptr = kvm_pdptr_read;

0 commit comments

Comments
 (0)