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: Tue, 22 Sep 2015 16:38:39 +0200 Message-ID: <1442932719.2691.109.camel@citrix.com> References: <55FFCB67.3050900@citrix.com> <1442842304.2691.67.camel@citrix.com> <1442844706.2691.79.camel@citrix.com> <560130BD.6090700@citrix.com> <56013185.4070200@citrix.com> <1442929201.2691.97.camel@citrix.com> <5601628B.2090209@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1052047653975099464==" Return-path: In-Reply-To: <5601628B.2090209@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap , "Wu, Feng" Cc: "Tian, Kevin" , Keir Fraser , George Dunlap , Andrew Cooper , "xen-devel@lists.xen.org" , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============1052047653975099464== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-GUnwcrUpzOkiOa1yGFd+" --=-GUnwcrUpzOkiOa1yGFd+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-09-22 at 15:15 +0100, George Dunlap wrote: > On 09/22/2015 02:52 PM, Wu, Feng wrote: > >=20 > >=20 > > > -----Original Message----- > > > From: Dario Faggioli [mailto:dario.faggioli@citrix.com] > > > Yes, the idle to vCPUB switch is covered by __context_switch(), > > > but > > it cannot change the PI state of vCPUA at that point. Like > > mentioned > > above, in this case, spurious PI interrupts happens. >=20 > On the contrary, when __context_switch() is called for the idle -> > vcpuB > transition in the above scenario, it is *actually* context switching > from vcpuA to vcpuB, since vcpuA is still actually on the cpu. =20 > Which > means that if you add PI code into arch->ctxt_switch_from(), the case > you describe above will be handled automatically. >=20 Yep, that's exactly what I was also writing... luckily, I've seen George's email before getting too far with that! :-P That's the point of lazy context switch. The context of vCPUA is still on pCPUA during the time idle executes. If, at the next transition point, we switch from idle to vCPUA again, then nothing is needed, and we just saved one context saving and one context restoring operation. If it is something else, like in your case, we need to save vCPUA's context, which is actually what we have on pCPUA, despite idle (and not vCPUA itself) was what was running. > So the only downside to doing everything in block(), wake(), and > __context_switch() is that if a VM is offline, or preempted by a > tasklet, and an interrupt comes in, we will get a spurious PI (i.e., > one > which interrupts us but we can't do anything useful about). >=20 Indeed. And that also seems bearable to me. Feng, are there reasons why you think it's not? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-GUnwcrUpzOkiOa1yGFd+ 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 iEYEABECAAYFAlYBZ+8ACgkQk4XaBE3IOsQ7dQCggKmJhpldrNXty5SUhFgBFAuA ySIAn29D/gSWIWxwqP3KRXLGSBxBsngn =Q2fW -----END PGP SIGNATURE----- --=-GUnwcrUpzOkiOa1yGFd+-- --===============1052047653975099464== 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 --===============1052047653975099464==--