From patchwork Tue Sep 24 07:43:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 13810426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5241CF9C71 for ; Tue, 24 Sep 2024 07:43:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6EC8A6B0088; Tue, 24 Sep 2024 03:43:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66FCF6B00A7; Tue, 24 Sep 2024 03:43:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4EA5D6B00AB; Tue, 24 Sep 2024 03:43:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2C8BB6B00A7 for ; Tue, 24 Sep 2024 03:43:58 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E92831A1841 for ; Tue, 24 Sep 2024 07:43:57 +0000 (UTC) X-FDA: 82598842914.06.A0FA4D1 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf14.hostedemail.com (Postfix) with ESMTP id 0FF5E10000F for ; Tue, 24 Sep 2024 07:43:55 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gbCWDKmJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of qiwuchen55@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=qiwuchen55@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727163801; a=rsa-sha256; cv=none; b=3nY7LhlkaUOzF3Qe12szvjUKFDVecdWBI0jkaXL0eb/5H4IW8HU9Yzhvr9Lti38jt6eCW0 EZ1MmfLAtuObfiTBz2SwYMWjPnZmzyMJiIdKeOOd1URlqHjKn7e619SwDjVEpgLpW0kxTN OIH32Xj1o65RLyoatAoLvYWgA22cQsA= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gbCWDKmJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf14.hostedemail.com: domain of qiwuchen55@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=qiwuchen55@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727163801; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sveNCmO55zA73Cq65R0Q3qE+br1KOMYEKyeAeW0hpMA=; b=DndwDKyf+INFsRZ9JOgejsoUEZkTGAe0WxmiB7hAZ3k+oC26z2+DgFLRyWvybyEAwebdo9 x2IBSJb66sp/Tr8F0moBm1g97xYwxZSMMEQSzK4SwPdaoUSIPY/0d1KdlTwNpgm1XEGbxM NKOiCQQV68AaEqCxoXH4mTIcybuMUvI= Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-20551e2f1f8so60029635ad.2 for ; Tue, 24 Sep 2024 00:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727163835; x=1727768635; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sveNCmO55zA73Cq65R0Q3qE+br1KOMYEKyeAeW0hpMA=; b=gbCWDKmJt6S/C45FCX9zJXwsVVT0bh4lCOpPLQeNr6xBIVYJyKj8JJq/UwUqfyrTpO PKjvEgG8QzphkHDyCGC/3372smG6yKoGTFDz/IHMdxhkB6wLxoVhEAv2Nq38wRfYaTij zQpIlmezq64hYrPMvBEZjZ36wJWIVdM8g7CSoVd1gXwm02vG7Vft25vNQ/hsfINZr5En Ztvz2VtyJRlmFAOX0Yzo/9BprTkDNsYAvHApXhwq6d591uHlODG8lyUZI11bFHrVL2UV cqKKZ63tNsmN8B/TLk2oL75IvLuzOcP+nOAyhuwBGfxcPLx2WlPrFHwP105qz8J7gk0v meug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727163835; x=1727768635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sveNCmO55zA73Cq65R0Q3qE+br1KOMYEKyeAeW0hpMA=; b=ct+YIaJFfJPZS7rIdr8H0mF9oLTvFOynSYpRMObT3Ic9hilSloJ7ZiL9E8DWLvWQP9 kuyQXoyAaWQxj2+PF+N2Q6a0FDWTKtfj7HdbE6lDTPylML5nEIjaahDghPQljmxRobtx ZVk5OJ3AvCUGaTavHVP+TCD/1pDbVmmHQOitM0U+CpjPFX7W86/ogqZWtopskE1tGsBq e58GS4Ssi5eim7mrQOLa2KSdszRwKzBbG3IiM7VoUrJsd4Kif42YawAhaBf2p1USi17o R6VLrvYbEJ9uC3KmRrEVA6YrDPlK81o0hmnGWPdEZfID0yQXjshgpPV+Gf6PYMuhCkBY yJQg== X-Forwarded-Encrypted: i=1; AJvYcCWXfon8Ec6Skp1x/BQXC+T1a3FqbBM4iL/EgHs3/QhVAzAv1KBq4MtfXkgWAiu+fbYkYFvBFScThg==@kvack.org X-Gm-Message-State: AOJu0YxSWUqr2L19NH7Yg5NllRoGD6tR0nr1PTwAAn8wfGDgwTpj5cvI mAk5GktF5c/7ngHU5fgmQI9k9rNTxsiXile04X8M5polCwU8r1T/ X-Google-Smtp-Source: AGHT+IGkboJEphLTV+FMa306u2HDfgQ+BFBgzuEmyLxUgIiH1SucNTTRvao0wYxNex2p4+02OD3TWg== X-Received: by 2002:a17:903:1c9:b0:206:99a8:525f with SMTP id d9443c01a7336-208d8338b2dmr265597905ad.4.1727163834623; Tue, 24 Sep 2024 00:43:54 -0700 (PDT) Received: from localhost ([183.226.245.34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af1819289sm5672595ad.214.2024.09.24.00.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 00:43:54 -0700 (PDT) From: "qiwu.chen" X-Google-Original-From: "qiwu.chen" To: corbet@lwn.net, oleg@redhat.com, catalin.marinas@arm.com, will@kernel.org, paulmck@kernel.org, akpm@linux-foundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, "qiwu.chen" Subject: [PATCH v4 2/2] arm64: show signal info for global init Date: Tue, 24 Sep 2024 15:43:41 +0800 Message-Id: <20240924074341.37272-2-qiwu.chen@transsion.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240924074341.37272-1-qiwu.chen@transsion.com> References: <20240924074341.37272-1-qiwu.chen@transsion.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 0FF5E10000F X-Rspamd-Server: rspam01 X-Stat-Signature: 3zyc4ry7a75gbjjj1o41ybhr8emubtj9 X-HE-Tag: 1727163835-84300 X-HE-Meta: U2FsdGVkX1/rZej/uV/x/ssVU+rLakyXSlUBqK/AQN6+4bDDKuKaMHFRoiIDcUXQvEpth3UWs9oEDCTRpTW6D9lV0cyJQosnCmcGaTwWQIS5eDosa7rizSuNEhrPIFyRCE7O8e/AZ1MqOd6O0MSgpC5HHlQOfVoc/0/WF4YYdGBAUC39Ps8lmm2nHCQ8pc9ENZth+arINXNUrsv7kE158i3jodGSGWODjjrkp7oEh9NZpRRMfGlP8j0vucU4nMwch9uxDlYikn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Y= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Currently, it's hard to debug panic issues caused by kill init on arm64, since there is no debug info from user mode in current panic msg such as the user_regs and maps info. This patch shows signal info sent to the global init, which will be helpful for debugging kill init issue caused by unhandled exception from user mode. - changes history: v3: https://lore.kernel.org/all/20240922095504.7182-1-qiwu.chen@transsion.com/ https://lore.kernel.org/all/20240922095504.7182-2-qiwu.chen@transsion.com/ v2: https://lore.kernel.org/all/20231110031553.33186-1-qiwu.chen@transsion.com/ v1: https://lore.kernel.org/all/20231110022720.GA3087@rlk/ Signed-off-by: qiwu.chen --- arch/arm64/kernel/traps.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 563cbce11126..3150fb84195f 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -247,12 +247,20 @@ static void arm64_show_signal(int signo, const char *str) unsigned long esr = tsk->thread.fault_code; struct pt_regs *regs = task_pt_regs(tsk); + /* + * The signal sent to the global init needs to be shown, + * which is useful for debugging kill init issue. + */ + if (unlikely(is_global_init(tsk))) + goto dump; + /* Leave if the signal won't be shown */ if (!show_unhandled_signals || !unhandled_signal(tsk, signo) || !__ratelimit(&rs)) return; +dump: pr_info("%s[%d]: unhandled exception: ", tsk->comm, task_pid_nr(tsk)); if (esr) pr_cont("%s, ESR 0x%016lx, ", esr_get_class_string(esr), esr);