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

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


  • To: "Steven Y. Ko" <sko@xxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
  • Date: Wed, 21 Nov 2007 15:57:20 +1100
  • Delivery-date: Tue, 20 Nov 2007 20:58:06 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acgr1fJ3k6xnQWVURDShppUkdFfvxwAJJCYg
  • Thread-topic: [Xen-devel] Xen-aware kernel module

> 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.

There may or may not be a CPU instruction to tell you what RING you are
running in.

As for telling if you are running under Xen, have a look at
/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c in the
function init_hypercall_stubs. The first thing it does is execute a
CPUID instruction. If Xen is running, a signature will be encoded into
EBX, ECX, and EDX. You might be able to make use of that?

James

_______________________________________________
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®.