Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp222393pxb; Mon, 8 Feb 2021 21:13:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgHoE01UvP0O9C2uSuGxqmEio6kQkja7HBwdJMxvOmpwTtBamSYD1dUSjI6t9jULXgsiZu X-Received: by 2002:aa7:dcc6:: with SMTP id w6mr13341184edu.19.1612847606021; Mon, 08 Feb 2021 21:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612847606; cv=none; d=google.com; s=arc-20160816; b=SALvxI7fUhr9uAlrD1piW0+uon53AM0EWrxdfIXwiTlj35ylqWQZCcq5x2p+OH3Eu9 pauQevCI0SeHolwAM6fg52AT+T68j3EvMd5Pa7V6UCaED3Fi++lU3yorAm0tb6sUooCg xLl5kxqR2SzDi3XthDnm0+iUotvBY+gE5ynawIPkIijY9nXwv9osyZGtOWKlL/J7UosA zV8Jl8+7gJFd6ldYbmFPUSzpe273fbZtfB/3YR0WktwbsePkPkl/JoaM1IvHBbZzP7rU E3SPpYVM+f/ewbqR2qIn0yWt5pUiCh9vYJj1ZTRkXfXUe3UqkUFTNwT4X6cDQbfqgscL p4bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=7YP7O4wBchfMMiHTd65KniybT/pBUYFhkXYvoJd5ULY=; b=ZoxUa81nAQ8q/ZK08PA3pDCI2Ytgnm7rBzTuoSsH1W8JM1YIONYYXZCDjx3GZ9Lm+H bbMF7GzV8efNa5E9lIlCvZOHp1YOawWlODLyzEBscD5hXxwwU+AWmwL6BpI4yU4rOXF8 OPKxZTXJg/En4isz1SFihm1Hn5VxhUsq8uSfLVXQ5Ox+qnkdpJJtiABE1duB4Nf6D2pR SN8ReT1K0oT7xvrRIHLfvYoCPZk9YciXKrCGhQJPy3YeoqmydxLIF0RXuksDWu2Bau9D gW2+C+rN5DmabKjys/A1tV3FRNUhxS5ra8j4TOznPyA0IiKc+4/RrQ9Xu+VW7DX0XHBH oi/w== 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 z2si12881629eja.539.2021.02.08.21.13.01; Mon, 08 Feb 2021 21:13:26 -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 S230191AbhBIFL1 (ORCPT + 99 others); Tue, 9 Feb 2021 00:11:27 -0500 Received: from mail.loongson.cn ([114.242.206.163]:41832 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229975AbhBIFGp (ORCPT ); Tue, 9 Feb 2021 00:06:45 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx3_MVGCJghngIAA--.10677S2; Tue, 09 Feb 2021 13:05:26 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH v2] MIPS: Make check condition for SDBBP consistent with EJTAG spec Date: Tue, 9 Feb 2021 13:05:25 +0800 Message-Id: <1612847125-3141-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Dx3_MVGCJghngIAA--.10677S2 X-Coremail-Antispam: 1UD129KBjvJXoW7trWxJry7tr17XrWfJw47Arb_yoW8Xw4fpw 4DC3WkGrW8WryUZay5ArZ5ur45X3s8GrWY9ayDK3yFqa4jgFWrtF4fKrW3Kry8Wa1jka10 ga9IgrnrXr1IyrUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8 WwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr 0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1l IxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjNJ55UUUU U== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 #ifdef CONFIG_SMP 1: PTR_LA k0, ejtag_debug_buffer_spinlock -- 2.1.0