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

[Xen-devel] [RFC PATCH] xen/arm: try to get stack in any case



Well,
  this is more an experiment than a patch but in my case was really
useful. Basically I was trying to get dom0 raw stack hitting '0' key
on Xen console. The problem is that when you hit such key you are Xen
domain, not domain 0 (code is called from Xen console). While Xen is
handling '0' command (dump dom0 state) show_guest_stack (in
xen/arch/arm/traps.c) try to get page from stack pointer failing as is
not current domain. In my case I had only domain0 so EL1 TTBR0/TTBR1
was domain0 and this patch work but obviously this can lead on real
cases to dump pages not from the wanted domain.

Possible solution is to get manually TTBR0/TTBR1 from the proper
domain and manually parse page tables. Now some question
- did somebody else have same issue?
- is there any helper function to get the proper page?

Regards,
   Frediano


---
 xen/arch/arm/mm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 46b6d98..c76c811 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1195,11 +1195,10 @@ int get_page(struct page_info *page, struct
domain *domain)
 {
     struct domain *owner = page_get_owner_and_reference(page);

-    if ( likely(owner == domain) )
+    if ( likely(owner == domain) || owner != NULL )
         return 1;

-    if ( owner != NULL )
-        put_page(page);
+    put_page(page);

     return 0;
 }
-- 
1.9.1

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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