xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Gordan Bobic <gordan@bobich.net>
To: Jan Beulich <JBeulich@suse.com>
Cc: Steven Haigh <netwiz@crc.id.au>,
	Ian Campbell <ian.campbell@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Andreas Falck <falck.andreas.lists@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: PCI passthrough problems after legacy update of xen 4.1
Date: Tue, 14 May 2013 20:30:21 +0100	[thread overview]
Message-ID: <519290CD.4030609@bobich.net> (raw)
In-Reply-To: <51925FC702000078000D609A@nat28.tlf.novell.com>

Bad news, I'm afraid - I still get error "22, invalid argument" with 
this patch.

Gordan

On 05/14/2013 03:01 PM, Jan Beulich wrote:
>>>> On 05.05.13 at 21:33, Andreas Falck <falck.andreas.lists@gmail.com> wrote:
>> I tried adding some debugging statements in physdev_map_pirq. I have
>> attached the physdev.c with my debug statements, a hypervisor log from
>> testing, and the output of lspci -vv for my three devices.
>
> Since I didn't hear anything from either of you anymore, I went
> through the (not very familiar to me) tool stack code again, and
> found that qemu and xend/libxl fundamentally disagree about the
> model to be used. Qemu wants to allocate PIRQs while xend/libxl
> want a 1:1 mapping. Allocating after having created a 1:1 mapping
> works by returning the 1:1 mapping as allocation result, so as long
> as libxl completes its setup before launching qemu, it would be
> obvious why things work there. Consequently I assume that xend
> launches qemu quite a bit earlier in the process of creating a new
> domain, and the result of an attempt to establish a 1:1 mapping
> when a different mapping was already established is dependent on
> the specific interrupt numbers (i.e. also explains the observations
> one of you made).
>
> Since the tool stack as a whole really ought to use a consistent
> model, and since the 1:1 mapping model for non-MSI IRQs seems
> quite natural, the below/attached patch takes care of enforcing
> a 1:1 mapping in libxc when allocation is being requested by the
> caller. Ian, Ian - do you foresee any problem with this?
>
> Please both of you give this a try and let us know of the results
> (patch applies cleanly to all of -unstable, 4.2, and 4.1).
>
> Jan
>
> --- a/tools/libxc/xc_physdev.c
> +++ b/tools/libxc/xc_physdev.c
> @@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xc
>       map.domid = domid;
>       map.type = MAP_PIRQ_TYPE_GSI;
>       map.index = index;
> -    map.pirq = *pirq;
> +    map.pirq = *pirq < 0 ? index : *pirq;
>
>       rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
>
> --- a/tools/python/xen/xend/server/pciif.py
> +++ b/tools/python/xen/xend/server/pciif.py
> @@ -340,7 +340,7 @@ class PciController(DevController):
>                   raise VmError(('pci: failed to configure I/O memory on device '+
>                               '%s - errno=%d')%(dev.name,rc))
>
> -        if not self.vm.info.is_hvm() and dev.irq:
> +        if dev.irq > 0:
>               rc = xc.physdev_map_pirq(domid = fe_domid,
>                                      index = dev.irq,
>                                      pirq  = dev.irq)
>
>

  parent reply	other threads:[~2013-05-14 19:30 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAvQYUSQnM26ofCStMuSeLPbabmy7_tksELHrJvi6V=jq6_PvQ@mail.gmail.com>
     [not found] ` <7fe927daf168b95128153bf104715689@mail.shatteredsilicon.net>
2013-05-01 14:22   ` [Xen-users] PCI passthrough problems after legacy update of xen 4.1 Andreas Falck
     [not found]   ` <CAAvQYUT8jeYm57WGEYMgJ9sWQjwP4i=E69ZdkhUswxe-pjLW0Q@mail.gmail.com>
2013-05-02 11:56     ` Jan Beulich
2013-05-02 12:42       ` Andreas Falck
     [not found]       ` <CAAvQYUTWT9Y24UbwVn3kzEW8Di+MtX8APGz7pGvsiv+f_LovjQ@mail.gmail.com>
2013-05-02 13:35         ` Jan Beulich
2013-05-02 18:57           ` Andreas Falck
     [not found]           ` <CAAvQYUR411fF__Yfc6EPUOzxCndhXv9qdz-cD1A93-GVaz_ETA@mail.gmail.com>
2013-05-02 21:07             ` Andreas Falck
     [not found]             ` <CAAvQYUTM8U-mBK3k3A+AOZ4gEhjAKtkparGY2dxTXsy08+Tn0A@mail.gmail.com>
2013-05-03  7:29               ` Jan Beulich
2013-05-03 13:31                 ` Andreas Falck
2013-05-03 13:51                   ` Jan Beulich
2013-05-03 13:57                   ` Andrew Cooper
2013-05-03 14:39                     ` Jan Beulich
2013-05-03 14:56                       ` Andreas Falck
2013-05-03 15:03                         ` Jan Beulich
2013-05-03 18:59                           ` Andreas Falck
2013-05-05 19:33                             ` Andreas Falck
2013-05-06  7:53                               ` Jan Beulich
2013-05-14 14:01                               ` Jan Beulich
2013-05-14 14:05                                 ` Gordan Bobic
2013-05-14 19:30                                 ` Gordan Bobic [this message]
2013-05-15  7:06                                   ` Jan Beulich
2013-05-15  7:24                                     ` PCI passthrough problems after XSA46 patch Gordan Bobic
2013-05-15  7:50                                       ` Jan Beulich
2013-05-17 19:29                                         ` Gordan Bobic
2013-05-16 12:20                                       ` Jan Beulich
2013-05-17 19:56                                         ` Gordan Bobic
2013-05-16  6:41                                 ` PCI passthrough problems after legacy update of xen 4.1 Andreas Falck
2013-05-19 14:56                                   ` Andreas Falck
2013-05-19 19:59                                     ` Gordan Bobic
2013-05-20  0:50                                       ` Steven Haigh
2013-05-20  8:55                                         ` Andrew Cooper
2013-05-20  9:13                                           ` Ian Campbell
2013-05-21  8:28                                             ` 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=519290CD.4030609@bobich.net \
    --to=gordan@bobich.net \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=falck.andreas.lists@gmail.com \
    --cc=ian.campbell@citrix.com \
    --cc=netwiz@crc.id.au \
    --cc=xen-devel@lists.xen.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 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).