From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46331 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q91OD-0006vm-QS for qemu-devel@nongnu.org; Sun, 10 Apr 2011 16:37:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q91OB-0004OI-AH for qemu-devel@nongnu.org; Sun, 10 Apr 2011 16:37:45 -0400 Received: from hall.aurel32.net ([88.191.126.93]:48571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q91OB-0004O5-1Z for qemu-devel@nongnu.org; Sun, 10 Apr 2011 16:37:43 -0400 Date: Sun, 10 Apr 2011 22:37:41 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 06/15] s390x: Dispatch interrupts to KVM or the real CPU Message-ID: <20110410203741.GL4551@volta.aurel32.net> References: <1301927544-32767-1-git-send-email-agraf@suse.de> <1301927544-32767-7-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1301927544-32767-7-git-send-email-agraf@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: peter.maydell@linaro.org, QEMU-devel Developers , Richard Henderson On Mon, Apr 04, 2011 at 04:32:15PM +0200, Alexander Graf wrote: > The KVM interrupt injection path is non-generic for now. So we need to push > knowledge of how to inject a device interrupt using KVM into the actual device > code. > > Signed-off-by: Alexander Graf > --- > hw/s390-virtio-bus.c | 10 ++++++++-- > 1 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c > index 60e0135..35acf53 100644 > --- a/hw/s390-virtio-bus.c > +++ b/hw/s390-virtio-bus.c > @@ -43,6 +43,8 @@ > do { } while (0) > #endif > > +#define VIRTIO_EXT_CODE 0x2603 > + > struct BusInfo s390_virtio_bus_info = { > .name = "s390-virtio", > .size = sizeof(VirtIOS390Bus), > @@ -304,9 +306,13 @@ static void virtio_s390_notify(void *opaque, uint16_t vector) > { > VirtIOS390Device *dev = (VirtIOS390Device*)opaque; > uint64_t token = s390_virtio_device_vq_token(dev, vector); > + CPUState *env = s390_cpu_addr2state(0); > > - /* XXX kvm dependency! */ > - kvm_s390_virtio_irq(s390_cpu_addr2state(0), 0, token); > + if (kvm_enabled()) { > + kvm_s390_virtio_irq(env, 0, token); > + } else { > + cpu_inject_ext(env, VIRTIO_EXT_CODE, 0, token); cpu_inject_ext() is defined in a later patch so the patch series should probably be reordered to not break bisecting (for the KVM version only in that case). > + } > } > > static unsigned virtio_s390_get_features(void *opaque) > -- > 1.6.0.2 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net