public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Borislav Petkov <bp@alien8.de>, X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH v1 11/12] x86, alternative: Use alternative_2 in rdtsc_barrier
Date: Tue, 03 Feb 2015 11:55:11 -0800	[thread overview]
Message-ID: <54D1279F.5030705@amacapital.net> (raw)
In-Reply-To: <1422987390-17878-12-git-send-email-bp@alien8.de>

On 02/03/2015 10:16 AM, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> ... now that we have it.

Hallelujah!

Acked-by: Andy Lutomirski <luto@amacapital.net>

>
> Cc: Richard Weinberger <richard@nod.at>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>   arch/x86/include/asm/barrier.h | 6 ++----
>   arch/x86/um/asm/barrier.h      | 4 ++--
>   2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
> index 2ab1eb33106e..959e45b81fe2 100644
> --- a/arch/x86/include/asm/barrier.h
> +++ b/arch/x86/include/asm/barrier.h
> @@ -95,13 +95,11 @@ do {									\
>    * Stop RDTSC speculation. This is needed when you need to use RDTSC
>    * (or get_cycles or vread that possibly accesses the TSC) in a defined
>    * code region.
> - *
> - * (Could use an alternative three way for this if there was one.)
>    */
>   static __always_inline void rdtsc_barrier(void)
>   {
> -	alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
> -	alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
> +	alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC,
> +			  "lfence", X86_FEATURE_LFENCE_RDTSC);
>   }
>
>   #endif /* _ASM_X86_BARRIER_H */
> diff --git a/arch/x86/um/asm/barrier.h b/arch/x86/um/asm/barrier.h
> index 2d7d9a1f5b53..8ffd2146fa6a 100644
> --- a/arch/x86/um/asm/barrier.h
> +++ b/arch/x86/um/asm/barrier.h
> @@ -64,8 +64,8 @@
>    */
>   static inline void rdtsc_barrier(void)
>   {
> -	alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
> -	alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
> +	alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC,
> +			  "lfence", X86_FEATURE_LFENCE_RDTSC);
>   }
>
>   #endif
>


  reply	other threads:[~2015-02-03 19:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 18:16 [PATCH v1 00/12] x86, alternatives: Instruction padding and more robust JMPs Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 01/12] x86, copy_user: Remove FIX_ALIGNMENT define Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 02/12] x86, alternatives: Cleanup DPRINTK macro Borislav Petkov
2015-02-03 19:01   ` Joe Perches
2015-02-03 18:16 ` [PATCH v1 03/12] x86, alternatives: Add instruction padding Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 04/12] x86, alternatives: Make JMPs more robust Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 05/12] x86, alternatives: Use optimized NOPs for padding Borislav Petkov
2015-02-03 19:36   ` Andy Lutomirski
2015-02-03 19:54     ` Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 06/12] x86, copy_page_64.S: Use generic ALTERNATIVE macro Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 07/12] x86, copy_user_64.S: Convert to ALTERNATIVE_2 Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 08/12] x86, SMAP: Use ALTERNATIVE macro Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 09/12] x86, alternative: Convert X86_INVD_BUG to generic macro Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 10/12] x86, alternatives: Convert clear_page_64.S Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 11/12] x86, alternative: Use alternative_2 in rdtsc_barrier Borislav Petkov
2015-02-03 19:55   ` Andy Lutomirski [this message]
2015-02-03 20:08     ` Borislav Petkov
2015-02-03 18:16 ` [PATCH v1 12/12] x86, alternative: Cleanup prefetch primitives Borislav Petkov
2015-02-18 21:20 ` [PATCH v1 00/12] x86, alternatives: Instruction padding and more robust JMPs Ingo Molnar
2015-02-18 21:23   ` Borislav Petkov
2015-02-24 11:04   ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D1279F.5030705@amacapital.net \
    --to=luto@amacapital.net \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox