From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3 2/6] xen: add hypercall option to override and restore vcpu affinity Date: Tue, 8 Mar 2016 12:45:20 +0100 Message-ID: <1457437520.3102.172.camel@citrix.com> References: <1457023730-10997-1-git-send-email-jgross@suse.com> <1457023730-10997-3-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6841410135662250103==" Return-path: In-Reply-To: <1457023730-10997-3-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Juergen Gross , xen-devel@lists.xen.org Cc: Wei Liu , Stefano Stabellini , George Dunlap , Andrew Cooper , Ian Jackson , David Vrabel , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============6841410135662250103== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-mW7Wt0M+yFniP2SnS57F" --=-mW7Wt0M+yFniP2SnS57F Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-03-03 at 17:48 +0100, Juergen Gross wrote: > Some hardware (e.g. Dell studio 1555 laptops) require SMIs to be > called on physical cpu 0 only. Linux drivers like dcdbas or i8k try > to achieve this by pinning the running thread to cpu 0, but in Dom0 > this is not enough: the vcpu must be pinned to physical cpu 0 via > Xen, too. >=20 > Add a stable hypercall option SCHEDOP_pin_override to the sched_op > hypercall to achieve this. It is taking a physical cpu number as > parameter. If pinning is possible (the calling domain has the > privilege to make the call and the cpu is available in the domain's > cpupool) the calling vcpu is pinned to the specified cpu. > I would have added the "and the cpu is available in the domain's cpupool" part in the comment in public headers too, such as: > --- a/xen/include/public/sched.h > +++ b/xen/include/public/sched.h > @@ -118,6 +118,17 @@ > =C2=A0 * With id !=3D 0 and timeout !=3D 0, poke watchdog timer and set n= ew > timeout. > =C2=A0 */ > =C2=A0#define SCHEDOP_watchdog=C2=A0=C2=A0=C2=A0=C2=A06 > + > +/* > + * Override the current vcpu affinity by pinning it to one physical > cpu or undo > + * this override restoring the previous affinity. > + * @arg =3D=3D pointer to sched_pin_override_t structure. > + * > + * A negative pcpu value will undo a previous pin override and > restore the > + * previous cpu affinity. > + * This call is allowed for the hardware domain only. ", and succeeds only if the specified cpu is available in the domain's cpupool." > + */ > +#define SCHEDOP_pin_override 7 > =C2=A0/* ` } */ > =C2=A0 > =C2=A0struct sched_shutdown { > In any case, the scheduling part is: Acked-by: Dario Faggioli Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-mW7Wt0M+yFniP2SnS57F 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 v2 iEYEABECAAYFAlbeu1AACgkQk4XaBE3IOsSg7wCgi4WwnR1e8ENmmuWIDrk1ejLC Du8AoK7ebXAD9MwdCYxSGuTUf9tGDewt =LlPW -----END PGP SIGNATURE----- --=-mW7Wt0M+yFniP2SnS57F-- --===============6841410135662250103== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============6841410135662250103==--