From: DDD <dongdong.deng@windriver.com>
To: Milton Miller <miltonm@bga.com>
Cc: kgdb-bugreport@lists.sourceforge.net,
Hai Shan <shan.hai@windriver.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Jason Wessel <jason.wessel@windriver.com>
Subject: Re: Corrected data type mismatch
Date: Tue, 16 Nov 2010 20:07:32 +0800 [thread overview]
Message-ID: <4CE27404.7020307@windriver.com> (raw)
In-Reply-To: <mdm-kgbd-badfix@mdm.bga.com>
Milton Miller wrote:
> [added cc's based on from ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d,
> which added the patched line ]
>
> https://patchwork.kernel.org/patch/323022/
>
> On Sun, 14 Nov 2010 around 02:06:59 -0000, Hai Shan wrote:
>> Corrected data type mismatch
>>
> This merely hides the type mismatch by force casting it.
>
> Looking at the context I believe the intent is to copy the the value to
> or from the register content slot, not take the previous value of the
> register and use that as an address to copy to or from.
OOPS! It is wrong here, The right one should be as following:
- memcpy(mem, current->thread.evr[regno-32],
+ memcpy(mem, (void*)¤t->thread.evr[regno-32],
dbg_reg_def[regno].size);
Thanks milton & Shan.Hai, I will send out the fix to Jason ASAP.
Dongdong
>
> milton
>> Signed-off-by: Hai Shan <shan.hai@windriver.com>
>>
>> ---
>> 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..c5ce65f 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, (void *)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((void *)current->thread.evr[regno-32], mem,
>> dbg_reg_def[regno].size);
>> #else
>> /* fp registers not used by kernel, leave zero */
>
WARNING: multiple messages have this Message-ID (diff)
From: DDD <dongdong.deng@windriver.com>
To: Milton Miller <miltonm@bga.com>
Cc: Hai Shan <shan.hai@windriver.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Jason Wessel <jason.wessel@windriver.com>,
kgdb-bugreport@lists.sourceforge.net
Subject: Re: Corrected data type mismatch
Date: Tue, 16 Nov 2010 20:07:32 +0800 [thread overview]
Message-ID: <4CE27404.7020307@windriver.com> (raw)
In-Reply-To: <mdm-kgbd-badfix@mdm.bga.com>
Milton Miller wrote:
> [added cc's based on from ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d,
> which added the patched line ]
>
> https://patchwork.kernel.org/patch/323022/
>
> On Sun, 14 Nov 2010 around 02:06:59 -0000, Hai Shan wrote:
>> Corrected data type mismatch
>>
> This merely hides the type mismatch by force casting it.
>
> Looking at the context I believe the intent is to copy the the value to
> or from the register content slot, not take the previous value of the
> register and use that as an address to copy to or from.
OOPS! It is wrong here, The right one should be as following:
- memcpy(mem, current->thread.evr[regno-32],
+ memcpy(mem, (void*)¤t->thread.evr[regno-32],
dbg_reg_def[regno].size);
Thanks milton & Shan.Hai, I will send out the fix to Jason ASAP.
Dongdong
>
> milton
>> Signed-off-by: Hai Shan <shan.hai@windriver.com>
>>
>> ---
>> 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..c5ce65f 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, (void *)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((void *)current->thread.evr[regno-32], mem,
>> dbg_reg_def[regno].size);
>> #else
>> /* fp registers not used by kernel, leave zero */
>
next prev parent reply other threads:[~2010-11-16 12:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-14 2:06 Corrected data type mismatch in kgdb Powerpc Hai Shan
2010-11-14 2:06 ` [PATCH] Corrected data type mismatch Hai Shan
2010-11-16 10:17 ` Milton Miller
2010-11-16 10:17 ` Milton Miller
2010-11-16 12:07 ` DDD [this message]
2010-11-16 12:07 ` DDD
2010-11-16 13:16 ` bhs
2010-11-16 13:16 ` bhs
2010-11-16 15:35 ` David Laight
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=4CE27404.7020307@windriver.com \
--to=dongdong.deng@windriver.com \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=miltonm@bga.com \
--cc=shan.hai@windriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.