lkml.org 
[lkml]   [2022]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 19/44] mm/pkeys: PKS Testing, add pks_mk_*() tests
On 1/27/22 09:54, ira.weiny@intel.com wrote:
> bool pks_test_callback(void)
> {
> - return false;
> + bool armed = (test_armed_key != 0);
> +
> + if (armed) {
> + pks_mk_readwrite(test_armed_key);
> + fault_cnt++;
> + }
> +
> + return armed;
> +}

Where's the locking for all this? I don't think we need anything fancy,
but is there anything preventing the test from being started from
multiple threads at the same time? I think a simple global test mutex
would probably suffice.

Also, pks_test_callback() needs at least a comment or two about what
it's doing.

Does this work if you have a test armed and then you get an unrelated
PKS fault on another CPU? I think this will disarm the test from the
unrelated thread.

\
 
 \ /
  Last update: 2022-02-01 18:46    [W:1.056 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site