From: David Hildenbrand <david@redhat.com>
To: kvm@vger.kernel.org
Cc: fanwenyi0529@gmail.com, Paolo Bonzini <pbonzini@redhat.com>,
rkrcmar@redhat.com, david@redhat.com
Subject: [PATCH 1/2] KVM: nVMX: kmap() can't fail
Date: Wed, 25 Jan 2017 11:58:57 +0100 [thread overview]
Message-ID: <20170125105858.20850-2-david@redhat.com> (raw)
In-Reply-To: <20170125105858.20850-1-david@redhat.com>
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>
---
arch/x86/kvm/vmx.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a236dec..a409fc4 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)
return 0;
vapic_page = kmap(vmx->nested.virtual_apic_page);
- if (!vapic_page) {
- WARN_ON(1);
- return -ENOMEM;
- }
__kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page);
kunmap(vmx->nested.virtual_apic_page);
@@ -9730,11 +9726,6 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu,
return false;
}
msr_bitmap_l1 = (unsigned long *)kmap(page);
- if (!msr_bitmap_l1) {
- nested_release_page_clean(page);
- WARN_ON(1);
- return false;
- }
memset(msr_bitmap_l0, 0xff, PAGE_SIZE);
--
2.9.3
next prev parent reply other threads:[~2017-01-25 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 10:58 [PATCH 0/2] KVM: nVMX: kmap() can't fail David Hildenbrand
2017-01-25 10:58 ` David Hildenbrand [this message]
2017-01-25 10:58 ` [PATCH 2/2] KVM: nVMX: vmx_complete_nested_posted_interrupt() " David Hildenbrand
2017-01-25 12:08 ` [PATCH 0/2] KVM: nVMX: kmap() " Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170125105858.20850-2-david@redhat.com \
--to=david@redhat.com \
--cc=fanwenyi0529@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox