From owner-freebsd-hackers@FreeBSD.ORG Sat May 17 16:05:26 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 712741065672 for ; Sat, 17 May 2008 16:05:26 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id ECD388FC1D for ; Sat, 17 May 2008 16:05:25 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1382484fgb.35 for ; Sat, 17 May 2008 09:05:24 -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=MdTouOI2vdupALD+kwPYXv2+QeHN50T/DRR+kgu0VDU=; b=n4ZZS93EDKwB/PG60rUgEhmrLe3tSNQ26DnmJh+eevLQwnFM3jv3mKbyptKy0CDse3amLpTxUqWIuCPJOqfedqNuVYF3c9y1VqcSCnZGcDNAP07UgNrvWyn+0MX1TKSwsZOeHUwW8RpvqfeMWjMys+YP06jS204s4H8OksMfPxg= 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=At2mtHlTlPXv/sgCbB/ny3rV7pY2UvwSXrZXFsMjkgrl7b9QS+havMlLweXSZACa7jYlaxfug6CKmkqtnuawF6xD+Ti17J1sP0e130eVwJtvbRkqafR3o9odMxY7DJ3Qkzzm3GKP1ZM0zG/DY+JCr8m/gFOw71dJLPhauLgidGs= Received: by 10.210.113.16 with SMTP id l16mr4867906ebc.195.1211038630152; Sat, 17 May 2008 08:37:10 -0700 (PDT) Received: from epsilon.local ( [89.214.240.107]) by mx.google.com with ESMTPS id g17sm7461515nfd.3.2008.05.17.08.37.07 (version=SSLv3 cipher=RC4-MD5); Sat, 17 May 2008 08:37:08 -0700 (PDT) Message-ID: <482EFBA0.30107@FreeBSD.org> Date: Sat, 17 May 2008 16:37:04 +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> In-Reply-To: <482E93C0.4070802@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 16:05:26 -0000 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. Regards, -- Rui Paulo