Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1003589pxb; Tue, 9 Feb 2021 19:39:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJywaEmVY2yvKKxFsRZsXNKVn9qY6LtStLCxV+bWDujkXLZSHzlIrcjG5y6PQLLb0W0aZ1GS X-Received: by 2002:a17:906:4a8b:: with SMTP id x11mr862276eju.195.1612928368523; Tue, 09 Feb 2021 19:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612928368; cv=none; d=google.com; s=arc-20160816; b=GMZnE5aru9dJv4+mbz1gaBPiGI6GUS5ZAARs4IH0Bo6uO0ct+PItAwQjPEE3uznHg2 cefiK4qelWSGJW4jb7EvUdEUoR2eDPSC3pPDhFsiy0hb3/0pVv3w5egmjevwV45wtIqB /jKoiYjpcVxelRjLgzEF4SzsDQ1++An1UgNLb9RidSmNWSq4kTe+WDTK1m1l10UQTAUG JVXQiMcVk7AbDrpA2DHd5Yy6621XatVCIkDyuFk0QIqv7vLYawAW7JuCTHdlRnATPzBg sNCcanGsxpsKt8aWEsdDRk152AuGcmLOIsMNN7146MtudVNJG+ArXn4T1K2CL1VZGem6 hi2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ivmRHxYR4rHSKqZerODIQFp3ysaiHJ8fEL6MKHjvIpI=; b=P/XD3Ykm6NXR7Tir1YKZFonM+I98wzzYLdX8/cZnHYQz/d90xo16xocyqKvQfB2I0Z jBd6UV74uxszTmrFZZGcqoBrhgZmwPo/jT4J5lYS3nX3/NIUk+iKPdIgONd5vPjGS5+m 2meLJZFAvocgczZaJdToI56O3PzKY5w3Zbys0t2KwuLn/TOkGZeQe8mlOZKqk8JzN+aF drfr0W6IWRnFNS3tvDSouppCeiJKk7iSnQuMG+FxUHTJUThBMBcJTW1lIuSm5BOjXlKD jXThEPHgTSUsmCgkCs+pppOxQQVeEpG03uqg4fPRONYoz/qaaY9znYkuRWGm376XC9G5 2JWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd1si440147ejb.214.2021.02.09.19.39.05; Tue, 09 Feb 2021 19:39:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbhBIMky (ORCPT + 99 others); Tue, 9 Feb 2021 07:40:54 -0500 Received: from elvis.franken.de ([193.175.24.41]:36515 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbhBIMj6 (ORCPT ); Tue, 9 Feb 2021 07:39:58 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l9SIV-0003IE-00; Tue, 09 Feb 2021 13:39:15 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 980DAC0DB9; Tue, 9 Feb 2021 13:11:24 +0100 (CET) Date: Tue, 9 Feb 2021 13:11:24 +0100 From: Thomas Bogendoerfer To: Tiezhu Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: Re: [PATCH v2] MIPS: Make check condition for SDBBP consistent with EJTAG spec Message-ID: <20210209121124.GA11134@alpha.franken.de> References: <1612847125-3141-1-git-send-email-yangtiezhu@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1612847125-3141-1-git-send-email-yangtiezhu@loongson.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 01:05:25PM +0800, Tiezhu Yang wrote: > According to MIPS EJTAG Specification [1], a Debug Breakpoint > exception occurs when an SDBBP instruction is executed, the > CP0_DEBUG bit DBp indicates that a Debug Breakpoint exception > occurred, just check bit DBp for SDBBP is more accurate. > > [1] http://www.t-es-t.hu/download/mips/md00047f.pdf > > Signed-off-by: Tiezhu Yang > --- > > v2: add MIPS_DEBUG_DBP definition > > arch/mips/include/asm/mipsregs.h | 4 ++++ > arch/mips/kernel/genex.S | 4 ++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h > index a0e8ae5..9c8099a 100644 > --- a/arch/mips/include/asm/mipsregs.h > +++ b/arch/mips/include/asm/mipsregs.h > @@ -1085,6 +1085,10 @@ > #define CVMVMCONF_RMMUSIZEM1_S 0 > #define CVMVMCONF_RMMUSIZEM1 (_U64CAST_(0xff) << CVMVMCONF_RMMUSIZEM1_S) > > +/* Debug register field definitions */ > +#define MIPS_DEBUG_DBP_SHIFT 1 > +#define MIPS_DEBUG_DBP (_ULCAST_(1) << MIPS_DEBUG_DBP_SHIFT) > + > /* > * Coprocessor 1 (FPU) register names > */ > diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S > index bcce32a..743d759 100644 > --- a/arch/mips/kernel/genex.S > +++ b/arch/mips/kernel/genex.S > @@ -349,8 +349,8 @@ NESTED(ejtag_debug_handler, PT_SIZE, sp) > MTC0 k0, CP0_DESAVE > mfc0 k0, CP0_DEBUG > > - sll k0, k0, 30 # Check for SDBBP. > - bgez k0, ejtag_return > + andi k0, k0, MIPS_DEBUG_DBP # Check for SDBBP. > + beqz k0, ejtag_return IMHO both implementations are doing the same thing. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]