From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B076C7619A for ; Thu, 6 Apr 2023 02:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234501AbjDFCxs (ORCPT ); Wed, 5 Apr 2023 22:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234768AbjDFCx2 (ORCPT ); Wed, 5 Apr 2023 22:53:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 731A193F9 for ; Wed, 5 Apr 2023 19:53:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE58A62AE1 for ; Thu, 6 Apr 2023 02:53:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10F61C433D2; Thu, 6 Apr 2023 02:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1680749584; bh=RkBpM94R1pP7NLV+F44wUZwT0raa0g6U7nZardoNfIQ=; h=Date:To:From:Subject:From; b=pTL+DcJBwr7dnQviXKIcPbYF26WR7aRVZcgW2eq8x1HUBNIs6hs612CcuS15KUEDb MoF2SQnUbcpn6QNBugW6z7n9ZqyrsmYG7HVDzQNtdUPjPw4Q4kSahZpQmOqfVRKzCm +ubfE+kRorXSUtGc8JYjBbjxQ+zAXLlGLQV7J698= Date: Wed, 05 Apr 2023 19:53:03 -0700 To: mm-commits@vger.kernel.org, richard@nod.at, kbingham@kernel.org, johannes@sipsolutions.net, jan.kiszka@siemens.com, anton.ivanov@kot-begemot.co.uk, development@efficientek.com, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-nonmm-stable] scripts-gdb-support-getting-current-task-struct-in-uml.patch removed from -mm tree Message-Id: <20230406025304.10F61C433D2@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The quilt patch titled Subject: scripts/gdb: support getting current task struct in UML has been removed from the -mm tree. Its filename was scripts-gdb-support-getting-current-task-struct-in-uml.patch This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Glenn Washburn Subject: scripts/gdb: support getting current task struct in UML Date: Sun, 26 Feb 2023 22:06:00 -0600 A running x86 UML kernel reports with architecture "i386:x86-64" as it is a sub-architecture. However, a difference with bare-metal x86 kernels is in how it manages tasks and the current task struct. To identify that the inferior is a UML kernel and not bare-metal, check for the existence of the UML specific symbol "cpu_tasks" which contains the current task struct. Link: https://lkml.kernel.org/r/b839d611e2906ccef2725c34d8e353fab35fe75e.1677469905.git.development@efficientek.com Signed-off-by: Glenn Washburn Reviewed-by: Jan Kiszka Cc: Anton Ivanov Cc: Johannes Berg Cc: Kieran Bingham Cc: Richard Weinberger Signed-off-by: Andrew Morton --- scripts/gdb/linux/cpus.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/scripts/gdb/linux/cpus.py~scripts-gdb-support-getting-current-task-struct-in-uml +++ a/scripts/gdb/linux/cpus.py @@ -163,8 +163,14 @@ def get_current_task(cpu): task_ptr_type = task_type.get_type().pointer() if utils.is_target_arch("x86"): - var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task") - return per_cpu(var_ptr, cpu).dereference() + if gdb.lookup_global_symbol("cpu_tasks"): + # This is a UML kernel, which stores the current task + # differently than other x86 sub architectures + var_ptr = gdb.parse_and_eval("(struct task_struct *)cpu_tasks[0].task") + return var_ptr.dereference() + else: + var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task") + return per_cpu(var_ptr, cpu).dereference() elif utils.is_target_arch("aarch64"): current_task_addr = gdb.parse_and_eval("$SP_EL0") if (current_task_addr >> 63) != 0: _ Patches currently in -mm which might be from development@efficientek.com are