From: "Steven Y. Ko" Subject: Re: Hypercall privilege check Date: Thu, 28 Jun 2007 20:32:38 -0500 Message-ID: <5fa100fd0706281832x1bb0c898jb5a1651901587ed0@mail.gmail.com> References: <5fa100fd0706281554s4bd36ae1l936e92b8ec8ce280@mail.gmail.com> <200706290007.05501.mark.williamson@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200706290007.05501.mark.williamson@cl.cam.ac.uk> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mark Williamson Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Thanks for the quick answer! But I guess my question was not clear enough, because I was actually asking about Xen and how it enforces hypercalls to be made only from ring 1. I just assumed that Xen checks if int 0x82 is executed with the right privilege. But when I tried to find where Xen actually does it, I couldn't find it. I hope my question is more clear this time :) - Steve On 6/28/07, Mark Williamson wrote: > > I'm wondering where Xen actually checks whether a hypercall is made > > from ring 1 or ring 3. Could anyone point me out to the code? Any > > pointer would be much appreciated. Thanks! > > Hypercalls are made from ring 1. The userspace tools do make hypercalls > sometimes, but they do it by calling a special kernel driver, which then does > the actual hypercall. *actually* what that does is to jump into the > hypercall transfer page at the right location. This page contains the actual > implementation of the hypercall (using this indirection allows future > versions of Xen to supply different implementations of the calls, if > appropriate). > > Take a look at: > drivers/xen/privcmd/privcmd.c in the XenLinux tree. This is used by the dom0 > tools to do control plane operations. > > Also, take a look at: include/asm-i386/mach-xen/asm/hypercall.h which contains > implementations of some other hypercalls. > > HTH, > Cheers, > mark > > -- > Dave: Just a question. What use is a unicyle with no seat? And no pedals! > Mark: To answer a question with a question: What use is a skateboard? > Dave: Skateboards have wheels. > Mark: My wheel has a wheel! >