All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"Chen, Tiejun" <tiejun.chen@intel.com>,
	"anthony.perard@citrix.com" <anthony.perard@citrix.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"Kelly.Zytaruk@amd.com" <Kelly.Zytaruk@amd.com>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Kay, Allen M" <allen.m.kay@intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"anthony@codemonkey.ws" <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge
Date: Fri, 06 Jun 2014 08:44:51 +0200	[thread overview]
Message-ID: <53916363.8080706@redhat.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0AAE2B0B@SHSMSX104.ccr.corp.intel.com>

Il 06/06/2014 05:06, Zhang, Yang Z ha scritto:
> Paolo Bonzini wrote on 2014-06-03:
>> Il 30/05/2014 10:59, Tiejun Chen ha scritto:
>>> +static int create_pch_isa_bridge(PCIBus *bus, XenHostPCIDevice *hdev)
>>> +{
>>> +    struct PCIDevice *dev;
>>> +
>>> +    char rid;
>>> +
>>> +    dev = pci_create(bus, PCI_DEVFN(0x1f, 0), "intel-pch-isa-bridge");
>>
>> This is really a huge hack.  You're going to have two ISA bridge devices
>> in the machine, with the BIOS imagining that the "good" one is at 1f.0
>
> Definitely. So how about expose a fake device at 00:1f.0 but not Isa Bridge? I have discussion with gfx driver developer, it is ok for them to check the device on 00:1f.0 no matter what device it is.

That would be slightly better.

>> and the ACPI tables actually describing the other one.  But the PCI
>> device at 1f.0 remains there and a driver in the OS could catch it---not
>> just intel_detect_pch---and if you want to add such a hack it should be
>> done in the Xen management layers.
>>
>> If possible, the host bridge patches are even worse.  If you change the
>> vendor and device ID while keeping the registers of the i440FX you're
>> going to get conflicts or break firmware badly; TianoCore and SeaBIOS
>> both expect the normal i440FX vendor and device IDs, for example.
>
> I only see the class id is changed but not vendor and device id.

Yes, and the class ID is a typo probably.

But when the guest reads the vendor and device ID, igd_pci_read passes 
it through.  So effectively it changes, if I read the code correctly.

Paolo

>>
>> The hardcoded list of offsets is also not acceptable.  It is also not
>> clear who is accessing the registers, whether the BIOS or the driver.
>> For Linux, a cursory look at the driver shows that it only accesses
>> 0x50/0x52 of the listed offsets, but also 0x44/0x48 ("MCH BAR"), what
>> happens if that code path is encountered?
>
> Will have a double check.
>
>>
>> The main problem with IGD passthrough is the incestuous (and that's a
>> euphemism) relationship between the MCH, PCH and graphics driver.  It
>> may make sense at the hardware level, but for virtualization it doesn't.
>>   A virt-specific driver for GPU command passthrough (with aid from the
>> kernel driver, but abstracting all the MCH/PCH-dependent details) would
>> make much more sense.
>
> Agree. But it is too hard.
>
>>
>> It's really not your fault, there's not much you can do given the
>> hardware architecture.  But I don't think this code can be accepted
>> upstream, sorry.
>>
>> Paolo
>
>
> Best regards,
> Yang
>
>
>
>

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"Chen, Tiejun" <tiejun.chen@intel.com>,
	"anthony.perard@citrix.com" <anthony.perard@citrix.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"Kelly.Zytaruk@amd.com" <Kelly.Zytaruk@amd.com>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"Kay, Allen M" <allen.m.kay@intel.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"anthony@codemonkey.ws" <anthony@codemonkey.ws>
Subject: Re: [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge
Date: Fri, 06 Jun 2014 08:44:51 +0200	[thread overview]
Message-ID: <53916363.8080706@redhat.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0AAE2B0B@SHSMSX104.ccr.corp.intel.com>

Il 06/06/2014 05:06, Zhang, Yang Z ha scritto:
> Paolo Bonzini wrote on 2014-06-03:
>> Il 30/05/2014 10:59, Tiejun Chen ha scritto:
>>> +static int create_pch_isa_bridge(PCIBus *bus, XenHostPCIDevice *hdev)
>>> +{
>>> +    struct PCIDevice *dev;
>>> +
>>> +    char rid;
>>> +
>>> +    dev = pci_create(bus, PCI_DEVFN(0x1f, 0), "intel-pch-isa-bridge");
>>
>> This is really a huge hack.  You're going to have two ISA bridge devices
>> in the machine, with the BIOS imagining that the "good" one is at 1f.0
>
> Definitely. So how about expose a fake device at 00:1f.0 but not Isa Bridge? I have discussion with gfx driver developer, it is ok for them to check the device on 00:1f.0 no matter what device it is.

That would be slightly better.

>> and the ACPI tables actually describing the other one.  But the PCI
>> device at 1f.0 remains there and a driver in the OS could catch it---not
>> just intel_detect_pch---and if you want to add such a hack it should be
>> done in the Xen management layers.
>>
>> If possible, the host bridge patches are even worse.  If you change the
>> vendor and device ID while keeping the registers of the i440FX you're
>> going to get conflicts or break firmware badly; TianoCore and SeaBIOS
>> both expect the normal i440FX vendor and device IDs, for example.
>
> I only see the class id is changed but not vendor and device id.

Yes, and the class ID is a typo probably.

But when the guest reads the vendor and device ID, igd_pci_read passes 
it through.  So effectively it changes, if I read the code correctly.

Paolo

>>
>> The hardcoded list of offsets is also not acceptable.  It is also not
>> clear who is accessing the registers, whether the BIOS or the driver.
>> For Linux, a cursory look at the driver shows that it only accesses
>> 0x50/0x52 of the listed offsets, but also 0x44/0x48 ("MCH BAR"), what
>> happens if that code path is encountered?
>
> Will have a double check.
>
>>
>> The main problem with IGD passthrough is the incestuous (and that's a
>> euphemism) relationship between the MCH, PCH and graphics driver.  It
>> may make sense at the hardware level, but for virtualization it doesn't.
>>   A virt-specific driver for GPU command passthrough (with aid from the
>> kernel driver, but abstracting all the MCH/PCH-dependent details) would
>> make much more sense.
>
> Agree. But it is too hard.
>
>>
>> It's really not your fault, there's not much you can do given the
>> hardware architecture.  But I don't think this code can be accepted
>> upstream, sorry.
>>
>> Paolo
>
>
> Best regards,
> Yang
>
>
>
>

  reply	other threads:[~2014-06-06  6:45 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-30  8:59 [v4][PATCH 0/5] xen: add Intel IGD passthrough support Tiejun Chen
2014-05-30  8:59 ` [v4][PATCH 1/5] xen, gfx passthrough: basic graphics " Tiejun Chen
2014-05-30 16:13   ` [Xen-devel] " Konrad Rzeszutek Wilk
2014-06-02 14:51   ` [Qemu-devel] " Stefano Stabellini
2014-06-02 14:51     ` Stefano Stabellini
2014-05-30  8:59 ` [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge Tiejun Chen
2014-05-30 16:13   ` [Xen-devel] " Konrad Rzeszutek Wilk
2014-06-02 14:52   ` [Qemu-devel] " Stefano Stabellini
2014-06-02 14:52     ` Stefano Stabellini
2014-06-03  8:46   ` [Qemu-devel] " Paolo Bonzini
2014-06-03  8:46     ` Paolo Bonzini
2014-06-03 11:29     ` [Qemu-devel] " Stefano Stabellini
2014-06-03 11:29       ` Stefano Stabellini
2014-06-03 11:39       ` [Qemu-devel] " Paolo Bonzini
2014-06-03 11:39         ` Paolo Bonzini
2014-06-03 11:43         ` [Qemu-devel] " Stefano Stabellini
2014-06-03 11:43           ` Stefano Stabellini
2014-06-03 23:24         ` [Qemu-devel] " Tian, Kevin
2014-06-03 23:24           ` Tian, Kevin
2014-06-03 11:42       ` George Dunlap
2014-06-03 11:42         ` George Dunlap
2014-06-03 12:21         ` [Qemu-devel] [Xen-devel] " Sander Eikelenboom
2014-06-03 12:21           ` Sander Eikelenboom
2014-06-03 12:24           ` [Qemu-devel] " Paolo Bonzini
2014-06-03 12:24             ` Paolo Bonzini
2014-06-03 12:38             ` [Qemu-devel] " Sander Eikelenboom
2014-06-03 12:38               ` Sander Eikelenboom
2014-06-06  3:06     ` [Qemu-devel] " Zhang, Yang Z
2014-06-06  3:06       ` Zhang, Yang Z
2014-06-06  6:44       ` Paolo Bonzini [this message]
2014-06-06  6:44         ` Paolo Bonzini
2014-05-30  8:59 ` [v4][PATCH 3/5] xen, gfx passthrough: support Intel IGD passthrough with VT-D Tiejun Chen
2014-05-30 16:14   ` Konrad Rzeszutek Wilk
2014-06-02 14:53   ` [Qemu-devel] " Stefano Stabellini
2014-06-02 14:53     ` Stefano Stabellini
2014-05-30  8:59 ` [v4][PATCH 4/5] xen, gfx passthrough: create host bridge to passthrough Tiejun Chen
2014-05-30 16:14   ` Konrad Rzeszutek Wilk
2014-06-02 14:54   ` [Qemu-devel] " Stefano Stabellini
2014-06-02 14:54     ` Stefano Stabellini
2014-06-02 20:36   ` [Qemu-devel] " Michael S. Tsirkin
2014-06-02 20:36     ` Michael S. Tsirkin
2014-06-03  1:10     ` [Qemu-devel] " Chen, Tiejun
2014-06-03  1:10       ` Chen, Tiejun
2014-05-30  8:59 ` [v4][PATCH 5/5] xen, gfx passthrough: add opregion mapping Tiejun Chen
2014-05-30 16:15   ` Konrad Rzeszutek Wilk
2014-06-02 14:56   ` [Qemu-devel] " Stefano Stabellini
2014-06-02 14:56     ` Stefano Stabellini
2014-06-02 14:59 ` [Qemu-devel] [v4][PATCH 0/5] xen: add Intel IGD passthrough support Stefano Stabellini
2014-06-02 14:59   ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53916363.8080706@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Kelly.Zytaruk@amd.com \
    --cc=allen.m.kay@intel.com \
    --cc=anthony.perard@citrix.com \
    --cc=anthony@codemonkey.ws \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tiejun.chen@intel.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yang.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.