aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2017-01-25 05:58:57 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2017-02-07 12:16:44 -0500
commit42cf014d38d8822cce63703a467e00f65d000952 (patch)
tree1086956a82cf975a6814be6620b6b8506f7e2ebe
parentd3e328f2cb01f6f09259a5810baae3edf5416076 (diff)
KVM: nVMX: kmap() can't fail
kmap() can't fail, therefore it will always return a valid pointer. Let's just get rid of the unnecessary checks. Signed-off-by: David Hildenbrand <david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index d850d5d36182..693e4203b666 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4973,10 +4973,6 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
4973 return 0; 4973 return 0;
4974 4974
4975 vapic_page = kmap(vmx->nested.virtual_apic_page); 4975 vapic_page = kmap(vmx->nested.virtual_apic_page);
4976 if (!vapic_page) {
4977 WARN_ON(1);
4978 return -ENOMEM;
4979 }
4980 __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page); 4976 __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page);
4981 kunmap(vmx->nested.virtual_apic_page); 4977 kunmap(vmx->nested.virtual_apic_page);
4982 4978
@@ -9738,11 +9734,6 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu,
9738 return false; 9734 return false;
9739 } 9735 }
9740 msr_bitmap_l1 = (unsigned long *)kmap(page); 9736 msr_bitmap_l1 = (unsigned long *)kmap(page);
9741 if (!msr_bitmap_l1) {
9742 nested_release_page_clean(page);
9743 WARN_ON(1);
9744 return false;
9745 }
9746 9737
9747 memset(msr_bitmap_l0, 0xff, PAGE_SIZE); 9738 memset(msr_bitmap_l0, 0xff, PAGE_SIZE);
9748 9739