Skip to content

Commit 5d55a05

Browse files
committed
Merge tag 'kvm-x86-mmu-6.12' of https://github.com/kvm-x86/linux into HEAD
KVM x86 MMU changes for 6.12: - Overhaul the "unprotect and retry" logic to more precisely identify cases where retrying is actually helpful, and to harden all retry paths against putting the guest into an infinite retry loop. - Add support for yielding, e.g. to honor NEED_RESCHED, when zapping rmaps in the shadow MMU. - Refactor pieces of the shadow MMU related to aging SPTEs in prepartion for adding MGLRU support in KVM. - Misc cleanups
2 parents c345344 + 9a5bff7 commit 5d55a05

File tree

7 files changed

+369
-383
lines changed

7 files changed

+369
-383
lines changed

arch/x86/include/asm/kvm_host.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,6 @@ enum x86_intercept_stage;
282282
#define PFERR_PRIVATE_ACCESS BIT_ULL(49)
283283
#define PFERR_SYNTHETIC_MASK (PFERR_IMPLICIT_ACCESS | PFERR_PRIVATE_ACCESS)
284284

285-
#define PFERR_NESTED_GUEST_PAGE (PFERR_GUEST_PAGE_MASK | \
286-
PFERR_WRITE_MASK | \
287-
PFERR_PRESENT_MASK)
288-
289285
/* apic attention bits */
290286
#define KVM_APIC_CHECK_VAPIC 0
291287
/*
@@ -2142,7 +2138,15 @@ int kvm_get_nr_pending_nmis(struct kvm_vcpu *vcpu);
21422138

21432139
void kvm_update_dr7(struct kvm_vcpu *vcpu);
21442140

2145-
int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn);
2141+
bool __kvm_mmu_unprotect_gfn_and_retry(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
2142+
bool always_retry);
2143+
2144+
static inline bool kvm_mmu_unprotect_gfn_and_retry(struct kvm_vcpu *vcpu,
2145+
gpa_t cr2_or_gpa)
2146+
{
2147+
return __kvm_mmu_unprotect_gfn_and_retry(vcpu, cr2_or_gpa, false);
2148+
}
2149+
21462150
void kvm_mmu_free_roots(struct kvm *kvm, struct kvm_mmu *mmu,
21472151
ulong roots_to_free);
21482152
void kvm_mmu_free_guest_mode_roots(struct kvm *kvm, struct kvm_mmu *mmu);

0 commit comments

Comments
 (0)