diff options
author | Zhongyu Gao <gzy@sangfor.com.cn> | 2021-11-29 10:58:47 +0800 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2021-11-28 20:58:05 -0800 |
commit | 493bfdf5e667d39b9044e4885bb6b41ce1888d0a (patch) | |
tree | f1dde350059270860ee79032b74c1f8aa01075a1 | |
parent | e9fe0cd3cbd3d80f776be4343b2f5baaa4c12f37 (diff) | |
download | ras-tools-493bfdf5e667d39b9044e4885bb6b41ce1888d0a.tar.gz |
einj_mem_uc: Fix vtop failed in "instr" test case
An error occurs during the execution of the einj_mem_uc "instr" test
and exits. The error message shows that the instr memory page is not
found, and the einj_mem_uc exits. The detailed log is as follows:
$ ./einj_mem_uc -c 10 -f instr
page not present
0: instr vaddr = 0x403000 paddr = ffffffffffffffff
~/einj_mem_uc : write error on '/sys/kernel/debug/apei/einj/error_inject'
Test Environment:
OS Version:
CentOS Linux release 7.9.2009 (Core)
Kernel Version:
3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Solution: Call the dosum function in instr_alloc to load the dosum
memory page in advance to prevent vtop conversion failure.
Signed-off-by: Zhongyu Gao <gzy@sangfor.com.cn>
Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r-- | einj_mem_uc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/einj_mem_uc.c b/einj_mem_uc.c index 21befa9..843a382 100644 --- a/einj_mem_uc.c +++ b/einj_mem_uc.c @@ -234,6 +234,9 @@ static void *instr_alloc(void) p += 2 * pagesize; + /*pre-load the dosum memory page to prevent vtop conversion failure*/ + dosums(); + return (void *)((long)p & ~(pagesize - 1)); } |