From: Zhen Lei thunder.leizhen@huawei.com
hulk inclusion category: performance bugzilla: https://e.gitee.com/open_euler/issues/list?issue=I4SCW7 CVE: NA
-------------------------------------------------------------------------
This reverts commit 8d4f091ca14427d547986934ba3d5d3043dc12af.
Temporary rollback, which will be backported later so that other patches can be backported without conflict.
Signed-off-by: Zhen Lei thunder.leizhen@huawei.com Reviewed-by: Chen Wandun chenwandun@huawei.com Reviewed-by: Hanjun Guo guohanjun@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/arm64/lib/copy_from_user.S | 13 +++---------- arch/arm64/lib/copy_in_user.S | 21 +++++++-------------- arch/arm64/lib/copy_to_user.S | 14 +++----------- 3 files changed, 13 insertions(+), 35 deletions(-)
diff --git a/arch/arm64/lib/copy_from_user.S b/arch/arm64/lib/copy_from_user.S index 957a6d092d7a..0f8a3a9e3795 100644 --- a/arch/arm64/lib/copy_from_user.S +++ b/arch/arm64/lib/copy_from_user.S @@ -29,7 +29,7 @@ .endm
.macro ldrh1 reg, ptr, val - uao_user_alternative 9997f, ldrh, ldtrh, \reg, \ptr, \val + uao_user_alternative 9998f, ldrh, ldtrh, \reg, \ptr, \val .endm
.macro strh1 reg, ptr, val @@ -37,7 +37,7 @@ .endm
.macro ldr1 reg, ptr, val - uao_user_alternative 9997f, ldr, ldtr, \reg, \ptr, \val + uao_user_alternative 9998f, ldr, ldtr, \reg, \ptr, \val .endm
.macro str1 reg, ptr, val @@ -45,7 +45,7 @@ .endm
.macro ldp1 reg1, reg2, ptr, val - uao_ldp 9997f, \reg1, \reg2, \ptr, \val + uao_ldp 9998f, \reg1, \reg2, \ptr, \val .endm
.macro stp1 reg1, reg2, ptr, val @@ -53,10 +53,8 @@ .endm
end .req x5 -srcin .req x15 SYM_FUNC_START(__arch_copy_from_user) add end, x0, x2 - mov srcin, x1 #include "copy_template.S" mov x0, #0 // Nothing to copy ret @@ -65,11 +63,6 @@ EXPORT_SYMBOL(__arch_copy_from_user)
.section .fixup,"ax" .align 2 -9997: cmp dst, dstin - b.ne 9998f - // Before being absolutely sure we couldn't copy anything, try harder -USER(9998f, ldtrb tmp1w, [srcin]) - strb tmp1w, [dst], #1 9998: sub x0, end, dst // bytes not copied ret .previous diff --git a/arch/arm64/lib/copy_in_user.S b/arch/arm64/lib/copy_in_user.S index 35c01da09323..80e37ada0ee1 100644 --- a/arch/arm64/lib/copy_in_user.S +++ b/arch/arm64/lib/copy_in_user.S @@ -30,34 +30,33 @@ .endm
.macro ldrh1 reg, ptr, val - uao_user_alternative 9997f, ldrh, ldtrh, \reg, \ptr, \val + uao_user_alternative 9998f, ldrh, ldtrh, \reg, \ptr, \val .endm
.macro strh1 reg, ptr, val - uao_user_alternative 9997f, strh, sttrh, \reg, \ptr, \val + uao_user_alternative 9998f, strh, sttrh, \reg, \ptr, \val .endm
.macro ldr1 reg, ptr, val - uao_user_alternative 9997f, ldr, ldtr, \reg, \ptr, \val + uao_user_alternative 9998f, ldr, ldtr, \reg, \ptr, \val .endm
.macro str1 reg, ptr, val - uao_user_alternative 9997f, str, sttr, \reg, \ptr, \val + uao_user_alternative 9998f, str, sttr, \reg, \ptr, \val .endm
.macro ldp1 reg1, reg2, ptr, val - uao_ldp 9997f, \reg1, \reg2, \ptr, \val + uao_ldp 9998f, \reg1, \reg2, \ptr, \val .endm
.macro stp1 reg1, reg2, ptr, val - uao_stp 9997f, \reg1, \reg2, \ptr, \val + uao_stp 9998f, \reg1, \reg2, \ptr, \val .endm
end .req x5 -srcin .req x15 + SYM_FUNC_START(__arch_copy_in_user) add end, x0, x2 - mov srcin, x1 #include "copy_template.S" mov x0, #0 ret @@ -66,12 +65,6 @@ EXPORT_SYMBOL(__arch_copy_in_user)
.section .fixup,"ax" .align 2 -9997: cmp dst, dstin - b.ne 9998f - // Before being absolutely sure we couldn't copy anything, try harder -USER(9998f, ldtrb tmp1w, [srcin]) -USER(9998f, sttrb tmp1w, [dst]) - add dst, dst, #1 9998: sub x0, end, dst // bytes not copied ret .previous diff --git a/arch/arm64/lib/copy_to_user.S b/arch/arm64/lib/copy_to_user.S index 85705350ff35..4ec59704b8f2 100644 --- a/arch/arm64/lib/copy_to_user.S +++ b/arch/arm64/lib/copy_to_user.S @@ -32,7 +32,7 @@ .endm
.macro strh1 reg, ptr, val - uao_user_alternative 9997f, strh, sttrh, \reg, \ptr, \val + uao_user_alternative 9998f, strh, sttrh, \reg, \ptr, \val .endm
.macro ldr1 reg, ptr, val @@ -40,7 +40,7 @@ .endm
.macro str1 reg, ptr, val - uao_user_alternative 9997f, str, sttr, \reg, \ptr, \val + uao_user_alternative 9998f, str, sttr, \reg, \ptr, \val .endm
.macro ldp1 reg1, reg2, ptr, val @@ -48,14 +48,12 @@ .endm
.macro stp1 reg1, reg2, ptr, val - uao_stp 9997f, \reg1, \reg2, \ptr, \val + uao_stp 9998f, \reg1, \reg2, \ptr, \val .endm
end .req x5 -srcin .req x15 SYM_FUNC_START(__arch_copy_to_user) add end, x0, x2 - mov srcin, x1 #include "copy_template.S" mov x0, #0 ret @@ -64,12 +62,6 @@ EXPORT_SYMBOL(__arch_copy_to_user)
.section .fixup,"ax" .align 2 -9997: cmp dst, dstin - b.ne 9998f - // Before being absolutely sure we couldn't copy anything, try harder - ldrb tmp1w, [srcin] -USER(9998f, sttrb tmp1w, [dst]) - add dst, dst, #1 9998: sub x0, end, dst // bytes not copied ret .previous