From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StJBN-0006iX-D5 for qemu-devel@nongnu.org; Mon, 23 Jul 2012 10:00:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StJBD-0007F9-Q6 for qemu-devel@nongnu.org; Mon, 23 Jul 2012 10:00:21 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:45173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StJBD-0007Cp-Bg for qemu-devel@nongnu.org; Mon, 23 Jul 2012 10:00:11 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Jul 2012 15:00:06 +0100 Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6NDu0hD2257002 for ; Mon, 23 Jul 2012 14:56:34 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6NDtQC6026726 for ; Mon, 23 Jul 2012 07:55:26 -0600 Date: Mon, 23 Jul 2012 15:55:07 +0200 From: Cornelia Huck Message-ID: <20120723155507.5ca26587@BR9GNB5Z> In-Reply-To: <500D4E1A.4010708@redhat.com> References: <1342811652-16931-1-git-send-email-peter.maydell@linaro.org> <500A52BF.9080207@web.de> <500A730F.8040604@web.de> <500A7A02.3050301@web.de> <500A8303.8020903@web.de> <500A8DAE.3040909@web.de> <500AA21E.9050506@web.de> <500AABC8.7080406@web.de> <20120723140418.76d8f874@BR9GNB5Z> <500D4129.8030200@redhat.com> <20120723150600.57f2aab5@BR9GNB5Z> <500D4E1A.4010708@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Peter Maydell , kvm , patches@linaro.org, Marcelo Tosatti , qemu-devel@nongnu.org, Alexander Graf , Jan Kiszka On Mon, 23 Jul 2012 16:14:02 +0300 Avi Kivity wrote: > On 07/23/2012 04:06 PM, Cornelia Huck wrote: > > On Mon, 23 Jul 2012 15:18:49 +0300 > > Avi Kivity wrote: > > > >> > So, for example, if a specific subchannel (=device) has pending status > >> > and an I/O interrupt is to be generated, this interrupt remains pending > >> > until an arbitrary cpu is enabled for I/O interrupts. If several cpus > >> > are enabled for I/O interrupts, any of them may be interrupted. > >> > >> This may be costly to emulate. On x86 we do not have access to a > >> guest's interrupt status while it is running. Is this not the case for > >> s390? > >> > >> Oh, let me guess. You write some interrupt descriptor in memory > >> somewhere, issue one of your famous instructions, and the hardware finds > >> a guest vcpu and injects the interrupt. > > > > Basically, we have some flags in our control block we can set so that > > the cpu drops out of SIE whenever external/I/O/... interrupts are > > enabled and then have the host do the lowcore updates, psw swaps, etc. > > Can you write them from a different cpu and expect them to take effect? > > How do you emulate an interrupt with a large guest? You have to update > the flags in the control blocks for all vcpus; then restore them when > the interrupt is delivered? We may access the flags for any vcpu via the kvm_s390_float_interrupt structure which is contained in kvm->arch. We'll get control when a vcpu enters a wait state and try to deliver pending interrupts or set/clear the flags. Moreover, idle vcpus are on a wait queue and are the first target for getting an interrupt injected. > >> While you don't have an irqchip, you do have asynchronous interrupt > >> injection, yes? That's what irqchip really is all about. > > > > You mean injection via ioctl() that is asynchronous to vcpu execution? > > Yes, although we use a different ioctl than the others. > > Ok. The difference between irqfd and the ioctl is that with irqfd > everything (the payload in your case, the interrupt number for others) > is prepared beforehand, while with the ioctl the extra information is > delivered with the ioctl. This should work for us. Cornelia