lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Apr 2023 14:44:55 +0300
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     linux-kselftest@...r.kernel.org,
        Reinette Chatre <reinette.chatre@...el.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org
Cc:     Shaopeng Tan <tan.shaopeng@...fujitsu.com>,
        Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH v2 13/24] selftests/resctrl: Add flush_buffer() to fill_buf

Currently, flushing is only done after allocating and filling the
buffer and cannot be controlled by the test cases.

The new CAT test will want to control flushing within a test so
introduce flush_buffer() for that purpose.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
---
 tools/testing/selftests/resctrl/fill_buf.c | 5 +++++
 tools/testing/selftests/resctrl/resctrl.h  | 1 +
 2 files changed, 6 insertions(+)

diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c
index 677e1a113629..7e0d3a1ea555 100644
--- a/tools/testing/selftests/resctrl/fill_buf.c
+++ b/tools/testing/selftests/resctrl/fill_buf.c
@@ -58,6 +58,11 @@ static void mem_flush(void *p, size_t s)
 	sb();
 }
 
+void flush_buffer(unsigned long long span)
+{
+	mem_flush(startptr, span);
+}
+
 static void *malloc_and_init_memory(size_t s)
 {
 	void *p = NULL;
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index 8748121345f3..ba36eb5fdf0d 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -97,6 +97,7 @@ int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu,
 		    int group_fd, unsigned long flags);
 void free_buffer(void);
 int alloc_buffer(unsigned long long buf_size, int memflush);
+void flush_buffer(unsigned long long span);
 int use_buffer(unsigned long long buf_size, int op, bool once);
 int run_fill_buf(unsigned long span, int memflush, int op, bool once);
 int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param);
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ