From: David Hildenbrand <david@redhat.com>
To: kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
david@redhat.com
Subject: [PATCH v1 04/13] KVM: x86: drop BUG_ON(vcpu->kvm)
Date: Fri, 4 Aug 2017 15:14:19 +0200 [thread overview]
Message-ID: <20170804131428.15844-5-david@redhat.com> (raw)
In-Reply-To: <20170804131428.15844-1-david@redhat.com>
And also get rid of that superfluous local variable "kvm".
Signed-off-by: David Hildenbrand <david@redhat.com>
---
arch/x86/kvm/x86.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 72d82ab..3b5455b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7930,16 +7930,12 @@ EXPORT_SYMBOL_GPL(kvm_no_apic_vcpu);
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
{
struct page *page;
- struct kvm *kvm;
int r;
- BUG_ON(vcpu->kvm == NULL);
- kvm = vcpu->kvm;
-
vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv();
vcpu->arch.pv.pv_unhalted = false;
vcpu->arch.emulate_ctxt.ops = &emulate_ops;
- if (!irqchip_in_kernel(kvm) || kvm_vcpu_is_reset_bsp(vcpu))
+ if (!irqchip_in_kernel(vcpu->kvm) || kvm_vcpu_is_reset_bsp(vcpu))
vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
else
vcpu->arch.mp_state = KVM_MP_STATE_UNINITIALIZED;
@@ -7957,7 +7953,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
if (r < 0)
goto fail_free_pio_data;
- if (irqchip_in_kernel(kvm)) {
+ if (irqchip_in_kernel(vcpu->kvm)) {
r = kvm_create_lapic(vcpu);
if (r < 0)
goto fail_mmu_destroy;
--
2.9.4
next prev parent reply other threads:[~2017-08-04 13:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 13:14 [PATCH v1 00/13] KVM x86/VMX cleanups David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 01/13] KVM: x86: mmu: returning void in a void function is strange David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 02/13] KVM: x86: mmu: use for_each_shadow_entry_lockless() David Hildenbrand
2017-08-14 10:21 ` Paolo Bonzini
2017-08-17 10:12 ` David Hildenbrand
2017-08-17 10:23 ` Paolo Bonzini
2017-08-17 10:39 ` David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 03/13] KVM: x86: mmu: free_page can handle NULL David Hildenbrand
2017-08-04 13:14 ` David Hildenbrand [this message]
2017-08-04 13:14 ` [PATCH v1 05/13] KVM: VMX: vmx_vcpu_setup() cannot fail David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 06/13] KVM: x86: no need to inititalize vcpu members to 0 David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 07/13] KVM: VMX: drop enable_ept check from ept_sync_context() David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 08/13] KVM: VMX: call ept_sync_global() with enable_ept only David Hildenbrand
2017-08-14 10:25 ` Paolo Bonzini
2017-08-17 10:06 ` David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 09/13] KVM: VMX: drop unnecessary function declarations David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 10/13] KVM: nVMX: no need to set vcpu->cpu when switching vmcs David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 11/13] KVM: VMX: cleanup init_rmode_identity_map() David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 12/13] KVM: x86: document special identity map address value David Hildenbrand
2017-08-04 13:14 ` [PATCH v1 13/13] KVM: x86: allow setting identity map addr with no vcpus only David Hildenbrand
2017-08-10 17:58 ` [PATCH v1 00/13] KVM x86/VMX cleanups Radim Krčmář
2017-08-14 10:30 ` 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=20170804131428.15844-5-david@redhat.com \
--to=david@redhat.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