From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 1/4] KVM: x86: INIT and reset sequences are different Date: Tue, 07 Apr 2015 15:57:07 +0200 Message-ID: <5523E233.7060004@redhat.com> References: <1427933438-12782-1-git-send-email-namit@cs.technion.ac.il> <1427933438-12782-2-git-send-email-namit@cs.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Nadav Amit Return-path: Received: from mail-wg0-f42.google.com ([74.125.82.42]:36097 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754984AbbDGN5N (ORCPT ); Tue, 7 Apr 2015 09:57:13 -0400 Received: by wgsk9 with SMTP id k9so34425769wgs.3 for ; Tue, 07 Apr 2015 06:57:12 -0700 (PDT) In-Reply-To: <1427933438-12782-2-git-send-email-namit@cs.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On 02/04/2015 02:10, Nadav Amit wrote: > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 155534c..1ef4c0d 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -1195,7 +1195,7 @@ static void init_vmcb(struct vcpu_svm *svm) > enable_gif(svm); > } > > -static void svm_vcpu_reset(struct kvm_vcpu *vcpu) > +static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) > { > struct vcpu_svm *svm = to_svm(vcpu); > u32 dummy; Please move this code: svm->vcpu.arch.apic_base = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; if (kvm_vcpu_is_reset_bsp(&svm->vcpu)) svm->vcpu.arch.apic_base |= MSR_IA32_APICBASE_BSP; from svm_create_vcpu to svm_vcpu_reset, so that it can be wrapped with "if (!init_event)" as in the VMX case. Paolo