From owner-freebsd-current@FreeBSD.ORG Thu Jun 5 21:21:36 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 DA09B106567C for ; Thu, 5 Jun 2008 21:21:36 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id 03C188FC19 for ; Thu, 5 Jun 2008 21:21:35 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ug-out-1314.google.com with SMTP id q2so648827uge.37 for ; Thu, 05 Jun 2008 14:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender; bh=ZyzQq2rhh8NJkdHOhNB2Agc6SzVKiM7nyR/tj/Akly4=; b=r3ev1Lo/P/ZtQZC8wtZAJvGhZ8NXI4v68GDsjlj33jjMmcpaKoXFNzTzm4wzBwOdqJ LpraWQaHXYwcQxgXOtT7+kFhtubcDnTrT7Tf1huAZvfcrHMxO+JfbTXhmEONpXLBkS4o /7IV7UZVfkfbtK84KY6DecS7aFXTtyDzSPPf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent:sender; b=paM7Tz9w0B8UxubtO6ADUD8ACF4y9Nn3hTbBZqxYE801Ku3pYDhmY+lewL2RwxJKD6 XDW6aCytczT6y+8MNxpd/RXNr4IjWQcTLaj4VM6FPK6uE42euPmemcT/BvSpIOC1Vf53 9itkamIdwMKEvZNgrKZa/TZLfC6NRft/8UZ74= Received: by 10.210.59.3 with SMTP id h3mr1411744eba.65.1212699351005; Thu, 05 Jun 2008 13:55:51 -0700 (PDT) Received: from epsilon.local ( [89.214.229.70]) by mx.google.com with ESMTPS id c25sm2285395ika.11.2008.06.05.13.55.47 (version=SSLv3 cipher=RC4-MD5); Thu, 05 Jun 2008 13:55:49 -0700 (PDT) Date: Thu, 5 Jun 2008 21:55:39 +0100 From: Rui Paulo To: Stanislav Sedov Message-ID: <20080605204823.GA7361@epsilon.local> References: <20080605231705.db589d89.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080605231705.db589d89.stas@FreeBSD.org> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: Rui Paulo Cc: kib@FreeBSD.org, 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 21:21:36 -0000 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