Commit 55c1dcd8 authored by Krish Sadhukhan's avatar Krish Sadhukhan Committed by Paolo Bonzini

nVMX x86: Make nested_vmx_check_pml_controls() concise

Suggested-by: default avatarJim Mattson <jmattson@google.com>
Signed-off-by: default avatarKrish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: default avatarMark Kanda <mark.kanda@oracle.com>
Reviewed-by: default avatarJim Mattson <jmattson@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 3ff519f2
...@@ -11779,15 +11779,12 @@ static int nested_vmx_check_msr_switch_controls(struct kvm_vcpu *vcpu, ...@@ -11779,15 +11779,12 @@ static int nested_vmx_check_msr_switch_controls(struct kvm_vcpu *vcpu,
static int nested_vmx_check_pml_controls(struct kvm_vcpu *vcpu, static int nested_vmx_check_pml_controls(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12) struct vmcs12 *vmcs12)
{ {
u64 address = vmcs12->pml_address; if (!nested_cpu_has_pml(vmcs12))
int maxphyaddr = cpuid_maxphyaddr(vcpu); return 0;
if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_PML)) { if (!nested_cpu_has_ept(vmcs12) ||
if (!nested_cpu_has_ept(vmcs12) || !page_address_valid(vcpu, vmcs12->pml_address))
!IS_ALIGNED(address, 4096) || return -EINVAL;
address >> maxphyaddr)
return -EINVAL;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment