kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 05/13] KVM: VMX: vmx_vcpu_setup() cannot fail
Date: Fri,  4 Aug 2017 15:14:20 +0200	[thread overview]
Message-ID: <20170804131428.15844-6-david@redhat.com> (raw)
In-Reply-To: <20170804131428.15844-1-david@redhat.com>

Make it a void and drop error handling code.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 arch/x86/kvm/vmx.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index b22af24..96e2ef4 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5279,7 +5279,7 @@ static void ept_set_mmio_spte_mask(void)
 /*
  * Sets up the vmcs for emulated real mode.
  */
-static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
+static void vmx_vcpu_setup(struct vcpu_vmx *vmx)
 {
 #ifdef CONFIG_X86_64
 	unsigned long a;
@@ -5388,8 +5388,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
 		vmcs_write64(PML_ADDRESS, page_to_phys(vmx->pml_pg));
 		vmcs_write16(GUEST_PML_INDEX, PML_ENTITY_NUM - 1);
 	}
-
-	return 0;
 }
 
 static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
@@ -9272,11 +9270,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
 	cpu = get_cpu();
 	vmx_vcpu_load(&vmx->vcpu, cpu);
 	vmx->vcpu.cpu = cpu;
-	err = vmx_vcpu_setup(vmx);
+	vmx_vcpu_setup(vmx);
 	vmx_vcpu_put(&vmx->vcpu);
 	put_cpu();
-	if (err)
-		goto free_vmcs;
 	if (cpu_need_virtualize_apic_accesses(&vmx->vcpu)) {
 		err = alloc_apic_access_page(kvm);
 		if (err)
-- 
2.9.4

  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 ` [PATCH v1 04/13] KVM: x86: drop BUG_ON(vcpu->kvm) David Hildenbrand
2017-08-04 13:14 ` David Hildenbrand [this message]
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-6-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;
as well as URLs for NNTP newsgroup(s).