public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64
@ 2019-06-06 20:00 Uros Bizjak
  2019-06-10 17:31 ` Reinette Chatre
  2019-06-10 20:52 ` [tip:x86/cache] x86/resctrl: Use _ASM_BX to avoid ifdeffery tip-bot for Uros Bizjak
  0 siblings, 2 replies; 3+ messages in thread
From: Uros Bizjak @ 2019-06-06 20:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Uros Bizjak, Fenghua Yu, Reinette Chatre, x86

Depending on CONFIG_X86_64 _ASM_BX expands to either rbx or ebx.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: x86@kernel.org
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
index 604c0e3bcc83..09408794eab2 100644
--- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
+++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
@@ -431,11 +431,7 @@ static int pseudo_lock_fn(void *_rdtgrp)
 #else
 	register unsigned int line_size asm("esi");
 	register unsigned int size asm("edi");
-#ifdef CONFIG_X86_64
-	register void *mem_r asm("rbx");
-#else
-	register void *mem_r asm("ebx");
-#endif /* CONFIG_X86_64 */
+	register void *mem_r asm(_ASM_BX);
 #endif /* CONFIG_KASAN */
 
 	/*
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64
  2019-06-06 20:00 [PATCH] x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64 Uros Bizjak
@ 2019-06-10 17:31 ` Reinette Chatre
  2019-06-10 20:52 ` [tip:x86/cache] x86/resctrl: Use _ASM_BX to avoid ifdeffery tip-bot for Uros Bizjak
  1 sibling, 0 replies; 3+ messages in thread
From: Reinette Chatre @ 2019-06-10 17:31 UTC (permalink / raw)
  To: Uros Bizjak, linux-kernel, x86, acme, Thomas Gleixner; +Cc: Fenghua Yu

Hi Uros,

On 6/6/2019 1:00 PM, Uros Bizjak wrote:
> Depending on CONFIG_X86_64 _ASM_BX expands to either rbx or ebx.
> 
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Reinette Chatre <reinette.chatre@intel.com>
> Cc: x86@kernel.org
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> ---
>  arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> index 604c0e3bcc83..09408794eab2 100644
> --- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> +++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> @@ -431,11 +431,7 @@ static int pseudo_lock_fn(void *_rdtgrp)
>  #else
>  	register unsigned int line_size asm("esi");
>  	register unsigned int size asm("edi");
> -#ifdef CONFIG_X86_64
> -	register void *mem_r asm("rbx");
> -#else
> -	register void *mem_r asm("ebx");
> -#endif /* CONFIG_X86_64 */
> +	register void *mem_r asm(_ASM_BX);
>  #endif /* CONFIG_KASAN */
>  
>  	/*
> 

Thank you very much for catching this. I was not aware of this macro.

Acked-by: Reinette Chatre <reinette.chatre@intel.com>

Reinette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/cache] x86/resctrl: Use _ASM_BX to avoid ifdeffery
  2019-06-06 20:00 [PATCH] x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64 Uros Bizjak
  2019-06-10 17:31 ` Reinette Chatre
@ 2019-06-10 20:52 ` tip-bot for Uros Bizjak
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Uros Bizjak @ 2019-06-10 20:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, mingo, x86, bp, reinette.chatre, mingo, ubizjak,
	tglx, hpa, fenghua.yu

Commit-ID:  515f0453752e3daba7c47d37d9172a66509a56fd
Gitweb:     https://git.kernel.org/tip/515f0453752e3daba7c47d37d9172a66509a56fd
Author:     Uros Bizjak <ubizjak@gmail.com>
AuthorDate: Thu, 6 Jun 2019 22:00:44 +0200
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Mon, 10 Jun 2019 22:36:38 +0200

x86/resctrl: Use _ASM_BX to avoid ifdeffery

Use the _ASM_BX macro which expands to either %rbx or %ebx, depending on
the 32-bit or 64-bit config selected.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190606200044.5730-1-ubizjak@gmail.com
---
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
index 604c0e3bcc83..09408794eab2 100644
--- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
+++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
@@ -431,11 +431,7 @@ static int pseudo_lock_fn(void *_rdtgrp)
 #else
 	register unsigned int line_size asm("esi");
 	register unsigned int size asm("edi");
-#ifdef CONFIG_X86_64
-	register void *mem_r asm("rbx");
-#else
-	register void *mem_r asm("ebx");
-#endif /* CONFIG_X86_64 */
+	register void *mem_r asm(_ASM_BX);
 #endif /* CONFIG_KASAN */
 
 	/*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-10 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-06 20:00 [PATCH] x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64 Uros Bizjak
2019-06-10 17:31 ` Reinette Chatre
2019-06-10 20:52 ` [tip:x86/cache] x86/resctrl: Use _ASM_BX to avoid ifdeffery tip-bot for Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox