From: Andi Kleen <andi@firstfloor.org>
To: Jim Kukunas <james.t.kukunas@linux.intel.com>
Cc: Linux Raid <linux-raid@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Neil Brown <neilb@suse.de>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] lib/raid6: Add AVX2 optimized recovery functions
Date: Thu, 29 Nov 2012 12:09:37 -0800 [thread overview]
Message-ID: <m2obigf9xa.fsf@firstfloor.org> (raw)
In-Reply-To: <1352411264-5156-1-git-send-email-james.t.kukunas@linux.intel.com> (Jim Kukunas's message of "Thu, 8 Nov 2012 13:47:44 -0800")
Jim Kukunas <james.t.kukunas@linux.intel.com> writes:
> +
> + /* ymm0 = x0f[16] */
> + asm volatile("vpbroadcastb %0, %%ymm7" : : "m" (x0f));
> +
> + while (bytes) {
> +#ifdef CONFIG_X86_64
> + asm volatile("vmovdqa %0, %%ymm1" : : "m" (q[0]));
> + asm volatile("vmovdqa %0, %%ymm9" : : "m" (q[32]));
> + asm volatile("vmovdqa %0, %%ymm0" : : "m" (p[0]));
> + asm volatile("vmovdqa %0, %%ymm8" : : "m" (p[32]));
This is somewhat dangerous to assume registers do not get changed
between assembler statements or assembler statements do not get
reordered. Better always put such values into explicit variables or
merge them into a single asm statement.
asm volatile is also not enough to prevent reordering. If anything
you would need a memory clobber.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
next prev parent reply other threads:[~2012-11-29 20:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-08 21:47 [PATCH] lib/raid6: Add AVX2 optimized recovery functions Jim Kukunas
2012-11-09 11:35 ` Paul Menzel
2012-11-09 11:39 ` H. Peter Anvin
2012-11-09 11:46 ` Paul Menzel
2012-11-09 11:50 ` NeilBrown
2012-11-09 12:24 ` H. Peter Anvin
2012-11-09 19:56 ` Jim Kukunas
2012-11-19 0:57 ` NeilBrown
2012-11-29 20:09 ` Andi Kleen [this message]
2012-11-29 21:13 ` H. Peter Anvin
2012-11-29 21:18 ` Andi Kleen
2012-11-29 22:27 ` H. Peter Anvin
2012-11-29 22:28 ` H. Peter Anvin
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=m2obigf9xa.fsf@firstfloor.org \
--to=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=james.t.kukunas@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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