Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b66d8000 authored by Gui Jianfeng's avatar Gui Jianfeng Committed by Avi Kivity
Browse files

KVM: MMU: Don't calculate quadrant if tdp_enabled



There's no need to calculate quadrant if tdp is enabled.

Signed-off-by: default avatarGui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 316b9521
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1378,7 +1378,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
	if (role.direct)
	if (role.direct)
		role.cr4_pae = 0;
		role.cr4_pae = 0;
	role.access = access;
	role.access = access;
	if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) {
	if (!tdp_enabled && vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) {
		quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level));
		quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level));
		quadrant &= (1 << ((PT32_PT_BITS - PT64_PT_BITS) * level)) - 1;
		quadrant &= (1 << ((PT32_PT_BITS - PT64_PT_BITS) * level)) - 1;
		role.quadrant = quadrant;
		role.quadrant = quadrant;