From patchwork Fri Feb 21 06:44:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Yang Z" X-Patchwork-Id: 322440 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 BF87B2C033A for ; Fri, 21 Feb 2014 17:49:57 +1100 (EST) Received: from localhost ([::1]:42375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGjvm-0000wf-GM for incoming@patchwork.ozlabs.org; Fri, 21 Feb 2014 01:49:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGjv9-0000vC-Hn for qemu-devel@nongnu.org; Fri, 21 Feb 2014 01:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGjv3-0007bZ-TZ for qemu-devel@nongnu.org; Fri, 21 Feb 2014 01:49:15 -0500 Received: from mga02.intel.com ([134.134.136.20]:24883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGjv3-0007aN-NR for qemu-devel@nongnu.org; Fri, 21 Feb 2014 01:49:09 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 20 Feb 2014 22:49:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,517,1389772800"; d="scan'208";a="459295688" Received: from yang-desktopd.sh.intel.com (HELO yang-desktop.sh.intel.com) ([10.239.47.126]) by orsmga001.jf.intel.com with ESMTP; 20 Feb 2014 22:49:06 -0800 From: Yang Zhang To: qemu-devel@nongnu.org Date: Fri, 21 Feb 2014 14:44:10 +0800 Message-Id: <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <1392965053-1069-1-git-send-email-yang.z.zhang@intel.com> References: <1392965053-1069-1-git-send-email-yang.z.zhang@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.20 Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, stefano.stabellini@eu.citrix.com, allen.m.kay@intel.com, weidong.han@intel.com, jean.guyader@eu.citrix.com, Yang Zhang , anthony@codemonkey.ws, anthony.perard@citrix.com Subject: [Qemu-devel] [PATCH 2/5] 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 From: Yang Zhang Some VBIOSs and drivers assume the IGD BDF (bus:device:function) is always 00:02.0, so this patch reserves 00:02.0 for assigned IGD in guest. The original patch is from Weidong Han Signed-off-by: Yang Zhang Cc: Weidong Han --- hw/pci/pci.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 4e0701d..e81816e 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -808,6 +808,12 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, if (devfn < 0) { for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); devfn += PCI_FUNC_MAX) { +#if defined(CONFIG_XEN_PCI_PASSTHROUGH) + /* If gfx_passthru is in use, reserve 00:02.* for the IGD */ + if (gfx_passthru && devfn == 0x10) { + continue; + } +#endif if (!bus->devices[devfn]) goto found; }