From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752002AbcEJKpY (ORCPT ); Tue, 10 May 2016 06:45:24 -0400 Received: from foss.arm.com ([217.140.101.70]:43849 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbcEJKpW (ORCPT ); Tue, 10 May 2016 06:45:22 -0400 Date: Tue, 10 May 2016 11:45:11 +0100 From: Mark Rutland To: Daniel Thompson Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Jason Wessel , Dave P Martin , Vijaya Kumar K Subject: Re: [PATCH] arm64: kgdb: Match pstate size with gdbserver protocol Message-ID: <20160510104511.GH687@leverpostej> References: <1462815566-15086-1-git-send-email-daniel.thompson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462815566-15086-1-git-send-email-daniel.thompson@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 09, 2016 at 06:39:26PM +0100, Daniel Thompson wrote: > Current versions of gdb do not interoperate cleanly with kgdb on arm64 > systems because gdb and kgdb do not use the same register description. > This patch modifies kgdb to work with recent releases of gdb (>= 7.8.1). > > Compatibility with gdb (after the patch is applied) is as follows: > > gdb-7.6 and earlier Ok > gdb-7.7 series Works if user provides custom target description > gdb-7.8(.0) Works if user provides custom target description > gdb-7.8.1 and later Ok > > When commit 44679a4f142b ("arm64: KGDB: Add step debugging support") was > introduced it was paired with a gdb patch that made an incompatible > change to the gdbserver protocol. This patch was eventually merged into > the gdb sources: > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=a4d9ba85ec5597a6a556afe26b712e878374b9dd > > The change to the protocol was mostly made to simplify big-endian support > inside the kernel gdb stub. While that was how we discovered the inconsistency, a major concern is that SPSR_EL* (i.e. PSTATE), as accessed by MRS/MSR is a 64-bit quantity, even if the upper 32 bits are RES0 today. It is conceivable that the upper 32 bits could be used in future (as happened with CLIDR_EL1), and for this reason we expose those upper 32 bits from the kernel, and treat system registers as 64-bit quantities generally. So this was also about ensuring the interface was consistent and to some extent future-proof. Thanks, Mark.