From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6789CA9EC0 for ; Mon, 28 Oct 2019 10:59:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7C60821744 for ; Mon, 28 Oct 2019 10:59:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Yx4nNJIJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZOynHkfm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C60821744 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XFe0ubV4LWiYTSD5bVJqnKowS9gvYP9tajerKCW1vzw=; b=Yx4nNJIJe6CD6C 6n0o9/WPcs1XMj0zJ6Cpvnov9OpDFfxBtv+RPw2YTsJibilcAnQeLVC73ebHVZnZoAEI5/gByACrD /CziyxSfT1H8dc+GHRFOiGOED8frUDimHdPIuDynFL/dG7ARdZWyqejpUdt5voT66W8fl0CQgh6SM tLObLhzPBBRFqnFfCwO9kwXbIe1WZ/yVENdoPAbLhzO4NfcabTbi1YrIo5Fq3Jx+e0WX2LXHNXzqu XN0dC4+V06qw824J6aqESSxbmWxIQqxO+SZx0qjsHZnOzZwEF6yr5YPGatHwepfdUH7JzKGxevelR AXRpW8oLd29Cg4BSUNng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iP2kb-0001us-4W; Mon, 28 Oct 2019 10:59:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iP2kX-0001uP-TL for linux-arm-kernel@lists.infradead.org; Mon, 28 Oct 2019 10:59:51 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE75C20873; Mon, 28 Oct 2019 10:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572260389; bh=vnID9+Oo8Ba/7JkP4NlkjT8aLuIOGGl8S6SiOMEIGLM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZOynHkfmFX06vNr8sfpvCZQtP+oE9c+n01F6NmlPDm8xnwdvq8mtNOSlkhGKdWkJV 5SNqE4Kw+KgkfR4LHBMn9kxVbXVJ0JAgzHWvt6ug5g6HreFNmQX5REz2u8FRKNnYtL l8HASqabKNYlo51wBS0ALEHgahupJhoOVPcDmWvw= Date: Mon, 28 Oct 2019 10:59:44 +0000 From: Will Deacon To: Candle Sun Subject: Re: [PATCH v2] ARM/hw_breakpoint: add more ARMv8 debug architecture versions support Message-ID: <20191028105943.GA4122@willie-the-truck> References: <20191024080539.9187-1-candlesea@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191024080539.9187-1-candlesea@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191028_035949_973104_0956D66D X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, linux@armlinux.org.uk, Candle Sun , linux-kernel@vger.kernel.org, orson.zhai@unisoc.com, Nianfu Bai , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 24, 2019 at 04:05:39PM +0800, Candle Sun wrote: > From: Candle Sun > > When ARMv8 cores are used in AArch32 mode, arch_hw_breakpoint_init() > in arch/arm/kernel/hw_breakpoint.c will be used. > > From ARMv8 specification, v8 debug architecture versions defined: > * 0110 ARMv8, v8 Debug architecture. > * 0111 ARMv8.1, v8 Debug architecture, with Virtualization Host > Extensions. > * 1000 ARMv8.2, v8.2 Debug architecture. > * 1001 ARMv8.4, v8.4 Debug architecture. > > So missing ARMv8.1/ARMv8.2/ARMv8.4 cases will cause > enable_monitor_mode() returns -ENODEV,and eventually > arch_hw_breakpoint_init() will fail. > > Signed-off-by: Candle Sun > Signed-off-by: Nianfu Bai > --- > Changes in v2: > - Add ARMv8.4 debug architecture case > - Update patch description > --- > arch/arm/include/asm/hw_breakpoint.h | 3 +++ > arch/arm/kernel/hw_breakpoint.c | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h > index ac54c06764e6..62358d3ca0a8 100644 > --- a/arch/arm/include/asm/hw_breakpoint.h > +++ b/arch/arm/include/asm/hw_breakpoint.h > @@ -53,6 +53,9 @@ static inline void decode_ctrl_reg(u32 reg, > #define ARM_DEBUG_ARCH_V7_MM 4 > #define ARM_DEBUG_ARCH_V7_1 5 > #define ARM_DEBUG_ARCH_V8 6 > +#define ARM_DEBUG_ARCH_V8_1 7 > +#define ARM_DEBUG_ARCH_V8_2 8 > +#define ARM_DEBUG_ARCH_V8_4 9 > > /* Breakpoint */ > #define ARM_BREAKPOINT_EXECUTE 0 > diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c > index b0c195e3a06d..02ca7adf5375 100644 > --- a/arch/arm/kernel/hw_breakpoint.c > +++ b/arch/arm/kernel/hw_breakpoint.c > @@ -246,6 +246,9 @@ static int enable_monitor_mode(void) > case ARM_DEBUG_ARCH_V7_ECP14: > case ARM_DEBUG_ARCH_V7_1: > case ARM_DEBUG_ARCH_V8: > + case ARM_DEBUG_ARCH_V8_1: > + case ARM_DEBUG_ARCH_V8_2: > + case ARM_DEBUG_ARCH_V8_4: > ARM_DBG_WRITE(c0, c2, 2, (dscr | ARM_DSCR_MDBGEN)); > isb(); > break; Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel