All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/3] clean up KPTI / SDEI trampoline data alignment
@ 2020-03-19  9:12 ` Rémi Denis-Courmont
  0 siblings, 0 replies; 44+ messages in thread
From: Rémi Denis-Courmont @ 2020-03-19  9:12 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, linux-arm-kernel
  Cc: Mark Rutland, James Morse, linux-kernel

	Hi,

The KPTI and SDE trampolines each load a pointer from the same fixmap data
page. This reduces the data alignment to the useful value, and tries to
clarify the assembler code.

Changes since v2:
- Retain alignment even when SDEI is disabled to keep ld happy.

----------------------------------------------------------------
Rémi Denis-Courmont (3):
      arm64: clean up trampoline vector loads
      arm64/sdei: gather trampolines' .rodata
      arm64: reduce trampoline data alignment

 arch/arm64/kernel/entry.S | 23 ++++++++++-------------
 arch/arm64/mm/mmu.c       |  5 ++---
 2 files changed, 12 insertions(+), 16 deletions(-)

-- 
Реми Дёни-Курмон
http://www.remlab.net/




^ permalink raw reply	[flat|nested] 44+ messages in thread
* [PATCH 1/3] arm64: clean up trampoline vector loads
@ 2020-03-16 12:40 ` Rémi Denis-Courmont
  0 siblings, 0 replies; 44+ messages in thread
From: Rémi Denis-Courmont @ 2020-03-16 12:40 UTC (permalink / raw)
  To: catalin.marinas, will, linux-arm-kernel; +Cc: mark.rutland, linux-kernel

From: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>

This switches from custom instruction patterns to the regular large
memory model sequence with ADRP and LDR. In doing so, the ADD
instruction can be eliminated in the SDEI handler, and the code no
longer assumes that the trampoline vectors and the vectors address both
start on a page boundary.

Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>
---
 arch/arm64/kernel/entry.S | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index e5d4e30ee242..24f828739696 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -805,9 +805,9 @@ alternative_else_nop_endif
 2:
 	tramp_map_kernel	x30
 #ifdef CONFIG_RANDOMIZE_BASE
-	adr	x30, tramp_vectors + PAGE_SIZE
+	adrp	x30, tramp_vectors + PAGE_SIZE
 alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003
-	ldr	x30, [x30]
+	ldr	x30, [x30, #:lo12:__entry_tramp_data_start]
 #else
 	ldr	x30, =vectors
 #endif
@@ -953,9 +953,8 @@ SYM_CODE_START(__sdei_asm_entry_trampoline)
 1:	str	x4, [x1, #(SDEI_EVENT_INTREGS + S_ORIG_ADDR_LIMIT)]
 
 #ifdef CONFIG_RANDOMIZE_BASE
-	adr	x4, tramp_vectors + PAGE_SIZE
-	add	x4, x4, #:lo12:__sdei_asm_trampoline_next_handler
-	ldr	x4, [x4]
+	adrp	x4, tramp_vectors + PAGE_SIZE
+	ldr	x4, [x4, #:lo12:__sdei_asm_trampoline_next_handler]
 #else
 	ldr	x4, =__sdei_asm_handler
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2020-03-24 11:23 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19  9:12 [PATCHv3 0/3] clean up KPTI / SDEI trampoline data alignment Rémi Denis-Courmont
2020-03-19  9:12 ` Rémi Denis-Courmont
2020-03-19  9:14 ` [PATCH 1/3] arm64: clean up trampoline vector loads Rémi Denis-Courmont
2020-03-19  9:14   ` Rémi Denis-Courmont
2020-03-23 12:07   ` Mark Rutland
2020-03-23 12:07     ` Mark Rutland
2020-03-23 12:08     ` Rémi Denis-Courmont
2020-03-23 12:08       ` Rémi Denis-Courmont
2020-03-23 12:14       ` Mark Rutland
2020-03-23 12:14         ` Mark Rutland
2020-03-23 19:04         ` Catalin Marinas
2020-03-23 19:04           ` Catalin Marinas
2020-03-23 20:42           ` Rémi Denis-Courmont
2020-03-23 20:42             ` Rémi Denis-Courmont
2020-03-24 10:37             ` Catalin Marinas
2020-03-24 10:37               ` Catalin Marinas
2020-03-24 10:52             ` Mark Rutland
2020-03-24 10:52               ` Mark Rutland
2020-03-24 11:23               ` Catalin Marinas
2020-03-24 11:23                 ` Catalin Marinas
2020-03-19  9:14 ` [PATCH 2/3] arm64/sdei: gather trampolines' .rodata Rémi Denis-Courmont
2020-03-19  9:14   ` Rémi Denis-Courmont
2020-03-19  9:14 ` [PATCH 3/3] arm64: reduce trampoline data alignment Rémi Denis-Courmont
2020-03-19  9:14   ` Rémi Denis-Courmont
2020-03-21 13:40   ` Catalin Marinas
2020-03-21 13:41     ` Catalin Marinas
2020-03-23 11:58     ` Mark Rutland
2020-03-23 11:58       ` Mark Rutland
2020-03-19 18:37 ` [PATCHv3 0/3] clean up KPTI / SDEI " Will Deacon
2020-03-19 18:37   ` Will Deacon
2020-03-20 16:54 ` Catalin Marinas
2020-03-20 16:54   ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2020-03-16 12:40 [PATCH 1/3] arm64: clean up trampoline vector loads Rémi Denis-Courmont
2020-03-16 12:40 ` Rémi Denis-Courmont
2020-03-17 22:30 ` Will Deacon
2020-03-17 22:30   ` Will Deacon
2020-03-18 17:57 ` Catalin Marinas
2020-03-18 17:57   ` Catalin Marinas
2020-03-18 18:06   ` Catalin Marinas
2020-03-18 18:06     ` Catalin Marinas
2020-03-18 18:29     ` Rémi Denis-Courmont
2020-03-18 18:29       ` Rémi Denis-Courmont
2020-03-18 19:48       ` Remi Denis-Courmont
2020-03-18 19:48         ` Remi Denis-Courmont

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.