From: "Jan Beulich" <jbeulich@novell.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] x86: fix variable_test_bit() asmconstraints
Date: Fri, 14 Mar 2008 13:51:26 +0000 [thread overview]
Message-ID: <47DA90EE.76E4.0078.0@novell.com> (raw)
In-Reply-To: <C4001818.15017%keir.fraser@eu.citrix.com>
>>> Keir Fraser <keir.fraser@eu.citrix.com> 14.03.08 12:55 >>>
>On 14/3/08 11:23, "Jan Beulich" <jbeulich@novell.com> wrote:
>
>> I just sent a (much bigger, see below) patch to the same effect to the
>> x86 Linux maintainers - in Xen, all the operations modifying bits do
>> have "memory" clobbers, so it's just the test_bit() constraint that's
>> wrong.
>
>Yes, I agree that fix is needed, although it would be consistent with other
>asm statements in that file to use a memory clobbers instead.
But memory clobber aren't nice when you want the compiler to optimize
well.
>> However, I wonder whether the non-atomic ops aren't limiting things too
>> much by having "memory" clobbers, they would much better be restricted
>> to indicate just the changing memory location. This, however, would
>> probably require some additional consideration given that Xen (other
>> than Linux) isn't using -fno-strict-aliasing. Furthermore, these
>> non-atomic operations, according to their comments, can be re-ordered,
>> which contradicts the use of __asm__ __volatile__ (but note that
>> removing this would probably require extra precautions to meet strict
>> aliasing rules).
>
>Xen *does* use -fno-strict-aliasing. I'm afraid I don't understand why
Oh, okay, I just grepped xen/ for it, but it lives in Config.mk...
>memory-clobber would be needed for the atomic ops, but a dummy memory
>operand would suffice for non-atomic ops. I used memory clobber everywhere
Atomic ops imply a barrier (otherwise the compiler can defeat the
purpose of the atomic operation). The non-atomic ones don't need a
dummy operand, but one that precisely describes the place in memory
that changes.
>because at least I'm certain that works. Same for 'asm volatile'. We've had
>various problems with the bitops before, and I just want the darn things to
>work!
Okay, if you feel that way then I guess I won't propose changing it,
at the expense of slightly worse code generation.
Jan
next prev parent reply other threads:[~2008-03-14 13:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 11:23 [PATCH] x86: fix variable_test_bit() asm constraints Jan Beulich
2008-03-14 11:55 ` Keir Fraser
2008-03-14 11:59 ` Keir Fraser
2008-03-14 13:46 ` [PATCH] x86: fix variable_test_bit() asmconstraints Jan Beulich
2008-03-14 12:06 ` [PATCH] x86: fix variable_test_bit() asm constraints Keir Fraser
2008-03-14 13:51 ` Jan Beulich [this message]
2008-03-14 13:57 ` [PATCH] x86: fix variable_test_bit() asmconstraints Keir Fraser
2008-03-14 14:11 ` [PATCH] x86: fix variable_test_bit()asmconstraints Jan Beulich
2008-03-14 15:37 ` Keir Fraser
2008-03-14 16:42 ` Jan Beulich
2008-03-14 17:08 ` Keir Fraser
2008-03-16 14:08 ` Keir Fraser
2008-03-14 13:59 ` [PATCH] x86: fix variable_test_bit() asmconstraints Samuel Thibault
2008-03-14 14:04 ` Keir Fraser
2008-03-14 14:18 ` Jan Beulich
2008-03-14 15:17 ` Jan Beulich
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=47DA90EE.76E4.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=keir.fraser@eu.citrix.com \
--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.