Received: from eggs.gnu.org ([2001:4830:134:3::10]:33396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv2mM-0001o2-4I for qemu-devel@nongnu.org; Thu, 12 Jun 2014 07:02:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv2mB-0000Wf-WF for qemu-devel@nongnu.org; Thu, 12 Jun 2014 07:02:46 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:37994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv2mB-0000WL-NV for qemu-devel@nongnu.org; Thu, 12 Jun 2014 07:02:35 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Jun 2014 12:02:32 +0100 Date: Thu, 12 Jun 2014 13:02:27 +0200 From: Cornelia Huck Message-ID: <20140612130227.2819fbd2.cornelia.huck@de.ibm.com> In-Reply-To: <53997520.8020509@ozlabs.ru> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Alexey Kardashevskiy 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 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.