mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Juhani Rautiainen <jrauti@iki.fi>
Cc: linux-kernel@vger.kernel.org,
	iommu <iommu@lists.linux-foundation.org>,
	Joerg Roedel <joro@8bytes.org>
Subject: Re: KVM PCI passthrough problems after kernel v4.2
Date: Thu, 12 Nov 2015 15:00:23 -0700	[thread overview]
Message-ID: <1447365623.3946.99.camel@redhat.com> (raw)
In-Reply-To: <CAN74MCz9MCoLFh=NDLeUVQvBnUgaVJO_c8uTv1RT2V9sTMZ9yA@mail.gmail.com>

On Thu, 2015-11-12 at 23:36 +0200, Juhani Rautiainen wrote:
> Hi!
> 
> I've been using KVM PCI passthrough with a dual-port NIC for over a
> year. I just upgraded to v4.3 from v4.1.4 and PCI passthrough stopped
> working. I checked with v4.1.9 and it still works there. Version 4.2
> seems to point after which my system doesn't work. How can I help to
> narrow down the cause of the problem? I checked the intel-iommu.c and
> there seem to have been lots of changes between 4.1.9 and 4.2 in
> drivers/iommu/intel-iommu.c. My motherboard is Asus P8C WS which has
> Intel C216 chipset. CPU is Intel I5-3470. From v4.2 onwards
> passthrough fails with:
> 
> pci-stub 0000:02:00.0: kvm assign device failed ret -22.

This happens when kvm calls iommu_attach_device(), which was changed in
v4.2 to fail with -EINVAL (-22) when the device is part of a
non-singleton iommu group.  Legacy kvm device assignment is not iommu
group aware and has been deprecated for some time.  Have you considered
using vfio for device assignment instead?

For reference, here's the comment that made this change:

commit 426a273834eae65abcfc7132a21a85b3151e0bce
Author: Joerg Roedel <jroedel@suse.de>
Date:   Thu May 28 18:41:30 2015 +0200

    iommu: Limit iommu_attach/detach_device to devices with their own group
    
    This patch changes the behavior of the iommu_attach_device
    and iommu_detach_device functions. With this change these
    functions only work on devices that have their own group.
    For all other devices the iommu_group_attach/detach
    functions must be used.
    
    Signed-off-by: Joerg Roedel <jroedel@suse.de>



  reply	other threads:[~2015-11-12 22:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 21:36 Juhani Rautiainen
2015-11-12 22:00 ` Alex Williamson [this message]
2015-11-13  4:48   ` Juhani Rautiainen

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=1447365623.3946.99.camel@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=jrauti@iki.fi \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®