Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>
Cc: Yao Qi <qiyaoltc@gmail.com>, <gdb@sourceware.org>,
	Will Deacon	<will.deacon@arm.com>
Subject: Re: Random SIGILL / SIGSEGV on ARMv7 while debugging ?
Date: Wed, 11 May 2016 12:21:00 -0000	[thread overview]
Message-ID: <wwokinyklr8u.fsf@ericsson.com> (raw)
In-Reply-To: <564F2B42.9000605@ericsson.com>


Antoine Tremblay writes:

> On 11/20/2015 07:55 AM, Antoine Tremblay wrote:
>> On 11/20/2015 04:11 AM, Yao Qi wrote:
>
>>> You can turn on debugging output, like "set debug infrun 1" and "set
>>> debug remote 1", and you may find some clues from them.
>
> For reference here is a pastebin of a run with gdb debug on and the 
> fault appearing :
>
> http://pastebin.com/nB8gPY2D

After some more investigation, and great help from Will Deacon.

It turns out that theses SIGILL are due to a SoC Hardware bug as
described by Will as such :

So the problem is that A15 has 64-byte I-cache lines and A7 has 32-byte
I-cache lines. That means that if the kernel is doing cache maintenance
on the A15, it will issue an invalidation for each 64 bytes of the region
it wants to invalidate. The A7 will then receive these invalidation
messages, but only invalidate 32 bytes for each one, leaving a bunch of
32-byte holes that didn't get invalidated.

This is an SoC hardware bug. The two cores should report the same line
size (as I mentioned, there's a tie-off on the A15 to make it report
32-byte cachelines)."

The tie-off documentation can be found in the Technical Reference Manual
under "Configuration signals" as IMINLN.

I tested the patch below with an Odroid-UX4 and the problem was fixed.
I have not tested yet with the Firefly RK3288, I'm missing a cable to do
it at the moment...

I will send this to the Odroid team...

diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index ee1d805..573db9b 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -82,10 +82,7 @@
  * on ARMv7.
  */
        .macro  icache_line_size, reg, tmp
-       mrc     p15, 0, \tmp, c0, c0, 1         @ read ctr
-       and     \tmp, \tmp, #0xf                @ cache line size encoding
-       mov     \reg, #4                        @ bytes per word
-       mov     \reg, \reg, lsl \tmp            @ actual cache line size
+       mov     \reg, #32                       @ hack
        .endm


      reply	other threads:[~2016-05-11 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 18:22 Antoine Tremblay
2015-11-20  9:11 ` Yao Qi
2015-11-20 12:55   ` Antoine Tremblay
2015-11-20 14:16     ` Antoine Tremblay
2016-05-11 12:21       ` Antoine Tremblay [this message]

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=wwokinyklr8u.fsf@ericsson.com \
    --to=antoine.tremblay@ericsson.com \
    --cc=gdb@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=will.deacon@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox