qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "BALATON Zoltan" <balaton@eik.bme.hu>, <qemu-devel@nongnu.org>,
	<qemu-ppc@nongnu.org>
Cc: <clg@kaod.org>, "Greg Kurz" <groug@kaod.org>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>
Subject: Re: [PATCH v2 10/10] target/ppc: Get CPUState in one step
Date: Thu, 15 Jun 2023 13:35:25 +1000	[thread overview]
Message-ID: <CTCWQNY1WICB.22H2C7EM4JJKT@wheely> (raw)
In-Reply-To: <f2a22b2c5483a31fa2c6cdd84fe659bfc5d499cd.1686776990.git.balaton@eik.bme.hu>

On Thu Jun 15, 2023 at 7:34 AM AEST, BALATON Zoltan wrote:
> We can get CPUState from env with env_cpu without going through
> PowerPCCPU and casting that.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

Acked-by: Nicholas Piggin <npiggin@gmail.com>

> ---
>  target/ppc/excp_helper.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index 662457f342..5edf06210f 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1506,8 +1506,8 @@ static int p7_interrupt_powersave(CPUPPCState *env)
>  
>  static int p7_next_unmasked_interrupt(CPUPPCState *env)
>  {
> -    PowerPCCPU *cpu = env_archcpu(env);
> -    CPUState *cs = CPU(cpu);
> +    CPUState *cs = env_cpu(env);
> +
>      /* Ignore MSR[EE] when coming out of some power management states */
>      bool msr_ee = FIELD_EX64(env->msr, MSR, EE) || env->resume_as_sreset;
>  
> @@ -1596,8 +1596,8 @@ static int p8_interrupt_powersave(CPUPPCState *env)
>  
>  static int p8_next_unmasked_interrupt(CPUPPCState *env)
>  {
> -    PowerPCCPU *cpu = env_archcpu(env);
> -    CPUState *cs = CPU(cpu);
> +    CPUState *cs = env_cpu(env);
> +
>      /* Ignore MSR[EE] when coming out of some power management states */
>      bool msr_ee = FIELD_EX64(env->msr, MSR, EE) || env->resume_as_sreset;
>  
> @@ -1717,8 +1717,8 @@ static int p9_interrupt_powersave(CPUPPCState *env)
>  
>  static int p9_next_unmasked_interrupt(CPUPPCState *env)
>  {
> -    PowerPCCPU *cpu = env_archcpu(env);
> -    CPUState *cs = CPU(cpu);
> +    CPUState *cs = env_cpu(env);
> +
>      /* Ignore MSR[EE] when coming out of some power management states */
>      bool msr_ee = FIELD_EX64(env->msr, MSR, EE) || env->resume_as_sreset;
>  
> @@ -2412,9 +2412,8 @@ void helper_scv(CPUPPCState *env, uint32_t lev)
>  
>  void helper_pminsn(CPUPPCState *env, uint32_t insn)
>  {
> -    CPUState *cs;
> +    CPUState *cs = env_cpu(env);
>  
> -    cs = env_cpu(env);
>      cs->halted = 1;
>  
>      /* Condition for waking up at 0x100 */
> -- 
> 2.30.9



      reply	other threads:[~2023-06-15  3:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 21:34 [PATCH v2 00/10] Misc clean ups to target/ppc exception handling BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 01/10] target/ppc: Remove some superfluous parentheses BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 02/10] target/ppc: Remove unneeded parameter from powerpc_reset_wakeup() BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 03/10] target/ppc: Move common check in exception handlers to a function BALATON Zoltan
2023-06-15  3:28   ` Nicholas Piggin
2023-06-14 21:34 ` [PATCH v2 04/10] target/ppc: Use env_cpu for cpu_abort in excp_helper BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 05/10] target/ppc: Change parameter of cpu_interrupt_exittb() to an env pointer BALATON Zoltan
2023-06-15  3:32   ` Nicholas Piggin
2023-06-15  9:19     ` BALATON Zoltan
2023-06-15 11:40       ` Nicholas Piggin
2023-06-15 23:00         ` BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 06/10] target/ppc: Readability improvements in exception handlers BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 07/10] target/ppd: Remove unused define BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 08/10] target/ppc: Fix gen_sc to use correct nip BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 09/10] target/ppc: Simplify syscall exception handlers BALATON Zoltan
2023-06-15  3:34   ` Nicholas Piggin
2023-06-15  9:25     ` BALATON Zoltan
2023-06-15 11:46       ` Nicholas Piggin
2023-06-15 23:02         ` BALATON Zoltan
2023-06-14 21:34 ` [PATCH v2 10/10] target/ppc: Get CPUState in one step BALATON Zoltan
2023-06-15  3:35   ` Nicholas Piggin [this message]

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=CTCWQNY1WICB.22H2C7EM4JJKT@wheely \
    --to=npiggin@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=groug@kaod.org \
    --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 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).