From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F32B71E32B9 for ; Thu, 20 Mar 2025 17:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742492807; cv=none; b=DQU4EE/RFk4XJI9x9/aUTKIUlP9UvnXrHWsySJT8PdO7YzDSsskV9N2cU/V2H6qKsHOa31a1HG/+vyRwjw4kku1pHuWH010Mnqu8U/I4ho6PuaJEWTMNbr6YYUWIiR7GJZvrWW6N/dnUo0WtXqTX/yB3vEwk2xXxbVEqv7GYC4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742492807; c=relaxed/simple; bh=gGkHIctrglz/x9mJyu8j4/TTt+kOTJGYHX62Xb6+X5U=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=k0SXenG4sLCxsYCPc1HualJcj9IfWoHQWWHfqh2kKEwGlrE+UrQKGc+hbwX+t0/W2x+e9JN4D1BFboezzzFQyhEMNZvLXThsh98fVWmX+kp+m1ELOE5kvHKY0utDiEAzUbnvRY4bAjCBtoS+8KJKx8CUa/O59GZ9WAfiLXoAVUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--wnliu.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Mm3G/HLm; arc=none smtp.client-ip=209.85.214.201 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--wnliu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Mm3G/HLm" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2262051205aso9872995ad.3 for ; Thu, 20 Mar 2025 10:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742492804; x=1743097604; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=C8sWmgtXc9A8SS+LZhHtZUXAexu8GgTmOedRrg1dhsA=; b=Mm3G/HLmlEbyXaYf+bymb2so+kLmnoTzJNCbYQBMJx63ptNsDhuzIjeqKLViLQfccj HdB6HZTVkG810qM+6vt5U9qpUz7mocbYOy/FnRSKitG+sEtLnml+ZVqLV0k+5ofFTjwI krKlCPj2GPci43DvHxRt7JQ2TxYQtbTI7od/DQGJX08SvYV0y8im8Gpr53OafuBxgixI Ao60A95+clA3l7LLVXA7+uokY4PI90Brj0laK2SGWyTMJFFI+k4qXBjfx3qjUhfmnDPZ 8yMCm9nAixU/J4NnpLtv6EAldzAv1qgWpMtMS53SOGohOJMSA53+6ewUVqKFIoMRkste 9CrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742492804; x=1743097604; h=content-transfer-encoding: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; bh=C8sWmgtXc9A8SS+LZhHtZUXAexu8GgTmOedRrg1dhsA=; b=rLD07I6h1FTnc4LPPqU4yD8Vlsa+9NgcXFjsrjnxoMBU8WcNSXXFYeXBkS5ohYkQw9 9QlubDQ8AdTBSjK7aLGjpyQlogpwVRPkr+u5Wy5CyInRUA5qM1cRqjSuA1w7xbdYKFCO CCCLWBE9sKc5PQRhzj2NZYepZr8aHic1tfGg4keKxZ0PcZjVT/3Xe8afN0ec48ePI8CN 6YCayWwbHWWvErLue7hz83BEP6gXNl+MVQO5YunLejiYcIIxFcyfDWDYH8+GaTheRZmJ f2rcVpZ2dkViGP3kyMdnn0vrz1lQII4PwXwAqUqtdJMJddrBxFE+e8NAT8IXOkQnJx6J 6Liw== X-Forwarded-Encrypted: i=1; AJvYcCWauv8X2975zJ9zC9KYypn4c0z1xVK6qt1ntlfwjJn01BW6OdSnT4K/j1N1y5X6SgtOHLdo/QQrAUHVU9wP/bjL@vger.kernel.org X-Gm-Message-State: AOJu0Yz2J5a/MzHKkhF/m9ejfGXKUFE2HPcW9PZRPy2eE91pvIwkJbpa 2xx19UrQDBteGzckRTv35Sbm+gpzpjJtrbtlAvr+njqeAnxQ0fpwDudQUj+HsoR+OnyA2j6Meg= = X-Google-Smtp-Source: AGHT+IGkcvsUd+T1mc9VlLct3/yS/hr+HeuaSZ94iAFaq0agza5SWuSHmNHqalPgRdwW9LY8R0G3yzT4RA== X-Received: from pfbcg19.prod.google.com ([2002:a05:6a00:2913:b0:732:7e28:8f7d]) (user=wnliu job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3991:b0:732:535d:bb55 with SMTP id d2e1a72fcca58-73905966850mr512059b3a.4.1742492804271; Thu, 20 Mar 2025 10:46:44 -0700 (PDT) Date: Thu, 20 Mar 2025 17:46:41 +0000 In-Reply-To: <20250320171559.3423224-2-song@kernel.org> Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250320171559.3423224-2-song@kernel.org> X-Mailer: git-send-email 2.49.0.395.g12beb8f557-goog Message-ID: <20250320174642.855602-1-wnliu@google.com> Subject: [PATCH v3 1/2] arm64: Implement arch_stack_walk_reliable From: Weinan Liu To: song@kernel.org Cc: indu.bhagat@oracle.com, irogers@google.com, joe.lawrence@redhat.com, jpoimboe@kernel.org, kernel-team@meta.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-toolchains@vger.kernel.org, live-patching@vger.kernel.org, mark.rutland@arm.com, peterz@infradead.org, puranjay@kernel.org, roman.gushchin@linux.dev, rostedt@goodmis.org, will@kernel.org, wnliu@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 20, 2025 at 10:16=E2=80=AFAM Song Liu wrote: > > static __always_inline void > @@ -230,8 +231,26 @@ kunwind_next_frame_record(struct kunwind_state *stat= e) > new_fp =3D READ_ONCE(record->fp); > new_pc =3D READ_ONCE(record->lr); > > - if (!new_fp && !new_pc) > - return kunwind_next_frame_record_meta(state); > + if (!new_fp && !new_pc) { > + int ret; > + > + ret =3D kunwind_next_frame_record_meta(state); The exception case kunwind_next_regs_pc() will return 0 when unwind success= . Should we return a different value for the success case of kunwind_next_reg= s_pc()? > + if (ret < 0) { > + /* > + * This covers two different conditions: > + * 1. ret =3D=3D -ENOENT, unwinding is done. > + * 2. ret =3D=3D -EINVAL, unwinding hit error. > + */ > + return ret; > + } > + /* > + * Searching across exception boundaries. The stack is no= w > + * unreliable. > + */ > + if (state->end_on_unreliable) > + return -EINVAL; > + return 0; > + }