From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] PPC: Add wrapper for target long DCR operations
Date: Sat, 6 Feb 2010 17:15:26 +0100 [thread overview]
Message-ID: <20100206161526.GD11050@volta.aurel32.net> (raw)
In-Reply-To: <E0AA6D03-6738-40E0-8E02-BC21B060BF15@suse.de>
On Thu, Jan 14, 2010 at 06:04:25PM +0100, Alexander Graf wrote:
>
> On 14.01.2010, at 18:02, Aurelien Jarno wrote:
>
> > On Thu, Jan 14, 2010 at 04:19:31PM +0100, Alexander Graf wrote:
> >>
> >> On 14.01.2010, at 16:13, Aurelien Jarno wrote:
> >>
> >>> On Fri, Jan 01, 2010 at 04:41:06PM +0100, Alexander Graf wrote:
> >>>> The recent transition to always have the DCR helper functions take 32 bit
> >>>> values broke the PPC64 target, as tlong became 64 bits there.
> >>>>
> >>>> This patch moves all translate.c callers to a _tl function that simply
> >>>> calls the uint32_t functions. That way we don't need to mess with TCG
> >>>> trying to pass registers as uint32_t variables to functions.
> >>>>
> >>>> Fixes PPC64 build with --enable-debug-tcg
> >>>>
> >>>> Signed-off-by: Alexander Graf <agraf@suse.de>
> >>>> Reported-by: Stefan Weil <weil@mail.berlios.de>
> >>>> ---
> >>>> target-ppc/cpu.h | 2 ++
> >>>> target-ppc/helper.h | 4 ++--
> >>>> target-ppc/op_helper.c | 10 ++++++++++
> >>>> target-ppc/translate.c | 12 ++++++------
> >>>> 4 files changed, 20 insertions(+), 8 deletions(-)
> >>>>
> >>>> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
> >>>> index d15bba1..60a8b68 100644
> >>>> --- a/target-ppc/cpu.h
> >>>> +++ b/target-ppc/cpu.h
> >>>> @@ -733,6 +733,8 @@ void ppc_store_slb (CPUPPCState *env, target_ulong rb, target_ulong rs);
> >>>> void ppc_store_sr (CPUPPCState *env, int srnum, target_ulong value);
> >>>> #endif /* !defined(CONFIG_USER_ONLY) */
> >>>> void ppc_store_msr (CPUPPCState *env, target_ulong value);
> >>>> +void helper_store_dcr (uint32_t dcrn, uint32_t val);
> >>>> +uint32_t helper_load_dcr (uint32_t dcrn);
> >>>>
> >>>> void ppc_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
> >>>>
> >>>> diff --git a/target-ppc/helper.h b/target-ppc/helper.h
> >>>> index 40d4ced..86f0af7 100644
> >>>> --- a/target-ppc/helper.h
> >>>> +++ b/target-ppc/helper.h
> >>>> @@ -359,8 +359,8 @@ DEF_HELPER_2(divo, tl, tl, tl)
> >>>> DEF_HELPER_2(divs, tl, tl, tl)
> >>>> DEF_HELPER_2(divso, tl, tl, tl)
> >>>>
> >>>> -DEF_HELPER_1(load_dcr, i32, i32);
> >>>> -DEF_HELPER_2(store_dcr, void, i32, i32)
> >>>> +DEF_HELPER_1(load_dcr_tl, tl, tl);
> >>>> +DEF_HELPER_2(store_dcr_tl, void, tl, tl)
> >>>>
> >>>> DEF_HELPER_1(load_dump_spr, void, i32)
> >>>> DEF_HELPER_1(store_dump_spr, void, i32)
> >>>> diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
> >>>> index cea27f2..6c375d3 100644
> >>>> --- a/target-ppc/op_helper.c
> >>>> +++ b/target-ppc/op_helper.c
> >>>> @@ -1844,6 +1844,11 @@ uint32_t helper_load_dcr (uint32_t dcrn)
> >>>> return val;
> >>>> }
> >>>>
> >>>> +target_ulong helper_load_dcr_tl (target_ulong dcrn)
> >>>> +{
> >>>> + return (uint32_t)helper_load_dcr((uint32_t)dcrn);
> >>>> +}
> >>>> +
> >>>> void helper_store_dcr (uint32_t dcrn, uint32_t val)
> >>>> {
> >>>> if (unlikely(env->dcr_env == NULL)) {
> >>>> @@ -1857,6 +1862,11 @@ void helper_store_dcr (uint32_t dcrn, uint32_t val)
> >>>> }
> >>>> }
> >>>>
> >>>> +void helper_store_dcr_tl (target_ulong dcrn, target_ulong val)
> >>>> +{
> >>>> + helper_store_dcr((uint32_t)dcrn, (uint32_t)val);
> >>>> +}
> >>>> +
> >>>
> >>> I do wonder why we need to keep the old helper_load_dcr() and
> >>> helper_store_dcr() instead of modifying them directly. They doesn't seems
> >>> to be used elsewhere.
> >>
> >> Last time I checked they were used in hw/*ppc*.c. Maybe mangled through funny preprocessor or function callback logic. But maybe I'm wrong :).
> >>
> >
> > I am not able to find them. I have tried to remove helper_load_dcr() and
> > helper_store_dcr() from target-ppc/cpu.h and the code still compiles.
>
> Hm, right. The only references are to ppc_dcr_read and ppc_dcr_write. I guess the other helpers are superfluous then.
>
I have applied a patch to fix the problem.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2010-02-06 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-01 15:41 [Qemu-devel] [PATCH] PPC: Add wrapper for target long DCR operations Alexander Graf
2010-01-03 10:25 ` Stefan Weil
2010-01-14 15:13 ` Aurelien Jarno
2010-01-14 15:19 ` Alexander Graf
2010-01-14 17:02 ` Aurelien Jarno
2010-01-14 17:04 ` Alexander Graf
2010-02-06 16:15 ` Aurelien Jarno [this message]
2010-02-06 17:16 ` Alexander Graf
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=20100206161526.GD11050@volta.aurel32.net \
--to=aurelien@aurel32.net \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
/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).