All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carmelo AMOROSO <carmelo.amoroso@st.com>
To: linux-sh@vger.kernel.org
Subject: Re: Fwd: sh:fixed issue in xchg_u32 function when val==r15.
Date: Wed, 22 Jun 2011 07:18:50 +0000	[thread overview]
Message-ID: <4E01975A.4000302@st.com> (raw)

On 22/06/2011 9.05, Carmelo Amoroso wrote:
> ---------- Forwarded message ----------
> From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
> Date: 19 April 2011 18:28
> Subject: Re: sh:fixed issue in xchg_u32 function when val=r15.
> To: Paul Mundt <lethal@linux-sh.org>
> Cc: linux-sh@vger.kernel.org, Stuart Menefy <stuart.menefy@st.com>
> 
> 
> Hi Paul,
> Thanks for the suggestion.
> 
> Attached is the reworked patch for potential gUSA rollback users.
> 
> Thanks,
> srini
> 
> 
> Paul Mundt wrote:
>>
>> On Thu, Apr 07, 2011 at 01:57:09PM +0100, Srinivas KANDAGATLA wrote:
>>
>>>
>>> Recently we have discovered a bug in xchg_u32 function of GUSA_RB feature.
>>> This function breaks if one of the input parameter 'val' is r15.
>>>
>>>    168:    02 c7           mova    174 <exit_mm+0x54>,r0
>>>    16a:    09 00           nop       16c:    f3 61           mov    r15,r1
>>>    16e:    fc ef           mov    #-4,r15
>>>
>>
>> The -4 here is part of the gUSA login sequence, so if you're seeing the
>> problem with gUSA based xchg_u32 it seems like you're going to have to
>> apply the same fix for all gUSA rollback users.
>>

Hi Paul, Srini
instead of making 'val' an input/output contraint (to force gcc not
using r15 directly), should not be better (or more correct) to add r15
to the clobbered register list ? r15 is actually modified for the
login/logout gUSA sequence.
Indeed, 'val' is not an output parameter... so we are benefiting from a
side effect.

Further, looking at __cmpxchg_u32, we think that we should make the
first argument (volatile int *m) an input/output constraint as well (as
it happens in xchg_u8 and xchg_32), and include r15 instead in the
clobber list, keeping 'val' just an input parameter.

Comments are welcome.

Cheers,
Carmelo & Salvo


             reply	other threads:[~2011-06-22  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  7:18 Carmelo AMOROSO [this message]
2011-06-23 12:27 ` Fwd: sh:fixed issue in xchg_u32 function when val==r15 Srinivas KANDAGATLA
2011-06-23 13:17 ` Carmelo AMOROSO

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=4E01975A.4000302@st.com \
    --to=carmelo.amoroso@st.com \
    --cc=linux-sh@vger.kernel.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.