From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.198 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794881227; b=a4FNHw0eDNh3tTaBqvukimePeIaQ+TBbjJpataMZsPlvpXLRK1xucwn7WLYV4rFN1rf6 0+Y2Unn2goh8fZsGFF0a5EWKcMAx6Yw1kxTM0vsIrRFo/4Dps4zOVgiFX0LnovxtG2wi0 1aXdMQhl8oqI7gMS+PcR6Isw1Nk9i7+0i+z9l4Qxhty/qCO4V8bRCeL0MHSV6UmxP2W/+ QrlgssUDHMyVDVkBJ8NIleH0n2WixjIld1JtIdlqOCr2dOgBUIEsArRgMIKePh/OLQNYE 2DoZPK/7k4BB4R229AMLhJ1kFKrgMyRM2anetQzfM1yof5zXgIxKy5kfQxI2nwovPaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794881227; 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=T6cadkjN46GcrXLLE1nWeeqEA3+9BIJxzX9p3OXCpkMur3EI/Djil9tzCk7+A0gQs03r P1VWNjRLcd5JrRAvBUGhCfCfzU0OvYsR+SZdmO+cPAfvbya4MFMF3ecp/qmdlGEdvXVzx vC5Wz7H8olvjnu1ithtxyYM2VQ4mXHaUY3d/Eb5g2NXM9+kOl7ZH4SC8yz3Jg/nlONjUB Mnv5Z9lCLDcRO4VYgEWw5ySX4Eb3U25vKR772G77sB/Fj99Sol7EQhUeniEbUksWsKdEY xOZ9J+IQSy7kGGVWCIYmLoKjvzQZnOdMmqYJomAJl4H96h/+WgJbrjQJU6csJKD0o/w== 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.198 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (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 7DD40606A323 for ; Tue, 17 Nov 2026 02:07:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7DD40606A323 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-f198.google.com with SMTP id d9443c01a7336-2ed05900df7so17253435ad.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=FpGORT6h7HUdrmOhM+VEtIdSdnh31u2dOfAblcKSC8kZYcw6zCZQTiYTtLVyAqhCtM TScVpDgIp30pqbI/+mgBeBX0Suqc61wv62ysumPYozE9RNCr3A/rBNQ5c9VEgiIXMPI6 ES7qnjUjEX0rRvfP7a3bNwzlhYKUtbiuhkBagz8FOaat1oLPnm6gwyO55kS5PekVw9pt lRAOjK7fqnfW1QScfs2ZcKs2LysYbA8ZI/CeYKnw5IR+DuGBEi2cq8gCpKzCYDASCtf6 FBS0WaCSv2Hc4iE6HzLgJ+2ewapF4AgxEDMYq0XMuAUt0mZVdMtdE+/C5tz4G5IL59/D wI0g== X-Forwarded-Encrypted: i=1; AL+hErEiZ7cmJ+e2pgqArKdndeVwB8QOzG17RWyu6KFbgOW2qdMsu1nYOf9ZnWmyF7Xmt1/1o7K9cW+758+LpxY=@vger.kernel.org X-Gm-Message-State: APuU4Z9IggPhTUDOiD+xybhAHuyPX/D+jx+4RtfmNdHppJiyP8IhrhDn JVBRs9Oh1U2PyOnIbxJZeya+WeP0PMl38mKd6ba+X1oF0pWPlofuHBpXG2juiHESr0/okh+7P0j Y6CFXgxoJkCTRGUtCNCqwNEYpvw== 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-kernel@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