qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>, Janosch Frank <frankja@linux.ibm.com>
Cc: thuth@redhat.com, pmorel@linux.ibm.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: Wed, 27 Nov 2019 18:45:49 +0100	[thread overview]
Message-ID: <e47ebb75-9c5b-98f9-bc83-640829e02bb1@redhat.com> (raw)
In-Reply-To: <20191125141926.427c30e6.cohuck@redhat.com>

On 25.11.19 14:19, Cornelia Huck wrote:
> 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.

+1, g_assert_not_reached().


-- 
Thanks,

David / dhildenb



  reply	other threads:[~2019-11-27 17:47 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
2019-11-27 17:45     ` David Hildenbrand [this message]
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=e47ebb75-9c5b-98f9-bc83-640829e02bb1@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@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 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).