All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii.anisov@globallogic.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: Chen Baozi <baozich@gmail.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Domain 0 crashed when booting OMAP5 uEVM
Date: Mon, 12 Aug 2013 17:54:35 +0300	[thread overview]
Message-ID: <CAGQvs6g5PQQvCYpNbYkHBeOq4VHi31HoxnCkjPks+iPJbL431w@mail.gmail.com> (raw)
In-Reply-To: <5208D969.6090708@linaro.org>


[-- Attachment #1.1: Type: text/plain, Size: 3326 bytes --]

> > (XEN)     size=2 sign=0 write=0 reg=0
> > (XEN)     eat=0 cm=0 s1ptw=0 dfsc=7
> > (XEN) dom0 IPA 0x000000004ae06704
> > (XEN) P2M @ 02fdbf80 mfn:0xfedfc
> > (XEN) 1ST[0x1] = 0x00000000fedfe6ff
> > (XEN) 2ND[0x57] = 0x00000000ac9796ff
> > (XEN) 3RD[0x6] = 0x0000000000000000
> > (XEN) ----[ Xen-4.4-unstable  arm32  debug=y  Not tainted ]----
> > (XEN) CPU:    0
> > (XEN) PC:     c0033410
>
> To help you, you can use "addr2line -e vmlinux address" to find the
> faulty line in linux. Where address is your pc.
>
>
long time ago, when we faced similar problems, we did a debug patch:

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index f3f88d4..76ec21c 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -862,6 +862,27 @@ done:
     if (first) unmap_domain_page(first);
 }

+#ifdef DEBUG_DOMAIN
+static uint32_t exec_vector_base(void) {
+ if (READ_SYSREG(SCTLR_EL1) & SCTLR_V)
+ return EXC_BASE_ADDR_HI;
+ else if (READ_SYSREG32(ID_PFR1_EL1) & PFR1_SE_MASK)
+ return READ_SYSREG(VBAR_EL1);
+ else
+ return EXC_BASE_ADDR_LO;
+}
+
+static void domain_data_abort(struct cpu_user_regs *regs) {
+ printk("Data abort invokation on the domain side...\n");
+ regs->spsr_abt = regs->cpsr;
+ regs->lr_abt = regs->pc + 8;
+ WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_VA, HCR_EL2);
+ regs->cpsr &= ~(PSR_JAZELLE | PSR_IT_MASK | PSR_MODE_MASK);
+ regs->cpsr |= PSR_MODE_ABT | PSR_IRQ_MASK | PSR_ABT_MASK;
+ regs->pc = exec_vector_base() + DATA_ABORT_OFFSET;
+}
+#endif
+
 static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
                                      struct hsr_dabt dabt)
 {
@@ -917,7 +938,11 @@ bad_data_abort:
     else
         dump_guest_s1_walk(current->domain, info.gva);
     show_execution_state(regs);
+#ifndef DEBUG_DOMAIN
     domain_crash_synchronous();
+#else
+    domain_data_abort(regs);
+#endif
 }

 asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
diff --git a/xen/include/asm-arm/arm32/processor.h
b/xen/include/asm-arm/arm32/processor.h
index a782d96..4de8431 100644
--- a/xen/include/asm-arm/arm32/processor.h
+++ b/xen/include/asm-arm/arm32/processor.h
@@ -107,6 +107,11 @@ struct cpu_user_regs
 #define READ_SYSREG(R...)       READ_SYSREG32(R)
 #define WRITE_SYSREG(V, R...)   WRITE_SYSREG32(V, R)

+#define EXC_BASE_ADDR_HI        0xffff0000
+#define EXC_BASE_ADDR_LO        0x00000000
+
+#define DATA_ABORT_OFFSET       0x10
+
 #endif /* __ASSEMBLY__ */

 #endif /* __ASM_ARM_ARM32_PROCESSOR_H */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 3333399..a07a33c 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -228,6 +228,10 @@ typedef uint64_t xen_callback_t;
 #define PSR_BIG_ENDIAN  (1<<9)        /* Big Endian Mode */
 #define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */

+/* If-Then execution state bits mask for the Thumb IT (If-Then)
instruction */
+#define PSR_IT_MASK     (0x3F<<10 | 0x3<<25)
+#define PFR1_SE_MASK    (0xF<<4)      /* PFR1 Security Extensions bits
mask */
+
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */

 /*
-- 
1.7.9.5

The idea was to invoke data abort on domain side, to see call stack. This
patch applied to the code we forked near the March this year, I don't know
if it would fit current code. It worked for Dom0 only.

*Sincerely,*
*Andrii Anisov.*

[-- Attachment #1.2: Type: text/html, Size: 7055 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  parent reply	other threads:[~2013-08-12 14:54 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 12:24 Domain 0 crashed when booting OMAP5 uEVM Chen Baozi
2013-08-12 12:47 ` Julien Grall
2013-08-12 14:15   ` Andrii Anisov
2013-08-12 14:30   ` Andrii Anisov
2013-08-12 15:08     ` Julien Grall
2013-08-12 15:32       ` Andrii Anisov
2013-08-12 15:40         ` Andrii Anisov
2013-08-13  2:40           ` Chen Baozi
2013-08-13  7:56     ` Chen Baozi
2013-08-13  8:45       ` Chen Baozi
2013-08-13  9:55         ` Julien Grall
2013-08-12 14:54   ` Andrii Anisov [this message]
2013-08-13  9:10   ` Chen Baozi
2013-08-13  9:36     ` Andrii Anisov
2013-08-13  9:40       ` Chen Baozi
2013-08-13  9:58       ` Julien Grall
2013-08-14  9:46         ` Chen Baozi
2013-08-14  9:55           ` Julien Grall
2013-08-14 12:38             ` Chen Baozi
2013-08-15  9:13               ` Julien Grall
2013-08-15  9:47                 ` Chen Baozi
2013-08-15 10:07                   ` Julien Grall
2013-08-15 10:54                     ` Andrii Anisov
2013-08-15 11:00                       ` Chen Baozi
2013-08-15 11:07                         ` Andrii Anisov
2013-08-15 10:59                     ` Chen Baozi
2013-08-15 12:24                       ` Ian Campbell
2013-08-15 12:43                         ` Julien Grall
2013-08-14 16:07             ` Andrii Anisov
2013-08-14 19:47               ` Julien Grall
2013-08-14  9:53       ` Chen Baozi
2013-08-14 16:03         ` Andrii Anisov
2013-08-15  2:31           ` Chen Baozi
2013-08-15  7:37             ` Chen Baozi
2013-08-15  8:34               ` Andrii Anisov
2013-08-15  8:51                 ` Chen Baozi
2013-08-15  9:12                   ` Andrii Anisov
2013-08-15  9:17                     ` Chen Baozi
2013-08-15  8:45               ` Andrii Anisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGQvs6g5PQQvCYpNbYkHBeOq4VHi31HoxnCkjPks+iPJbL431w@mail.gmail.com \
    --to=andrii.anisov@globallogic.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=baozich@gmail.com \
    --cc=julien.grall@linaro.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.