[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220429094355.122389-21-chenzhongjin@huawei.com>
Date: Fri, 29 Apr 2022 17:43:38 +0800
From: Chen Zhongjin <chenzhongjin@...wei.com>
To: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-arch@...r.kernel.org>
CC: <jthierry@...hat.com>, <catalin.marinas@....com>,
<will@...nel.org>, <masahiroy@...nel.org>, <jpoimboe@...hat.com>,
<peterz@...radead.org>, <ycote@...hat.com>,
<herbert@...dor.apana.org.au>, <mark.rutland@....com>,
<davem@...emloft.net>, <ardb@...nel.org>, <maz@...nel.org>,
<tglx@...utronix.de>, <luc.vanoostenryck@...il.com>,
<chenzhongjin@...wei.com>
Subject: [RFC PATCH v4 20/37] arm64: Set intra-function call annotations
From: Julien Thierry <jthierry@...hat.com>
Stack validation requires BL instructions to an address,
within the symbol containing the BL should be annotated as intra-function
calls.
Make __pmull_p8_core normally set frame because there's a intra-function
call destinating middle of it and the caller have set the frame. When
analyzing the insns there will be a cfi state mismatch between normal-call
and intra-call.
Signed-off-by: Julien Thierry <jthierry@...hat.com>
Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
---
arch/arm64/crypto/crct10dif-ce-core.S | 5 +++++
arch/arm64/kernel/entry.S | 2 ++
2 files changed, 7 insertions(+)
diff --git a/arch/arm64/crypto/crct10dif-ce-core.S b/arch/arm64/crypto/crct10dif-ce-core.S
index dce6dcebfca1..a1b10d2fb06d 100644
--- a/arch/arm64/crypto/crct10dif-ce-core.S
+++ b/arch/arm64/crypto/crct10dif-ce-core.S
@@ -63,6 +63,7 @@
//
#include <linux/linkage.h>
+#include <linux/objtool.h>
#include <asm/assembler.h>
.text
@@ -132,6 +133,8 @@
.endm
SYM_FUNC_START_LOCAL(__pmull_p8_core)
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
.L__pmull_p8_core:
ext t4.8b, ad.8b, ad.8b, #1 // A1
ext t5.8b, ad.8b, ad.8b, #2 // A2
@@ -193,6 +196,7 @@ SYM_FUNC_START_LOCAL(__pmull_p8_core)
eor t4.16b, t4.16b, t5.16b
eor t6.16b, t6.16b, t3.16b
+ ldp x29, x30, [sp], #16
ret
SYM_FUNC_END(__pmull_p8_core)
@@ -207,6 +211,7 @@ SYM_FUNC_END(__pmull_p8_core)
pmull2 \rq\().8h, \ad\().16b, \bd\().16b // D = A*B
.endif
+ ANNOTATE_INTRA_FUNCTION_CALL
bl .L__pmull_p8_core\i
eor \rq\().16b, \rq\().16b, t4.16b
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index ede028dee81b..47829a3077be 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -10,6 +10,7 @@
#include <linux/arm-smccc.h>
#include <linux/init.h>
#include <linux/linkage.h>
+#include <linux/objtool.h>
#include <asm/alternative.h>
#include <asm/assembler.h>
@@ -682,6 +683,7 @@ alternative_else_nop_endif
* entry onto the return stack and using a RET instruction to
* enter the full-fat kernel vectors.
*/
+ ANNOTATE_INTRA_FUNCTION_CALL
bl 2f
b .
2:
--
2.17.1
Powered by blists - more mailing lists