Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2008 21:55:39 +0100
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        Stanislav Sedov <stas@FreeBSD.org>
Cc:        kib@FreeBSD.org, current@FreeBSD.org
Subject:   Re: cpuctl(formely devcpu) patch test request
Message-ID:  <20080605204823.GA7361@epsilon.local>
In-Reply-To: <20080605231705.db589d89.stas@FreeBSD.org>
References:  <20080605231705.db589d89.stas@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 05, 2008 at 11:17:05PM +0400, Stanislav Sedov wrote:
> Hi, FreeBSD hackers!
> 
> Due to increasing requests to have a special device
> to provide MSR reading/writing abilities in the base
> system, it was decided to integrate sysutils/devcpu module
> into the kernel. Given the fact there were no new bugs
> found in devcpu for a long time (though I fixed several
> while preparing patches;-)) this should not brake our
> kernel entirely.
> 
> Basically, the patch[1] implements a new pseudo-device
> cpuctl which provides interface to read/write machine-
> specific registers, retrieve CPUID data and update
> processor firmware (on P6+ and K8 cpus). All of this
> operations are performed via simple ioctl interface.
> Currently, only amd64 and i386 cpus are supported.
> 
> I'd like to ask all interested parties to review
> the patch mentioned[1]. kib@ was kind enough
> to review the work on early stages (thanks a lot!)
> but there might be bugs that was not noticed yet.
> Or you might have some points about the interface
> and implementation - tell it now, before the code
> hits the tree.
> 
> I plan to update the microcode update utility to
> use the new interface when it will be committed.
> devcpu module will be shipped for older FreeBSD
> versions.
> 
> Thanks!
> 
> [1] http://www.SpringDaemons.com/stas/cpuctl.diff

Thanks, it's good.

A couple comments:
1) Do you plan to MFC this ? For what older versions of FreeBSD will devcpu be
shipped?

2) in cpuctl_modevent(): perhaps it's better to return ENOMEM instead of
ENOSYS if malloc() fails and ENXIO instead of ENOSYS if MSR functionality is
not present

3) I don't mean to impose, but this code needs some small style cleanup,
   namely: characters above the 80 column, second level indents are four
   spaces"

And that's it.

Thanks,
-- 
Rui Paulo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080605204823.GA7361>