All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: Alex Williamson
	<alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>,
	Jiang Liu <jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	James Smart <jsmart2021-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: kernel BUG at drivers/iommu/intel-iommu.c:608
Date: Mon, 08 Apr 2019 08:13:34 -0700	[thread overview]
Message-ID: <1554736414.118779.265.camel@acm.org> (raw)
In-Reply-To: <20190407173132.24032810-hfcDOgR9qeA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]

On Sun, 2019-04-07 at 17:31 -0600, Alex Williamson wrote:
> It's not possible to do what you want with this configuration.  An IOMMU
> group represents the smallest set of devices that are isolated from
> other sets of devices and is also therefore the minimum granularity we
> can assign devices to userspace (ex. QEMU).  The kernel reacts to
> breaking the isolation of the group with a BUG_ON.  If you managed not
> to hit the BUG_ON here, you'd hit the BUG_ON in vfio code when the loss
> of isolation is detected there. IOMMU groups are formed at the highest
> point in the topology which guarantees isolation.  This can be
> indicated either via native PCIe ACS support or ACS-equivalent quirks
> in the code.  If the root port provides neither of these, then all
> devices downstream are grouped together as well as all peer root ports
> in the same PCI slot and all devices downstream of those.  If a
> multifunction endpoint does not provide ACS or equivalent quirks, the
> functions will be grouped together. Not all endpoint devices or systems
> are designed for minimum possible granularity.  You can learn more
> here[1].  Thanks,
> 
> Alex
> 
> [1] http://vfio.blogspot.com/2014/08/iommu-groups-inside-and-out.html

Hi Alex,

Thank you for the detailed reply. The background information you provided
makes it very clear why the devices I mentioned in my e-mail ended up in the
same IOMMU group.

But it seems that I was not clear enough in my original e-mail. My concern is
that a user space action (modprobe) should never trigger a kernel BUG(). Is
there any way to make sure that the sequence of actions I performed causes
modprobe to fail with an error code instead of triggering a kernel BUG()?

Thanks,

Bart.

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <bvanassche@acm.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: iommu@lists.linux-foundation.org, Joerg Roedel <jroedel@suse.de>,
	Jiang Liu <jiang.liu@linux.intel.com>,
	James Smart <jsmart2021@gmail.com>
Subject: Re: kernel BUG at drivers/iommu/intel-iommu.c:608
Date: Mon, 08 Apr 2019 08:13:34 -0700	[thread overview]
Message-ID: <1554736414.118779.265.camel@acm.org> (raw)
Message-ID: <20190408151334.2Bu_KZztyXojokMnx2Ikefl2x-pQJ6RIj0ovlirBTWM@z> (raw)
In-Reply-To: <20190407173132.24032810@x1.home>

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]

On Sun, 2019-04-07 at 17:31 -0600, Alex Williamson wrote:
> It's not possible to do what you want with this configuration.  An IOMMU
> group represents the smallest set of devices that are isolated from
> other sets of devices and is also therefore the minimum granularity we
> can assign devices to userspace (ex. QEMU).  The kernel reacts to
> breaking the isolation of the group with a BUG_ON.  If you managed not
> to hit the BUG_ON here, you'd hit the BUG_ON in vfio code when the loss
> of isolation is detected there. IOMMU groups are formed at the highest
> point in the topology which guarantees isolation.  This can be
> indicated either via native PCIe ACS support or ACS-equivalent quirks
> in the code.  If the root port provides neither of these, then all
> devices downstream are grouped together as well as all peer root ports
> in the same PCI slot and all devices downstream of those.  If a
> multifunction endpoint does not provide ACS or equivalent quirks, the
> functions will be grouped together. Not all endpoint devices or systems
> are designed for minimum possible granularity.  You can learn more
> here[1].  Thanks,
> 
> Alex
> 
> [1] http://vfio.blogspot.com/2014/08/iommu-groups-inside-and-out.html

Hi Alex,

Thank you for the detailed reply. The background information you provided
makes it very clear why the devices I mentioned in my e-mail ended up in the
same IOMMU group.

But it seems that I was not clear enough in my original e-mail. My concern is
that a user space action (modprobe) should never trigger a kernel BUG(). Is
there any way to make sure that the sequence of actions I performed causes
modprobe to fail with an error code instead of triggering a kernel BUG()?

Thanks,

Bart.

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2019-04-08 15:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07 19:10 kernel BUG at drivers/iommu/intel-iommu.c:608 Bart Van Assche
2019-04-07 19:10 ` Bart Van Assche
     [not found] ` <a523ea10-3dab-fa2c-1ecf-5cf32077565f-HInyCGIudOg@public.gmane.org>
2019-04-07 21:06   ` Alex Williamson
2019-04-07 21:06     ` Alex Williamson
     [not found]     ` <20190407150650.060cc508-hfcDOgR9qeA@public.gmane.org>
2019-04-07 23:02       ` Bart Van Assche
2019-04-07 23:02         ` Bart Van Assche
     [not found]         ` <8d876549-21da-e027-0157-8737b10e26f8-HInyCGIudOg@public.gmane.org>
2019-04-07 23:31           ` Alex Williamson
2019-04-07 23:31             ` Alex Williamson
     [not found]             ` <20190407173132.24032810-hfcDOgR9qeA@public.gmane.org>
2019-04-08 15:13               ` Bart Van Assche [this message]
2019-04-08 15:13                 ` Bart Van Assche
     [not found]                 ` <1554736414.118779.265.camel-HInyCGIudOg@public.gmane.org>
2019-04-08 15:23                   ` Alex Williamson
2019-04-08 15:23                     ` Alex Williamson
     [not found]                     ` <20190408092345.01751472-hfcDOgR9qeA@public.gmane.org>
2019-04-08 15:30                       ` Bart Van Assche
2019-04-08 15:30                         ` Bart Van Assche
2019-04-08 15:55                       ` Christoph Hellwig
2019-04-08 15:55                         ` Christoph Hellwig
2019-04-08 17:10                       ` Robin Murphy
2019-04-08 17:10                         ` Robin Murphy
     [not found]                         ` <c5511683-9739-9c74-418b-cf2aed6b294a-5wv7dgnIgG8@public.gmane.org>
2019-04-08 18:05                           ` Alex Williamson
2019-04-08 18:05                             ` Alex Williamson

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=1554736414.118779.265.camel@acm.org \
    --to=bvanassche-hinycgiudog@public.gmane.org \
    --cc=alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=jroedel-l3A5Bk7waGM@public.gmane.org \
    --cc=jsmart2021-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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.