Commit 2a0c772f authored by Ross Zwisler's avatar Ross Zwisler Committed by H. Peter Anvin

x86: Use clflushopt in drm_clflush_page

If clflushopt is available on the system, use it instead of clflush in
drm_clflush_page.
Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Link: http://lkml.kernel.org/r/1393441612-19729-4-git-send-email-ross.zwisler@linux.intel.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 8b80fd8b
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
#include <drm/drmP.h> #include <drm/drmP.h>
#if defined(CONFIG_X86) #if defined(CONFIG_X86)
/*
* clflushopt is an unordered instruction which needs fencing with mfence or
* sfence to avoid ordering issues. For drm_clflush_page this fencing happens
* in the caller.
*/
static void static void
drm_clflush_page(struct page *page) drm_clflush_page(struct page *page)
{ {
...@@ -44,7 +50,7 @@ drm_clflush_page(struct page *page) ...@@ -44,7 +50,7 @@ drm_clflush_page(struct page *page)
page_virtual = kmap_atomic(page); page_virtual = kmap_atomic(page);
for (i = 0; i < PAGE_SIZE; i += size) for (i = 0; i < PAGE_SIZE; i += size)
clflush(page_virtual + i); clflushopt(page_virtual + i);
kunmap_atomic(page_virtual); kunmap_atomic(page_virtual);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment