Re: [PATCH RFC V3 5/9] x86/pks: Add PKS kernel API

From
Ira Weiny <hidden>
Date
2020-10-17 05:42:20
Also in
linux-doc, linux-fsdevel, linux-mm, lkml, nvdimm
Reply to
Peter Zijlstra, 2020-10-16
On Fri, Oct 16, 2020 at 01:07:47PM +0200, Peter Zijlstra wrote:
On Fri, Oct 09, 2020 at 12:42:54PM -0700, ira.weiny@intel.com wrote:
quoted
+static inline void pks_update_protection(int pkey, unsigned long protection)
+{
+	current->thread.saved_pkrs = update_pkey_val(current->thread.saved_pkrs,
+						     pkey, protection);
+	preempt_disable();
+	write_pkrs(current->thread.saved_pkrs);
+	preempt_enable();
+}
write_pkrs() already disables preemption itself. Wrapping it in yet
another layer is useless.
I was thinking the update to saved_pkrs needed this protection as well and that
was to be included in the preemption disable.  But that too is incorrect.

I've removed this preemption disable.

Thanks,
Ira
Thread (47 messages) 47 messages, 4 authors, last reply 2020-10-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help