From patchwork Tue May 20 05:13:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 350499 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 13733140079 for ; Tue, 20 May 2014 15:14:22 +1000 (EST) Received: from localhost ([::1]:51338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmcNX-0006Tv-NS for incoming@patchwork.ozlabs.org; Tue, 20 May 2014 01:14:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmcNA-000637-JJ for qemu-devel@nongnu.org; Tue, 20 May 2014 01:14:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmcN6-00010k-R4 for qemu-devel@nongnu.org; Tue, 20 May 2014 01:13:56 -0400 Received: from mga03.intel.com ([143.182.124.21]:26152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmcN6-00010e-KC for qemu-devel@nongnu.org; Tue, 20 May 2014 01:13:52 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 19 May 2014 22:13:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,871,1392192000"; d="scan'208";a="434312863" Received: from fmsmsx107.amr.corp.intel.com ([10.19.9.54]) by azsmga001.ch.intel.com with ESMTP; 19 May 2014 22:13:47 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX107.amr.corp.intel.com (10.19.9.54) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 19 May 2014 22:13:47 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 19 May 2014 22:13:47 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.7]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.34]) with mapi id 14.03.0123.003; Tue, 20 May 2014 13:13:45 +0800 From: "Chen, Tiejun" To: Konrad Rzeszutek Wilk , "Zhang, Yang Z" Thread-Topic: [Xen-devel] [v2][PATCH 6/8] xen, gfx passthrough: support Intel IGD passthrough with VT-D Thread-Index: AQHPcRQnH53cFT/IPE2k8mD30wOsVZtGkrkAgADS/gCAAYu1EA== Date: Tue, 20 May 2014 05:13:45 +0000 Message-ID: References: <1400237624-8505-1-git-send-email-tiejun.chen@intel.com> <1400237624-8505-7-git-send-email-tiejun.chen@intel.com> <20140516143511.GE3154@phenom.dumpdata.com> <20140519133400.GA3152@phenom.dumpdata.com> In-Reply-To: <20140519133400.GA3152@phenom.dumpdata.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 143.182.124.21 Cc: "peter.maydell@linaro.org" , "xen-devel@lists.xensource.com" , "mst@redhat.com" , "stefano.stabellini@eu.citrix.com" , "Kay, Allen M" , "Kelly.Zytaruk@amd.com" , "qemu-devel@nongnu.org" , "anthony@codemonkey.ws" , "anthony.perard@citrix.com" Subject: Re: [Qemu-devel] [Xen-devel] [v2][PATCH 6/8] xen, gfx passthrough: support Intel IGD passthrough with VT-D 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 > -----Original Message----- > From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com] > Sent: Monday, May 19, 2014 9:34 PM > To: Zhang, Yang Z > Cc: Chen, Tiejun; anthony.perard@citrix.com; stefano.stabellini@eu.citrix.com; > mst@redhat.com; Kelly.Zytaruk@amd.com; peter.maydell@linaro.org; > xen-devel@lists.xensource.com; weidong.han@intel.com; Kay, Allen M; > qemu-devel@nongnu.org; jean.guyader@eu.citrix.com; > anthony@codemonkey.ws > Subject: Re: [Xen-devel] [v2][PATCH 6/8] xen, gfx passthrough: support Intel > IGD passthrough with VT-D > > On Mon, May 19, 2014 at 12:58:50AM +0000, Zhang, Yang Z wrote: > > Konrad Rzeszutek Wilk wrote on 2014-05-16: > > > On Fri, May 16, 2014 at 06:53:42PM +0800, Tiejun Chen wrote: > > > > Some registers of Intel IGD are mapped in host bridge, so it needs > > > > to passthrough these registers of physical host bridge to guest > > > > because emulated host bridge in guest doesn't have these mappings. > > > > Thanks for your review for the whole series patch. > > Sure thing! > > .. snip.. > > > > +write_default: > > > > + pci_default_write_config(pci_dev, config_addr, val, len); > > > > > > > > > and we just allow it through. But what happens if the guest decides > > > to change the BAR sizes? Or fiddle with the GTT? > > > > > > Ouch. That really looks dangerous - or maybe I am too paranoid? > > > > > > > I do not quite understand your concern. We only pass through PAVPC to > physical host bridge. The others are handled by current logic. We don't change > any of it. So what problem will be exposed by this patch? > > Ah, I assumed that pci_default_write_config would be writting everything > without any checks. But it looks to be doing the right thing and just sets the > emulated values. > > Could we just add comment saying that it writes to the emulated values? That > way it won't trip folks. Thanks Tiejun diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c index 1342f4f..5e5e3d5 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -367,6 +367,7 @@ void igd_pci_write(PCIDevice *pci_dev, uint32_t config_addr, case 0x58: /* PAVPC Offset */ break; default: + /* Just sets the emulated values. */ goto write_default; } @@ -427,6 +428,7 @@ uint32_t igd_pci_read(PCIDevice *pci_dev, uint32_t config_addr, int len) case 0xa8: /* SNB: base of GTT stolen memory */ break; default: + /* Just gets the emulated values. */ goto read_default; }