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 ...
Stanislav Sedov
stas at FreeBSD.org
Fri Aug 8 19:17:44 UTC 2008
On Fri, 8 Aug 2008 21:51:33 +0300
Kostik Belousov <kostikbel at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20080808/a26b2d17/attachment.pgp
More information about the cvs-src
mailing list