From: Weidong Han <weidong.han@intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"Kay, Allen M" <allen.m.kay@intel.com>,
Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: [PATCH 1/3] VT-d: support Intel IGD passthrough
Date: Fri, 05 Feb 2010 09:52:47 +0800 [thread overview]
Message-ID: <4B6B79EF.2070609@intel.com> (raw)
In-Reply-To: <19306.65275.325707.253978@mariner.uk.xensource.com>
Ian Jackson wrote:
> Han, Weidong writes ("[Xen-devel][PATCH 1/3] VT-d: support Intel IGD passthrough "):
>
>> 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.
>>
>> Some VBIOSs and drivers ssume the IGD BDF (bus:device:function) is
>> always 00:02.0, so this patch reserves 00:02.0 for assigned IGD in
>> guest.
>>
>
> Thanks for the contribution, which I have applied with a very small
> change to avoid having an open else at #endif.
>
> However the part in pci.c is really very ugly indeed. If we ever get
> around to rebasing to recent upstream qemu and trying to upstream our
> patches, this is sure to be dropped. So you might profitably spend
> some time thinking how to make it less ugly.
>
> Thanks,
> Ian.
>
Thanks for check-in. I agree the hacking in pci.c is not elegant. We
will think how to make it cleaner.
Regards,
Weidong
>
>> +#ifdef CONFIG_PASSTHROUGH
>> + /* host bridge reads for IGD passthrough */
>> + if ( igd_passthru && pci_dev->devfn == 0x00 )
>> + {
>> + val = pci_dev->config_read(pci_dev, config_addr, len);
>> +
>> + if ( config_addr == 0x00 && len == 4 )
>> + val = pt_pci_host_read_long(0, 0, 0, 0x00);
>> + else if ( config_addr == 0x02 ) // Device ID
>> + val = pt_pci_host_read_word(0, 0, 0, 0x02);
>> + else if ( config_addr == 0x52 ) // GMCH Graphics Control Register
>> + val = pt_pci_host_read_word(0, 0, 0, 0x52);
>> + else if ( config_addr == 0xa0 ) // GMCH Top of Memory Register
>> + val = pt_pci_host_read_word(0, 0, 0, 0xa0);
>> + }
>> + else if ( igd_passthru && pci_dev->devfn == 0x10 &&
>> + config_addr == 0xfc ) // read on IGD device
>> + val = 0; // use SMI to communicate with the system BIOS
>> + else
>> +#endif
>> + val = pci_dev->config_read(pci_dev, config_addr, len);
>> +
>>
next prev parent reply other threads:[~2010-02-05 1:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 8:12 [PATCH 1/3] VT-d: support Intel IGD passthrough Han, Weidong
2010-02-04 17:08 ` Ian Jackson
2010-02-05 1:52 ` Weidong Han [this message]
2010-02-18 9:49 ` Isaku Yamahata
2010-02-20 7:47 ` Weidong Han
[not found] ` <E5E913F540B51B4C997F7A2993168735BC95981B01@vmdc1.w3host.co.uk>
2010-02-22 7:07 ` VT-d support proprietary NVidia/ATI GPU passthrough Weidong Han
2010-02-22 12:32 ` Timothy J. Moore
2010-02-22 16:48 ` Konrad Rzeszutek Wilk
2010-02-23 1:16 ` Weidong Han
2010-02-23 21:08 ` Timothy J. Moore
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=4B6B79EF.2070609@intel.com \
--to=weidong.han@intel.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=allen.m.kay@intel.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).