[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.4] xen/arm: dump guest stack even if not the current VCPU
commit 7bb6b2722be1e27f99948e5c68f7f42eb23f8e53 Author: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx> AuthorDate: Thu Oct 23 17:18:52 2014 +0100 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Wed Dec 10 14:09:35 2014 +0000 xen/arm: dump guest stack even if not the current VCPU If show_guest_stack was called from Xen context (for instance hitting '0' key on Xen console) get_page_from_gva was not able to get the page returning NULL. Detecting different domain and changing VTTBR register make get_page_from_gva works for different domains. Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> (cherry picked from commit 281c892e3bdb0a56cfd8ab6516cd1a33c095c857) --- xen/arch/arm/p2m.c | 24 ++++++++++++++++++++---- xen/arch/arm/traps.c | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index bc81b67..aff7a2c 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -688,13 +688,29 @@ struct page_info *get_page_from_gva(struct domain *d, vaddr_t va, { struct p2m_domain *p2m = &d->arch.p2m; struct page_info *page = NULL; - paddr_t maddr; - - ASSERT(d == current->domain); + paddr_t maddr = 0; + int rc; spin_lock(&p2m->lock); - if ( gvirt_to_maddr(va, &maddr, flags) ) + if ( unlikely(d != current->domain) ) + { + unsigned long irq_flags; + + local_irq_save(irq_flags); + p2m_load_VTTBR(d); + + rc = gvirt_to_maddr(va, &maddr, flags); + + p2m_load_VTTBR(current->domain); + local_irq_restore(irq_flags); + } + else + { + rc = gvirt_to_maddr(va, &maddr, flags); + } + + if ( rc ) goto err; if ( !mfn_valid(maddr >> PAGE_SHIFT) ) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 4c910c8..d527409 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -888,7 +888,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs) return; } - page = get_page_from_gva(current->domain, sp, GV2M_READ); + page = get_page_from_gva(v->domain, sp, GV2M_READ); if ( page == NULL ) { printk("Failed to convert stack to physical address\n"); -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.4 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |