From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v9 15/17] vmx: VT-d posted-interrupt core logic handling Date: Tue, 10 Nov 2015 17:59:10 +0100 Message-ID: <1447174750.6409.19.camel@citrix.com> References: <1446540207-4806-1-git-send-email-feng.wu@intel.com> <1446540207-4806-16-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6955590150478191134==" 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: "Wu, Feng" , "xen-devel@lists.xen.org" Cc: George Dunlap , Andrew Cooper , "Tian, Kevin" , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============6955590150478191134== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-DcWK3MenwgbqZJgoDFN0" --=-DcWK3MenwgbqZJgoDFN0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-11-03 at 09:07 +0000, Wu, Feng wrote: > BTW, In the previous discussion, we will do the PI state adjustment > in vmx_do_resume, however, seems this is not a good place to do this, > since this function gets called only if the scheduling occurs, no > matter it switches to another vCPU or continue runs the current vCPU. > If no scheduling happens during "VM->Xen->VM", vmx-do_resume() will > not get called.=20 > Mmm... When I first read this, it seemed to me to be a good thing, and a reason for actually putting your logic in there (that would avoid paying the price of going through it during every VMENTRY, which you were yourself hesitant about)! So, maybe I'm missing/misremembering something. Just to be sure, can you tell me... > So I put the PI state adjustment code in vmx_vmenter_helper(), if you > have any other good suggestions, please let me know, thanks a lot! >=20 ... what is the reason(s) why you need to do the update even if no scheduling happened? Looking at the code again, I think one reason may be to cope with when vcpu_block() is called, but then local_events_need_delivery() returns true, as shown here below: void vcpu_block(void) { struct vcpu *v =3D current; set_bit(_VPF_blocked, &v->pause_flags); arch_vcpu_block(v); // nv <--- pi_wakeup_ve= ctor /* Check for events /after/ blocking: avoids wakeup waiting race. */ if ( local_events_need_delivery() ) // <=3D=3D=3D TRUE clear_bit(_VPF_blocked, &v->pause_flags); // we want nv =3D=3D po= sted_intr_vector, so we need vmx_pi_st= ate_change() to run, even if we'r= e not scheduling } Is this the case? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-DcWK3MenwgbqZJgoDFN0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlZCIl4ACgkQk4XaBE3IOsThHQCgoXVvmFh2ok4b/+rQRR2Q4KvV dqAAn35xBy0+vIxvAPwFNt8w+CHoJrlW =x9U1 -----END PGP SIGNATURE----- --=-DcWK3MenwgbqZJgoDFN0-- --===============6955590150478191134== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6955590150478191134==--