Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp159725pxb; Mon, 8 Feb 2021 18:41:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy24tr14VKNaOZO9zEGT9GsWOvFBTs4RvoNb84XjIySEmejdIHvWZGQNEzOd8t/Gys3KK62 X-Received: by 2002:a17:906:b4a:: with SMTP id v10mr15709773ejg.382.1612838513895; Mon, 08 Feb 2021 18:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612838513; cv=none; d=google.com; s=arc-20160816; b=dInOooiAgQEseJ0JnP7+sVNW7OeyXq8DqEZYpZkGWhtOywHTAjGkFdpBixWSRnxQA+ 1tG/VVfEkz+x3MA+0iHAaDdRtCltT7J6YUggSYr7MFrKNc0bwy78jMtU4mYtXF/BJXz4 7dpP12hAMArYGcBtY2Fz4kUshDEDqDHYzmE4KHe3/tWNr5Wlv9LL2H9DCAbZxJC85Br7 77Zmb05MTnXKMudhvHTDrqLfmn1SZnvpbg/yrGW1zMZceXPJVjmYURWlwjIVt4DVwBYb b4RwZa+uSsVtadqFwnYC7WeDnZPlFGgGo3xtfMUFM2jIQOKe60itY9gCddenaXjn8ZRM 06eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=Imuik1TGE9YdIuXmmENtdnG1NGZ0AhGfwRsqBCCiPHg=; b=QHXpFtWF56ZTBhFUQvb0SuZPBYFH5yFH2JVWSoT5N15cuEksqR42DhfC+T4NQNLpj4 9XTDjrwSkkRnSRg5c9APmOLCEqfg+9xWsXwlE+5p2RKNw++DEAgswT/rGNietDPr4EeF aB1y6zyZovmQf7EQ/muB8/Mgn5/nDdWGD9TfTOVfgvVU97LcNXB1aCBSqoi6/tue2DVt gU73rJ4yhUyzl1SxybbPoimYAOpKE13TMrViC/MDh0qyNprNzm7087nGGp0N4x+X2gWB KBwRUniO0x0i0pIjwV6RJ0f1mNFQ41YNwSM/AHTbFfXayEMl+bOSn1Tlo+NgAwjYI3a9 bw3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=msUmLiiJ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=tL+7XajZ; 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 p13si12811905ejo.460.2021.02.08.18.41.06; Mon, 08 Feb 2021 18:41:53 -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; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=msUmLiiJ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=tL+7XajZ; 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 S230031AbhBICiL (ORCPT + 99 others); Mon, 8 Feb 2021 21:38:11 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:52223 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbhBIChm (ORCPT ); Mon, 8 Feb 2021 21:37:42 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BBDFB5C01DE; Mon, 8 Feb 2021 21:36:34 -0500 (EST) Received: from imap1 ([10.202.2.51]) by compute6.internal (MEProxy); Mon, 08 Feb 2021 21:36:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=Imuik1TGE9YdIuXmmENtdnG1NGZ0AhG fwRsqBCCiPHg=; b=msUmLiiJyeh3xS3YzYg3EhX3fUjCTmir5PgppkgLdVZNDo4 isMmSYOmg9CHTmWMkPLbZBBaT7vIRe4s+J1ePv0rJY1IdiUh/+E8H/s2AsZDioFG hWYxjOu5qrcHKd1mbXhPOCTfPjNxHzxfrz2U9D9bXZczMIosYfGVCpRx8ceEMkMO e0XGWPdRLCQ9Ql3ofw90EYLlfPhiA+EXJE1Rc0JljE1zWgfu44+kdPsES1pXu9Vj AW5zpb8gZyN6W0+KDdjCBPwBCJRCdlKoo1Z2otIUhjZ0fKtltpDwUPIgyltRiCdX hqUqsI9Jx3byS9Lcg7ntGqoO+Pab84ujLdStuuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Imuik1 TGE9YdIuXmmENtdnG1NGZ0AhGfwRsqBCCiPHg=; b=tL+7XajZUzjlwcyuBGEuY4 a6gwxG9Va3eNM7BKGhluZX3C1fZy1QIQDvuz7ZcfuWzfKQG7TM2FMHIzbBsjXIoM mE+B/dakS3lrOwszmsBU7Mvvd6h3Zw7B9QQuTmgOJAa7fuUdck6vPAHsiiHXXvvG ARv+0qmuWa7IesKLnf0Rx/ZZZXLvCZPViQKIC7p7hlNM14nQkki1FPo35onbl4V0 0e90tsUqYGTxmMd59hao1c0ef9isbUVxy109UG5NrhXKJZW7xPYyi6s/NcS+c28e wF5uUTm66pHlS9qPU5Zc9CmQOdp2NFU54xBQ3+bQ/pEQ/X9nGenXgA3chU7UUn2A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheeggdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpedflfhirgig uhhnucgjrghnghdfuceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepgefgfeeujeffhedufeehleejleffjefhjedvtedtvdeftdeg ueevjeelleevgfefnecuffhomhgrihhnpehtqdgvshdqthdrhhhupdhgvghnvgigrdhssg enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgr gihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4EC2D130005D; Mon, 8 Feb 2021 21:36:33 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-93-gef6c4048e6-fm-20210128.002-gef6c4048 Mime-Version: 1.0 Message-Id: In-Reply-To: <76dbc72a-32fd-4de3-bc36-3eb0d0eebb44@www.fastmail.com> References: <1612790085-14436-1-git-send-email-yangtiezhu@loongson.cn> <76dbc72a-32fd-4de3-bc36-3eb0d0eebb44@www.fastmail.com> Date: Tue, 09 Feb 2021 10:36:11 +0800 From: "Jiaxun Yang" To: "Tiezhu Yang" , "Thomas Bogendoerfer" Cc: "linux-mips@vger.kernel.org" , linux-kernel@vger.kernel.org, "Xuefeng Li" Subject: =?UTF-8?Q?Re:_[PATCH]_MIPS:_Make_check_condition_for_SDBBP_consistent_wi?= =?UTF-8?Q?th_EJTAG_spec?= Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 9, 2021, at 12:32 AM, Jiaxun Yang wrote: > > > On Mon, Feb 8, 2021, at 9:14 PM, 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 > > --- > > arch/mips/kernel/genex.S | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S > > index bcce32a..6336826 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, 0x2 # Check for SDBBP. > > + beqz k0, ejtag_return > > You'd better define a marco for it to prevent further confusion. > > Btw I'm curious about how do kernel receive EJTAG exception? > In my understanding there are only two possible EJTAG exception vectors, > 0xbfc00480 and DSEG one. Both of them are reachable by kernel. ^ not > How do this piece of code work? > > Thanks. > > - Jiaxun > > > > > #ifdef CONFIG_SMP > > 1: PTR_LA k0, ejtag_debug_buffer_spinlock > > -- > > 2.1.0 > > > > > > -- > - Jiaxun > -- - Jiaxun