lkml.org 
[lkml]   [2024]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 3/3] x86: call instrumentation hooks from copy_mc.c
From
On 2024/03/20 1:36, Alexander Potapenko wrote:
> @@ -61,10 +62,20 @@ unsigned long copy_mc_enhanced_fast_string(void *dst, const void *src, unsigned
> */
> unsigned long __must_check copy_mc_to_kernel(void *dst, const void *src, unsigned len)
> {
> - if (copy_mc_fragile_enabled)
> - return copy_mc_fragile(dst, src, len);
> - if (static_cpu_has(X86_FEATURE_ERMS))
> - return copy_mc_enhanced_fast_string(dst, src, len);
> + unsigned long ret;
> +
> + if (copy_mc_fragile_enabled) {
> + instrument_memcpy_before(dst, src, len);

I feel that instrument_memcpy_before() needs to be called *after*
copy_mc_fragile() etc. , for we can't predict how many bytes will
copy_mc_fragile() etc. actually copy.

> + ret = copy_mc_fragile(dst, src, len);
> + instrument_memcpy_after(dst, src, len, ret);
> + return ret;
> + }


\
 
 \ /
  Last update: 2024-05-27 15:55    [W:0.138 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site