Date: Fri, 8 Aug 2008 23:21:07 +0400 From: Stanislav Sedov <stas@FreeBSD.org> To: Kostik Belousov <kostikbel@gmail.com> Cc: Stanislav Sedov <stas@freebsd.org>, cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, John Baldwin <jhb@freebsd.org> Subject: Re: cvs commit: src/share/man/man4 Makefile cpuctl.4 src/sys/amd64/amd64 support.S src/sys/amd64/conf NOTES src/sys/amd64/include cpufunc.h specialreg.h src/sys/conf files.amd64 files.i386 src/sys/dev/cpuctl cpuctl.c ... Message-ID: <20080808232107.8889c5b2.stas@FreeBSD.org> In-Reply-To: <20080808185133.GG97161@deviant.kiev.zoral.com.ua> References: <200808081631.m78GVG9i088754@repoman.freebsd.org> <200808081251.17686.jhb@freebsd.org> <20080808181052.GF97161@deviant.kiev.zoral.com.ua> <200808081427.42536.jhb@freebsd.org> <20080808185133.GG97161@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Fri, 8 Aug 2008 21:51:33 +0300
Kostik Belousov <kostikbel@gmail.com> mentioned:
> >
> > You can achieve that now with cpuset. :) (See my ping-pong test program
> > recently which used cpuid to fetch the APIC ID to test for ping-ponging in
> > the scheduler.)
>
> If this is a backout request (for cpuid functionality) then we will do it.
>
> But I considered it much easier and cleaner to do
> fd = open("/dev/cpuctlN", O_RDWR);
> ioctl(fd, CPUCTL_CPUID, &x);
> if (x.y)
> ioctl(fd, CPUCTL_WRMSR, ...);
> close(fd);
> then
> fd = open("/dev/cpuctlN", O_RDWR);
> cpuset(...); /* bind to cpu */
> __asm__("cpuid" : =0 (x));
> if (x.y)
> ioctl(fd, CPUCTL_WRMSR, ...);
> cpuset(...); /* restore prev mask */
> close(fd);
>
One of the reasons to leave the cpuid functionality, present in
sysutils/devcpu, in cpuctl(4) was the fact, the software that
is supposed to use wrmsr/rdmsr calls, also usually perform
cpuid checks as well, and it will be clean to provide access to
all of this via a single interface.
--
Stanislav Sedov
ST4096-RIPE
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
iEYEARECAAYFAkicnK4ACgkQK/VZk+smlYHYhwCfahQiwNyKyDAXQe76sT15luwT
rWwAn0tY/oQ6KCOIq4/8g/Ke4hmajAkI
=jTxn
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080808232107.8889c5b2.stas>
