From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PART1 RFC 5/9] svm: Add VMEXIT handlers for AVIC Date: Thu, 3 Mar 2016 11:50:24 +0100 Message-ID: <56D816F0.2040403@redhat.com> References: <56C2C1BF.7010700@amd.com> <56C312E1.1080902@redhat.com> <20160216141330.GG10555@potion.brq.redhat.com> <56C354A5.4040807@redhat.com> <20160216180618.GA18952@potion.brq.redhat.com> <56C52B80.5050104@amd.com> <20160218141817.GA6289@potion.brq.redhat.com> <56C5DA62.8080204@redhat.com> <20160218154343.GA18904@potion.brq.redhat.com> <56C5E8E1.9060900@redhat.com> <20160218162701.GB6289@potion.brq.redhat.com> <56C5FCCF.5010802@redhat.com> <56D8150E.1070408@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: joro@8bytes.org, alex.williamson@redhat.com, gleb@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com, "Wu, Feng" To: Suravee Suthikulpanit , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: In-Reply-To: <56D8150E.1070408@amd.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 03/03/2016 11:42, Suravee Suthikulpanit wrote: > In facts, instead of setting up the vAPIC backing page address when > calling kvm_arch_vcpu_load(), we should be able to do it when calling > kvm_arch_vcpu_sched_in(). This seems more appropriate since the > kvm_arch_vcpu_load() is also called in many unnecessary occasions via > vcpu_load() (in the arch/x86/kvm/x86.c). The same goes for the > kvm_arch_vcpu_put(). > > However, there is no kvm_arch_vcpu_sched_out(). But that can be added > easily. > > What do you think? How much code is involved? It seems an unnecessary complication... Unless you can profile a difference, I would leave it in kvm_arch_vcpu_load()/kvm_arch_vcpu_put(). Note that sched_in and sched_out are not called once per invocation of KVM_RUN---only through the preempt notifiers. So I'm not sure it is enough to use sched_in and sched_out. Paolo