Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1042298pxb; Tue, 9 Feb 2021 21:09:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0pFD8Sb2lvkWlSJ9DU6+whjSGHa1rVkkc0dg8pgpjTgusJYgVZdAhZd2yHySSsLxQyF68 X-Received: by 2002:a17:906:560b:: with SMTP id f11mr1259680ejq.162.1612933758818; Tue, 09 Feb 2021 21:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612933758; cv=none; d=google.com; s=arc-20160816; b=g/Xsyb5o4Lo1ohIwm2KUdYHTGvMKhLGfvGDNr+F+EDGT7hyoEeF17dZMLMR2TCimrA 5dW5tF+GBkrmP0mdbO2q2piY9UxeZcTJjGrjHyU6Oo99mMfU7suonbujG2YwRVJ0DApy gI1z5da8vNMJJr+hXaM+CewIrYnUZ+BSk2rBtALHkyTvLmrKiMRLjwSZX23z005iemeu oT7IxjIPfw35NxHkaRk92eU/qhGzz2JOIgxbju/JaB+RTwoModaWzkpWBqnhSvuySHQv FkQdB305CLb/ngUSCEtDaWfA8Yq8cj6zE5Y3P7aMc+9zwGvVL25wFYnzyccBOUFaome0 GdsQ== 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=eGHHMEdNOLifwyBuXjXM+mRd7D3CjO3vK2SgjUc0z5g=; b=gn+aOIy/Eu8ukXvD6xXajVp4M5UwKzyKCzdiQo1zr1HcZu9HC/jl9jz4XE492DQNA3 V8oS7zXys9s3k6dvjARAY3w7UvOhg1k8rjMWW0aRW3DkC6wou+BtkjL4BieZY9mc8Aje XTWOeRHPvwnMySuhijWFuIUFh6rumT6vuwKgANCBfWJ0XIOGDlUDV9a3cjdA/Eac8ezj rUtj7HQIBVSyWugu/Yfnxpbs+LK8uYajzoifI8aF0bhSXQkZqSkQp1l/ms5CC2/0WNyc uW4qQwluzx2u/0PbG7yQi9iYVWO0CTQF8DG6IF4d0IYtxBoP85UThT1KKMLrQ5S71CCu og1A== 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 r25si854100edc.514.2021.02.09.21.08.56; Tue, 09 Feb 2021 21:09:18 -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 S230108AbhBIOC6 (ORCPT + 99 others); Tue, 9 Feb 2021 09:02:58 -0500 Received: from elvis.franken.de ([193.175.24.41]:36682 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231135AbhBIOCN (ORCPT ); Tue, 9 Feb 2021 09:02:13 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l9Ta5-0004Ih-00; Tue, 09 Feb 2021 15:01:29 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 23E1BC0DC4; Tue, 9 Feb 2021 15:00:18 +0100 (CET) Date: Tue, 9 Feb 2021 15:00:18 +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: <20210209140018.GA13043@alpha.franken.de> References: <1612847125-3141-1-git-send-email-yangtiezhu@loongson.cn> <20210209121124.GA11134@alpha.franken.de> <03fcfc00-acdd-a949-046c-3002195d6024@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03fcfc00-acdd-a949-046c-3002195d6024@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 09:09:52PM +0800, Tiezhu Yang wrote: > On 02/09/2021 08:11 PM, Thomas Bogendoerfer wrote: > > 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. > > When I read the original code, it looks a little confusing > at first glance, the initial aim of this patch is to make the code > more readable and easier to understand. which your version is, but the description sounds like there is a semantic change somewhere (at least to me). So with a little bit rewording I'm fine with applying your patch. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]