From owner-freebsd-hackers@FreeBSD.ORG Sat May 17 17:26:11 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 3F7C7106566C for ; Sat, 17 May 2008 17:26:11 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id BEBCB8FC15 for ; Sat, 17 May 2008 17:26:10 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so592850nfh.33 for ; Sat, 17 May 2008 10:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=wAoZGNr2zL8JGNb7j6PdHkVKYx98BSeWUNsFut68hgc=; b=v8/UA6iJ3d8i2X9jOI+aAvk+WPGxMtVcw9x0l6s0Sfm/OWh/bkuUXI2NUOt+JBrwhPiyh9FQJyFuRXdkB9U/eYeK3WpWXfAs4P7JhBUvz4jOylQzVslf1qvZPJxTMU697KzqwaKrfdGudx62xzaMFE/xIERx8ZkcKP3yrneXhX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=gL4d/zNgT0beALKHs7dPJ8VtrrDL83OPVrDH0SVdQTAKG6nD6qff/3pKA3DVOImuj+2ehdKByBDjtxXHskwwupKjVPJMdCxAOG7Z48gw+3WuwlsiAmtDwhqTsvUw02e+CE0JA70pz6fOzXre/S0e2zWPjRuVUowdx2tfPVFv+34= Received: by 10.210.45.17 with SMTP id s17mr5043617ebs.9.1211045169544; Sat, 17 May 2008 10:26:09 -0700 (PDT) Received: from epsilon.local ( [89.214.240.107]) by mx.google.com with ESMTPS id 2sm8332286nfv.5.2008.05.17.10.26.04 (version=SSLv3 cipher=RC4-MD5); Sat, 17 May 2008 10:26:05 -0700 (PDT) Message-ID: <482F1529.5080409@FreeBSD.org> Date: Sat, 17 May 2008 18:26:01 +0100 From: Rui Paulo User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Andriy Gapon References: <482E93C0.4070802@icyb.net.ua> <482EFBA0.30107@FreeBSD.org> <482F1191.70709@icyb.net.ua> In-Reply-To: <482F1191.70709@icyb.net.ua> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: Rui Paulo 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:26:11 -0000 Andriy Gapon wrote: > 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? They are, but, IMHO, we should no longer continue to create this type of interfaces. Regards, -- Rui Paulo