aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2020-08-24 09:59:01 -0700
committerTony Luck <tony.luck@intel.com>2020-08-24 09:59:01 -0700
commit6b0a86d66540ebee5d15164e98b9f2160f7adf54 (patch)
treecb5db55cdc57d75c522ed4b0be40ec5f6ca428d7
parentd1f9fd9b0f4a7909ba829904a495d7fec13b2f4e (diff)
downloadras-tools-6b0a86d66540ebee5d15164e98b9f2160f7adf54.tar.gz
einj_mem_uc: Apply runup/size parameters from "-m" argument to copyin test
In order to force different code paths in the kernel, allow user to adjust start/size of kernel copy so that the poison is consumed at different points in the copy. Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--einj_mem_uc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/einj_mem_uc.c b/einj_mem_uc.c
index d661649..9fdc61d 100644
--- a/einj_mem_uc.c
+++ b/einj_mem_uc.c
@@ -246,7 +246,7 @@ int trigger_write(char *addr)
}
/*
- * parameters to the memcpy test.
+ * parameters to the memcpy and copyin tests.
*/
int memcpy_runup = 0; /* how much to copy before hitting poison */
int memcpy_size = 512; /* Total amount to copy */
@@ -304,7 +304,7 @@ int trigger_copyin(char *addr)
return -1;
}
(void)unlink(filename);
- if ((ret = write(fd, addr, 16) != 16)) {
+ if ((ret = write(fd, addr - memcpy_runup, memcpy_size) != memcpy_size)) {
if (ret == -1)
fprintf(stderr, "%s: couldn't write temp file (errno=%d)\n", progname, errno);
else