cpuctl(formely devcpu) patch test request
peterjeremy at optushome.com.au
Thu Jun 5 23:14:17 UTC 2008
On 2008-Jun-06 02:09:27 +0400, Stanislav Sedov <stas at freebsd.org> wrote:
>> 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
>I fully agree on ENOMEM (thanks for noticing that), while I think that
>returning ENOSYS for MSR-less systems is more correct, as it states that
>required functionality isn't implemented for this hardware.
ENOSYS generally means "system call not implemented". You need a response
implying that the requested operation isn't supported on the hardware.
IMHO, ENODEV comes closest to that.
I also agree with phk@ that serious thought needs to be given to the
foot-shooting capability offered by this patch before it is implemented.
Maybe add a sysctl to enable the write (at least) functionality - eg
hw.cpuctl.wrmsr_enable and hw.cpuctl.update_enable (both defaulting to
disabled). This at least adds a safety catch. I'm not sure if RDMSR
is dangerous - if so, possibly there should be an enable for it as well.
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20080605/3c0ae9d8/attachment.pgp
More information about the freebsd-current