From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC PATCH] xen/arm: try to get stack in any case Date: Fri, 17 Oct 2014 16:46:44 +0100 Message-ID: <544139E4.9040409@linaro.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio , Ian Campbell , Tim Deegan , Stefano Stabellini Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi Frediano, On 10/17/2014 04:22 PM, Frediano Ziglio wrote: > 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. I guess you see "Failed to convert stack to physical address"? > 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? The function get_page is used in many different place to get a reference to the page and check if the page belongs to the domain. This patch would lead to a security issue on most of the hypercalls that deal with memory. The proper solution would be to switch temporally on the p2m of the v we want to dump (see an example with flush_tlb_domain()); Regards, -- Julien Grall