From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] vmx, apicv: fix save/restore issue with apicv Date: Thu, 16 Oct 2014 10:53:58 +0100 Message-ID: <543F95B6.8070402@citrix.com> References: <1413014093-23050-1-git-send-email-yang.z.zhang@intel.com> <543BAA74020000780003E1F1@mail.emea.novell.com> <543D0EA9020000780003E9A8@mail.emea.novell.com> <543D41BD020000780003EC24@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Zhang, Yang Z" , Jan Beulich Cc: "Tian, Kevin" , "olaf@aepfle.de" , "malcolm.crossley@citrix.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 16/10/14 07:38, Zhang, Yang Z wrote: > Jan Beulich wrote on 2014-10-14: >>>>> On 14.10.14 at 15:10, wrote: >>> Jan Beulich wrote on 2014-10-14: >>>>>>> On 14.10.14 at 07:43, wrote: >>>>> Jan Beulich wrote on 2014-10-13: >>>>>>>>> On 11.10.14 at 09:54, wrote: >>>>>>> @@ -1597,6 +1599,29 @@ static void vmx_process_isr(int isr, >>>>>>> struct vcpu >>>>>> *v) >>>>>>> status |= isr << VMX_GUEST_INTR_STATUS_SVI_OFFSET; >>>>>>> __vmwrite(GUEST_INTR_STATUS, status); >>>>>>> } >>>>>>> + >>>>>>> + eoi_exit_bitmap = (unsigned int >>>>>>> + *)v->arch.hvm_vmx.eoi_exit_bitmap; >>>>>> No casts like this please. This is a bitmap and would hence >>>>>> preferably be treated that way consistently. The code here isn't >>>> performance critical. >>>>> Yes, it's performance critical from the live migration's point >>>>> and that's why I use the cast here and >>>> Compared to everything else involved in migration, a few extra >>>> cycles here >>> Xen is far behind KVM on live migration. If we want to remain the >>> competitive, I'd suggest doing a cleanup on current migration logic >>> to make it more effective. >> But that surely needs to be done elsewhere, where more than a couple >> of nanoseconds are to be gained. > If you think it is ok, I will use vector based operations: > > + for ( vector = 0x10; vector < NR_VECTORS; vector++ ) > + if (vlapic_test_vector(vector, &s->regs->data[APIC_IRR]) || > + vlapic_test_vector(vector, &s->regs->data[APIC_ISR])) > + set_bit(vector, v->arch.hvm_vmx.eoi_exit_bitmap); > > Andrew, is it ok for you? That covers the appropriate vector range, (and getting a working fix is far more important than arguing its efficiency at this point in the release). This looks fine to me.