From: David Laight <David.Laight@ACULAB.COM>
To: 'Nick Desaulniers' <ndesaulniers@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
"H . Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Kees Cook <keescook@chromium.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
Andy Lutomirski <luto@kernel.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: RE: [PATCH v4] x86, mem: move memmove to out of line assembler
Date: Fri, 30 Sep 2022 10:14:25 +0000 [thread overview]
Message-ID: <35ab0ccca42b4b4695f6c99b6d741b8f@AcuMS.aculab.com> (raw)
In-Reply-To: <20220928210512.642594-1-ndesaulniers@google.com>
From: Nick Desaulniers
> Sent: 28 September 2022 22:05
...
Reading it again, what is this test supposed to achieve?
> + /*
> + * movs instruction is only good for aligned case.
> + */
> + movl src, tmp0
> + xorl dest, tmp0
> + andl $0xff, tmp0
> + jz .Lforward_movs
The 'aligned' test would be '(src | dest) & 3'.
(Or maybe '& 7' since some 32bit x86 cpu actally
do 8 byte aligned 'rep movsl' faster than 4 byte
aligned ones.
OTOH the code loop is likely to be slower still.
I've not tried measuring misaligned 'rep movsw' but
on some recent intel cpu normal misaligned reads cost
almost nothing - even when doing two reads/clock.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2022-09-30 10:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 17:02 [PATCH] " Nick Desaulniers
2022-09-23 17:29 ` Linus Torvalds
2022-09-23 17:55 ` Nick Desaulniers
2022-09-23 18:05 ` Linus Torvalds
2022-09-27 17:03 ` Nick Desaulniers
2022-09-27 17:28 ` [PATCH v2] " Nick Desaulniers
2022-09-27 18:41 ` Kees Cook
2022-09-27 19:23 ` Kees Cook
2022-09-27 20:01 ` Nick Desaulniers
2022-09-27 20:36 ` Kees Cook
2022-09-27 21:02 ` [PATCH v3] " Nick Desaulniers
2022-09-27 21:14 ` Kees Cook
2022-09-28 7:24 ` Rasmus Villemoes
2022-09-28 19:00 ` Linus Torvalds
2022-09-28 19:06 ` Nick Desaulniers
2022-09-28 20:49 ` Nick Desaulniers
2022-09-28 21:05 ` [PATCH v4] " Nick Desaulniers
2022-09-28 22:03 ` Kees Cook
2022-09-29 7:01 ` Ingo Molnar
2022-09-29 8:02 ` Ingo Molnar
2022-09-29 17:26 ` Nick Desaulniers
2022-09-30 9:55 ` David Laight
2022-09-30 16:43 ` Nick Desaulniers
2022-09-30 16:46 ` Linus Torvalds
2022-09-30 18:55 ` [PATCH v5] " Nick Desaulniers
2022-09-30 10:14 ` David Laight [this message]
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=35ab0ccca42b4b4695f6c99b6d741b8f@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=llvm@lists.linux.dev \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@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®