Date: Fri, 6 Jun 2008 09:14:13 +1000 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Stanislav Sedov <stas@freebsd.org> Cc: kib@freebsd.org, Rui Paulo <rpaulo@freebsd.org>, current@freebsd.org Subject: Re: cpuctl(formely devcpu) patch test request Message-ID: <20080605231413.GU67629@server.vk2pj.dyndns.org> In-Reply-To: <20080606020927.8d6675e1.stas@FreeBSD.org> References: <20080605231705.db589d89.stas@FreeBSD.org> <20080605204823.GA7361@epsilon.local> <20080606020927.8d6675e1.stas@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2008-Jun-06 02:09:27 +0400, Stanislav Sedov <stas@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 functionalit= y 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. --=20 Peter Jeremy 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. --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkhIc0UACgkQ/opHv/APuIceeQCgwcV94j7QgsWAZMDIoSvhAlhp YCMAn0xlCp3Xfg/r5OT6fbGz1KI+8bSs =aCuP -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080605231413.GU67629>