From patchwork Tue Mar 29 13:29:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 88771 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 45AD7B6EFF for ; Wed, 30 Mar 2011 00:31:34 +1100 (EST) Received: from localhost ([127.0.0.1]:33248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4Z19-00019L-Bw for incoming@patchwork.ozlabs.org; Tue, 29 Mar 2011 09:31:31 -0400 Received: from [140.186.70.92] (port=58589 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4YzZ-00013m-JX for qemu-devel@nongnu.org; Tue, 29 Mar 2011 09:29:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4YzX-0006Vo-44 for qemu-devel@nongnu.org; Tue, 29 Mar 2011 09:29:53 -0400 Received: from cantor.suse.de ([195.135.220.2]:48643 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4YzW-0006Ui-TC for qemu-devel@nongnu.org; Tue, 29 Mar 2011 09:29:51 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 383439417A; Tue, 29 Mar 2011 15:29:50 +0200 (CEST) From: Alexander Graf To: qemu-devel@nongnu.org Date: Tue, 29 Mar 2011 15:29:38 +0200 Message-Id: <1301405386-25738-12-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1301405386-25738-1-git-send-email-agraf@suse.de> References: <1301405386-25738-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.2 Cc: peter.maydell@linaro.org, aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH 11/19] s390x: Dispatch interrupts to KVM or the real CPU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 58af164..6a32939 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); + } } static unsigned virtio_s390_get_features(void *opaque)