static union kvm_mmu_role
kvm_calc_shadow_mmu_root_page_role(struct kvm_vcpu *vcpu,
- const struct kvm_mmu_role_regs *regs)
+ union kvm_mmu_role cpu_role)
{
- union kvm_mmu_role cpu_role = kvm_calc_cpu_role(vcpu, regs);
union kvm_mmu_role role;
role = cpu_role;
- if (!____is_efer_lma(regs))
+ if (!cpu_role.ext.efer_lma)
role.base.level = PT32E_ROOT_LEVEL;
- else if (____is_cr4_la57(regs))
+ else if (cpu_role.ext.cr4_la57)
role.base.level = PT64_ROOT_5LEVEL;
else
role.base.level = PT64_ROOT_4LEVEL;
struct kvm_mmu *context = &vcpu->arch.root_mmu;
union kvm_mmu_role cpu_role = kvm_calc_cpu_role(vcpu, regs);
union kvm_mmu_role mmu_role =
- kvm_calc_shadow_mmu_root_page_role(vcpu, regs);
+ kvm_calc_shadow_mmu_root_page_role(vcpu, cpu_role);
shadow_mmu_init_context(vcpu, context, cpu_role, mmu_role);
}
static union kvm_mmu_role
kvm_calc_shadow_npt_root_page_role(struct kvm_vcpu *vcpu,
- const struct kvm_mmu_role_regs *regs)
+ union kvm_mmu_role cpu_role)
{
- union kvm_mmu_role cpu_role = kvm_calc_cpu_role(vcpu, regs);
union kvm_mmu_role role;
WARN_ON_ONCE(cpu_role.base.direct);
.efer = efer,
};
union kvm_mmu_role cpu_role = kvm_calc_cpu_role(vcpu, ®s);
- union kvm_mmu_role mmu_role = kvm_calc_shadow_npt_root_page_role(vcpu, ®s);
+ union kvm_mmu_role mmu_role = kvm_calc_shadow_npt_root_page_role(vcpu, cpu_role);
shadow_mmu_init_context(vcpu, context, cpu_role, mmu_role);
kvm_mmu_new_pgd(vcpu, nested_cr3);