All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Yang Zhang <yang.z.zhang@intel.com>
Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com,
	stefano.stabellini@eu.citrix.com, allen.m.kay@intel.com,
	weidong.han@intel.com, qemu-devel@nongnu.org,
	jean.guyader@eu.citrix.com, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH 2/5] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD
Date: Fri, 21 Mar 2014 17:26:54 +0000	[thread overview]
Message-ID: <20140321172654.GB8417@perard.uk.xensource.com> (raw)
In-Reply-To: <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com>

On Fri, Feb 21, 2014 at 02:44:10PM +0800, Yang Zhang wrote:
> From: Yang Zhang <yang.z.zhang@Intel.com>
> 
> 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 <weidong.han@intel.com>
> 
> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
> Cc: Weidong Han <weidong.han@intel.com>
> ---
>  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;
>          }

This does not look quite right, there is maybe another way to reserve a
devfn.

-- 
Anthony PERARD

WARNING: multiple messages have this Message-ID (diff)
From: Anthony PERARD <anthony.perard@citrix.com>
To: Yang Zhang <yang.z.zhang@intel.com>
Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com,
	stefano.stabellini@eu.citrix.com, allen.m.kay@intel.com,
	weidong.han@intel.com, qemu-devel@nongnu.org,
	jean.guyader@eu.citrix.com, anthony@codemonkey.ws
Subject: Re: [PATCH 2/5] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD
Date: Fri, 21 Mar 2014 17:26:54 +0000	[thread overview]
Message-ID: <20140321172654.GB8417@perard.uk.xensource.com> (raw)
In-Reply-To: <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com>

On Fri, Feb 21, 2014 at 02:44:10PM +0800, Yang Zhang wrote:
> From: Yang Zhang <yang.z.zhang@Intel.com>
> 
> 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 <weidong.han@intel.com>
> 
> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
> Cc: Weidong Han <weidong.han@intel.com>
> ---
>  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;
>          }

This does not look quite right, there is maybe another way to reserve a
devfn.

-- 
Anthony PERARD

  reply	other threads:[~2014-03-21 17:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21  6:44 [Qemu-devel] [PATCH 0/5] xen: add Intel IGD passthrough support Yang Zhang
2014-02-21  6:44 ` Yang Zhang
2014-02-21  6:44 ` [Qemu-devel] [PATCH 1/5] xen, gfx passthrough: basic graphics " Yang Zhang
2014-02-21  6:44   ` Yang Zhang
2014-03-21 16:24   ` [Qemu-devel] " Anthony PERARD
2014-03-21 16:24     ` Anthony PERARD
2014-05-09  7:27     ` [Qemu-devel] " Zhang, Yang Z
2014-05-09  7:27       ` Zhang, Yang Z
2014-04-02 15:19   ` [Qemu-devel] [Xen-devel] " Zytaruk, Kelly
2014-04-02 15:19     ` Zytaruk, Kelly
2014-02-21  6:44 ` [Qemu-devel] [PATCH 2/5] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD Yang Zhang
2014-02-21  6:44   ` Yang Zhang
2014-03-21 17:26   ` Anthony PERARD [this message]
2014-03-21 17:26     ` Anthony PERARD
2014-02-21  6:44 ` [Qemu-devel] [PATCH 3/5] xen, gfx passthrough: create intel isa bridge Yang Zhang
2014-02-21  6:44   ` Yang Zhang
2014-02-21  6:44 ` [Qemu-devel] [PATCH 4/5] xen, gfx passthrough: support Intel IGD passthrough with VT-D Yang Zhang
2014-02-21  6:44   ` Yang Zhang
2014-03-27 18:21   ` [Qemu-devel] " Stefano Stabellini
2014-03-27 18:21     ` Stefano Stabellini
2014-03-27 19:10     ` [Qemu-devel] " Michael S. Tsirkin
2014-03-27 19:10       ` Michael S. Tsirkin
2014-02-21  6:44 ` [Qemu-devel] [PATCH 5/5] xen, gfx passthrough: add opregion mapping Yang Zhang
2014-02-21  6:44   ` Yang Zhang
2014-02-27  5:38 ` [Qemu-devel] [PATCH 0/5] xen: add Intel IGD passthrough support Zhang, Yang Z
2014-02-27  5:38   ` Zhang, Yang Z
2014-02-27 12:47   ` [Qemu-devel] " Stefano Stabellini
2014-02-27 12:47     ` Stefano Stabellini
2014-04-04 22:46 ` [Qemu-devel] " Kevin O'Connor
2014-04-04 22:46   ` Kevin O'Connor
2014-04-07  8:36   ` [Qemu-devel] [Xen-devel] " Ian Campbell
2014-04-07  8:36     ` Ian Campbell

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=20140321172654.GB8417@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=allen.m.kay@intel.com \
    --cc=anthony@codemonkey.ws \
    --cc=jean.guyader@eu.citrix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=weidong.han@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.