Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1634005lqt; Wed, 20 Mar 2024 09:29:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVy7waLVr4qnyF+Pi4AQ6rL2cC4wdDiX2siwBfeTC1t7zOWyCk/fhcap0kGCHNktWqKEjA+TZQiEa1H+zxsKUEVo7F7BgEPZ8ya5a/QaQ== X-Google-Smtp-Source: AGHT+IFEosVzgAMSXeXuG8jOW8sVXLkB/ZUZp3kcSR0BAjZ3a8/UaF3v82D33ZD7hUHDuPrk4+bh X-Received: by 2002:a05:6a20:734e:b0:1a3:6a2b:a7d3 with SMTP id v14-20020a056a20734e00b001a36a2ba7d3mr7331252pzc.47.1710952151992; Wed, 20 Mar 2024 09:29:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710952151; cv=pass; d=google.com; s=arc-20160816; b=gXEntukkcjk6VhIjjr+UM93lFhUoj4D9sGr+EDdqEF6msz2kNeQToNIqKBISgr7fR3 tLqYrVcCWTpeXchWnQFpLuhqMuTOki+ROnSBZdQ38hR1QPY26bxjTKVu+3FM07cblZtz 4afRaT7J1SV2UMp7LsStpSOfCRJGdix6pEtufVzbvJkIwmg0OMPBIZyf6uChUy49nzgX Td46/u5k6k5M6x8XgKIz9RXfKjbNyXG2CN4rciBzTm2WQH9N2kKQ96CAzSe6ZZSOGMOO LtBATy6xSBl4jkAK1H7BQ7LEWZAvLUIX4wjRXB1Sj0VCJRlNsygvEGgstYZKhE5Gwn2j mtPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=msB9F7QOeQwvM5EEEp7pk58WHiFSBilQq0veDXMN8ik=; fh=vpQ0bDNYfkMlMpR+1Rv//Atck6hihJErbZX46ES1jGY=; b=TpZwXClGZx+cyhoMApjMEv8/+LSuDSP1JC6NEQWOdVGn2lqnflBLA7AVQwMA53ej6b iTIRc0NjtYapspIGuxSc3ueoc2sBLHTKXuqpKpktHqiM8KF8+LSJL/j8BdA9SXIWY+DN 8hmw81yDNfRIo8pYP31C7LtNCBemGEKJPA2GATbv72R8cp2QjFb9cOArDlYCkMHqIivT 3ZCdDeyukZy7UcvavdmLey6isAyFwEsKnPJFqkit7uJPXRueY+afQcmYqQeu03XCigKO I6jCrl0ADj8NAgcsnk1VoDHPmml84pjYDMbnAuI/hNsu2DxqT1HKbkt83L7GE52MFiwE DtCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v+jJayUs; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-109166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x24-20020aa784d8000000b006e6ade7acfdsi13217661pfn.307.2024.03.20.09.29.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 09:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v+jJayUs; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-109166-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CBC50B22CCE for ; Wed, 20 Mar 2024 16:28:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4A3F54FAE; Wed, 20 Mar 2024 16:28:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="v+jJayUs" Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 8273F4E1D5 for ; Wed, 20 Mar 2024 16:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710952088; cv=none; b=I9Tduems/0tWqgNfMS1PsbvRDY3rtoNAEVXqIYJOuWQ+gjdSrfogyHoVDG3tSYIGBcurIvh4fYqyFZxcp5/X/oda5r270HEUC0QHa+UgIvcZwmRBRhIFhLIqNSL6dgPf910ba0g8OuYDPprFlceV5P0m4pLgAAHQ/MYMVeLxGoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710952088; c=relaxed/simple; bh=yTzaE6ut/W8ahZ+/Mz5Xw5xcnS3KSBlLVAjk9v6eLtM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jAUP8vy+uEK8mE2OEfTSBjOwYEpls+DBbo7NAElyNbsEo5Ie48IL7v3K48Hl+kUbsWBlbjB4FacrD1IHkmquC9nVMwyDlRE+JX1U7+wKBe1upEjYiEvpaHHzaB0hZklNwv/h9Mc23f6Q8kAOVl7LRV1ruOtxgYCZqheIsYpFzms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=v+jJayUs; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-33fd12a06fdso2506836f8f.1 for ; Wed, 20 Mar 2024 09:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710952085; x=1711556885; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=msB9F7QOeQwvM5EEEp7pk58WHiFSBilQq0veDXMN8ik=; b=v+jJayUsCzfwwMNnWVBxrApMS2WwY53jUPISYEktrNJDMCU6gd1iABKITYnhfdefxN /WOvZH8I9VGeY7H7VO3VqTh28XJz1/257EriFlH6geHpuNCPhwrSwfk9Er0iTjxCX0Ua bNrVIORCxTnmIvhWd1YGe1oX1Uz/3b/Frl6CYqRrSkMM4PvzWVekSFyUWJSfOfK0aP4P GlL2PrG91liyPm2vERxHgnZyyNOj01GpA0UnHgtPz4ZLb5FxcfAnIjO1sf90HsFYktXn 0ZlwITZJrJlhTSvk8rc+yBKx/aMUWx4l4VtpvMRO/gXMZNBkun6grk2AU7JT6WajrAQ3 iHlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710952085; x=1711556885; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=msB9F7QOeQwvM5EEEp7pk58WHiFSBilQq0veDXMN8ik=; b=Rx4U/NYNC0BRuCzSdGqFk+Oq57eFeVy4Y0iVn4wwtz9srYggDNARWlKgkHHQ95amKy sVwXF1AFd//InW5MZMXnG3NGfIMoAIJI9HYg19PdAdqYSB7bjLLom4dE/Rv5gAfh817p 5q7s1FREe3/31eDFdaA+N4/k1knvzdoaLnePtvIr7dX4HYBSEnkSrcOeDfzPvS81Z2oB Lheq3XMVKKcSeJflrKMLvgGGmT6Tf7Y3lYcwX2aHh3r6grDO4vMaBe/kdhO/BCFO9r90 L7KIVqlQSMdeIhMIGKyNSvQDhPGTu/l7+y8EWBfzRRXAQTrtd8pDkdbWF4FdbLRBxGch mfbg== X-Forwarded-Encrypted: i=1; AJvYcCXuwbP0SaOd7IQgkSrvL5GqakamqCO4yvYeTWmj55BR7oraZ2g2TRCKCERwjCTDruo8BgVkTIJlyp3GwiIl6dA4cThwgrWqrE1lOcgu X-Gm-Message-State: AOJu0Yzw1I6XX2hfQPqnCGyVMWlztvquzZndFPm6kD1VbO7AkONc0hp9 KtEJM87XxiYdBhT1IosdcKx4G+nqFrtyClVY36XjxUBgIwdSrxndBz38Obfj838= X-Received: by 2002:a5d:64ab:0:b0:33e:781e:da57 with SMTP id m11-20020a5d64ab000000b0033e781eda57mr1983079wrp.53.1710952084670; Wed, 20 Mar 2024 09:28:04 -0700 (PDT) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id m10-20020adffe4a000000b0033de10c9efcsm14961571wrs.114.2024.03.20.09.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 09:28:04 -0700 (PDT) Date: Wed, 20 Mar 2024 16:28:02 +0000 From: Daniel Thompson To: liu.yec@h3c.com Cc: dianders@chromium.org, gregkh@linuxfoundation.org, jason.wessel@windriver.com, jirislaby@kernel.org, kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v1] kdb: Fix the deadlock issue in KDB debugging. Message-ID: <20240320162802.GA22198@aspen.lan> References: <20240314130916.GE202685@aspen.lan> <20240316023443.101169-1-liu.yec@h3c.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240316023443.101169-1-liu.yec@h3c.com> ^^^ This is v2 isn't it? On Sat, Mar 16, 2024 at 10:34:43AM +0800, liu.yec@h3c.com wrote: > From: LiuYe > > Currently, if CONFIG_KDB_KEYBOARD is enabled, then kgdboc will > attempt to use schedule_work() to provoke a keyboard reset when transitioning out Please format the description correctly. > of the debugger and back to normal operation. This can cause > deadlock because schedule_work() is not NMI-safe. Wasn't there another paragraph to go here? : The stack trace below shows an example of the problem. In this : case the master cpu is not running from NMI but it has parked : the slave CPUs using an NMI and the parked CPUs is holding : spinlocks needed by schedule_work(). > example: > BUG: spinlock lockup suspected on CPU#0, namex/10450 > lock: 0xffff881ffe823980, .magic: dead4ead, .owner: namexx/21888, .owner_cpu: 1 > ffff881741d00000 ffff881741c01000 0000000000000000 0000000000000000 > ffff881740f58e78 ffff881741cffdd0 ffffffff8147a7fc ffff881740f58f20 > Call Trace: > [] ? __schedule+0x16d/0xac0 > [] ? schedule+0x3c/0x90 > [] ? schedule_hrtimeout_range_clock+0x10a/0x120 > [] ? mutex_unlock+0xe/0x10 > [] ? ep_scan_ready_list+0x1db/0x1e0 > [] ? schedule_hrtimeout_range+0x13/0x20 > [] ? ep_poll+0x27a/0x3b0 > [] ? wake_up_q+0x70/0x70 > [] ? SyS_epoll_wait+0xb8/0xd0 > [] ? entry_SYSCALL_64_fastpath+0x12/0x75 > CPU: 0 PID: 10450 Comm: namex Tainted: G O 4.4.65 #1 > Hardware name: Insyde Purley/Type2 - Board Product Name1, BIOS 05.21.51.0036 07/19/2019 > 0000000000000000 ffff881ffe813c10 ffffffff8124e883 ffff881741c01000 > ffff881ffe823980 ffff881ffe813c38 ffffffff810a7f7f ffff881ffe823980 > 000000007d2b7cd0 0000000000000001 ffff881ffe813c68 ffffffff810a80e0 > Call Trace: > <#DB> [] dump_stack+0x85/0xc2 > [] spin_dump+0x7f/0x100 > [] do_raw_spin_lock+0xa0/0x150 > [] _raw_spin_lock+0x15/0x20 > [] try_to_wake_up+0x176/0x3d0 > [] wake_up_process+0x15/0x20 > [] insert_work+0x81/0xc0 > [] __queue_work+0x135/0x390 > [] queue_work_on+0x46/0x90 > [] kgdboc_post_exp_handler+0x48/0x70 > [] kgdb_cpu_enter+0x598/0x610 > [] kgdb_handle_exception+0xf2/0x1f0 > [] __kgdb_notify+0x71/0xd0 > [] kgdb_notify+0x35/0x70 > [] notifier_call_chain+0x4a/0x70 > [] notify_die+0x3d/0x50 > [] do_int3+0x89/0x120 > [] int3+0x44/0x80 > > Suggested-by: daniel.thompson@linaro.org Thanks for the credit but I think the following is probably a better way to express it: Co-authored-by: Daniel Thompson Signed-off-by: Daniel Thompson Daniel.