Thread (47 messages) flat view 47 messages, 9 authors, 2022-01-28

Re: [RFC][PATCH v2 4/5] x86/uaccess: Implement unsafe_try_cmpxchg_user()

From: Peter Zijlstra <peterz@infradead.org>
Date: 2022-01-27 09:56:39
Also in: linux-mm, lkml

On Thu, Jan 27, 2022 at 06:36:19AM +0000, Sean Christopherson wrote:
On Thu, Jan 27, 2022, Sean Christopherson wrote:
quoted
Doh, I should have specified that KVM needs 8-byte CMPXCHG on 32-bit kernels due
to using it to atomically update guest PAE PTEs and LTR descriptors (yay).

Also, KVM's use case isn't a tight loop, how gross would it be to add a slightly
less unsafe version that does __uaccess_begin_nospec()?  KVM pre-checks the address
way ahead of time, so the access_ok() check can be omitted.  Alternatively, KVM
could add its own macro, but that seems a little silly.  E.g. somethign like this,
though I don't think this is correct
*sigh*

Finally realized I forgot to add back the page offset after converting from guest
page frame to host virtual address.  Anyways, this is what I ended up with, will
test more tomorrow.
Looks about right :-) (famous last words etc..)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help