Re: [PATCH v4 5/8] arm64: probes: Add GCS support to bl/blr/ret

From
Mark Brown <broonie@kernel.org>
Date
2025-07-23 11:13:27
Also in
linux-arm-kernel, linux-perf-users, lkml
Reply to
Catalin Marinas, 2025-07-23
On Wed, Jul 23, 2025 at 11:00:33AM +0100, Catalin Marinas wrote:
On Fri, Jul 18, 2025 at 11:37:37PM -0500, Jeremy Linton wrote:
quoted
@@ -133,17 +147,26 @@ simulate_br_blr(u32 opcode, long addr, struct pt_regs *regs)
 	/* update pc first in case we're doing a "blr lr" */
 	instruction_pointer_set(regs, get_x_reg(regs, xn));
 
-	/* Link register is x30 */
 	if (((opcode >> 21) & 0x3) == 1)
-		set_x_reg(regs, 30, addr + 4);
+		update_lr(regs, addr);
 }
I can see why this function was originally updating PC (in case of a blr
lr) but updating the LR was not supposed to fail. With GCS, I think we
should follow similar logic to simulate_b_bl() and skip updating PC/LR
if the write to the GCS failed (assuming that's what the hardware does,
I haven't checked the spec).
Yes, the pseudocode does the GCS validation before it starts updating
BTYPE or any of the registers.

Attachments

Thread (25 messages) 25 messages, 5 authors, last reply 2025-07-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help