summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorKarimAllah Ahmed <karahmed@amazon.de>2019-01-31 21:24:43 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-04-30 21:49:44 +0200
commite0bf2665ca26c1f6d6909de29bd382e7a5ee41e7 (patch)
treec3d4d7e2ff57d00472bcb6f490d546175055d803 /arch/x86
parentdee9c0493108b36e89d289c8fd6f4c90321d0d5e (diff)
downloadlinux-stable-e0bf2665ca26c1f6d6909de29bd382e7a5ee41e7.tar.gz
linux-stable-e0bf2665ca26c1f6d6909de29bd382e7a5ee41e7.tar.bz2
linux-stable-e0bf2665ca26c1f6d6909de29bd382e7a5ee41e7.zip
KVM/nVMX: Use page_address_valid in a few more locations
Use page_address_valid in a few more locations that is already checking for a page aligned address that does not cross the maximum physical address. Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/vmx/nested.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 52347dcc252c..877593573b52 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -4275,7 +4275,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
* Note - IA32_VMX_BASIC[48] will never be 1 for the nested case;
* which replaces physical address width with 32
*/
- if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu)))
+ if (!page_address_valid(vcpu, vmptr))
return nested_vmx_failInvalid(vcpu);
if (kvm_read_guest(vcpu->kvm, vmptr, &revision, sizeof(revision)) ||
@@ -4338,7 +4338,7 @@ static int handle_vmclear(struct kvm_vcpu *vcpu)
if (nested_vmx_get_vmptr(vcpu, &vmptr))
return 1;
- if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu)))
+ if (!page_address_valid(vcpu, vmptr))
return nested_vmx_failValid(vcpu,
VMXERR_VMCLEAR_INVALID_ADDRESS);
@@ -4545,7 +4545,7 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu)
if (nested_vmx_get_vmptr(vcpu, &vmptr))
return 1;
- if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu)))
+ if (!page_address_valid(vcpu, vmptr))
return nested_vmx_failValid(vcpu,
VMXERR_VMPTRLD_INVALID_ADDRESS);