KVM: X86/MMU: Add sp_has_gptes()
authorLai Jiangshan <jiangshan.ljs@antgroup.com>
Wed, 20 Apr 2022 13:12:03 +0000 (21:12 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Apr 2022 16:50:00 +0000 (12:50 -0400)
commit767d8d8d503f946c7a67735e77dea7e1c9cb6b51
treeb2114c64a31d58808569378567fbe382b8b559e4
parent9f084f7c2ed7e6b8cc3176b9ece2f6cb0641c385
KVM: X86/MMU: Add sp_has_gptes()

Add sp_has_gptes() which equals to !sp->role.direct currently.

Shadow page having gptes needs to be write-protected, accounted and
responded to kvm_mmu_pte_write().

Use it in these places to replace !sp->role.direct and rename
for_each_gfn_indirect_valid_sp.

Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Message-Id: <20220420131204.2850-2-jiangshanlai@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c