From patchwork Fri May 16 10:53:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 349568 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 786FC140096 for ; Fri, 16 May 2014 20:57:27 +1000 (EST) Received: from localhost ([::1]:34754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlFpN-00005A-2y for incoming@patchwork.ozlabs.org; Fri, 16 May 2014 06:57:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlFn9-0004Mu-BY for qemu-devel@nongnu.org; Fri, 16 May 2014 06:55:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlFn1-0001bQ-IP for qemu-devel@nongnu.org; Fri, 16 May 2014 06:55:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:62789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlFn1-0001ab-DL for qemu-devel@nongnu.org; Fri, 16 May 2014 06:54:59 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 16 May 2014 03:54:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.97,1066,1389772800"; d="scan'208"; a="540167987" Received: from tchen0-linux.bj.intel.com ([10.238.154.58]) by fmsmga002.fm.intel.com with ESMTP; 16 May 2014 03:54:56 -0700 From: Tiejun Chen To: anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, mst@redhat.com, Kelly.Zytaruk@amd.com Date: Fri, 16 May 2014 18:53:40 +0800 Message-Id: <1400237624-8505-5-git-send-email-tiejun.chen@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400237624-8505-1-git-send-email-tiejun.chen@intel.com> References: <1400237624-8505-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.88 Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, weidong.han@intel.com, allen.m.kay@intel.com, qemu-devel@nongnu.org, jean.guyader@eu.citrix.com, anthony@codemonkey.ws, yang.z.zhang@Intel.com Subject: [Qemu-devel] [v2][PATCH 4/8] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD 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 Some VBIOSs and drivers assume the IGD BDF (bus:device:function) is always 00:02.0, so we need to reserves 00:02.0 for assigned IGD in guest. Signed-off-by: Tiejun Chen Signed-off-by: Yang Zhang --- v2: * Use a common way patch #2 introduce to reserve PCI devfn. hw/pci-host/piix.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index ffdc853..b6f49bd 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -329,6 +329,14 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, s = PCI_HOST_BRIDGE(dev); b = pci_bus_new(dev, NULL, pci_address_space, address_space_io, 0, TYPE_PCI_BUS); + + /* + * Some video bioses and gfx drivers will assume the bdf of IGD is 00:02.0. + * So user need to set it to 00:02.0 in Xen configure file explicitly, + * otherwise IGD will fail to work. + */ + pci_reserve_pci_devfn(b, PCI_DEVFN(2, 0)); + s->bus = b; object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL); qdev_init_nofail(dev);