From nobody Tue Feb 10 02:50:00 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1565188345; cv=none; d=zoho.com; s=zohoarc; b=hBtVPEJ2ksLAiwr5R+xbx3mnSur+GioNGWYjbX6KybKHgDuNFy1PKixnCoYQ9VPXW4rqf7HEtJYrYd8cCFUJ3lOOhp63wJCKrFVia+PGGuBLxCyQXuXS4DM86EzEpb9qXzfdUAcPL/y8XuqvzIldFjHl0Rao1M3M1erchAoBXu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565188345; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BAxhFLEUgl0BX7THgd6Ckv/Z3iIpMHhrax0sqKckX2k=; b=awLUmwT7Cf38lQ8NLP+1koQi1I896CkuvbteRuKuiCMPINmIM28Rj9UxKXu/sCY1UdR2HJLSCsnuAsVlN0QwGrgVAi4p14OFaCT9wUG/DG92DuUNpJZa62VEXGfwvCPW9XOKYaPZP/AOrRwTUHdtEYAPb4TdDnDknr18FQP9nyg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1565188345594321.2855416838686; Wed, 7 Aug 2019 07:32:25 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvMyM-0000yT-4n; Wed, 07 Aug 2019 14:31:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvMyK-0000y5-Tj for xen-devel@lists.xenproject.org; Wed, 07 Aug 2019 14:31:24 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 078bee50-b920-11e9-b7f8-5ba9b72e5674; Wed, 07 Aug 2019 14:31:23 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 84D6EB034; Wed, 7 Aug 2019 14:31:22 +0000 (UTC) X-Inumbo-ID: 078bee50-b920-11e9-b7f8-5ba9b72e5674 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 7 Aug 2019 16:31:17 +0200 Message-Id: <20190807143119.8360-3-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190807143119.8360-1-jgross@suse.com> References: <20190807143119.8360-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 2/4] xen: add new CONFIG_SPINLOCK_DEBUG option X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Instead of enabling spinlock debugging for debug builds only add a dedicated Kconfig option for that purpose which defaults to DEBUG. Signed-off-by: Juergen Gross --- xen/Kconfig.debug | 7 +++++++ xen/common/spinlock.c | 4 ++-- xen/include/xen/spinlock.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index e10e314e25..5db3e7ec25 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -44,6 +44,13 @@ config COVERAGE =20 If unsure, say N here. =20 +config SPINLOCK_DEBUG + bool "Spinlock debugging" + default DEBUG + ---help--- + Enable debugging features of spinlock handling. Some additional + checks will be performed when acquiring and releasing locks. + config LOCK_PROFILE bool "Lock Profiling" ---help--- diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 4e681cc651..16356ec9b7 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -9,7 +9,7 @@ #include #include =20 -#ifndef NDEBUG +#ifdef CONFIG_SPINLOCK_DEBUG =20 static atomic_t spin_debug __read_mostly =3D ATOMIC_INIT(0); =20 @@ -97,7 +97,7 @@ void spin_debug_disable(void) atomic_dec(&spin_debug); } =20 -#else /* defined(NDEBUG) */ +#else /* CONFIG_SPINLOCK_DEBUG */ =20 #define check_lock(l) ((void)0) #define check_barrier(l) ((void)0) diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index b4881ad433..e3458f10dd 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -6,7 +6,7 @@ #include #include =20 -#ifndef NDEBUG +#ifdef CONFIG_SPINLOCK_DEBUG union lock_debug { unsigned short val; struct { --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel