From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Harsh Prateek Bora" <harshpb@linux.ibm.com>, <qemu-ppc@nongnu.org>
Cc: <qemu-devel@nongnu.org>, <farosas@suse.de>, <danielhb413@gmail.com>
Subject: Re: [PATCH v2 1/4] ppc: spapr: cleanup cr get/store in [h_enter|spapr_exit]_nested with helpers.
Date: Wed, 03 May 2023 00:39:57 +1000 [thread overview]
Message-ID: <CSBVBHXUFNTB.V3R66Q201OGP@wheely> (raw)
In-Reply-To: <f4810103-78ce-eb5b-4d43-b9268b9aa745@linux.ibm.com>
On Tue May 2, 2023 at 3:00 PM AEST, Harsh Prateek Bora wrote:
>
>
> On 5/2/23 10:07, Nicholas Piggin wrote:
> > On Tue Apr 25, 2023 at 12:47 AM AEST, Harsh Prateek Bora wrote:
> >> The bits in cr reg are grouped into eight 4-bit fields represented
> >> by env->crf[8] and the related calculations should be abstracted to
> >> keep the calling routines simpler to read. This is a step towards
> >> cleaning up the [h_enter|spapr_exit]_nested calls for better readability.
> >>
> >> Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
> >> Reviewed-by: Fabiano Rosas <farosas@suse.de>
> >> ---
> >> hw/ppc/spapr_hcall.c | 18 ++----------------
> >
> > Could you either convert all callers, or do implementation and
> > conversion as separate patches. Preference for former if you can
> > be bothered.
> >
> > save_user_regs(), restore_user_regs(), gdb read/write register * 2,
> > kvm_arch_get/put_registers, monitor_get_ccr, at a quick glance.
>
> Sure, I can include other consumers as well in the patches.
> I usually prefer separate patches for implementation/conversion but
> since the implementation is a small change, I hope either approach is fine.
Yeah one patch would be fine.
>
> >
> >> target/ppc/cpu.c | 17 +++++++++++++++++
> >> target/ppc/cpu.h | 2 ++
> >> 3 files changed, 21 insertions(+), 16 deletions(-)
> >>
> >> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> >> index ec4def62f8..124cee5e53 100644
> >> --- a/hw/ppc/spapr_hcall.c
> >> +++ b/hw/ppc/spapr_hcall.c
> >
> > [snip]
> >
> >> diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c
> >> index 1a97b41c6b..3b444e58b5 100644
> >> --- a/target/ppc/cpu.c
> >> +++ b/target/ppc/cpu.c
> >> @@ -67,6 +67,23 @@ uint32_t ppc_get_vscr(CPUPPCState *env)
> >> return env->vscr | (sat << VSCR_SAT);
> >> }
> >>
> >> +void ppc_store_cr(CPUPPCState *env, uint64_t cr)
> >
> > Set is normal counterpart to get. Or load and store, but
> > I think set and get is probably better.
> >
> Sure, make sense.
I did say that before realising the other functions there use as
much varied and inconsistent terminology as possible, sigh.
I *think* ppc_get|set_reg() is the best naming. store is used a lot but
it means something else too, so set is better. But if you have strong
feelings another way I don't mind.
Thanks,
Nick
next prev parent reply other threads:[~2023-05-02 14:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 14:47 [PATCH v2 0/4] Cleanup [h_enter|spapr_exit]_nested routines Harsh Prateek Bora
2023-04-24 14:47 ` [PATCH v2 1/4] ppc: spapr: cleanup cr get/store in [h_enter|spapr_exit]_nested with helpers Harsh Prateek Bora
2023-05-02 4:37 ` Nicholas Piggin
2023-05-02 5:00 ` Harsh Prateek Bora
2023-05-02 14:39 ` Nicholas Piggin [this message]
2023-05-02 14:46 ` Fabiano Rosas
2023-04-24 14:47 ` [PATCH v2 2/4] ppc: spapr: cleanup h_enter_nested() with helper routines Harsh Prateek Bora
2023-05-02 4:49 ` Nicholas Piggin
2023-05-02 6:13 ` Harsh Prateek Bora
2023-05-02 6:41 ` Nicholas Piggin
2023-05-02 7:36 ` Harsh Prateek Bora
2023-05-02 8:39 ` Nicholas Piggin
2023-05-02 10:20 ` Harsh Prateek Bora
2023-04-24 14:47 ` [PATCH v2 3/4] ppc: spapr: cleanup spapr_exit_nested() " Harsh Prateek Bora
2023-05-02 5:06 ` Nicholas Piggin
2023-05-02 6:25 ` Harsh Prateek Bora
2023-04-24 14:47 ` [PATCH v2 4/4] MAINTAINERS: Adding myself in the list for ppc/spapr Harsh Prateek Bora
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=CSBVBHXUFNTB.V3R66Q201OGP@wheely \
--to=npiggin@gmail.com \
--cc=danielhb413@gmail.com \
--cc=farosas@suse.de \
--cc=harshpb@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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.