From 62a80973477b87d7d14b378f7f6bba01ba3dd0d1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 27 Jul 2022 16:59:43 +0200 Subject: [PATCH] 5.4-stable patches added patches: x86-drop-bogus-cc-clobber-from-__try_cmpxchg_user_asm.patch --- queue-5.4/series | 1 + ...-clobber-from-__try_cmpxchg_user_asm.patch | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 queue-5.4/x86-drop-bogus-cc-clobber-from-__try_cmpxchg_user_asm.patch diff --git a/queue-5.4/series b/queue-5.4/series index 761bd574f85..c4979baf908 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -84,3 +84,4 @@ tty-drop-tty_schedule_flip.patch tty-extract-tty_flip_buffer_commit-from-tty_flip_buffer_push.patch tty-use-new-tty_insert_flip_string_and_push_buffer-in-pty_write.patch net-usb-ax88179_178a-needs-flag_send_zlp.patch +x86-drop-bogus-cc-clobber-from-__try_cmpxchg_user_asm.patch diff --git a/queue-5.4/x86-drop-bogus-cc-clobber-from-__try_cmpxchg_user_asm.patch b/queue-5.4/x86-drop-bogus-cc-clobber-from-__try_cmpxchg_user_asm.patch new file mode 100644 index 00000000000..dcba8a0bbb7 --- /dev/null +++ b/queue-5.4/x86-drop-bogus-cc-clobber-from-__try_cmpxchg_user_asm.patch @@ -0,0 +1,36 @@ +From 1df931d95f4dc1c11db1123e85d4e08156e46ef9 Mon Sep 17 00:00:00 2001 +From: Jan Beulich +Date: Tue, 7 Jun 2022 17:00:53 +0200 +Subject: x86: drop bogus "cc" clobber from __try_cmpxchg_user_asm() + +From: Jan Beulich + +commit 1df931d95f4dc1c11db1123e85d4e08156e46ef9 upstream. + +As noted (and fixed) a couple of times in the past, "=@cc" outputs +and clobbering of "cc" don't work well together. The compiler appears to +mean to reject such, but doesn't - in its upstream form - quite manage +to yet for "cc". Furthermore two similar macros don't clobber "cc", and +clobbering "cc" is pointless in asm()-s for x86 anyway - the compiler +always assumes status flags to be clobbered there. + +Fixes: 989b5db215a2 ("x86/uaccess: Implement macros for CMPXCHG on user addresses") +Signed-off-by: Jan Beulich +Message-Id: <485c0c0b-a3a7-0b7c-5264-7d00c01de032@suse.com> +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/uaccess.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/include/asm/uaccess.h ++++ b/arch/x86/include/asm/uaccess.h +@@ -498,7 +498,7 @@ __pu_label: \ + [ptr] "+m" (*_ptr), \ + [old] "+a" (__old) \ + : [new] ltype (__new) \ +- : "memory", "cc"); \ ++ : "memory"); \ + if (unlikely(__err)) \ + goto label; \ + if (unlikely(!success)) \ -- 2.47.3