From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54786 invoked by alias); 11 May 2016 12:21:54 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 54613 invoked by uid 89); 11 May 2016 12:21:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=holes, mrc, ctr, Hx-languages-length:1911 X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 11 May 2016 12:21:41 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id AE.D5.03614.2A323375; Wed, 11 May 2016 14:20:51 +0200 (CEST) Received: from elxa4wqvvz1 (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.84) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 May 2016 08:21:38 -0400 References: <564E136E.9090603@ericsson.com> <86poz5yr12.fsf@gmail.com> <564F182D.2080801@ericsson.com> <564F2B42.9000605@ericsson.com> User-agent: mu4e 0.9.17; emacs 24.4.1 From: Antoine Tremblay To: Antoine Tremblay CC: Yao Qi , , Will Deacon Subject: Re: Random SIGILL / SIGSEGV on ARMv7 while debugging ? In-Reply-To: <564F2B42.9000605@ericsson.com> Date: Wed, 11 May 2016 12:21:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00001.txt.bz2 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