x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64
Subsystems (2)
PATCH 1/1 x86/resctrl: Use _ASM_BX to avoid #ifdef CONFIG_X86_64
Depending on CONFIG_X86_64 _ASM_BX expands to either rbx or ebx.
Cc Fenghua Yu <[email protected]>
Cc Reinette Chatre <[email protected]>
Signed-off-by Uros Bizjak <[email protected]>
--- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1 -5
@@ -431,11 +431,7 @@ static int pseudo_lock_fn(void *_rdtgrp)#else registerunsigned int line_size asm("esi" ); registerunsigned int size asm("edi" ); -#ifdef CONFIG_X86_64 - registervoid *mem_r asm("rbx" ); -#else - registervoid *mem_r asm("ebx" ); -#endif /* CONFIG_X86_64 */ + register void *mem_r asm(_ASM_BX);#endif /* CONFIG_KASAN */ /*
Signature · 1 line
2.21.0
Hi Uros,
Quoted 18 lines · Uros Bizjak
Depending on
CONFIG_X86_64_ASM_BXexpands to either rbx or ebx.Cc Fenghua Yu <[email protected]>Cc Reinette Chatre <[email protected]>Signed-off-by Uros Bizjak <[email protected]>--- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)arch/x86/kernel/cpu/resctrl/pseudo_lock.c +0
-0@@ -431,11 +431,7 @@ static int pseudo_lock_fn(void *_rdtgrp)#else registerunsigned int line_size asm("esi" );
arch/x86/kernel/cpu/resctrl/pseudo_lock.c static int pseudo_lock_fn(void *_rdtgrp) · line 437
Quoted 10 lines
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1
-5registerunsigned int size asm("edi" ); -#ifdef CONFIG_X86_64 - registervoid *mem_r asm("rbx" ); -#else - registervoid *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 <[email protected]>
Reinette
tip-bot for Uros Bizjak
merge bot[tip:x86/cache] x86/resctrl: Use _ASM_BX to avoid ifdeffery
In reply to Uros Bizjakx86/resctrl: Use _ASM_BX to avoid ifdeffery
Commit-ID: 515f0453752e3daba7c47d37d9172a66509a56fd Gitweb: https://git.kernel.org/tip/515f0453752e3daba7c47d37d9172a66509a56fd Author: Uros Bizjak <[email protected]> AuthorDate: Thu, 6 Jun 2019 22:00:44 +0200 Committer: Borislav Petkov <[email protected]> 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 <[email protected]>
Signed-off-by Borislav Petkov <[email protected]>
Acked-by Reinette Chatre <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc x86-ml <[email protected]>
--- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1 -5
@@ -431,11 +431,7 @@ static int pseudo_lock_fn(void *_rdtgrp)#else registerunsigned int line_size asm("esi" ); registerunsigned int size asm("edi" ); -#ifdef CONFIG_X86_64 - registervoid *mem_r asm("rbx" ); -#else - registervoid *mem_r asm("ebx" ); -#endif /* CONFIG_X86_64 */ + register void *mem_r asm(_ASM_BX);#endif /* CONFIG_KASAN */ /*