mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Steve Capper <steve.capper@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	open list <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC PATCH] arm64: cmpxchg.h: Bring ldxr and stxr closer
Date: Tue, 3 Mar 2015 17:22:29 +0000	[thread overview]
Message-ID: <20150303172228.GQ28951@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAJhHMCBVTF0keDzqxi0Mw=8SM5gSUxE8D4c5-oHAOg1bUkBYEw@mail.gmail.com>

On Tue, Mar 03, 2015 at 11:58:26AM -0500, Pranith Kumar wrote:
> On Tue, Mar 3, 2015 at 9:34 AM, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > Do you mean the cmpxchg_double() change? Becuase %w0 and %0 is the same
> > physical register. You set it to 0 and immediately override it with
> > ldxp.
> 
> Thanks Catalin. I realized the blunder a while after Will pointed it
> out. The asm here was a bit confusing. %0 usually refers to the first
> input/output variable. But for ldxp instruction(which is just a
> double-word load, not exclusive), it refers to the physical registers.

OK, so please try not to touch any asm code until you understood (a) the
AArch64 instruction set and (b) the gcc inline assembly syntax ;).

> What about the changes in cmpxchg()? Why do we need to set %w0 to 0
> after the ldxrh instruction? Also, could you please point me to any
> arm64 asm reference?

"info gcc" for the inline assembly syntax and the ARMv8 ARM for the
description of the AArch64 instruction set. It also helps if you look at
the code generated by the compiler (e.g. objdump -d).

-- 
Catalin

      reply	other threads:[~2015-03-03 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 20:09 Pranith Kumar
2015-02-27 20:15 ` Will Deacon
2015-02-27 20:17   ` Pranith Kumar
2015-02-27 20:29     ` Pranith Kumar
2015-03-03 14:34       ` Catalin Marinas
2015-03-03 16:58         ` Pranith Kumar
2015-03-03 17:22           ` Catalin Marinas [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=20150303172228.GQ28951@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=bobby.prani@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steve.capper@linaro.org \
    --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

all inboxes | Powered by JetHome®