Re: [RFC PATCH v2 13/13] objtool: arm64: Enable stack validation for arm64

2021-03-09 Thread Julien Thierry
On 3/7/21 11:25 AM, Ard Biesheuvel wrote: On Wed, 3 Mar 2021 at 18:10, Julien Thierry wrote: From: Raphael Gault Add build option to run stack validation at compile time. When requiring stack validation, jump tables are disabled as it simplifies objtool analysis (without having

Re: [RFC PATCH v2 00/13] objtool: add base support for arm64

2021-03-09 Thread Julien Thierry
], but there are multiple parts in arm64 assembler needing this). I have not submitted those yet because I didn't want the amount of patches to become overwhelming and mixing objtool + kernel sources. [1] https://github.com/julien-thierry/linux/commit/9005e9f3bb10aac663c42bb87d337b7a1aae5a67 [2] https

Re: [RFC PATCH v2 00/13] objtool: add base support for arm64

2021-03-04 Thread Julien Thierry
. Add a target that can be called from the top level as such: $ make tools/objtool/build-test Signed-off-by: Julien Thierry --- tools/Makefile | 3 +++ tools/objtool/Makefile | 6 ++ 2 files changed, 9 insertions(+) diff --git a/tools/Makefile b/tools/Makefile index 7e9d34ddd

[RFC PATCH v2 12/13] objtool: arm64: Ignore replacement section for alternative callback

2021-03-03 Thread Julien Thierry
ARM64_CB_PATCH doesn't have static replacement instructions. Skip trying to validate the alternative section. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/special.c | 12 tools/objtool/check.c | 3 +++ 2 files changed, 15 insertions(+) diff --git

[RFC PATCH v2 03/13] tools: bug: Remove duplicate definition

2021-03-03 Thread Julien Thierry
Under tools, bug.h only defines BUILD_BUG_ON_ZERO() which is already defined in build_bug.h. This prevents a file to include both headers at the same time. Have bug.h include build_bug.h instead. Signed-off-by: Julien Thierry --- tools/include/linux/bug.h | 6 +- 1 file changed, 1

[RFC PATCH v2 07/13] objtool: arm64: Decode other system instructions

2021-03-03 Thread Julien Thierry
Decode ERET, BRK and NOPs Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index 983f16b8b2af..3008dcbb5e64 100644 --- a/tools/objtool/arch/arm64

[RFC PATCH v2 09/13] objtool: arm64: Decode LDR instructions

2021-03-03 Thread Julien Thierry
Load literal instructions can generate constants inside code sections. Record the locations of the constants in order to be able to remove their corresponding "struct instruction". Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c| 86 +

[RFC PATCH v2 02/13] tools: arm64: Make aarch64 instruction decoder available to tools

2021-03-03 Thread Julien Thierry
Add aarch64 encoder/decoder implementation under tools/ as well as the necessary arm64 headers. Signed-off-by: Julien Thierry --- tools/arch/arm64/include/asm/insn.h | 565 +++ tools/arch/arm64/lib/insn.c | 1456 +++ 2 files changed, 2021 insertions

[RFC PATCH v2 06/13] objtool: arm64: Decode jump and call related instructions

2021-03-03 Thread Julien Thierry
Decode branch, branch and link (aarch64's call) and return instructions. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index

[RFC PATCH v2 01/13] tools: Add some generic functions and headers

2021-03-03 Thread Julien Thierry
These will be needed to be able to use arm64 instruction decoder in userland tools. Signed-off-by: Julien Thierry --- tools/include/asm-generic/bitops/__ffs.h | 11 +++ tools/include/linux/kernel.h | 21 + tools/include/linux/printk.h | 40

[RFC PATCH v2 13/13] objtool: arm64: Enable stack validation for arm64

2021-03-03 Thread Julien Thierry
size nor system performance. Signed-off-by: Raphael Gault Signed-off-by: Julien Thierry --- arch/arm64/Kconfig | 1 + arch/arm64/Makefile | 4 2 files changed, 5 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1f212b47a48a..928323c03318 100644 --- a/arch/arm64

[RFC PATCH v2 10/13] objtool: arm64: Accept padding in code sections

2021-03-03 Thread Julien Thierry
The compiler can introduce some '0' words in code sections to pad the end of functions. Similar to load literal functions, record these zero words to remove the "struct instruction" created for them. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 19

[RFC PATCH v2 08/13] objtool: arm64: Decode load/store instructions

2021-03-03 Thread Julien Thierry
the base pointer after the load). Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 148 ++ 1 file changed, 148 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index 3008dcbb5e64..4e086d2251f5 100644

[RFC PATCH v2 8/8] arm64: insn: Add load/store decoding helpers

2021-03-03 Thread Julien Thierry
Provide some function to group different load/store instructions. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/insn.h | 28 1 file changed, 28 insertions(+) diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h index 388aa22eacb1

[RFC PATCH v2 05/13] objtool: arm64: Decode add/sub instructions

2021-03-03 Thread Julien Thierry
Decode aarch64 additions and substractions and create stack_ops for instructions interacting with SP or FP. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 94 +++ 1 file changed, 94 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c

[RFC PATCH v2 04/13] objtool: arm64: Add base definition for arm64 backend

2021-03-03 Thread Julien Thierry
Provide needed definitions for a new architecture instruction decoder. No proper decoding is done yet. Signed-off-by: Julien Thierry --- tools/objtool/Makefile| 5 + tools/objtool/arch/arm64/Build| 8 ++ tools/objtool/arch/arm64/decode.c

[RFC PATCH v2 00/13] objtool: add base support for arm64

2021-03-03 Thread Julien Thierry
, there are still some errors when building with objtool. A number of cleanups/annotations are needed on the arm64, as well as handling SYM_DATA objects in objtool. Those changes can be found on top of this branch here: git clone https://github.com/julien-thierry/linux.git -b objtoolxarm64-latest Changes

[RFC PATCH v2 11/13] objtool: arm64: Handle supported relocations in alternatives

2021-03-03 Thread Julien Thierry
Based on get_alt_insn() in arch/arm64/kernel/alternative.c, arm64 alternative code adapts offsets for static branches and adrp instructions. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/special.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools

[RFC PATCH v2 7/8] arm64: insn: Add some opcodes to instruction decoder

2021-03-03 Thread Julien Thierry
Add decoding capability for some instructions that objtool will need to decode. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/insn.h | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h index 185f52ef0228

[RFC PATCH v2 6/8] arm64: insn: Add barrier encodings

2021-03-03 Thread Julien Thierry
Create necessary functions to encode/decode aarch64 barrier instructions. DSB needs special case handling as it has multiple encodings. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/insn.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/include

[RFC PATCH v2 3/8] arm64: insn: Reduce header dependencies of instruction decoder

2021-03-03 Thread Julien Thierry
The instruction encoder/decoder depends on alternative headers only for single macro definitions that could be part of the instruction decoder. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/alternative-macros.h | 3 --- arch/arm64/include/asm/insn.h | 3 ++- 2 files

[RFC PATCH v2 5/8] arm64: insn: Add SVE instruction class

2021-03-03 Thread Julien Thierry
SVE has been public for some time now. Let the decoder acknowledge its existence. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/insn.h | 1 + arch/arm64/lib/insn.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64

[RFC PATCH v2 4/8] arm64: Move instruction encoder/decoder under lib/

2021-03-03 Thread Julien Thierry
. Code was only moved, no code should have been added, removed nor modifier. Signed-off-by: Julien Thierry --- arch/arm64/kernel/Makefile| 2 +- arch/arm64/lib/Makefile | 6 +++--- arch/arm64/{kernel => lib}/insn.c | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename a

[RFC PATCH v2 2/8] arm64: Move aarch32 condition check functions

2021-03-03 Thread Julien Thierry
The functions to check condition flags for aarch32 execution is only used to emulate aarch32 instructions. Move them from the instruction encoding/decoding code to the trap handling files. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/insn.h| 2 - arch/arm64/include/asm

[RFC PATCH v2 1/8] arm64: Move patching utilities out of instruction encoding/decoding

2021-03-03 Thread Julien Thierry
Files insn.[c|h] containt some functions used for instruction patching. In order to reuse the instruction encoder/decoder, move the patching utilities to their own file. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/insn.h | 5 - arch/arm64/include/asm/patching.h | 13

[RFC PATCH v2 0/8] arm64: Prepare instruction decoder for objtool

2021-03-03 Thread Julien Thierry
encoder/decoder capabilities in several steps as suggested by Mark R. - Exclude dsb encoding where CRm != 0b0x00 - Support dsb FEAT_XS encoding - Support previously missing barriers [1] https://lkml.org/lkml/2021/1/20/791 Thanks, Julien --> Julien Thierry (8): arm64: Move patching utilit

Re: [RFC PATCH 1/5] arm64: Move instruction encoder/decoder under lib/

2021-02-03 Thread Julien Thierry
On 2/3/21 12:12 PM, Mark Rutland wrote: On Wed, Feb 03, 2021 at 09:26:45AM +0100, Julien Thierry wrote: On 2/2/21 11:17 AM, Mark Rutland wrote: On Wed, Jan 20, 2021 at 06:17:41PM +0100, Julien Thierry wrote: Aarch64 instruction set encoding and decoding logic can prove useful for some

Re: [RFC PATCH 3/5] arm64: aarch64-insn: Add barrier encodings

2021-02-03 Thread Julien Thierry
On 2/2/21 12:15 PM, Mark Rutland wrote: On Wed, Jan 20, 2021 at 06:17:43PM +0100, Julien Thierry wrote: Create necessary functions to encode/decode aarch64 data/instruction barriers. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/aarch64-insn.h | 9 + 1 file changed, 9

Re: [RFC PATCH 1/5] arm64: Move instruction encoder/decoder under lib/

2021-02-03 Thread Julien Thierry
Hi Mark, On 2/2/21 11:17 AM, Mark Rutland wrote: Hi Julien, On Wed, Jan 20, 2021 at 06:17:41PM +0100, Julien Thierry wrote: Aarch64 instruction set encoding and decoding logic can prove useful for some features/tools both part of the kernel and outside the kernel. Isolate the function

Re: [RFC PATCH 12/17] gcc-plugins: objtool: Add plugin to detect switch table on arm64

2021-02-03 Thread Julien Thierry
On 2/3/21 12:01 AM, Nick Desaulniers wrote: On Tue, Feb 2, 2021 at 12:57 AM Julien Thierry wrote: On 2/2/21 12:17 AM, Nick Desaulniers wrote: On Mon, Feb 1, 2021 at 1:44 PM Josh Poimboeuf wrote: On Fri, Jan 29, 2021 at 10:10:01AM -0800, Nick Desaulniers wrote: On Wed, Jan 27, 2021

Re: [RFC PATCH 12/17] gcc-plugins: objtool: Add plugin to detect switch table on arm64

2021-02-02 Thread Julien Thierry
ge section name to store switch table information, Make plugin Kconfig be selected rather than opt-in by user, Add a relocation in the switch_table_info that points to the jump operation itself] Signed-off-by: Julien Thierry Rather than tightly couple this feature to a

Re: [RFC PATCH 00/17] objtool: add base support for arm64

2021-01-21 Thread Julien Thierry
On 1/21/21 12:08 PM, Ard Biesheuvel wrote: On Thu, 21 Jan 2021 at 11:26, Julien Thierry wrote: Hi Ard, On 1/21/21 10:03 AM, Ard Biesheuvel wrote: Hello Julien, On Wed, 20 Jan 2021 at 18:38, Julien Thierry wrote: Hi, This series enables objtool to start doing stack validation

Re: [RFC PATCH 00/17] objtool: add base support for arm64

2021-01-21 Thread Julien Thierry
Hi Ard, On 1/21/21 10:03 AM, Ard Biesheuvel wrote: Hello Julien, On Wed, 20 Jan 2021 at 18:38, Julien Thierry wrote: Hi, This series enables objtool to start doing stack validation on arm64 kernel builds. Could we elaborate on this point, please? 'Stack validation' means getting

[RFC PATCH 15/17] objtool: arm64: Handle supported relocations in alternatives

2021-01-20 Thread Julien Thierry
Based on get_alt_insn() in arch/arm64/kernel/alternative.c, arm64 alternative code adapts offsets for static branches and adrp instructions. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/special.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools

[RFC PATCH 09/17] objtool: arm64: Decode LDR instructions

2021-01-20 Thread Julien Thierry
Load literal instructions can generate constants inside code sections. Record the locations of the constants in order to be able to remove their corresponding "struct instruction". Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c| 86 +

[RFC PATCH 00/17] objtool: add base support for arm64

2021-01-20 Thread Julien Thierry
be found on top of this branch here: git clone https://github.com/julien-thierry/linux.git -b objtoolxarm64-latest But it would be nice to have some feedback on this before I start submitting everyting. [1] https://lkml.org/lkml/2021/1/20/791 Thanks, Julien --> Julien Thierry (15): to

[RFC PATCH 01/17] tools: Add some generic functions and headers

2021-01-20 Thread Julien Thierry
These will be needed to be able to use arm64 instruction decoder in userland tools. Signed-off-by: Julien Thierry --- tools/include/asm-generic/bitops/__ffs.h | 11 +++ tools/include/linux/kernel.h | 21 + tools/include/linux/printk.h | 40

[RFC PATCH 07/17] objtool: arm64: Decode other system instructions

2021-01-20 Thread Julien Thierry
Decode ERET, BRK and NOPs Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index 924121b4b466..a4a587c400a1 100644 --- a/tools/objtool/arch/arm64

[RFC PATCH 05/17] objtool: arm64: Decode add/sub instructions

2021-01-20 Thread Julien Thierry
Decode aarch64 additions and substractions and create stack_ops for instructions interacting with SP or FP. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 84 +++ 1 file changed, 84 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c

[RFC PATCH 03/17] tools: bug: Remove duplicate definition

2021-01-20 Thread Julien Thierry
Under tools, bug.h only defines BUILD_BUG_ON_ZERO() which is already defined in build_bug.h. This prevents a file to include both headers at the same time. Have bug.h include build_bug.h instead. Signed-off-by: Julien Thierry --- tools/include/linux/bug.h | 6 +- 1 file changed, 1

[RFC PATCH 06/17] objtool: arm64: Decode jump and call related instructions

2021-01-20 Thread Julien Thierry
Decode branch, branch and link (aarch64's call) and return instructions. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index

[RFC PATCH 02/17] tools: arm64: Make aarch64 instruction decoder available to tools

2021-01-20 Thread Julien Thierry
Add aarch64 encoder/decoder implementation under tools/ as well as the necessary arm64 headers. Signed-off-by: Julien Thierry --- tools/arch/arm64/include/asm/aarch64-insn.h | 551 +++ tools/arch/arm64/lib/aarch64-insn.c | 1425 +++ 2 files changed, 1976 insertions

[RFC PATCH 08/17] objtool: arm64: Decode load/store instructions

2021-01-20 Thread Julien Thierry
the base pointer after the load). Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 127 ++ 1 file changed, 127 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index a4a587c400a1..1087ede67bcd 100644

[RFC PATCH 04/17] objtool: arm64: Add base definition for arm64 backend

2021-01-20 Thread Julien Thierry
Provide needed definitions for a new architecture instruction decoder. No proper decoding is done yet. Signed-off-by: Julien Thierry --- tools/objtool/Makefile| 5 + tools/objtool/arch/arm64/Build| 8 ++ tools/objtool/arch/arm64/decode.c

[RFC PATCH 10/17] objtool: arm64: Accept padding in code sections

2021-01-20 Thread Julien Thierry
The compiler can introduce some '0' words in code sections to pad the end of functions. Similar to load literal functions, record these zero words to remove the "struct instruction" created for them. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/decode.c | 19

[RFC PATCH 12/17] gcc-plugins: objtool: Add plugin to detect switch table on arm64

2021-01-20 Thread Julien Thierry
ge section name to store switch table information, Make plugin Kconfig be selected rather than opt-in by user, Add a relocation in the switch_table_info that points to the jump operation itself] Signed-off-by: Julien Thierry --- arch/arm64/Kconfig

[RFC PATCH 13/17] objtool: arm64: Implement functions to add switch tables alternatives

2021-01-20 Thread Julien Thierry
. Signed-off-by: Raphael Gault [J.T.: Update arch implementation to new prototypes, Update switch table information section name, Do some clean up, Use the offset sign information, Use the newly added rela to find the corresponding jump instruction] Signed-off-by: Julien

[RFC PATCH 16/17] objtool: arm64: Ignore replacement section for alternative callback

2021-01-20 Thread Julien Thierry
ARM64_CB_PATCH doesn't have static replacement instructions. Skip trying to validate the alternative section. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/special.c | 12 tools/objtool/check.c | 3 +++ 2 files changed, 15 insertions(+) diff --git

[RFC PATCH 17/17] objtool: arm64: Enable stack validation for arm64

2021-01-20 Thread Julien Thierry
From: Raphael Gault Add build option to run stack validation at compile time. Signed-off-by: Raphael Gault Signed-off-by: Julien Thierry --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 93a320cc8e03..3f297d61b56b 100644

[RFC PATCH 14/17] objtool: arm64: Cache section with switch table information

2021-01-20 Thread Julien Thierry
Section ".discard.switch_table_info", created by the gcc plugin will be looked up for every dynamic jump in the object file while the section might not even exist. Cache the result of the first lookup. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/spec

[RFC PATCH 11/17] efi: libstub: Ignore relocations for .discard sections

2021-01-20 Thread Julien Thierry
EFI stub cannot have absolute relocations in sections affecting the execution flow. However, for sections that get discarded at link time, it doesn't really matter if they have absolute relocations. Ignore the relocation associated with such sections. Signed-off-by: Julien Thierry --- drivers

Re: Live patching on ARM64

2021-01-20 Thread Julien Thierry
-kernel/20210120173800.1660730-1-jthie...@redhat.com/T/#t There are still some things missing, so if you want to investigate a more complete state I have a branch: $ git clone https://github.com/julien-thierry/linux.git -b objtoolxarm64-latest Let me know if there are any questions related

[RFC PATCH 0/5] arm64: Prepare instruction decoder for objtool

2021-01-20 Thread Julien Thierry
. Thanks, Julien --> Julien Thierry (5): arm64: Move instruction encoder/decoder under lib/ arm64: aarch64-insn: Add SVE instruction class arm64: aarch64-insn: Add barrier encodings arm64: aarch64-insn: Add some opcodes to instruction decoder arm64: Add load/store decoding helpers a

[RFC PATCH 1/5] arm64: Move instruction encoder/decoder under lib/

2021-01-20 Thread Julien Thierry
. Code was only moved, no code should have been added, removed nor modifier. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/aarch64-insn.h | 505 +++ arch/arm64/include/asm/alternative-macros.h |3 - arch/arm64/include/asm/alternative.h|1 + arch/arm64/include

[RFC PATCH 4/5] arm64: aarch64-insn: Add some opcodes to instruction decoder

2021-01-20 Thread Julien Thierry
Add decoding capability for some instructions that objtool will need to decode. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/aarch64-insn.h | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/aarch64-insn.h b/arch/arm64/include/asm/aarch64-insn.h

[RFC PATCH 5/5] arm64: Add load/store decoding helpers

2021-01-20 Thread Julien Thierry
Provide some function to group different load/store instructions. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/aarch64-insn.h | 28 +++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/include/asm/aarch64-insn.h b/arch/arm64/include/asm/aarch64

[RFC PATCH 2/5] arm64: aarch64-insn: Add SVE instruction class

2021-01-20 Thread Julien Thierry
SVE has been public for some time now. Let the decoder acknowledge its existence. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/aarch64-insn.h | 1 + arch/arm64/lib/aarch64-insn.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm

[RFC PATCH 3/5] arm64: aarch64-insn: Add barrier encodings

2021-01-20 Thread Julien Thierry
Create necessary functions to encode/decode aarch64 data/instruction barriers. Signed-off-by: Julien Thierry --- arch/arm64/include/asm/aarch64-insn.h | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/aarch64-insn.h b/arch/arm64/include/asm/aarch64-insn.h

Re: Live patching on ARM64

2021-01-19 Thread Julien Thierry
and will try to get a git branch into shape on a recent mainline (a few things need fixing since the last time I rebased it). I'll update you once I have something at least usable/presentable. Cheers, -- Julien Thierry

[tip: objtool/core] objtool: Make SP memory operation match PUSH/POP semantics

2021-01-18 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 201ef5a974e24112953b74cc9f33dcfc4cbcc1cb Gitweb: https://git.kernel.org/tip/201ef5a974e24112953b74cc9f33dcfc4cbcc1cb Author:Julien Thierry AuthorDate:Wed, 14 Oct 2020 08:38:02 +01:00

[tip: objtool/core] objtool: Fully validate the stack frame

2021-01-18 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: fb084fde0c8106bc86df243411751c3421c07c08 Gitweb: https://git.kernel.org/tip/fb084fde0c8106bc86df243411751c3421c07c08 Author:Julien Thierry AuthorDate:Wed, 14 Oct 2020 08:38:00 +01:00

[tip: objtool/core] objtool: Support addition to set CFA base

2021-01-18 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 468af56a7bbaa626da5a4578bedc930d731fba13 Gitweb: https://git.kernel.org/tip/468af56a7bbaa626da5a4578bedc930d731fba13 Author:Julien Thierry AuthorDate:Wed, 14 Oct 2020 08:38:01 +01:00

[PATCH v3 0/3] objtool: Extend CFA updating/checking

2020-10-14 Thread Julien Thierry
for BP and return address [1] https://lkml.org/lkml/2020/9/28/354 Thanks, Julien Julien Thierry (3): objtool: check: Fully validate the stack frame objtool: check: Support addition to set CFA base objtool: check: Make SP memory operation match PUSH/POP semantics tools/objtool/check.c | 46

[PATCH v3 1/3] objtool: check: Fully validate the stack frame

2020-10-14 Thread Julien Thierry
to verify a function properly sets up all the elements of the stack frame. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index f50ffa243c72..87f10e726a75 100644

[PATCH v3 3/3] objtool: check: Make SP memory operation match PUSH/POP semantics

2020-10-14 Thread Julien Thierry
Architectures without PUSH/POP instructions will always access the stack though memory operations (SRC/DEST_INDIRECT). Make those operations have the same effect on the CFA as PUSH/POP, with no stack pointer modification. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 20

[PATCH v3 2/3] objtool: check: Support addition to set CFA base

2020-10-14 Thread Julien Thierry
instruction. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 87f10e726a75..815aeb770930 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1898,6 +1898,17 @@ static

Re: [PATCH v2 1/3] objtool: check: Fully validate the stack frame

2020-10-13 Thread Julien Thierry
On 10/12/20 4:35 PM, Josh Poimboeuf wrote: On Mon, Oct 12, 2020 at 11:21:49AM +0100, Julien Thierry wrote: On 9/29/20 8:18 PM, Josh Poimboeuf wrote: "Stack frame" has more than one meaning now, I suppose. i.e. it could also include the callee-saved registers and any other s

Re: [PATCH v2 1/3] objtool: check: Fully validate the stack frame

2020-10-12 Thread Julien Thierry
On 9/29/20 8:18 PM, Josh Poimboeuf wrote: On Mon, Sep 28, 2020 at 10:36:29AM +0100, Julien Thierry wrote: +++ b/tools/objtool/arch/x86/include/cfi_regs.h @@ -22,4 +22,7 @@ #define CFI_RA16 #define CFI_NUM_REGS 17 A few more naming nitpicks: +#define

[PATCH v2 3/3] objtool: check: Make SP memory operation match PUSH/POP semantics

2020-09-28 Thread Julien Thierry
Architectures without PUSH/POP instructions will always access the stack though memory operations (SRC/DEST_INDIRECT). Make those operations have the same effect on the CFA as PUSH/POP, with no stack pointer modification. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 20

[PATCH v2 1/3] objtool: check: Fully validate the stack frame

2020-09-28 Thread Julien Thierry
to verify a function properly sets up all the elements of the stack frame. Signed-off-by: Julien Thierry --- tools/objtool/arch/x86/include/cfi_regs.h | 3 +++ tools/objtool/cfi.h | 2 ++ tools/objtool/check.c | 21 + 3 files changed, 22

[PATCH v2 2/3] objtool: check: Support addition to set CFA base

2020-09-28 Thread Julien Thierry
instruction. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 50b3a4504db1..9f7a14a24a65 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1901,6 +1901,19

[PATCH v2 0/3] objtool: Extend CFA updating/checking

2020-09-28 Thread Julien Thierry
discussion with Josh [1] https://www.spinics.net/lists/kernel/msg3662146.html Thanks, Julien --> Julien Thierry (3): objtool: check: Fully validate the stack frame objtool: check: Support addition to set CFA base objtool: check: Make SP memory operation match PUSH/POP semantics to

[tip: objtool/core] objtool: Ignore unreachable fake jumps

2020-09-21 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: fb136219f0e2b417d84e67b2a3adc1f933997d04 Gitweb: https://git.kernel.org/tip/fb136219f0e2b417d84e67b2a3adc1f933997d04 Author:Julien Thierry AuthorDate:Tue, 15 Sep 2020 08:53:17 +01:00

[tip: objtool/core] objtool: Remove useless tests before save_reg()

2020-09-21 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: f4f803984c3685f416a74e9e2fa7d39bdafbe02b Gitweb: https://git.kernel.org/tip/f4f803984c3685f416a74e9e2fa7d39bdafbe02b Author:Julien Thierry AuthorDate:Tue, 15 Sep 2020 08:53:16 +01:00

[tip: objtool/core] objtool: Handle calling non-function symbols in other sections

2020-09-21 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 2b232a22d8225df419a92ca69ddeeb4e5fe902f7 Gitweb: https://git.kernel.org/tip/2b232a22d8225df419a92ca69ddeeb4e5fe902f7 Author:Julien Thierry AuthorDate:Tue, 15 Sep 2020 08:53:18 +01:00

Re: [PATCH 1/3] objtool: check: Fully validate the stack frame

2020-09-21 Thread Julien Thierry
On 9/18/20 9:56 PM, Josh Poimboeuf wrote: On Tue, Sep 15, 2020 at 09:12:02AM +0100, Julien Thierry wrote: A valid stack frame should contain both the return address and the previous frame pointer value. On x86, the return value is placed on the stack by the calling instructions. On other

Re: [PATCH 3/3] objtool: check: Make SP memory operation match PUSH/POP semantics

2020-09-21 Thread Julien Thierry
On 9/18/20 10:43 PM, Josh Poimboeuf wrote: On Tue, Sep 15, 2020 at 09:12:04AM +0100, Julien Thierry wrote: Architectures without PUSH/POP instructions will always access the stack though memory operations (SRC/DEST_INDIRECT). Make those operations have the same effect on the CFA as PUSH/POP

Re: [PATCH 3/3] objtool: check: Handle calling non-function symbols in other sections

2020-09-21 Thread Julien Thierry
On 9/18/20 9:07 PM, Josh Poimboeuf wrote: On Tue, Sep 15, 2020 at 08:53:18AM +0100, Julien Thierry wrote: Relocation for a call destination could point to a symbol that has type STT_NOTYPE. Then shouldn't the callee be changed to STT_FUNC? Not if it's a code symbol that does not follow

[PATCH 0/3] objtool: Extend CFA updating/checking

2020-09-15 Thread Julien Thierry
sent previously. [1] https://lkml.org/lkml/2020/9/15/199 Thanks, Julien --> Julien Thierry (3): objtool: check: Fully validate the stack frame objtool: check: Support addition to set CFA base objtool: check: Make SP memory operation match PUSH/POP semantics tools/objtool/arch/x86/incl

[PATCH 1/3] objtool: check: Fully validate the stack frame

2020-09-15 Thread Julien Thierry
to verify a function properly sets up the all the elements of the stack frame. Signed-off-by: Julien Thierry --- tools/objtool/arch/x86/include/cfi_regs.h | 4 tools/objtool/check.c | 17 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tools

[PATCH 3/3] objtool: check: Make SP memory operation match PUSH/POP semantics

2020-09-15 Thread Julien Thierry
Architectures without PUSH/POP instructions will always access the stack though memory operations (SRC/DEST_INDIRECT). Make those operations have the same effect on the CFA as PUSH/POP, with no stack pointer modification. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 17

[PATCH 2/3] objtool: check: Support addition to set CFA base

2020-09-15 Thread Julien Thierry
Instead of "mov SP, BP", a compiler could simply set BP to SP + constant. Handle changing the CFA base in such cases. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/che

[PATCH 0/3] objtool: Miscellaneous cleanup/fixes

2020-09-15 Thread Julien Thierry
Hi, These patches provide some simple cleanup or lift small limitations found while working on the arm64 port. They should apply on current tip/objtool/core branch Cheers, Julien --> Julien Thierry (3): objtool: check: Remove useless tests objtool: check: Ignore unreachable fake ju

[PATCH 2/3] objtool: check: Ignore unreachable fake jumps

2020-09-15 Thread Julien Thierry
the set of alternatives, reaching it is not a requirement. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index fd2edab8e672..cd7c6698d316 100644 --- a/tools/objtool/check.c +++ b/tools

[PATCH 3/3] objtool: check: Handle calling non-function symbols in other sections

2020-09-15 Thread Julien Thierry
Relocation for a call destination could point to a symbol that has type STT_NOTYPE. Lookup such a symbol when no function is available. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools

[PATCH 1/3] objtool: check: Remove useless tests

2020-09-15 Thread Julien Thierry
save_reg already checks that the register being saved does not already have a saved state. Remove redundant checks before processing a register storing operation. Signed-off-by: Julien Thierry --- tools/objtool/check.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[tip: objtool/core] objtool: Decode unwind hint register depending on architecture

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: edea9e6bcbeaa41718b022a8b99ffddef2330bbc Gitweb: https://git.kernel.org/tip/edea9e6bcbeaa41718b022a8b99ffddef2330bbc Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:28 +01:00

[tip: objtool/core] objtool: Only include valid definitions depending on source file type

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 5567c6c39f3404e4492c18c0c1abff5556684f6e Gitweb: https://git.kernel.org/tip/5567c6c39f3404e4492c18c0c1abff5556684f6e Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:26 +01:00

[tip: objtool/core] objtool: Move ORC logic out of check()

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: d44becb9decf4438d1e555b1428634964d2e5764 Gitweb: https://git.kernel.org/tip/d44becb9decf4438d1e555b1428634964d2e5764 Author:Julien Thierry AuthorDate:Tue, 25 Aug 2020 13:47:40 +01:00

[tip: objtool/core] objtool: Move object file loading out of check()

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 6545eb030e6f14cef8793a86312483c788eaee46 Gitweb: https://git.kernel.org/tip/6545eb030e6f14cef8793a86312483c788eaee46 Author:Julien Thierry AuthorDate:Tue, 25 Aug 2020 13:47:39 +01:00

[tip: objtool/core] objtool: Make sync-check consider the target architecture

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: bb090fdb70ecc51c91e1d86345adae064caa06c8 Gitweb: https://git.kernel.org/tip/bb090fdb70ecc51c91e1d86345adae064caa06c8 Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:20 +01:00

[tip: objtool/core] objtool: Skip ORC entry creation for non-text sections

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 3eaecac88a17f7fdf29561a197dc728f7f697c60 Gitweb: https://git.kernel.org/tip/3eaecac88a17f7fdf29561a197dc728f7f697c60 Author:Julien Thierry AuthorDate:Tue, 25 Aug 2020 13:47:41 +01:00

[tip: objtool/core] objtool: Group headers to check in a single list

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 3890b8d92710af75baedf291832cf40193b33454 Gitweb: https://git.kernel.org/tip/3890b8d92710af75baedf291832cf40193b33454 Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:19 +01:00

[tip: objtool/core] objtool: Define 'struct orc_entry' only when needed

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 66734e32463bd1346466f92662feeaccef26e94f Gitweb: https://git.kernel.org/tip/66734e32463bd1346466f92662feeaccef26e94f Author:Julien Thierry AuthorDate:Tue, 25 Aug 2020 13:47:42 +01:00

[tip: objtool/core] objtool: Move macros describing structures to arch-dependent code

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: c8ea0d672521ef663f0f9a77faa94d0d47102d77 Gitweb: https://git.kernel.org/tip/c8ea0d672521ef663f0f9a77faa94d0d47102d77 Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:21 +01:00

[tip: objtool/core] objtool: Abstract alternative special case handling

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: eda3dc905834dc9c99132f987f77b68cf53a8682 Gitweb: https://git.kernel.org/tip/eda3dc905834dc9c99132f987f77b68cf53a8682 Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:22 +01:00

[tip: objtool/core] objtool: Rename frame.h -> objtool.h

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 00089c048eb4a8250325efb32a2724fd0da68cce Gitweb: https://git.kernel.org/tip/00089c048eb4a8250325efb32a2724fd0da68cce Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:25 +01:00

[tip: objtool/core] objtool: Make relocation in alternative handling arch dependent

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: 45245f51f9a4b9a883a8c94468473c1de9b88153 Gitweb: https://git.kernel.org/tip/45245f51f9a4b9a883a8c94468473c1de9b88153 Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:23 +01:00

[tip: objtool/core] objtool: Make unwind hint definitions available to other architectures

2020-09-10 Thread tip-bot2 for Julien Thierry
The following commit has been merged into the objtool/core branch of tip: Commit-ID: ee819aedf34a8f35cd54ee3967c7beb4d1d4a635 Gitweb: https://git.kernel.org/tip/ee819aedf34a8f35cd54ee3967c7beb4d1d4a635 Author:Julien Thierry AuthorDate:Fri, 04 Sep 2020 16:30:27 +01:00

[PATCH] objtool: Fix sync-check.sh bashisms

2020-09-08 Thread Julien Thierry
Previous patches introduced some non SUS compliant changes to sync-check.sh. Replace used bash features for standard shell. Signed-off-by: Julien Thierry --- tools/objtool/sync-check.sh | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Note: This patch applies on Josh P.'s objtool

  1   2   3   4   5   6   7   8   9   10   >