From owner-freebsd-hackers@FreeBSD.ORG Sat May 17 17:10:48 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECBCF106564A for ; Sat, 17 May 2008 17:10:48 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id A5AE28FC16 for ; Sat, 17 May 2008 17:10:48 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1JxPvi-000P6h-Ss; Sat, 17 May 2008 20:10:46 +0300 Message-ID: <482F1191.70709@icyb.net.ua> Date: Sat, 17 May 2008 20:10:41 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: Rui Paulo References: <482E93C0.4070802@icyb.net.ua> <482EFBA0.30107@FreeBSD.org> In-Reply-To: <482EFBA0.30107@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: Re: rdmsr from userspace X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2008 17:10:49 -0000 on 17/05/2008 18:37 Rui Paulo said the following: > Andriy Gapon wrote: >> >> It seems that rdmsr instruction can be executed only at the highest >> privilege level and thus is not permitted from userland. Maybe we >> should provide something like Linux /dev/cpu/msr? >> I don't like interface of that device, I think that ioctl approach >> would be preferable in this case. >> Something like create /dev/cpuN and allow some ioctls on it: >> ioctl(cpu_fd, CPU_RDMSR, arg). >> What do you think? >> > > While I think this (devcpu) is good for testing and development, I > prefer having a device driver to handle that specific MSR than a generic > /dev/cpuN where you can issue MSRs. > Both for security and reliability reasons. What about /dev/pci, /dev/io? Aren't they a precedent? -- Andriy Gapon