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

[Xen-devel] Show HVM guest stack

  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Abhinav Srivastava <abhinavs_iitkgp@xxxxxxxxxxx>
  • Date: Tue, 7 Oct 2008 03:32:04 +0530 (IST)
  • Delivery-date: Mon, 06 Oct 2008 15:02:30 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=agJ04UvnCqRj5w0/k+1oW1StrGOWX5nAU2EE2chBXgY4NiFqSSOChZX/APtamwE8x8A205nKKAF/TDYOeBm45ew6V4PK/6XXp+IB4HUu8TII4ovv5gqhELk8QeL1IJyf2j03ir3DDay18QEbfCszM3q9m3rr405dlVWNKa+Gb24=;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi there,

I am using Xen-3.2-testing (non-PAE and x86-32) on Intel's Core 2
Quad processor. My HVM domain is Fedora i386 with Linux kernel 2.6.16 
(with 8K of stack and CONFIG_FRAME_POINTER = y).

In my project, I am trying to perform stack walk on the HVM guest's
kernel stack from the Xen hypervisor. In order to do that, whenever
a VMEXIT happens, I get the ebp value from cpu_user_regs and try
to use this address as a starting point for the walk. I add 4 bytes
in this address (for return address ) and try to get the value at
this location using Xen's function hvm_copy_from_guest_virt(), which
reads 4 bytes of return address. I, then, do this process recursively
by reading the value at the location pointed by the ebp to get the 
previous frame and so on.

During the recursive process, sometimes when I try to get the
return address or next frame address, hvm_copy_from_guest_virt() function
crashes as it is not able to read that memory.

I saw a function named "show_guest_stack" in xen/arch/x86/traps.c,
which does the stack walk incase of PV domain. And, returns if
it finds HVM domain. Is there any function available for doing
stack walk in HVM domain?

If not, could you please let me know whether my stack walk 
procedure is correct or not? Or, do I need to do something different 
incase of an HVM domain? I tried using different methods of putting 
exit condition in my stack walk code such as frame-pointer = 0, 
return address = 0, Stack walk depth = 24, decreasing frame pointer and
ebp should be less than guest's current thread_info + 8912.

As of now, I am clueless as how to do this. Any help would be highly 


      Add more friends to your messenger and enjoy! Go to 

Xen-devel mailing list



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