All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] xen/arm: try to get stack in any case
@ 2014-10-17 15:22 Frediano Ziglio
  2014-10-17 15:46 ` Julien Grall
  0 siblings, 1 reply; 4+ messages in thread
From: Frediano Ziglio @ 2014-10-17 15:22 UTC (permalink / raw)
  To: Ian Campbell, Tim Deegan, Stefano Stabellini, Julien Grall; +Cc: xen-devel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-20  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 15:22 [RFC PATCH] xen/arm: try to get stack in any case Frediano Ziglio
2014-10-17 15:46 ` Julien Grall
2014-10-20  8:30   ` Ian Campbell
2014-10-20  8:34     ` Frediano Ziglio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.