All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wayne Warren <wwarren@emacinc.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Adeos I-Pipe patch problem on vendor-specific kernel
Date: Wed, 24 Oct 2012 20:36:07 +0200	[thread overview]
Message-ID: <50883517.8050709@xenomai.org> (raw)
In-Reply-To: <1351103161.25888.344.camel@ENG-09-LX.emacinc.com>

On 10/24/2012 08:26 PM, Wayne Warren wrote:
>   
>>>
>>> So it looks like maybe __ipipe_tsc_get is working as expected? 
>>
>> Yes, the debugger can not know what is at 0xffff0f40 because the code
>> copied there is not known at compilation (though you can run disass
>> *0xffff0f40, this should work). __ipipe_tsc_register does copy the
>> actual code, but before __ipipe_tsc_register copies the code, the code
>> there simply returns r0 and r1 set to 0.
>>
>> You should try and put a breakpoint at 0xffff040 to see what address is
>> invalid. Maybe the counter virtual address is invalid, or the access to
>> the timer register because the timer is not enabled yet at hardware level.
>>
> 
> disass *0xffff0f40 did not work, "No function contains specified
> address."

Sorry, it is disass /r 0xffff0f20,+0x60

For instance, I have, in user-space, with the I-pipe core for Linux 3.4
on omap3 (where __ipipe_tsc_get shifted a bit), but it should work the
same for the kernel:

(gdb) disass /r 0xffff0ee0,+0x60
Dump of assembler code from 0xffff0ee0 to 0xffff0f40:
   0xffff0ee0:   3b 48 8f 8c    stchi   8, cr4, [pc], {59}      ; 0x3b
   0xffff0ee4:   ec 01 00 00    andeq   r0, r0, r12, ror #3
   0xffff0ee8:   00 00 00 00    andeq   r0, r0, r0
   0xffff0eec:   00 00 00 00    andeq   r0, r0, r0
   0xffff0ef0:   00 00 00 00    andeq   r0, r0, r0
   0xffff0ef4:   00 00 00 00    andeq   r0, r0, r0
   0xffff0ef8:   00 00 00 00    andeq   r0, r0, r0
   0xffff0efc:   28 20 03 fb    blx     0xb8fa6
   0xffff0f00:   0c 00 1f e5    ldr     r0, [pc, #-12]  ; 0xffff0efc
   0xffff0f04:   dc 22 4f e1    ldrd    r2, [pc, #-44]  ; 0xffff0ee0
   0xffff0f08:   00 00 90 e5    ldr     r0, [r0]
   0xffff0f0c:   00 00 52 e1    cmp     r2, r0
   0xffff0f10:   00 10 a3 e2    adc     r1, r3, #0
   0xffff0f14:   1e ff 2f e1    bx      lr
   0xffff0f18:   00 f0 20 e3    nop     {0}
   0xffff0f1c:   00 f0 20 e3    nop     {0}
   0xffff0f20:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f24:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f28:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f2c:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f30:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f34:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f38:   00 00 00 00    andeq   r0, r0, r0
   0xffff0f3c:   00 00 00 00    andeq   r0, r0, r0

The range from 0xffff0ee0 to 0xffff0ef8 is really data, not code.
The hardware timer virtual address is at 0xffff0efc, so it is
0xfb032028
The 64 bits value at 0xffff0ee0 is where __ipipe_tsc_update stored the
value of __ipipe_tsc_get when it was last called.


> 
> So in other words, you are saying that if __ipipe_tsc_register had not
> registered the code, the exception would not occur because it would
> simply set r0 and r1 to 0 then return to the calling function? Just want
> to be certain I understand...
> 
> I did try to put a breakpoint at 0xffff040 (but I think you meant
> 0xfff0f040, i tried both) but then I get "Warning: Cannot insert
> breakpoint 10. Error accessing memory address 0xffff040: Unknown error".

That is where you need *, so, try break *0xffff0f40, yes 0xffff040 was a
typo.

> 
>>>                       
>>>>
>>>> Or apply the following patch:
>>>> http://git.xenomai.org/?p=ipipe-gch.git;a=commitdiff;h=42dd9056983cb6f65b6a336363f2f08f4426625a;hp=3b51cebda0b0d0123cb61b6ec07ecb62f293a528
>>>
>>> I will try this out, thanks!
>>
>> It will probably not fix this issue, but it is better to start from that
>> code anyway.
>>
> 
> Okay, just to be clear are you suggesting that we start all over with
> this patch, merge in the TI changes and our own code, and begin
> debugging again from there?

No, the patch should not have any dependency, so, you should be able to
apply it without any problem.

-- 
					    Gilles.


  reply	other threads:[~2012-10-24 18:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 21:08 [Xenomai] Adeos I-Pipe patch problem on vendor-specific kernel Wayne Warren
2012-10-02 21:32 ` Gilles Chanteperdrix
2012-10-02 21:35   ` Gilles Chanteperdrix
2012-10-04 16:57     ` Wayne Warren
2012-10-04 17:09       ` Gilles Chanteperdrix
2012-10-04 18:02         ` Gilles Chanteperdrix
2012-10-05  8:06         ` Gilles Chanteperdrix
2012-10-05 18:47           ` Wayne Warren
2012-10-05 20:16             ` Gilles Chanteperdrix
2012-10-05 21:47               ` Wayne Warren
2012-10-05 22:43                 ` Gilles Chanteperdrix
2012-10-06  4:29                   ` Wayne Warren
2012-10-06  9:46                     ` Gilles Chanteperdrix
2012-10-09 20:55                       ` Wayne Warren
2012-10-09 21:12                         ` Gilles Chanteperdrix
2012-10-19 21:22                           ` Wayne Warren
2012-10-20  1:33                             ` Gilles Chanteperdrix
2012-10-22 19:22                               ` Wayne Warren
2012-10-22 19:25                                 ` Gilles Chanteperdrix
2012-10-22 19:34                                   ` Wayne Warren
2012-10-22 21:12                                     ` Gilles Chanteperdrix
2012-10-23 15:32                                       ` Wayne Warren
2012-10-23 20:12                                         ` Gilles Chanteperdrix
2012-10-24 17:32                                           ` Wayne Warren
2012-10-24 17:38                                             ` Gilles Chanteperdrix
2012-10-24 17:55                                               ` Wayne Warren
2012-10-24 18:05                                                 ` Gilles Chanteperdrix
2012-10-24 18:26                                                   ` Wayne Warren
2012-10-24 18:36                                                     ` Gilles Chanteperdrix [this message]
2012-10-24 17:36                                           ` Wayne Warren
2012-10-24 17:57                                             ` Gilles Chanteperdrix
2012-10-20  8:24                             ` Gilles Chanteperdrix
2012-10-19 21:32                           ` Wayne Warren
2012-10-20  1:36                             ` Gilles Chanteperdrix

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=50883517.8050709@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=wwarren@emacinc.com \
    --cc=xenomai@xenomai.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.