Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794881228; b=AKEek9l6eioh1aOFbV9dzFuovXeOGr+fpgnZ0LbSyVTltM5MVHnwA505qSSRHWT+LcHv ygHxGWjGk8EyLn9fTMjGy0YHDm4csxEots6zLnbT0KxR2cNBERJdUAJsYuIBK5wapWKFZ zLsOuLsulzoMrV6vXNjImfV4UIxYacYKDcncuYJSpVeRmO8coh2jvCWmbN3S/t5FVYyKS vNb1UMcgArfEcIguSzizXZQN9jqSz1x4gnBPyAmIbaDEJQrbcGyC0vncS2ZbiWOZ6CzPp XIAD19zqdldVzgEijqLc7uPj57AoCmG6mIXUL6ivCJ3XLCnjGclmlY71K4PfRrGSXZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794881228; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=4H9SESbbRGSoAq2gQL4B9mysuCtb/u5ZBxs535NDDIs=; b=Nt9/Tqpwt9CDGUEiWG2/Ej6JcbTVPxDACJmSeWPBBh5UgkZC1FJOXp0a8onsv6ogKz9R 2gXj7vZew/cdRuECUAoLpi/ZhXIU3GmgoXoRYIB4XCQSzIp0R0+z0E/AeKXkWsWHTk+Do 8BX+eEv+su1bIyZe6rWl5R531S4qozyj2O/npnF0P6DzWkG8kp2ZqdlItVTga++Y1LgDE p996L1UB7H9gt+nHb6A2qA+GkDcljmlvSRY06/U2/SO+pg/LusOOhwVdYDBY9TZu0j2xF tXZ3maCV5nSwelRZcs3Tb27Zd8b6HvQsT/XIPLUDUdFOIvO0JjK1IEwjVr+cimEyD/Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--dylanbhatch.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=RS0NTd8l; arc=none smtp.remote-ip=209.85.214.197 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82AA4606A88D for ; Tue, 17 Nov 2026 02:07:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 82AA4606A88D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--dylanbhatch.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=RS0NTd8l Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2ed05900df7so17253425ad.1 for ; Mon, 16 Nov 2026 18:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1794881227; x=1795486027; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4H9SESbbRGSoAq2gQL4B9mysuCtb/u5ZBxs535NDDIs=; b=RS0NTd8lyLPhf1ahEd/zO9Zi59bEXgNqtB8SLdJu1WczJSgrtam5QL/5Sjdd5+WyBO bjsb+zcDHFy757WIlTyizzu6bFu4QSm7j6/qPbJanrYmIwczLMphCWySIHBtdv11SXHQ ihNrJ9FF7hwvizOy3FZxK1CbPesdEdUrrPw1s/THg7iwXrJxUXdDGfOXnQiw+uZXpyxk 8TKe5Or2DFyjQgiK3owU/uwJLXn1/4hpzpmyyfPLcHOkF7dAGs/2bNsFbKmSlIPSRYvz kkCoKNjrhqhxah+92VifK9C+q7cVSctVOljOkAb/Upo4vNoqc8DxXCQ4h2Clz5H9JhsS XRuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794881227; x=1795486027; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4H9SESbbRGSoAq2gQL4B9mysuCtb/u5ZBxs535NDDIs=; b=Fw+mWoQDYCAdb7HCzaGyNd7wau+VHq4oLNijBA+4vN6UB//YJw6OSQcDp7kZMfXv3L ELtkwZDuZj2/sePKQo7IQBH9GCJMWWzsqDRsAdvoxbjqLeiFrgmz4OklJBcRZNV2AMSn VhbH2qnKTWD+yr38IeuorEPkAydJqlAhGU42bwcJDfTmwYBlD8Gb59bLT9JRGZ1JeZP/ BwMcEohqCdxPyI98zjb5TOC4A4Z7soZVM3PitPG3lv2h2k2vxZI46a7bw/DYdNe03woC HmMH4PZvKfS5GIt4dG33NxhS+MVnDkoHLlvUoEcii2Ew13uMj4Z47Z8SQdiZVFDWW2uB 7oug== X-Forwarded-Encrypted: i=1; AL+hErEPv7rh1autb009Zu9i9B6+IKyWNZ+rhJXbK7jvzvGquLbCWJD1eR8LbJoo53EMu4P1M/fnoO45/Ejsqb3Cp7Z0@vger.kernel.org X-Gm-Message-State: APuU4Z9+3spvx5XnefYtJJwGHKdt4vNT5cY/soSNVAPhjbkzeGHruf7X 1dyePWyslHM4HjOdHY3vrfY3HkubPE+9zmS12F1RsllyZcys9WnOYgKmK98boBJuZIFT9Tcv7Rp ILtW2Yj38AKpwbPV/vA+lXHC/3w== X-Received: from plsb22.prod.google.com ([2002:a17:902:b616:b0:2ef:e0e7:c9d1]) (user=dylanbhatch job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e5c9:b0:2e9:73db:3c78 with SMTP id d9443c01a7336-2ee0daa43c4mr117565405ad.17.1794881226561; Mon, 16 Nov 2026 18:07:06 -0800 (PST) Date: Tue, 17 Nov 2026 02:06:46 +0000 In-Reply-To: <20261117020648.323464-1-dylanbhatch@google.com> X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261117020648.323464-1-dylanbhatch@google.com> X-Mailer: git-send-email 2.56.0.679.gc527c65306-goog Message-ID: <20261117020648.323464-10-dylanbhatch@google.com> Subject: [PATCH v9 09/11] arm64: entry: add unwind info for call_on_irq_stack() From: Dylan Hatch To: Roman Gushchin , Weinan Liu , Will Deacon , Josh Poimboeuf , Indu Bhagat , Peter Zijlstra , Steven Rostedt , Catalin Marinas , Jiri Kosina , Mark Rutland , Jens Remus Cc: Dylan Hatch , Prasanna Kumar T S M , Puranjay Mohan , Song Liu , joe.lawrence@redhat.com, linux-toolchains@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Randy Dunlap , Mostafa Saleh , Herbert Xu , "David S . Miller" Content-Type: text/plain; charset="UTF-8" From: Weinan Liu DWARF CFI (Call Frame Information) specifies how to recover the return address and callee-saved registers at each PC in a given function. Compilers are able to generate the CFI annotations when they compile the code to assembly language. For handcrafted assembly, we need to annotate them by hand. Frame pointers alone are usually sufficient to recover stack frames (without CFI), except at the exception boundary, where more information is needed to determine if the LR is live. Since an exception can be taken from call_on_irq_stack(), annotate it with CFI. The actual entry assembly functions are left untouched, since they are not expected to take exceptions themselves. Signed-off-by: Weinan Liu Suggested-by: Jens Remus Reviewed-by: Jens Remus Signed-off-by: Dylan Hatch --- Changes since v8: - (sashiko) Use SYM_START() with .cfi_startproc before 'bti c' so the FDE covers the landing pad at call_on_irq_stack+0. --- arch/arm64/kernel/entry.S | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 8d17f61d1b5b2..cc9290b218204 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -30,6 +30,12 @@ #include #include +/* + * Do not generate .eh_frame. Only generate .debug_frame and optionally + * .sframe (via assembler option --gsframe[-N]). + */ + .cfi_sections .debug_frame + .macro clear_gp_regs .irp n,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 mov x\n, xzr @@ -881,7 +887,9 @@ NOKPROBE(ret_from_fork) * * Calls func(regs) using this CPU's irq stack and shadow irq stack. */ -SYM_FUNC_START(call_on_irq_stack) +SYM_START(call_on_irq_stack, SYM_L_GLOBAL, SYM_A_ALIGN) + .cfi_startproc + bti c save_and_disable_daif x9 #ifdef CONFIG_SHADOW_CALL_STACK get_current_task x16 @@ -892,6 +900,9 @@ SYM_FUNC_START(call_on_irq_stack) /* Create a frame record to save our LR and SP (implicit in FP) */ stp x29, x30, [sp, #-16]! mov x29, sp + .cfi_def_cfa 29, 16 + .cfi_offset 29, -16 + .cfi_offset 30, -8 ldr_this_cpu x16, irq_stack_ptr, x17 @@ -907,9 +918,13 @@ SYM_FUNC_START(call_on_irq_stack) */ mov sp, x29 ldp x29, x30, [sp], #16 + .cfi_restore 29 + .cfi_restore 30 + .cfi_def_cfa 31, 0 scs_load_current restore_irq x9 ret + .cfi_endproc SYM_FUNC_END(call_on_irq_stack) NOKPROBE(call_on_irq_stack) -- 2.56.0.679.gc527c65306-goog