xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Łukasz Oleś" <lukaszoles@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Re: [vt-d][xen4-rc6] Hangs on startup
Date: Mon, 22 Mar 2010 17:54:36 -0400	[thread overview]
Message-ID: <20100322215436.GA1073@phenom.dumpdata.com> (raw)
In-Reply-To: <cb0d70421003221456x4eb0353pec19713b167fdcd6@mail.gmail.com>

> >> "0000:00:1a.1">/sys/bus/pci/devices/0000:00:1a.1/driver/unbind
> >> root@debian:~# echo "0000:00:1a.1">/sys/bus/pci/drivers/pci-stub/bind
> >
> > Where did you get the documentation for those steps? I would suggest you use
> > the 'pciback' instead of 'pci-stub' module for this just to see if that
> > makes the 'pciback' later error go away.
> 
> Well, I missread http://wiki.xensource.com/xenwiki/VTdHowTo  I
> switched to pciback(I used
> http://wiki.xensource.com/xenwiki/Assign_hardware_to_DomU_with_PCIBack_as_module)
>  and this error no longer occurs.

.. snip ..
> >> (XEN) mm.c:859:d1 Error getting mfn 40004 (pfn 5555555555555555) from
> >> L1 entry 0000000040004037 for l1e_owner=1, pg_owner=1
> >> ...
> >> And guest never starts.  Perhaps this is related to the firmware which
> >> is used by qla2xxx?
> >
> > So you see this _only_ when you pass in QLA2XXX card, right? When you
> > don't pass in a PCI card, you don't see this, correct?
> 
> Exactly. This happens with both pciback and pci-stub.

You are hitting two bugs.

1). pciback doesn't release the spinlock properly, spinning forever and
causing havoc when pcistub is used for the device.

2). qemu/vt-d/bochs bios/hvmload isn't setting up the HVM PCI passthrough
properly for your QLogic card.

For the 1) there isn't much there except to find the culprit and fix it,
should be pretty easy - probably some mutex/dead-lock condition. But
there is a work-around which you found, and that is to use _only_ pciback for
HVM and PV guests.

For the 2) problem I've no idea. I haven't dug through the QEMU PCI
passthrough code that much to figure this out. Depending on your needs
we can fix this the easy or the hard way. The easy way is for you to try
PV pass-through instead of HVM pass-through. It requires taking your
kernel and initramfs image from your DomU, and referencing them direclty
in your .cfg file. There should be an example of this in /etc/xen (look
for pv-grub). Also you might need to pass in 'iommu=0' on your Xen command line. 

The hard way is to try to figure this one out. There are four pieces of
technology working here: IOMMU (VT-d chipset), the QEMU
PCI pass-through code, the hvmloader code, and the Bochs BIOS. First step is
to instrument your QEMU to print all manners of debug information and do the same with
the hvmloader (grep for 'debug').  Also adding in 'loglvl=all' on your Xen
command line is a good idea (and compiling Xen with 'debug=y'). For the 
Bochs BIOS, there are some options in it where you can tweak it to print
more details.

Oh, and also would need to instrument DomU to figure out when that
'Error getting mfn' is triggered. You can do that easily by using
'xenctx' and seeing the stack trace of the guest (And with your
System.map table pin-point what is happening).

      reply	other threads:[~2010-03-22 21:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 23:41 [vt-d][xen4-rc6] Hangs on startup Łukasz Oleś
2010-03-16 23:55 ` Konrad Rzeszutek Wilk
2010-03-17  8:21   ` Keir Fraser
2010-03-17 12:46     ` Ross Philipson
2010-03-17  8:02 ` Cui, Dexuan
2010-03-17  8:43   ` Cui, Dexuan
2010-03-17 18:20 ` Łukasz Oleś
2010-03-17 20:14   ` Konrad Rzeszutek Wilk
2010-03-17 21:48     ` Łukasz Oleś
2010-03-18 14:19       ` Konrad Rzeszutek Wilk
2010-03-21 22:30         ` Łukasz Oleś
2010-03-22 19:50           ` Konrad Rzeszutek Wilk
2010-03-22 21:06             ` Nadolski, Ed
2010-03-22 20:54               ` Konrad Rzeszutek Wilk
2010-03-22 22:11                 ` Nadolski, Ed
2010-03-22 22:05                   ` Konrad Rzeszutek Wilk
2010-03-22 22:57                   ` Sander Eikelenboom
2010-03-22 21:56             ` Łukasz Oleś
2010-03-22 21:54               ` Konrad Rzeszutek Wilk [this message]

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=20100322215436.GA1073@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=lukaszoles@gmail.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).