Commit 9a40ac86 authored by Khem Raj's avatar Khem Raj Committed by Russell King

ARM: 6164/1: Add kto and kfrom to input operands list.

When functions incoming parameters are not in input operands list gcc
4.5 does not load the parameters into registers before calling this
function but the inline assembly assumes valid addresses inside this
function. This breaks the code because r0 and r1 are invalid when
execution enters v4wb_copy_user_page ()

Also the constant needs to be used as third input operand so account
for that as well.

Tested on qemu arm.

CC: <stable@kernel.org>
Signed-off-by: default avatarKhem Raj <raj.khem@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 76962be8
...@@ -18,7 +18,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom) ...@@ -18,7 +18,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
{ {
asm("\ asm("\
stmfd sp!, {r4-r9, lr} \n\ stmfd sp!, {r4-r9, lr} \n\
mov ip, %0 \n\ mov ip, %2 \n\
1: mov lr, r1 \n\ 1: mov lr, r1 \n\
ldmia r1!, {r2 - r9} \n\ ldmia r1!, {r2 - r9} \n\
pld [lr, #32] \n\ pld [lr, #32] \n\
...@@ -64,7 +64,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom) ...@@ -64,7 +64,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\ mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\
ldmfd sp!, {r4-r9, pc}" ldmfd sp!, {r4-r9, pc}"
: :
: "I" (PAGE_SIZE)); : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE));
} }
void feroceon_copy_user_highpage(struct page *to, struct page *from, void feroceon_copy_user_highpage(struct page *to, struct page *from,
......
...@@ -27,7 +27,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom) ...@@ -27,7 +27,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
{ {
asm("\ asm("\
stmfd sp!, {r4, lr} @ 2\n\ stmfd sp!, {r4, lr} @ 2\n\
mov r2, %0 @ 1\n\ mov r2, %2 @ 1\n\
ldmia r1!, {r3, r4, ip, lr} @ 4\n\ ldmia r1!, {r3, r4, ip, lr} @ 4\n\
1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\ 1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\
stmia r0!, {r3, r4, ip, lr} @ 4\n\ stmia r0!, {r3, r4, ip, lr} @ 4\n\
...@@ -44,7 +44,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom) ...@@ -44,7 +44,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB\n\ mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB\n\
ldmfd sp!, {r4, pc} @ 3" ldmfd sp!, {r4, pc} @ 3"
: :
: "I" (PAGE_SIZE / 64)); : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
} }
void v4wb_copy_user_highpage(struct page *to, struct page *from, void v4wb_copy_user_highpage(struct page *to, struct page *from,
......
...@@ -25,7 +25,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom) ...@@ -25,7 +25,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
{ {
asm("\ asm("\
stmfd sp!, {r4, lr} @ 2\n\ stmfd sp!, {r4, lr} @ 2\n\
mov r2, %0 @ 1\n\ mov r2, %2 @ 1\n\
ldmia r1!, {r3, r4, ip, lr} @ 4\n\ ldmia r1!, {r3, r4, ip, lr} @ 4\n\
1: stmia r0!, {r3, r4, ip, lr} @ 4\n\ 1: stmia r0!, {r3, r4, ip, lr} @ 4\n\
ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\ ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\
...@@ -40,7 +40,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom) ...@@ -40,7 +40,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
mcr p15, 0, r2, c7, c7, 0 @ flush ID cache\n\ mcr p15, 0, r2, c7, c7, 0 @ flush ID cache\n\
ldmfd sp!, {r4, pc} @ 3" ldmfd sp!, {r4, pc} @ 3"
: :
: "I" (PAGE_SIZE / 64)); : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
} }
void v4wt_copy_user_highpage(struct page *to, struct page *from, void v4wt_copy_user_highpage(struct page *to, struct page *from,
......
...@@ -34,7 +34,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom) ...@@ -34,7 +34,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
{ {
asm("\ asm("\
stmfd sp!, {r4, r5, lr} \n\ stmfd sp!, {r4, r5, lr} \n\
mov lr, %0 \n\ mov lr, %2 \n\
\n\ \n\
pld [r1, #0] \n\ pld [r1, #0] \n\
pld [r1, #32] \n\ pld [r1, #32] \n\
...@@ -67,7 +67,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom) ...@@ -67,7 +67,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
\n\ \n\
ldmfd sp!, {r4, r5, pc}" ldmfd sp!, {r4, r5, pc}"
: :
: "I" (PAGE_SIZE / 64 - 1)); : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64 - 1));
} }
void xsc3_mc_copy_user_highpage(struct page *to, struct page *from, void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment