All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
Date: Wed, 10 Oct 2012 11:07:40 +0000	[thread overview]
Message-ID: <201210101107.40898.arnd@arndb.de> (raw)
In-Reply-To: <1349862394.10070.23.camel@zakaz.uk.xensource.com>

On Wednesday 10 October 2012, Ian Campbell wrote:
> > * implement your own cmpxchg wrapper that may be implemented using a spinlock
> >   rather than cmpxchg if ARMv6 is enabled.
> 
> Even if ARMv6 is enabled the grant table code will never be running on
> one so so it might be ok to just have our own wrapper which
> unconditionally uses the v7 instruction? That might upset gas though.

Yes, that would be possible. You can tell gas to ignore the instruction
set in this case. If you do this, you can implement the update functions
more efficiently using direct ldrexh/strexh in assembler to avoid doing
two nested loops. I assume that you don't need the v1 grant table
code on ARM anyway, so the only code you need to look at is

        while (!((flags = *pflags) & GTF_transfer_committed)) {
                if (sync_cmpxchg(pflags, flags, 0) == flags)
                        return 0;
                cpu_relax();
        }

which should transform nicely into a few lines of inline assembly.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
Date: Wed, 10 Oct 2012 11:07:40 +0000	[thread overview]
Message-ID: <201210101107.40898.arnd@arndb.de> (raw)
In-Reply-To: <1349862394.10070.23.camel@zakaz.uk.xensource.com>

On Wednesday 10 October 2012, Ian Campbell wrote:
> > * implement your own cmpxchg wrapper that may be implemented using a spinlock
> >   rather than cmpxchg if ARMv6 is enabled.
> 
> Even if ARMv6 is enabled the grant table code will never be running on
> one so so it might be ok to just have our own wrapper which
> unconditionally uses the v7 instruction? That might upset gas though.

Yes, that would be possible. You can tell gas to ignore the instruction
set in this case. If you do this, you can implement the update functions
more efficiently using direct ldrexh/strexh in assembler to avoid doing
two nested loops. I assume that you don't need the v1 grant table
code on ARM anyway, so the only code you need to look at is

        while (!((flags = *pflags) & GTF_transfer_committed)) {
                if (sync_cmpxchg(pflags, flags, 0) == flags)
                        return 0;
                cpu_relax();
        }

which should transform nicely into a few lines of inline assembly.

	Arnd

  reply	other threads:[~2012-10-10 11:08 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 15:22 [GIT PULL 0/9] ARM architecture fixes for 3.7 Arnd Bergmann
2012-10-09 15:22 ` Arnd Bergmann
2012-10-09 15:22 ` Arnd Bergmann
2012-10-09 15:22 ` [PATCH 1/9] ARM: kprobes: make more tests conditional Arnd Bergmann
2012-10-09 15:22   ` Arnd Bergmann
2012-10-09 15:22 ` [PATCH 2/9] ARM: export set_irq_flags Arnd Bergmann
2012-10-09 15:22   ` Arnd Bergmann
2012-10-09 16:20   ` Thomas Gleixner
2012-10-09 16:20     ` Thomas Gleixner
2012-10-10  6:42   ` Linus Walleij
2012-10-10  6:42     ` Linus Walleij
2012-10-09 15:22 ` [PATCH 3/9] ARM: Fix another build warning in arch/arm/mm/alignment.c Arnd Bergmann
2012-10-09 15:22   ` Arnd Bergmann
2012-10-09 15:22 ` [PATCH 4/9] ARM: export default read_current_timer Arnd Bergmann
2012-10-09 15:22   ` Arnd Bergmann
2012-10-09 15:40   ` Jonathan Austin
2012-10-09 15:40     ` Jonathan Austin
2012-10-09 16:06     ` Russell King - ARM Linux
2012-10-09 16:06       ` Russell King - ARM Linux
2012-10-18  8:43       ` Alexander Holler
2012-10-18  8:43         ` Alexander Holler
2012-10-09 15:22 ` [PATCH 5/9] ARM: Xen: fix initial build problems: Arnd Bergmann
2012-10-09 15:22   ` Arnd Bergmann
2012-10-09 15:35   ` [Xen-devel] " Ian Campbell
2012-10-09 15:35     ` Ian Campbell
2012-10-09 15:35     ` Ian Campbell
2012-10-09 15:39     ` Arnd Bergmann
2012-10-09 15:39       ` Arnd Bergmann
2012-10-09 15:39       ` Arnd Bergmann
2012-10-09 16:10       ` Ian Campbell
2012-10-09 16:10         ` Ian Campbell
2012-10-09 16:10         ` Ian Campbell
2012-10-09 18:19         ` Arnd Bergmann
2012-10-09 18:19           ` Arnd Bergmann
2012-10-09 18:19           ` Arnd Bergmann
2012-10-10  9:46           ` Ian Campbell
2012-10-10  9:46             ` Ian Campbell
2012-10-10  9:46             ` Ian Campbell
2012-10-10 11:07             ` Arnd Bergmann [this message]
2012-10-10 11:07               ` Arnd Bergmann
2012-10-10 11:07               ` Arnd Bergmann
2012-10-09 19:24     ` Dan Magenheimer
2012-10-10  7:53       ` Ian Campbell
2012-10-10 14:51         ` Stefano Stabellini
2012-10-09 15:37   ` Stefano Stabellini
2012-10-09 15:37     ` Stefano Stabellini
2012-10-09 15:37     ` Stefano Stabellini
2012-10-09 18:21     ` Arnd Bergmann
2012-10-09 18:21       ` Arnd Bergmann
2012-10-09 18:21       ` Arnd Bergmann
2012-10-10  7:54       ` [Xen-devel] " Ian Campbell
2012-10-10  7:54         ` Ian Campbell
2012-10-10  7:54         ` Ian Campbell
2012-10-10 14:47         ` Stefano Stabellini
2012-10-10 14:47           ` Stefano Stabellini
2012-10-10 14:47           ` Stefano Stabellini
2012-10-10 14:53           ` Ian Campbell
2012-10-10 14:53             ` Ian Campbell
2012-10-10 14:53             ` Ian Campbell
2012-10-10 16:01             ` Stefano Stabellini
2012-10-10 16:01               ` Stefano Stabellini
2012-10-10 16:01               ` Stefano Stabellini
2012-10-09 16:04   ` Russell King - ARM Linux
2012-10-09 16:04     ` Russell King - ARM Linux
2012-10-09 15:23 ` [PATCH 6/9] ARM: pass -marm to gcc by default for both C and assembler Arnd Bergmann
2012-10-09 15:23   ` Arnd Bergmann
2012-10-09 17:27   ` Dave Martin
2012-10-09 17:27     ` Dave Martin
2012-10-09 15:23 ` [PATCH 7/9] ARM: be really quiet when building with 'make -s' Arnd Bergmann
2012-10-09 15:23   ` Arnd Bergmann
2012-10-09 15:23 ` [PATCH 8/9] ARM: binfmt_flat: unused variable 'persistent' Arnd Bergmann
2012-10-09 15:23   ` Arnd Bergmann
2012-10-09 15:23 ` [PATCH 9/9] ARM: warnings in arch/arm/include/asm/uaccess.h Arnd Bergmann
2012-10-09 15:23   ` Arnd Bergmann
2012-10-09 16:08 ` [GIT PULL 0/9] ARM architecture fixes for 3.7 Russell King - ARM Linux
2012-10-09 16:08   ` Russell King - ARM Linux
2012-10-09 17:06   ` Stefano Stabellini
2012-10-09 17:06     ` Stefano Stabellini
2012-10-09 17:06     ` Stefano Stabellini
2012-10-09 18:40   ` Arnd Bergmann
2012-10-09 18:40     ` Arnd Bergmann
2012-10-10 14:58     ` Stefano Stabellini
2012-10-10 14:58       ` Stefano Stabellini
2012-10-10 14:58       ` Stefano Stabellini
2012-10-12 13:20     ` Will Deacon
2012-10-12 13:20       ` Will Deacon
2012-10-12 13:20       ` Will Deacon

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=201210101107.40898.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=xen-devel@lists.xensource.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 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.