All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com
Subject: Re: PCI passthrough (pci-attach) to HVM guests bug (BAR64 addresses are bogus)
Date: Mon, 10 Nov 2014 16:32:48 -0500	[thread overview]
Message-ID: <20141110213248.GA23182@laptop.dumpdata.com> (raw)
In-Reply-To: <20141110180720.GA15286@laptop.dumpdata.com>

On Mon, Nov 10, 2014 at 01:07:20PM -0500, Konrad Rzeszutek Wilk wrote:
> On Mon, Nov 10, 2014 at 05:42:32PM +0000, David Vrabel wrote:
> > On 10/11/14 17:32, Konrad Rzeszutek Wilk wrote:
> > > Hey,
> > > 
> > > With Xen 4.5 (today's staging), when I boot a guest and then do pci-attach
> > > the BARs values are corrupt.

I can reproduce this with Xen 4.4, Xen 4.3 and Xen 4.1.

A bit digging in and I realized that:

(XEN) memory_map:add: dom1 gfn=f4000 mfn=d8000 nr=4000 [64M]
(XEN) AMD-Vi: update_paging_mode Try to access pdev_list without aquiring pcidevs_lock.
(XEN) memory_map:add: dom1 gfn=f8000 mfn=fc000 nr=2000 [32M]
(XEN) ioport_map:add: dom1 gport=1000 mport=c000 nr=80
(XEN) AMD-Vi: Disable: device id = 0x500, domain = 0, paging mode = 3
(XEN) AMD-Vi: Setup I/O page table: device id = 0x500, type = 0x1, root table = 0x228b02000, domain = 1, paging mode = 3

The sizes are my own editing. This means QEMU is putting the
devices in the MMIO region - and doing it succesfully. But then:

> > 
> > 
> > > [  152.572965] pci 0000:00:04.0: BAR 1: no space for [mem size 0x08000000 64bit  pref]
> [  152.518320] pci 0000:00:04.0: reg 0x14: [mem 0x00000000-0x07ffffff 64bit pref]

.. The guest computes the right size for them, but reads the wrong BAR value
that was set by QEMU and also created in the hypervisor.

Perhaps this is Linux kernel being on fritz. Will try another kernel.

  reply	other threads:[~2014-11-10 21:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 17:32 PCI passthrough (pci-attach) to HVM guests bug (BAR64 addresses are bogus) Konrad Rzeszutek Wilk
2014-11-10 17:42 ` David Vrabel
2014-11-10 18:07   ` Konrad Rzeszutek Wilk
2014-11-10 21:32     ` Konrad Rzeszutek Wilk [this message]
2014-11-12  1:37       ` Konrad Rzeszutek Wilk
2014-11-12  9:24         ` Jan Beulich
2014-11-12 10:01           ` Malcolm Crossley
2014-11-12 10:11             ` Jan Beulich
2014-11-12 10:41               ` Malcolm Crossley
2014-11-12 15:14             ` Konrad Rzeszutek Wilk
2014-11-12 17:24               ` Jan Beulich

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=20141110213248.GA23182@laptop.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.