On Thu, 21 Nov 2019 12:32:38 +0100 Janosch Frank wrote: > On 11/21/19 12:10 PM, Cornelia Huck wrote: > > On Wed, 20 Nov 2019 06:43:20 -0500 > > Janosch Frank wrote: > > > >> Let's move the resets into one function and switch by type, so we can > >> use fallthroughs for shared reset actions. > > > > Doing that makes sense. > > > >> > >> Signed-off-by: Janosch Frank > >> --- > >> hw/s390x/s390-virtio-ccw.c | 3 + > >> target/s390x/cpu.c | 111 ++++++++++++++++--------------------- > >> 2 files changed, 52 insertions(+), 62 deletions(-) > >> > >> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c > >> index d3edeef0ad..c1d1440272 100644 > >> --- a/hw/s390x/s390-virtio-ccw.c > >> +++ b/hw/s390x/s390-virtio-ccw.c > >> @@ -348,6 +348,9 @@ static void s390_machine_reset(MachineState *machine) > >> break; > >> case S390_RESET_LOAD_NORMAL: > >> CPU_FOREACH(t) { > >> + if (t == cs) { > >> + continue; > >> + } > > > > Hm, why is this needed now? > > The Ultravisor checks which reset is done to which cpu. > So blindly resetting the calling cpu with a normal reset to then do a > clear/initial reset will return an error. Let's split this change out, then? The rest of the patch is a simple refactoring.