From owner-freebsd-hackers@FreeBSD.ORG Sun May 18 15:50:36 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 6361B106564A for ; Sun, 18 May 2008 15:50:36 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by mx1.freebsd.org (Postfix) with ESMTP id E07DB8FC23 for ; Sun, 18 May 2008 15:50:35 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ug-out-1314.google.com with SMTP id q2so330942uge.37 for ; Sun, 18 May 2008 08:50:34 -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=K8Gb8EkZzQsezJdNJTXDT5S3pkrU/R29RtEHEh1/Zqk=; b=qaYzaHgNtShDcwr12U+ueUVMITa1QJlkf7pJv7NiYwwqaOGynQADaGCOMqzDqYUaTmsPJoslVItCUtIkO82htWp4uuTLrcKNm+g0+LGG5rsiLN4oNlyb/6ekKgeaWRcVQraL5hd0PEeOj8lFJhGt1PMs9iuVUHsKgtKqzFv7f8s= 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=gKaeFs7kr0P36Prge8US4I71IXo2pJP0rsmSwTAcDg8+xt9Mpho+aHSCE8WPSVFfaiMeV6Juk1ZY3cEVW6gjN6oACvf02r3qVGyUxMfIq3vpitg9u5W0m2sBSeNyRdFTvBFf6t/HHH9iix0yIanYaBbJwVGocB52Mr4plWuvm/w= Received: by 10.67.106.13 with SMTP id i13mr2607378ugm.49.1211125833988; Sun, 18 May 2008 08:50:33 -0700 (PDT) Received: from epsilon.local ( [89.214.185.160]) by mx.google.com with ESMTPS id j8sm12727142gvb.1.2008.05.18.08.50.31 (version=SSLv3 cipher=RC4-MD5); Sun, 18 May 2008 08:50:32 -0700 (PDT) Message-ID: <48305044.7000007@FreeBSD.org> Date: Sun, 18 May 2008 16:50:28 +0100 From: Rui Paulo User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Mike Meyer References: <482E93C0.4070802@icyb.net.ua> <20080517133037.3a3935db@bhuda.mired.org> In-Reply-To: <20080517133037.3a3935db@bhuda.mired.org> Content-Type: text/plain; charset=ISO-8859-1; 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: Sun, 18 May 2008 15:50:36 -0000 Mike Meyer wrote: > On Sat, 17 May 2008 11:13:52 +0300 > 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? > > Ok, this points directly at a question I've been wondering about, but > haven't been able to find an answer in the google. > > I've been mucking about with general access to sysctl's (a sysctl > plugin for gkrellm, and a python module for accessing sysctls), and > with that hammer in my hand, the nail for this problem is obviously a > dev.cpu.#.msr sysctl. How can you request a rdmsr within the sysctl tree? I don't think sysctl is appropriate here either. -- Rui Paulo