WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Xen-aware kernel module
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received: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; bh=Sl0a8behKlIcmi/hhPRRWKukMPAaPIlxHfeZyKpRE3c=; b=BgWncqhFhbS7mkQT8PzaqQQunBF/iYhbnDMCRL46G0ylf2XFFLyDM+nTwp55YrN1gdKr1QN1GdTsb+K6Tbrhjrs+vTT4CzoWEg5EZZslWz6rW33mXeFPrFjb+fqL15dmYxaXNayoNejKI0YiT/kT03Of3BUTzNv+dLd3BV3PO6Q=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C36994A5.1076F%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <5fa100fd0711201630y668d0846ufd5a6de2e065a17e@xxxxxxxxxxxxxx> <C36994A5.1076F%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>