On 06/12/2014 09:02 PM, Cornelia Huck wrote: > On Thu, 12 Jun 2014 19:38:40 +1000 > Alexey Kardashevskiy <a...@ozlabs.ru> wrote: > >> On 06/12/2014 04:31 PM, Cornelia Huck wrote: >>> On Thu, 12 Jun 2014 03:03:01 +1000 >>> Alexey Kardashevskiy <a...@ozlabs.ru> wrote: >>> >>>> This implements an NMI interface for s390 machine. >>>> >>>> This removes #ifdef s390 branch in qmp_inject_nmi so new s390's >>>> nmi_monitor_handler() callback is going to be used for NMI. >>>> >>>> Since nmi_monitor_handler()-calling code is platform independent, >>>> CPUState::cpu_index is used instead of S390CPU::env.cpu_num. >>>> There should not be any change in behaviour as both @cpu_index and >>>> @cpu_num are global CPU numbers. >>>> >>>> Also, s390_cpu_restart() takes care of preforming operations in >>>> the specific CPU thread so no extra measure is required here either. >>>> >>>> Since the only error s390_cpu_restart() can return is ENOSYS, convert >>>> it to QERR_UNSUPPORTED. >>>> >>>> Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> >>>> --- >>>> Changes: >>>> v6: >>>> * supported NMI interface >>>> >>>> v5: >>>> * added ENOSYS -> QERR_UNSUPPORTED, qapi/qmp/qerror.h was added for this >>>> >>>> v4: >>>> * s/\<nmi\>/nmi_monitor_handler/ >>>> >>>> v3: >>>> * now contains both old code removal and new code insertion, easier to >>>> track changes >>>> >>>> --- >>>> Is there any good reason to have @cpu_num in addition to @cpu_index? >>>> Just asking :) >>>> --- >>>> cpus.c | 14 -------------- >>>> hw/s390x/s390-virtio.c | 31 +++++++++++++++++++++++++++++++ >>>> target-s390x/cpu.c | 1 + >>>> 3 files changed, 32 insertions(+), 14 deletions(-) >>>> > >> I pushed some version to g...@github.com:aik/qemu.git , branch nmi-v7 >> Please have a look and give it a go - I do not have s390 kernel/images >> handy. Thanks! > > Gave it a try with both of the machines: Triggering 'nmi' from the > monitor still triggers the configured on_restart action, so this seems > to work as well as before. > >> >> It does not look like we really need a new file for NMI now. > > Yes, I think the v7 code looks fine.
Cool, thanks! I'll wait for a bit till everybody speaks and repost :-) -- Alexey