linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: "Deng, Dongdong" <dongdong.deng@windriver.com>,
	Sergei Shtylyov <sshtylyov@mvista.com>,
	kgdb-bugreport@lists.sourceforge.net, miltonm@bga.com, "Hai,
	Shan" <shan.hai@windriver.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] kgdb, ppc: Corrected the address using of current->thread.evr register
Date: Wed, 17 Nov 2010 11:21:04 -0600	[thread overview]
Message-ID: <4CE40F00.7010407@windriver.com> (raw)
In-Reply-To: <983540C0-C0E6-44DB-9264-4A5B1E058043@kernel.crashing.org>

On 11/17/2010 11:16 AM, Kumar Gala wrote:

>> Thanks,
>> Jason.
> 
> Repost a version with the casts and I'll pick it up.
> 
> - k

I have the final version ready for a pull request that I was going to
make in the next hour or two that is fully regression tested.

If you would prefer to these changes in the PPC, let me know, or if
you want to ack the patch, I'll add that before submitting the pull
request.

Thanks,
Jason.

--
>From b47efa1d4fa4631ee0cc59f4fcd143464b910cdc Mon Sep 17 00:00:00 2001
From: Dongdong Deng <dongdong.deng@windriver.com>
Date: Tue, 16 Nov 2010 16:02:00 -0600
Subject: [PATCH 4/4] kgdb: Fix regression in evr register handling

Commit ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d (kgdb,ppc: Individual
register get/set for ppc) introduced a problem where memcpy was used
incorrectly to read and write the evr registers with a kernel that
has:

CONFIG_FSL_BOOKE=y
CONFIG_SPE=y
CONFIG_KGDB=y

This patch also fixes the following compilation problems:

arch/powerpc/kernel/kgdb.c: In function 'dbg_get_reg':
arch/powerpc/kernel/kgdb.c:341: error: passing argument 2 of 'memcpy' makes pointer from integer without a cast
arch/powerpc/kernel/kgdb.c: In function 'dbg_set_reg':
arch/powerpc/kernel/kgdb.c:366: error: passing argument 1 of 'memcpy' makes pointer from integer without a cast

[jason.wessel@windriver.com: Remove void * casts and fix patch header]
Reported-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/kernel/kgdb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index 7a9db64..42850ee 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
 		/* FP registers 32 -> 63 */
 #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
 		if (current)
-			memcpy(mem, current->thread.evr[regno-32],
+			memcpy(mem, &current->thread.evr[regno-32],
 					dbg_reg_def[regno].size);
 #else
 		/* fp registers not used by kernel, leave zero */
@@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
 	if (regno >= 32 && regno < 64) {
 		/* FP registers 32 -> 63 */
 #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
-		memcpy(current->thread.evr[regno-32], mem,
+		memcpy(&current->thread.evr[regno-32], mem,
 				dbg_reg_def[regno].size);
 #else
 		/* fp registers not used by kernel, leave zero */
-- 
1.7.0.4

  reply	other threads:[~2010-11-17 17:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 12:58 [PATCH] kgdb, ppc: Corrected the address using of current->thread.evr register Dongdong Deng
2010-11-16 13:02 ` [Kgdb-bugreport] " Sergei Shtylyov
2010-11-16 22:02 ` Jason Wessel
2010-11-17 17:16   ` Kumar Gala
2010-11-17 17:21     ` Jason Wessel [this message]
2010-11-17 17:52       ` Kumar Gala
2010-11-17 18:58       ` Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE40F00.7010407@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=dongdong.deng@windriver.com \
    --cc=galak@kernel.crashing.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=shan.hai@windriver.com \
    --cc=sshtylyov@mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).