Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2830026lqt; Tue, 23 Apr 2024 02:58:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhl2QOun5Pga0nrSp3LnHzrlNn13SE+2GxQiC8BK2MTlqoxkJ4AyqHzXPELZ0TiKJfxKHVJ0FTd4Z4nAMzjo4puXAwwjhy98HcEZPAaA== X-Google-Smtp-Source: AGHT+IGvk295kQ1hIBGVuhFkQoDCiN/hxYyScBFpbzcPa1fECe3nBom8AfP4skIuvZysC3EFbpYR X-Received: by 2002:a17:90b:358c:b0:2ab:8e59:9da9 with SMTP id mm12-20020a17090b358c00b002ab8e599da9mr2970757pjb.6.1713866334887; Tue, 23 Apr 2024 02:58:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713866334; cv=pass; d=google.com; s=arc-20160816; b=nj+ubcyMC3GDNiiVhj2DqVkymw30D3lpHB0MRMOZzgMwOKXpaFm0oqwHtChgJ7a+U4 BtfOBjAec7ti8t5Hab0izurqPmS3Wk4WYmA+WrKeQZMgImj3iW/CgxLzCFhOXGZCoOkS MH3nzHgF9HJ0hAjD49gDOkDGcEgfUCHqVKJL0SACMAX7rpHOZ+VZ6puO8ou/sfHERZAE iD+v7RCbyWbDnzhrTWS/KzSflMoaOl262LE1XeFurY1Iq4ghYnZLrCR+DQRVYJ4bACU5 jmN0/BxkvbG8HIe8Mj6qIO0lhQNpAFxgY/q1OdDt9IctmQPR/wXrFfPPgjZI8GY3dbUv AEaA== 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; bh=zB5zEwQewi0rGpeBMNS/U5QEBAe9I8Gh52otF1l8/lI=; fh=5SfVGc8P4gIk5VCCoWF0i2bbokiYjZqjU4f+GXENcyA=; b=hMAg2fyIgAe3V7MMcQX9r0GMrL2ylI6dYBWVGpiovvAw3DzweaXxqu13T/WAXiXfRi SWEWVROXNe/eWckShMUdf5s5a5MG1O7+piweglURnUdJMjnXGWz3wZnlJ6lvx6en47wE Kvrdir+1y7ktZFaDQjE73/PdIz1u9mJcstsPAjJDCQ3b0zYCkKqUAVNKd9/cgN/6KKW1 eySMPgLAVoWeWKEVfVKW3U1OUJSTihfcaXYNywP5Xl9wTPfWXdGy5CnqOjjGOJfg7zkx SXQQ99LxuSMmC/1vCKcQi16+uFLwm/y+JIzqhn3qKhvpbIHg2JgcYNJbskxRA/h/NYlL +ibg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-154807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e91-20020a17090a6fe400b002a06b6f521fsi10962480pjk.127.2024.04.23.02.58.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 02:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-154807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 453D6285E05 for ; Tue, 23 Apr 2024 09:47:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02EE45A788; Tue, 23 Apr 2024 09:47:39 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B97EB55E45 for ; Tue, 23 Apr 2024 09:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713865658; cv=none; b=sM4ytEh5dWv87+TAzx3WFVQ5nXV9yjkvqUIhOTK4tGiong1joQ0LYlutOSIXNIyOYsJnQIaA74IJYr2ESQrZ/MlEMLwM5WUVFbRGtZIzsZYjQAOwCV0TCbo1GxSVqc4bjnpe/l2VDjSeste/4POAPxm9dlux3ychZVBJFmexmi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713865658; c=relaxed/simple; bh=o8f+brFbNNar+gNRDa+EC2wglP1NAfSvVEiv2tzucYA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mf3PcBmmi2Ya8Vpgk8hzR7cIjfhLEiaP8toXQg7r5hERyuHTStjucJdJGkjqZTKJsZTFxTVyw5SqmLDWkHhMVpW9LwhfLTL48Xv+0TE2lneuYKyIYIP7tWn8WaaNjQKAHOy6zO8AaDYLwl2zDoD+P6YIQxiFSR/boccCg9kT1LE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A1DE339; Tue, 23 Apr 2024 02:48:03 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.21.210]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A99F3F64C; Tue, 23 Apr 2024 02:47:33 -0700 (PDT) Date: Tue, 23 Apr 2024 10:47:29 +0100 From: Mark Rutland To: Kees Cook Cc: linux-kernel@vger.kernel.org, paulmck@kernel.org Subject: Re: [PATCH] lkdtm/bugs: add test for hung smp_call_function_single() Message-ID: References: <20240419103452.3530155-1-mark.rutland@arm.com> <202404191434.5B051B5DC6@keescook> 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: <202404191434.5B051B5DC6@keescook> On Fri, Apr 19, 2024 at 02:53:59PM -0700, Kees Cook wrote: > On Fri, Apr 19, 2024 at 11:34:52AM +0100, Mark Rutland wrote: > > The CONFIG_CSD_LOCK_WAIT_DEBUG option enables debugging of hung > > smp_call_function*() calls (e.g. when the target CPU gets stuck within > > the callback function). Testing this option requires triggering such > > hangs. > > > > This patch adds an lkdtm test with a hung smp_call_function_single() > > callbac, which can be used to test CONFIG_CSD_LOCK_WAIT_DEBUG and NMI > > backtraces (as CONFIG_CSD_LOCK_WAIT_DEBUG will attempt an NMI backtrace > > of the hung target CPU). [...] > > I wrote this because I needed to guide someone through debugging a hung > > smp_call_function() call, and I needed examples with/without an NMI > > backtrace. It seems like it'd be useful for testing the CSD lockup > > detector and NMI backtrace code in future. > > Like the other lockup detector, I suspect we should skip it by default > in the selftests? Something like this: > > diff --git a/tools/testing/selftests/lkdtm/tests.txt b/tools/testing/selftests/lkdtm/tests.txt > index 368973f05250..32baddc2c85d 100644 > --- a/tools/testing/selftests/lkdtm/tests.txt > +++ b/tools/testing/selftests/lkdtm/tests.txt > @@ -31,6 +31,7 @@ SLAB_FREE_CROSS > SLAB_FREE_PAGE > #SOFTLOCKUP Hangs the system > #HARDLOCKUP Hangs the system > +#CSDLOCKUP Hangs the system > #SPINLOCKUP Hangs the system > #HUNG_TASK Hangs the system > EXEC_DATA Ah, I wasn't ware of that file, yes. > > I'm not sure about the CSDLOCKUP name, but everything else I tried > > didn't seem great either: > > > > * IPILOCKUP sounds like it's testing IPIs generally > > * SMPCALLLOCKUP and similar look weirdly long > > * SMP_CALL_LOCKUP and similar look different to {HARD,SOFT,SPIN}LOCKUP > > > > ... and I'm happy to defer to Kees for the naming. ;) > > It looks like it's only useful with CSD lockup detector? If that's true, > sure, this name is fine. I think it's also useful for testing other things (e.g. RCU stall detection), so how about we go with SMP_CALL_LOCKUP, as that says what the test does rather than what specifically it can be used to test? Mark.