Re: [PATCH RFC V3 4/9] x86/pks: Preserve the PKRS MSR on context switch

From
Ira Weiny <hidden>
Date
2020-10-19 18:49:03
Also in
linux-fsdevel, linux-kselftest, linux-mm, lkml, nvdimm
Reply to
Peter Zijlstra, 2020-10-19
On Mon, Oct 19, 2020 at 11:37:14AM +0200, Peter Zijlstra wrote:
On Fri, Oct 16, 2020 at 10:14:10PM -0700, Ira Weiny wrote:
quoted
quoted
so it either needs to
explicitly do so, or have an assertion that preemption is indeed
disabled.
However, I don't think I understand clearly.  Doesn't [get|put]_cpu_ptr()
handle the preempt_disable() for us? 
It does.
quoted
Is it not sufficient to rely on that?
It is.
quoted
Dave's comment seems to be the opposite where we need to eliminate preempt
disable before calling write_pkrs().

FWIW I think I'm mistaken in my response to Dave regarding the
preempt_disable() in pks_update_protection().
Dave's concern is that we're calling with with preemption already
disabled so disabling it again is superfluous.
Ok, thanks, and after getting my head straight I think I agree with him, and
you.

Thanks I've reworked the code to removed the superfluous calls.  Sorry about
being so dense...  :-D

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