Skip to content

Commit dfeef3d

Browse files
committed
KVM: x86: Drop superfluous check on direct MMU vs. WRITE_PF_TO_SP flag
Remove reexecute_instruction()'s final check on the MMU being direct, as EMULTYPE_WRITE_PF_TO_SP is only ever set if the MMU is indirect, i.e. is a shadow MMU. Prior to commit 93c05d3 ("KVM: x86: improve reexecute_instruction"), the flag simply didn't exist (and KVM actually returned "true" unconditionally for both types of MMUs). I.e. the explicit check for a direct MMU is simply leftover artifact from old code. Link: https://lore.kernel.org/r/20240203002343.383056-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 515c18a commit dfeef3d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8806,8 +8806,7 @@ static bool reexecute_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
88068806
* then zap the SPTE to unprotect the gfn, and then do it all over
88078807
* again. Report the error to userspace.
88088808
*/
8809-
return vcpu->arch.mmu->root_role.direct ||
8810-
!(emulation_type & EMULTYPE_WRITE_PF_TO_SP);
8809+
return !(emulation_type & EMULTYPE_WRITE_PF_TO_SP);
88118810
}
88128811

88138812
static bool retry_instruction(struct x86_emulate_ctxt *ctxt,

0 commit comments

Comments
 (0)