From: tip-bot for Chris Wilson <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, chris@chris-wilson.co.uk,
linux-kernel@vger.kernel.org, bp@alien8.de, hpa@zytor.com,
tglx@linutronix.de, torvalds@linux-foundation.org
Subject: [tip:x86/asm] x86/asm: Enable fast 32-bit put_user_64() for copy_to_user()
Date: Thu, 16 Apr 2015 09:15:41 -0700 [thread overview]
Message-ID: <tip-6a907738ab9840ca3d71c22cd28fba4cbae7f7ce@git.kernel.org> (raw)
In-Reply-To: <1429091486-11443-1-git-send-email-chris@chris-wilson.co.uk>
Commit-ID: 6a907738ab9840ca3d71c22cd28fba4cbae7f7ce
Gitweb: http://git.kernel.org/tip/6a907738ab9840ca3d71c22cd28fba4cbae7f7ce
Author: Chris Wilson <chris@chris-wilson.co.uk>
AuthorDate: Wed, 15 Apr 2015 10:51:26 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 16 Apr 2015 12:08:21 +0200
x86/asm: Enable fast 32-bit put_user_64() for copy_to_user()
For fixed sized copies, copy_to_user() will utilize
__put_user_size() fastpaths. However, it is missing the
translation for 64-bit copies on x86/32.
Testing on a Pinetrail Atom, the 64 bit put_user() fastpath
is substantially faster than the generic copy_to_user()
fallback.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org
Link: http://lkml.kernel.org/r/1429091486-11443-1-git-send-email-chris@chris-wilson.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/uaccess_32.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
index 3c03a5d..0ed5504 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -59,6 +59,10 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
__put_user_size(*(u32 *)from, (u32 __user *)to,
4, ret, 4);
return ret;
+ case 8:
+ __put_user_size(*(u64 *)from, (u64 __user *)to,
+ 8, ret, 8);
+ return ret;
}
}
return __copy_to_user_ll(to, from, n);
prev parent reply other threads:[~2015-04-16 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 9:51 [PATCH] x86: Enable fast 32-bit put_user_64 for copy_to_user Chris Wilson
2015-04-16 7:28 ` Ingo Molnar
2015-04-16 7:40 ` Chris Wilson
2015-04-16 16:15 ` tip-bot for Chris Wilson [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=tip-6a907738ab9840ca3d71c22cd28fba4cbae7f7ce@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=chris@chris-wilson.co.uk \
--cc=hpa@zytor.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
Powered by JetHome