public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Bill Gatliff <bgat@billgatliff•com>
To: Bill Gatliff <bgat@billgatliff•com>,
	 gdb@sourceware•org, linuxppc-embedded@ozlabs•org
Subject: Re: Gdbserver syscall clobber
Date: Mon, 23 Jul 2007 10:37:13 -0500	[thread overview]
Message-ID: <46A4CB29.9080705@billgatliff.com> (raw)
In-Reply-To: <20070718183143.GA25324@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]

Daniel Jacobowitz wrote:
> On Wed, Jul 18, 2007 at 12:59:42PM -0500, Bill Gatliff wrote:
>   
>> Now, I'm a little rusty on PPC asm (I've been doing a lot of ARM
>> lately), but it looks to me like the kernel is setting bit 0 in CR0
>> (oris r10, r10, 0x1000) a.k.a LT, but the user side is looking at CR0
>> (bnslr+) bit 3 a.k.a. SO.  Or maybe the other way around, I'm not sure
>> after reading Sections 1.2 and 2.1 of the Programming Environments manual.
>>     
>
> It's not checking for restart here - userspace isn't supposed to have to.
> It's probably checking for error.  Check for the bit of kernel code
> that's supposed to back you up two instructions.
>
>   

I don't see it in this kernel.  What I see is this after the call to the 
syscall handler:

    li    r10,-_LAST_ERRNO
    cmpl    0,r3,r10
    blt    30f
    neg    r3,r3
    cmpi    0,r3,ERESTARTNOHAND
    bne    22f
    li    r3,EINTR
22:    lwz    r10,_CCR(r1)    /* Set SO bit in CR */
    oris    r10,r10,0x1000
    stw    r10,_CCR(r1)
30:    stw    r3,GPR3(r1)    /* Update return value */
    b    ret_from_except
66:    li    r3,ENOSYS
    b    22b


?

-- 
Bill Gatliff
bgat@billgatliff•com


[-- Attachment #2: Type: text/html, Size: 2229 bytes --]

  reply	other threads:[~2007-07-23 15:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 15:43 Gdbserver syscall clobber Bill Gatliff
2007-07-16 15:53 ` Daniel Jacobowitz
2007-07-18 17:42   ` Bill Gatliff
2007-07-18 17:59   ` Bill Gatliff
2007-07-18 18:31     ` Daniel Jacobowitz
2007-07-23 15:37       ` Bill Gatliff [this message]
2007-07-23 15:38       ` Bill Gatliff
2007-07-23 16:06       ` Bill Gatliff
2007-07-23 16:15         ` Daniel Jacobowitz
2007-07-26 16:28           ` Bill Gatliff
2007-07-23 16:19         ` Andreas Schwab

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=46A4CB29.9080705@billgatliff.com \
    --to=bgat@billgatliff$(echo .)com \
    --cc=gdb@sourceware$(echo .)org \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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