From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>, Peter Anvin <hpa@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-tip-commits@vger.kernel.org,
Fenghua Yu <fenghua.yu@intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [tip:x86/asm] x86-64, copy_user: Remove zero byte check before copy user buffer.
Date: Wed, 20 Nov 2013 11:12:52 -0800 [thread overview]
Message-ID: <528D09B4.9040805@zytor.com> (raw)
In-Reply-To: <CA+55aFywiJf1TiSaXSZNkUpGpgtJa1pmZa7E+BOJafvTQCuzdA@mail.gmail.com>
On 11/19/2013 11:38 AM, Linus Torvalds wrote:
> On Mon, Nov 18, 2013 at 8:37 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> Do you have a preference:
>>
>> 1. Considering the 32-bit truncation incidental (take it or leave it);
>> 2. Require the 32-bit truncation, or
>> 3. Get rid of it completely?
>
> I don't have a huge preference, but I hate the current situation (with
> Fenghua's patch) where it's not consistent. One path uses just 32-bits
> of the count (thanks to the "mov %edx,%ecx") while another path uses
> 64 bits.
>
> One or the other, but not a mixture of both.
>
> And only tangentially related to this: I do think that we could be
> stricter about the count. Make it oops if the high bits are set,
> rather than overwrite a lot of memory. So I would not be adverse to
> limiting the count to 31 bits (or even less) explicitly, and thus
> making the while 32-vs-64 bit issue moot.
>
I guess the question is if we want to spend the extra cycles on a test
and branch. For now I suggest that we just put back the truncation in
the form of a movl instruction.
-hpa
next prev parent reply other threads:[~2013-11-20 19:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 20:37 [PATCH] x86/copy_user.S: Remove zero byte check before copy user buffer Fenghua Yu
2013-11-17 6:18 ` [tip:x86/asm] x86-64, copy_user: " tip-bot for Fenghua Yu
[not found] ` <CA+55aFyFz_6oy8-1jb5Jzk+4VC5MLA5d0KbqhZxki0=+DmggBg@mail.gmail.com>
2013-11-17 6:51 ` H. Peter Anvin
2013-11-19 4:37 ` H. Peter Anvin
2013-11-19 19:38 ` Linus Torvalds
2013-11-20 19:12 ` H. Peter Anvin [this message]
2013-11-20 19:28 ` H. Peter Anvin
2013-11-20 20:13 ` Linus Torvalds
2013-11-20 20:36 ` H. Peter Anvin
2013-11-20 21:44 ` Linus Torvalds
2013-11-20 20:54 ` [tip:x86/asm] x86-64, copy_user: Use leal to produce 32-bit results tip-bot for H. Peter Anvin
2013-11-20 22:00 ` tip-bot for 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=528D09B4.9040805@zytor.com \
--to=hpa@zytor.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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