From patchwork Thu Jan 9 13:48:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11325717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C017921 for ; Thu, 9 Jan 2020 13:50:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7221220661 for ; Thu, 9 Jan 2020 13:50:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7221220661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipYBZ-0003Ki-EK; Thu, 09 Jan 2020 13:49:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipYBY-0003KO-7w for xen-devel@lists.xenproject.org; Thu, 09 Jan 2020 13:49:16 +0000 X-Inumbo-ID: cb1255ae-32e6-11ea-a985-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cb1255ae-32e6-11ea-a985-bc764e2007e4; Thu, 09 Jan 2020 13:49:02 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 55B4AAD5D; Thu, 9 Jan 2020 13:48:28 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Thu, 9 Jan 2020 14:48:25 +0100 Message-Id: <20200109134825.31482-3-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200109134825.31482-1-jgross@suse.com> References: <20200109134825.31482-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v2 2/2] xen: make CONFIG_DEBUG_LOCKS usable without CONFIG_DEBUG 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 , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In expert mode it is possible to enable CONFIG_DEBUG_LOCKS without having enabled CONFIG_DEBUG. The coding is depending on CONFIG_DEBUG as it is using ASSERT(), however. Fix that by using BUG_ON() instead of ASSERT() in rel_lock(). Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- xen/common/spinlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 286f916bca..344981c54a 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -86,7 +86,7 @@ static void got_lock(union lock_debug *debug) static void rel_lock(union lock_debug *debug) { if ( atomic_read(&spin_debug) > 0 ) - ASSERT(debug->cpu == smp_processor_id()); + BUG_ON(debug->cpu != smp_processor_id()); debug->cpu = SPINLOCK_NO_CPU; }