From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jike Song <albcamus@gmail.com>
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: add missed clobber for 32-bit memmove
Date: Fri, 17 Oct 2008 08:55:32 -0700 [thread overview]
Message-ID: <48F8B574.7070401@goop.org> (raw)
In-Reply-To: <1224249353-3032-2-git-send-email-albcamus@gmail.com>
Jike Song wrote:
> memmove() is implemented by inline assembly. It calls std at first
> and cld at last, but EFLAGS still should be clobbered.
>
I think x86 gcc assumes "cc" is always clobbered by asms. Otherwise
there'll need to be a lot more "cc" clobbers than this...
J
> Signed-off-by: Jike Song <albcamus@gmail.com>
> ---
> arch/x86/lib/memcpy_32.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/lib/memcpy_32.c b/arch/x86/lib/memcpy_32.c
> index 5415a9d..99a8240 100644
> --- a/arch/x86/lib/memcpy_32.c
> +++ b/arch/x86/lib/memcpy_32.c
> @@ -36,7 +36,7 @@ void *memmove(void *dest, const void *src, size_t n)
> :"0" (n),
> "1" (n-1+src),
> "2" (n-1+dest)
> - :"memory");
> + :"cc", "memory");
> }
> return dest;
> }
>
next prev parent reply other threads:[~2008-10-17 15:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-17 13:15 [PATCH] x86: add missed clobber for 32-bit memmove Jike Song
2008-10-17 13:15 ` Jike Song
2008-10-17 15:55 ` Jeremy Fitzhardinge [this message]
2008-10-17 16:35 ` H. Peter Anvin
2008-10-20 6:44 ` Jike Song
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=48F8B574.7070401@goop.org \
--to=jeremy@goop.org \
--cc=albcamus@gmail.com \
--cc=hpa@zytor.com \
--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 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.