From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122494 invoked by alias); 7 Jun 2019 15:48:42 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 122465 invoked by uid 89); 7 Jun 2019 15:48:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Jun 2019 15:48:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9296680D; Fri, 7 Jun 2019 08:48:35 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 72FFC3F718; Fri, 7 Jun 2019 08:48:34 -0700 (PDT) Date: Fri, 07 Jun 2019 15:48:00 -0000 From: Dave Martin To: Will Deacon Cc: Peter Maydell , gdb@sourceware.org, Zhang Lei , Julien Grall , Catalin Marinas , Alex =?iso-8859-1?Q?Benn=E9e?= , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 0/2] arm64/sve: Fix mutating register endianness on big-endian Message-ID: <20190607154832.GH28398@e103592.cambridge.arm.com> References: <1559839495-22315-1-git-send-email-Dave.Martin@arm.com> <20190607093858.GA21378@fuggles.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190607093858.GA21378@fuggles.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2019-06/txt/msg00010.txt.bz2 On Fri, Jun 07, 2019 at 10:38:58AM +0100, Will Deacon wrote: > On Thu, Jun 06, 2019 at 05:44:53PM +0100, Dave Martin wrote: > > By inspection while debugging something else, I noticed that the byte > > order of FPSIMD V-register stores and SVE Z-register stores is not the > > same when running on big-endian. > > > > This is not properly taken into account when moving between the FPSIMD > > and SVE register views inside the kernel, resulting in the bytes of a > > V-register getting spontaneously reversed in some situations, from > > userspace's point of view. The signal frame and ptrace interface are > > also affected. The KVM ABI forbids mixing the two views and so should > > not be affected. > > > > See patch 2 for details. > > > > Patch 1 does some trivial preparatory refactoring. > > Sorry to be a pain, but would you be able to flip this series round so that > the fix doesn't depend on the refactoring, please? That way we can put it > into stable without the dependency. > > > gdb may or may not be affected by this, depending on how it uses the > > NT_PRFPREG and NT_ARM_SVE regsets. I'll leave it to the developers to > > assess that. > > Wouldn't this be easy enough to test? So, gdb works OK on big-endian but weird stuff happening on both with and without the fix. There are places in the gdb code itself where it is likely missing endianness conversions, but I need to follow up with the gdb folks to clarify whether my patch is missing something... Cheers ---Dave