From patchwork Fri Jun 5 08:44:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 481119 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7EB0D14016A for ; Fri, 5 Jun 2015 18:52:55 +1000 (AEST) Received: from localhost ([::1]:45951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0nMz-0004KR-Pr for incoming@patchwork.ozlabs.org; Fri, 05 Jun 2015 04:52:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0nIw-0005j5-60 for qemu-devel@nongnu.org; Fri, 05 Jun 2015 04:48:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0nIv-0005Vp-4D for qemu-devel@nongnu.org; Fri, 05 Jun 2015 04:48:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:24454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0nIu-0005Sq-Vd for qemu-devel@nongnu.org; Fri, 05 Jun 2015 04:48:41 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 05 Jun 2015 01:48:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,557,1427785200"; d="scan'208";a="582578412" Received: from tchen0-linux.bj.intel.com ([10.238.154.91]) by orsmga003.jf.intel.com with ESMTP; 05 Jun 2015 01:48:38 -0700 From: Tiejun Chen To: mst@redhat.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com Date: Fri, 5 Jun 2015 16:44:59 +0800 Message-Id: <1433493901-9332-9-git-send-email-tiejun.chen@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433493901-9332-1-git-send-email-tiejun.chen@intel.com> References: <1433493901-9332-1-git-send-email-tiejun.chen@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [v8][RESEND][PATCH 08/10] xen, gfx passthrough: register a isa bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently we just register this isa bridge when we use IGD passthrough in Xen side. Signed-off-by: Tiejun Chen --- hw/xen/xen_pt.c | 18 ++++++++++++++++++ include/hw/xen/xen.h | 1 + 2 files changed, 19 insertions(+) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 3bf2233..fff169d 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -676,6 +676,21 @@ static const MemoryListener xen_pt_io_listener = { .priority = 10, }; +static void +xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s, + XenHostPCIDevice *dev) +{ + uint16_t gpu_dev_id; + PCIDevice *d = &s->dev; + + if (!is_igd_vga_passthrough(dev)) { + return; + } + + gpu_dev_id = dev->device_id; + igd_passthrough_isa_bridge_create(d->bus, gpu_dev_id); +} + /* init */ static int xen_pt_initfn(PCIDevice *d) @@ -725,6 +740,9 @@ static int xen_pt_initfn(PCIDevice *d) xen_host_pci_device_put(&s->real_device); return -1; } + + /* Register ISA bridge for passthrough GFX. */ + xen_igd_passthrough_isa_bridge_create(s, &s->real_device); } /* Handle real device's MMIO/PIO BARs */ diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h index 4356af4..703148e 100644 --- a/include/hw/xen/xen.h +++ b/include/hw/xen/xen.h @@ -51,4 +51,5 @@ void xen_register_framebuffer(struct MemoryRegion *mr); # define HVM_MAX_VCPUS 32 #endif +extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); #endif /* QEMU_HW_XEN_H */