From owner-freebsd-current@FreeBSD.ORG Thu Jun 5 23:14:16 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E69E51065672 for ; Thu, 5 Jun 2008 23:14:16 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.freebsd.org (Postfix) with ESMTP id 706488FC23 for ; Thu, 5 Jun 2008 23:14:16 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-215-175.belrs3.nsw.optusnet.com.au [122.106.215.175]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m55NED1c001135 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Jun 2008 09:14:14 +1000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.2) with ESMTP id m55NEDWN067979; Fri, 6 Jun 2008 09:14:13 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m55NEDj5067978; Fri, 6 Jun 2008 09:14:13 +1000 (EST) (envelope-from peter) Date: Fri, 6 Jun 2008 09:14:13 +1000 From: Peter Jeremy To: Stanislav Sedov Message-ID: <20080605231413.GU67629@server.vk2pj.dyndns.org> References: <20080605231705.db589d89.stas@FreeBSD.org> <20080605204823.GA7361@epsilon.local> <20080606020927.8d6675e1.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20080606020927.8d6675e1.stas@FreeBSD.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: kib@freebsd.org, Rui Paulo , current@freebsd.org Subject: Re: cpuctl(formely devcpu) patch test request X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2008 23:14:17 -0000 --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 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--