All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Janosch Frank <frankja@linux.ibm.com>
Cc: thuth@redhat.com, pmorel@linux.ibm.com, david@redhat.com,
	qemu-devel@nongnu.org, borntraeger@de.ibm.com,
	qemu-s390x@nongnu.org, mihajlov@linux.ibm.com
Subject: Re: [PATCH v3 2/5] s390x: Move reset normal to shared reset handler
Date: Mon, 25 Nov 2019 14:19:26 +0100	[thread overview]
Message-ID: <20191125141926.427c30e6.cohuck@redhat.com> (raw)
In-Reply-To: <20191125090348.27010-3-frankja@linux.ibm.com>

On Mon, 25 Nov 2019 04:03:45 -0500
Janosch Frank <frankja@linux.ibm.com> wrote:

> Let's start moving the cpu reset functions into a single function with
> a switch/case, so we can use fallthroughs and share more code between
> resets.
> 
> This patch introduces the reset function by renaming cpu_reset() and
> cleaning up leftovers.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/cpu-qom.h |  6 +++++-
>  target/s390x/cpu.c     | 16 ++++++++++------
>  target/s390x/cpu.h     |  2 +-
>  target/s390x/sigp.c    |  2 +-
>  4 files changed, 17 insertions(+), 9 deletions(-)
> 

> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index 3abe7e80fd..8d35a2a723 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -82,18 +82,22 @@ static void s390_cpu_load_normal(CPUState *s)
>  }
>  #endif
>  
> -/* S390CPUClass::cpu_reset() */
> -static void s390_cpu_reset(CPUState *s)
> +/* S390CPUClass::reset() */
> +static void s390_cpu_reset(CPUState *s, cpu_reset_type type)
>  {
>      S390CPU *cpu = S390_CPU(s);
>      S390CPUClass *scc = S390_CPU_GET_CLASS(cpu);
>      CPUS390XState *env = &cpu->env;
>  
> -    env->pfault_token = -1UL;
> -    env->bpbc = false;
>      scc->parent_reset(s);
>      cpu->env.sigp_order = 0;
>      s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
> +
> +    switch (type) {
> +    case S390_CPU_RESET_NORMAL:
> +        env->pfault_token = -1UL;
> +        env->bpbc = false;

I'm wondering whether we want a default case here to catch programming
errors.

> +    }
>  }
>  
>  /* S390CPUClass::initial_reset() */



  reply	other threads:[~2019-11-25 13:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25  9:03 [PATCH v3 0/5] s390x: Reset cleanup Janosch Frank
2019-11-25  9:03 ` [PATCH v3 1/5] s390x: Don't do a normal reset on the initial cpu Janosch Frank
2019-11-25 13:11   ` Cornelia Huck
2019-11-25  9:03 ` [PATCH v3 2/5] s390x: Move reset normal to shared reset handler Janosch Frank
2019-11-25 13:19   ` Cornelia Huck [this message]
2019-11-27 17:45     ` David Hildenbrand
2019-11-25  9:03 ` [PATCH v3 3/5] s390x: Move initial reset Janosch Frank
2019-11-25  9:03 ` [PATCH v3 4/5] s390x: Move clear reset Janosch Frank
2019-11-25 13:37   ` Cornelia Huck
2019-11-25 13:49     ` Janosch Frank
2019-11-25 15:42       ` Cornelia Huck
2019-11-25  9:03 ` [PATCH v3 5/5] s390x: Beautify diag308 handling Janosch Frank

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=20191125141926.427c30e6.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=mihajlov@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.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.