From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Iyr-00077Z-Ln for qemu-devel@nongnu.org; Mon, 20 Jan 2014 12:49:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5Iye-0006Um-3r for qemu-devel@nongnu.org; Mon, 20 Jan 2014 12:49:49 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:45796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Iyd-0006UH-Sx for qemu-devel@nongnu.org; Mon, 20 Jan 2014 12:49:36 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Jan 2014 10:49:34 -0700 Message-ID: <52DD61AB.7030709@linux.vnet.ibm.com> Date: Mon, 20 Jan 2014 11:49:31 -0600 From: Thomas Falcon MIME-Version: 1.0 References: <52D99A69.1020809@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] target-ppc: gdbstub allow byte swapping for, reading/writing registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc , QEMU Developers On 01/20/2014 08:33 AM, Alexander Graf wrote: > On 17.01.2014, at 22:02, Thomas Falcon wrote: > >> This patch allows registers to be properly read from and written to >> when using the gdbstub to debug a ppc guest running in little >> endian mode. It accomplishes this goal by byte swapping the values of >> any registers if the MSR:LE value is set. >> >> Signed-off-by: Thomas Falcon >> --- >> Differences from v2: >> >> Fixed formatting issues >> Added logic to ensure only FP registers have a guaranteed size of 8 bytes > > I don't really like how the write case has to know about the size of a register (maybe we could factor this out into a single function for all reads and writes?), but this is good enough for now :). However, I can't apply the patch as your email client seems to have broken the patch formatting. > > > Alex > > I'm not sure of a way to swap the value without knowing its size. In both read and write, the size needs to be known and is hardcoded in some cases. The write case cannot know the size without a conditional since we need to swap in mem_buf before we call ppc_cpu_gdb_write_register. Maybe we could get around this by hanging ppc_cpu_gdb_write_register so that it returns a pointer to the register being overwritten, and then we could swap that instead of mem_buf? But even then I guess we would still need to check the size of the register before we called bswap32/64. Anyway, sorry about the formatting issues again. Should I just resubmit the patch as is? Thanks, Tom