From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0RcK-0001AF-7M for qemu-devel@nongnu.org; Fri, 27 Jun 2014 04:34:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0RcE-0001GD-2N for qemu-devel@nongnu.org; Fri, 27 Jun 2014 04:34:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:39152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0RcD-0001G6-Nn for qemu-devel@nongnu.org; Fri, 27 Jun 2014 04:34:37 -0400 Message-ID: <53AD2C8E.8030009@intel.com> Date: Fri, 27 Jun 2014 16:34:22 +0800 From: "Chen, Tiejun" MIME-Version: 1.0 References: <1403662641-28526-1-git-send-email-tiejun.chen@intel.com> <1403662641-28526-5-git-send-email-tiejun.chen@intel.com> <53AA6B2D.2030804@redhat.com> In-Reply-To: <53AA6B2D.2030804@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v5][PATCH 4/5] xen, gfx passthrough: create host bridge to passthrough List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, mst@redhat.com, Kelly.Zytaruk@amd.com Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, allen.m.kay@intel.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, yang.z.zhang@intel.com On 2014/6/25 14:24, Paolo Bonzini wrote: > Il 25/06/2014 04:17, Tiejun Chen ha scritto: >> + if (xen_enabled() && xen_has_gfx_passthru) { >> + d = pci_create_simple(b, 0, TYPE_I440FX_XEN_PCI_DEVICE); >> + *pi440fx_state = I440FX_XEN_PCI_DEVICE(d); >> + pci_create_pch(b); >> + } else { >> + d = pci_create_simple(b, 0, TYPE_I440FX_PCI_DEVICE); >> + *pi440fx_state = I440FX_PCI_DEVICE(d); >> + } > > As mentioned in the review of v4, this should be a separate, > Xen-specific machine. pci_create_pch should not be called in generic PC > code. > I track this path: qemu_register_pc_machine(&xenfv_machine); | + .init = pc_xen_hvm_init, | + pc_init_pci(machine); | + pc_init1(machine, 1, 1); | + i440fx_init() So how to separate this to specific to xen? Or you mean we need to create an new machine to address this scenario? But actually this is same as xenfv_machine except for these little codes. If you don't like this involve other cases, we may drop this chunk of codes as a function to tweak with CONFIG_XEN. But this is not good as well since this is device feature, so kvm may need this one day. Thanks Tiejun From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [v5][PATCH 4/5] xen, gfx passthrough: create host bridge to passthrough Date: Fri, 27 Jun 2014 16:34:22 +0800 Message-ID: <53AD2C8E.8030009@intel.com> References: <1403662641-28526-1-git-send-email-tiejun.chen@intel.com> <1403662641-28526-5-git-send-email-tiejun.chen@intel.com> <53AA6B2D.2030804@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53AA6B2D.2030804@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Paolo Bonzini , anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, mst@redhat.com, Kelly.Zytaruk@amd.com Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, allen.m.kay@intel.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org On 2014/6/25 14:24, Paolo Bonzini wrote: > Il 25/06/2014 04:17, Tiejun Chen ha scritto: >> + if (xen_enabled() && xen_has_gfx_passthru) { >> + d = pci_create_simple(b, 0, TYPE_I440FX_XEN_PCI_DEVICE); >> + *pi440fx_state = I440FX_XEN_PCI_DEVICE(d); >> + pci_create_pch(b); >> + } else { >> + d = pci_create_simple(b, 0, TYPE_I440FX_PCI_DEVICE); >> + *pi440fx_state = I440FX_PCI_DEVICE(d); >> + } > > As mentioned in the review of v4, this should be a separate, > Xen-specific machine. pci_create_pch should not be called in generic PC > code. > I track this path: qemu_register_pc_machine(&xenfv_machine); | + .init = pc_xen_hvm_init, | + pc_init_pci(machine); | + pc_init1(machine, 1, 1); | + i440fx_init() So how to separate this to specific to xen? Or you mean we need to create an new machine to address this scenario? But actually this is same as xenfv_machine except for these little codes. If you don't like this involve other cases, we may drop this chunk of codes as a function to tweak with CONFIG_XEN. But this is not good as well since this is device feature, so kvm may need this one day. Thanks Tiejun