From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv4CR-00023D-TK for qemu-devel@nongnu.org; Thu, 12 Jun 2014 08:33:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv4CH-0002IG-Ft for qemu-devel@nongnu.org; Thu, 12 Jun 2014 08:33:47 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:58221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv4CH-0002I4-Ae for qemu-devel@nongnu.org; Thu, 12 Jun 2014 08:33:37 -0400 Received: by mail-pa0-f47.google.com with SMTP id fa1so966022pad.34 for ; Thu, 12 Jun 2014 05:33:36 -0700 (PDT) Message-ID: <53999E11.50701@ozlabs.ru> Date: Thu, 12 Jun 2014 22:33:21 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1402506183-29736-1-git-send-email-aik@ozlabs.ru> <1402506183-29736-3-git-send-email-aik@ozlabs.ru> <20140612083113.1e4cd667.cornelia.huck@de.ibm.com> <53997520.8020509@ozlabs.ru> <20140612130227.2819fbd2.cornelia.huck@de.ibm.com> In-Reply-To: <20140612130227.2819fbd2.cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 2/4] target-s390x: Migrate to new NMI interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: Alexander Graf , Stefan Hajnoczi , Peter Maydell , Markus Armbruster , qemu-devel@nongnu.org, Luiz Capitulino , qemu-ppc@nongnu.org, Alex Bligh , Paolo Bonzini , Richard Henderson On 06/12/2014 09:02 PM, Cornelia Huck wrote: > On Thu, 12 Jun 2014 19:38:40 +1000 > Alexey Kardashevskiy wrote: > >> On 06/12/2014 04:31 PM, Cornelia Huck wrote: >>> On Thu, 12 Jun 2014 03:03:01 +1000 >>> Alexey Kardashevskiy 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 >>>> --- >>>> Changes: >>>> v6: >>>> * supported NMI interface >>>> >>>> v5: >>>> * added ENOSYS -> QERR_UNSUPPORTED, qapi/qmp/qerror.h was added for this >>>> >>>> v4: >>>> * s/\/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 git@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