Skip to content

Commit 81b8eeb

Browse files
Xiao Guangrongbonzini
authored andcommitted
KVM: MMU: split reset_rsvds_bits_mask_ept
Since shadow ept page tables and Intel nested guest page tables have the same format, split reset_rsvds_bits_mask_ept so that the logic can be reused by later patches which check zero bits on sptes Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 6dc98b8 commit 81b8eeb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

arch/x86/kvm/mmu.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3660,11 +3660,10 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu,
36603660
is_pse(vcpu));
36613661
}
36623662

3663-
static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu,
3664-
struct kvm_mmu *context, bool execonly)
3663+
static void
3664+
__reset_rsvds_bits_mask_ept(struct rsvd_bits_validate *rsvd_check,
3665+
int maxphyaddr, bool execonly)
36653666
{
3666-
struct rsvd_bits_validate *rsvd_check = &context->guest_rsvd_check;
3667-
int maxphyaddr = cpuid_maxphyaddr(vcpu);
36683667
int pte;
36693668

36703669
rsvd_check->rsvd_bits_mask[0][3] =
@@ -3693,6 +3692,13 @@ static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu,
36933692
}
36943693
}
36953694

3695+
static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu,
3696+
struct kvm_mmu *context, bool execonly)
3697+
{
3698+
__reset_rsvds_bits_mask_ept(&context->guest_rsvd_check,
3699+
cpuid_maxphyaddr(vcpu), execonly);
3700+
}
3701+
36963702
static void update_permission_bitmask(struct kvm_vcpu *vcpu,
36973703
struct kvm_mmu *mmu, bool ept)
36983704
{

0 commit comments

Comments
 (0)