[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Xen-aware kernel module


  • To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
  • From: "Steven Y. Ko" <sko@xxxxxxxxxxx>
  • Date: Wed, 21 Nov 2007 16:03:00 -0600
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 21 Nov 2007 14:03:51 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=gCDJXhflqrpW/EevAzN2evyAMdP9T8uat/geTIqyoCyFwSrOHrlD7wk77TEKXF0CSpa37tEwr+MYuDHC6yTE9vCakz/yZ5GgP7c2wkpbNGdZDP71Pfj8Wr0E0ahMRnfiPnOXhR7ov/n/Ni2rXCTOZW0UU/Hc6KI/9qgVyqukou0=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Thank you all for the great tips!

- Steve

On Nov 21, 2007 1:54 AM, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> wrote:
> Since this code will be x86-specific anyway, you can use inline asm:
>
> unsigned long ring;
> asm ( "push %cs; pop %0; and $3,%0" : "=r" (ring) );
>
> Or perhaps just look at the KERNEL_CS macro.
>
>  -- Keir
>
>
> On 21/11/07 00:30, "Steven Y. Ko" <sko@xxxxxxxxxxx> wrote:
>
> > Hello,
> >
> > (I'm not sure if this is an appropriate place to ask this question. I
> > apologize, if it's not)
> >
> > I'm trying to write a kernel module, that's sort of Xen-aware (or
> > virtualisation-aware). I say "sort of", because what I actually need
> > is checking the ring. Specifically, in my kernel module, I want to
> > check which ring the code is running on (ring0, ring1, or even ring
> > 3!), and behave differently. Does Xen provide any interface to do it?
> > or is there any way to do it in a kernel module? Thanks for any help.
> >
> > Regards,
> > Steve
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-devel
>
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.