[PATCH v5 10/10] x86/asm/lib: Fix asmvalidate warnings for rwsem.S

Josh Poimboeuf
2015-06-10T12:08:10Z

Fix the following asmvalidate warnings:

asmvalidate: arch/x86/lib/rwsem.o: call_rwsem_down_read_failed(): missing FP_SAVE/RESTORE macros
asmvalidate: arch/x86/lib/rwsem.o: call_rwsem_down_write_failed(): missing FP_SAVE/RESTORE macros
asmvalidate: arch/x86/lib/rwsem.o: call_rwsem_wake(): missing FP_SAVE/RESTORE macros
asmvalidate: arch/x86/lib/rwsem.o: call_rwsem_downgrade_wake(): missing FP_SAVE/RESTORE macros

These are callable non-leaf functions, so save/restore the frame pointer
with FP_SAVE/RESTORE.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
arch/x86/lib/rwsem.S | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/lib/rwsem.S b/arch/x86/lib/rwsem.S
index 40027db..709bc9d 100644
--- a/arch/x86/lib/rwsem.S
+++ b/arch/x86/lib/rwsem.S
@@ -15,6 +15,7 @@

#include <linux/linkage.h>
#include <asm/alternative-asm.h>
+#include <asm/func.h>

#define __ASM_HALF_REG(reg) __ASM_SEL(reg, e##reg)
#define __ASM_HALF_SIZE(inst) __ASM_SEL(inst##w, inst##l)
@@ -84,24 +85,29 @@

/* Fix up special calling conventions */
ENTRY(call_rwsem_down_read_failed)
+ FP_SAVE
save_common_regs
__ASM_SIZE(push,) %__ASM_REG(dx)
movq %rax,%rdi
call rwsem_down_read_failed
__ASM_SIZE(pop,) %__ASM_REG(dx)
restore_common_regs
+ FP_RESTORE
ret
ENDPROC(call_rwsem_down_read_failed)

ENTRY(call_rwsem_down_write_failed)
+ FP_SAVE
save_common_regs
movq %rax,%rdi
call rwsem_down_write_failed
restore_common_regs
+ FP_RESTORE
ret
ENDPROC(call_rwsem_down_write_failed)

ENTRY(call_rwsem_wake)
+ FP_SAVE
/* do nothing if still outstanding active readers */
__ASM_HALF_SIZE(dec) %__ASM_HALF_REG(dx)
jnz 1f
@@ -109,15 +115,18 @@ ENTRY(call_rwsem_wake)
movq %rax,%rdi
call rwsem_wake
restore_common_regs
-1: ret
+1: FP_RESTORE
+ ret
ENDPROC(call_rwsem_wake)

ENTRY(call_rwsem_downgrade_wake)
+ FP_SAVE
save_common_regs
__ASM_SIZE(push,) %__ASM_REG(dx)
movq %rax,%rdi
call rwsem_downgrade_wake
__ASM_SIZE(pop,) %__ASM_REG(dx)
restore_common_regs
+ FP_RESTORE
ret
ENDPROC(call_rwsem_downgrade_wake)
--
2.1.0