From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v7 15/17] vmx: VT-d posted-interrupt core logic handling Date: Mon, 21 Sep 2015 16:24:32 +0200 Message-ID: <1442845472.2691.88.camel@citrix.com> References: <55FFD3CD.3030004@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9154118089831646310==" 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" , George Dunlap , George Dunlap Cc: Andrew Cooper , "Tian, Kevin" , Keir Fraser , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============9154118089831646310== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-N0I9jW5VdFDTPnSpwPFl" --=-N0I9jW5VdFDTPnSpwPFl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2015-09-21 at 12:22 +0000, Wu, Feng wrote: >=20 > > -----Original Message----- > > From: George Dunlap [mailto:george.dunlap@citrix.com] > > You also need to check that local_events_need_delivery() will > > return > > "true" if you get an interrupt between that time and entering the > > hypervisor. Will that happen automatically from > > hvm_local_events_need_delivery() -> hvm_vcpu_has_pending_irq() -> > > vlapic_has_pending_irq()? Or will you need to add a hook in > > hvm_vcpu_has_pending_irq()? >=20 > I think I don't need to add hook in hvm_vcpu_has_pending_irq(), what > I need > to do in vcpu_block() and do_poll() is as below: >=20 > 1. set_bit(_VPF_blocked, &v->pause_flags); >=20 > 2. ret =3D v->arch.arch_block(), in this hook, we can re-use the same > logic in > vmx_pre_ctx_switch_pi(), and check whether ON bit is set during > updating > posted-interrupt descriptor, can return 1 when ON is set > It think it would be ok for an hook to return a value (maybe, if doing that, let's pick variable names and use comments to explain what goes on as good as we can). I think I also see why you seem to prefer doing it that way, rather than hacking local_events_need_delivery(), but can you please elaborate on that? (My feeling is that you want to avoid having to update the data structures in between _VPF_blocked and the check local_events_need_delivery(), and then having to roll such update back if local_events_need_delivery() ends up being false, is that the case?). Code would look better, IMO, if we manage to fold that somehow inside local_events_need_delivery(), but that: 1. is hard to tell without actually seeing how the code will end up=20 being 2. might be my opinion only, so let's see what others think. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-N0I9jW5VdFDTPnSpwPFl 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 iEYEABECAAYFAlYAEyAACgkQk4XaBE3IOsTdKACeIbleSjtdc5txCjLH09lpMaKP b7AAnj1Cv/bCpSoWMCbktA0wi84Vgb6H =YIBU -----END PGP SIGNATURE----- --=-N0I9jW5VdFDTPnSpwPFl-- --===============9154118089831646310== 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 --===============9154118089831646310==--