From: Roland Dreier <roland@digitalvampire.org>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Fast 64-bit atomic writes (SSE?)
Date: 20 Mar 2004 06:43:34 -0800 [thread overview]
Message-ID: <87znabk295.fsf@love-shack.home.digitalvampire.org> (raw)
In-Reply-To: <p73znacvuic.fsf@brahms.suse.de>
Andi> Definitely not how you do it ;-) You corrupt the user space
Andi> FPU context. Also you didn't do a CPUID check, so it would
Andi> just crash on machines
I'm not an asm expert, so could you explain how it corrupts the FPU
context? I tried to save off the value of the XMM register I used,
and the docs I have say that the movq and movdq instructions don't
affect any flags.
As far as the CPUID, you're right... I left that part of the code out
but I am definitely planning on using this only if the machine has SSE2.
Andi> The RAID code has some examples on how to use SSE2 in the
Andi> kernel correctly.
Hmm, they save cr0 and do a clts, and then restore cr0 when they're
done. For my education, can you explain why?
Andi> Better is probably to use CMPXCHG8, which avoids all of
Andi> this.
OK, thanks.
- Roland
next prev parent reply other threads:[~2004-03-20 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <874qskl5ca.fsf@love-shack.home.digitalvampire.org.suse.lists.linux.kernel>
2004-03-20 7:37 ` Andi Kleen
2004-03-20 14:43 ` Roland Dreier [this message]
2004-03-20 14:48 ` Roland Dreier
2004-03-20 0:39 Roland Dreier
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=87znabk295.fsf@love-shack.home.digitalvampire.org \
--to=roland@digitalvampire.org \
--cc=ak@suse.de \
--cc=linux-kernel@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 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®