From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuhH2-0003mP-Pi for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:05:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuhGv-0002ya-BB for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:05:00 -0400 Message-ID: <539845E4.7030200@suse.de> Date: Wed, 11 Jun 2014 14:04:52 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1401869330-32449-1-git-send-email-aik@ozlabs.ru> <1401869330-32449-2-git-send-email-aik@ozlabs.ru> <20140610093951.6dd64ea4@redhat.com> <20140610164107.249d8290.cornelia.huck@de.ibm.com> <20140610104847.1cb5a424@redhat.com> <53973277.4090500@redhat.com> <539749EB.2050608@suse.de> <1A9DA1AC-C696-452F-8D7E-68C49E339785@suse.de> <5397E230.8020605@redhat.com> <53980CCB.2040306@suse.de> <5398130D.8040706@redhat.com> <53981381.6060302@suse.de> <53981549.2090307@redhat.com> <53981691.9020407@suse.de> <539833C4.5090101@redhat.com> In-Reply-To: <539833C4.5090101@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/4] cpus: Define NMI callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , Stefan Hajnoczi , Alexey Kardashevskiy , QEMU Developers , Markus Armbruster , "qemu-ppc@nongnu.org" , Alex Bligh , Cornelia Huck , Luiz Capitulino , =?ISO-8859-1?Q?Andreas_F=E4r?= =?ISO-8859-1?Q?ber?= , Richard Henderson On 06/11/2014 12:47 PM, Paolo Bonzini wrote: > Il 11/06/2014 10:42, Alexander Graf ha scritto: >> >> On 11.06.14 10:37, Paolo Bonzini wrote: >>> Il 11/06/2014 10:29, Alexander Graf ha scritto: >>>>> >>>>> But right now inject-nmi was a CPU-specific interface and whoever >>>>> needs something different will have to find a way. >>>>> >>>>> You could argue that Alexey does need something different thanks to >>>>> his need to inject the NMI on all CPUs. >>>>> >>>>> What about an NMIMonitorHandler interface that takes a Monitor*, and >>>>> then you iterate on all of /machine looking for implementors of the >>>>> interface? Then -M mac99 can add it to the MPIC, -M spapr can just >>>>> ignore the Monitor*, and i386/s390 can look at the current CPU. >>>> >>>> I think modeling a button is easier and closer to what you'd actually >>>> get on real hardware. >>> >>> What is a button? It certainly doesn't have any evdev support in >>> Linux. >> >> It's a device that links a qemu_irq line and implements an interface to >> call it. > > That seems awfully overengineered. On PPC every input line to a CPU is a qemu_irq. I don't see how a linking piece between this qemu_irq object and a command line interface is overengineered. Whether the linking piece is "a device you look for and call a function in" or "a machine callback you call" is an implementation detail IMHO. > >>> The NMI button is just something that closes a circuit. Whoever is >>> attached to that circuit reacts, in QEMU that's whoever implements an >>> NMIMonitorHandler. The Monitor* is just for backwards HMP >>> compatibility. >> >> I think the only major difference in thinking we have here is that I >> don't think it's necessary to maintain HMP compatibility for this debug >> feature that maybe 2 people in the world ever used ;). > > Ok, I can buy removing the support for CPU != 0. But still, the > overengineering remains. > > If Alexey needs to trigger the NMI on all CPUs, simply moving the new > method from CPU to Machine, and blindly using first_cpu in s390 and > x86 makes the most sense. Yes :). Alex