summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-02-02 03:49:42 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-13 20:37:47 +0300
commit989b5db215a2f22f89d730b607b071d964780f10 (patch)
treea48dcc261dd512fc47863dd9280176aa31885276 /fs
parent1aa0e8b144b6474c4914439d232d15bfe883636b (diff)
downloadlinux-989b5db215a2f22f89d730b607b071d964780f10.tar.xz
x86/uaccess: Implement macros for CMPXCHG on user addresses
Add support for CMPXCHG loops on userspace addresses. Provide both an "unsafe" version for tight loops that do their own uaccess begin/end, as well as a "safe" version for use cases where the CMPXCHG is not buried in a loop, e.g. KVM will resume the guest instead of looping when emulation of a guest atomic accesses fails the CMPXCHG. Provide 8-byte versions for 32-bit kernels so that KVM can do CMPXCHG on guest PAE PTEs, which are accessed via userspace addresses. Guard the asm_volatile_goto() variation with CC_HAS_ASM_GOTO_TIED_OUTPUT, the "+m" constraint fails on some compilers that otherwise support CC_HAS_ASM_GOTO_OUTPUT. Cc: stable@vger.kernel.org Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Co-developed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20220202004945.2540433-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions