[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2a34e60a-6ac3-0f83-51d5-80a4c6403504@redhat.com>
Date: Tue, 7 Jun 2022 17:16:52 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Jan Beulich <jbeulich@...e.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Sean Christopherson <seanjc@...gle.com>
Subject: Re: [PATCH] x86: drop bogus "cc" clobber from
__try_cmpxchg_user_asm()
On 6/7/22 17:00, Jan Beulich wrote:
> As noted (and fixed) a couple of times in the past, "=@cc<cond>" 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 <jbeulich@...e.com>
> ---
> The change I continue to carry locally actually allows specifying that
> "cc" is _not_ clobbered; it only happens to improve detection of bad
> situations like the one here.
>
> --- a/arch/x86/include/asm/uaccess.h
> +++ b/arch/x86/include/asm/uaccess.h
> @@ -439,7 +439,7 @@ do { \
> [ptr] "+m" (*_ptr), \
> [old] "+a" (__old) \
> : [new] ltype (__new) \
> - : "memory", "cc"); \
> + : "memory"); \
> if (unlikely(__err)) \
> goto label; \
> if (unlikely(!success)) \
>
Queued, thanks.
Paolo
Powered by blists - more mailing lists