提交 0af48f42 编写于 作者: V venkatesh.pallipadi@intel.com 提交者: H. Peter Anvin

x86: cpa_flush_array wbinvd should be done on all CPUs

cpa_flush_array seems to prefer wbinvd() over clflush at 4M threshold.
clflush needs to be done on only one CPU as per instruction definition.
wbinvd() however, should be done on all CPUs.

[ Impact: fix missing flush which could cause data corruption ]
Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
上级 0b827537
......@@ -204,6 +204,11 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
}
}
static void wbinvd_local(void *unused)
{
wbinvd();
}
static void cpa_flush_array(unsigned long *start, int numpages, int cache,
int in_flags, struct page **pages)
{
......@@ -219,7 +224,8 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
/* 4M threshold */
if (numpages >= 1024) {
if (boot_cpu_data.x86 >= 4)
wbinvd();
on_each_cpu(wbinvd_local, NULL, 1);
return;
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册