All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Alex Williamson
	<alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iommu/vt-d: Fix VM domain ID leak
Date: Thu, 16 Jul 2015 19:03:57 +0200	[thread overview]
Message-ID: <20150716170356.GC10969@8bytes.org> (raw)
In-Reply-To: <1437061435.1391.580.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Thu, Jul 16, 2015 at 09:43:55AM -0600, Alex Williamson wrote:
> I was tempted to do this as well, but what about
> domain_remove_dev_info() where we also handle vm domains specially and
> don't do a symmetric detach in both directions?  I started down that
> path but quickly found the code to fragile to make those kinds of
> changes.  Thanks,

Okay, so domain_remove_dev_info() does:

                if (domain_type_is_vm(domain)) {
                        iommu_detach_dependent_devices(info->iommu, info->dev);
                        domain_detach_iommu(domain, info->iommu);
                }

... in a loop over all devices attached to the domain. The first
function (iommu_detach_dependent_devices) is not special to vm-domains.
In fact, domain_remove_one_dev_info calls it for all domain types.

And domain_detach_iommu only clears the bit in the iommu_bmp of the
domain, which is also not special and also called for all domain types
in domain_remove_one_dev_info.

So it looks like this special handling has no real purpose and is just
part of the whole mess. I am currently working on the conversion of the
Intel VT-d driver to use default-domains from the iommu-core. When this
is done we can get rid of that mess.



	Joerg

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: iommu@lists.linux-foundation.org, dwmw2@infradead.org,
	jiang.liu@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/vt-d: Fix VM domain ID leak
Date: Thu, 16 Jul 2015 19:03:57 +0200	[thread overview]
Message-ID: <20150716170356.GC10969@8bytes.org> (raw)
In-Reply-To: <1437061435.1391.580.camel@redhat.com>

On Thu, Jul 16, 2015 at 09:43:55AM -0600, Alex Williamson wrote:
> I was tempted to do this as well, but what about
> domain_remove_dev_info() where we also handle vm domains specially and
> don't do a symmetric detach in both directions?  I started down that
> path but quickly found the code to fragile to make those kinds of
> changes.  Thanks,

Okay, so domain_remove_dev_info() does:

                if (domain_type_is_vm(domain)) {
                        iommu_detach_dependent_devices(info->iommu, info->dev);
                        domain_detach_iommu(domain, info->iommu);
                }

... in a loop over all devices attached to the domain. The first
function (iommu_detach_dependent_devices) is not special to vm-domains.
In fact, domain_remove_one_dev_info calls it for all domain types.

And domain_detach_iommu only clears the bit in the iommu_bmp of the
domain, which is also not special and also called for all domain types
in domain_remove_one_dev_info.

So it looks like this special handling has no real purpose and is just
part of the whole mess. I am currently working on the conversion of the
Intel VT-d driver to use default-domains from the iommu-core. When this
is done we can get rid of that mess.



	Joerg


  parent reply	other threads:[~2015-07-16 17:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 20:48 [PATCH] iommu/vt-d: Fix VM domain ID leak Alex Williamson
2015-07-14 20:48 ` Alex Williamson
     [not found] ` <20150714204731.10189.28556.stgit-GCcqpEzw8uZBDLzU/O5InQ@public.gmane.org>
2015-07-16 15:20   ` Joerg Roedel
2015-07-16 15:20     ` Joerg Roedel
     [not found]     ` <20150716152030.GB10969-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-07-16 15:43       ` Alex Williamson
2015-07-16 15:43         ` Alex Williamson
     [not found]         ` <1437061435.1391.580.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-16 17:03           ` Joerg Roedel [this message]
2015-07-16 17:03             ` Joerg Roedel
     [not found]             ` <20150716170356.GC10969-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-07-22 21:01               ` Alex Williamson
2015-07-22 21:01                 ` Alex Williamson
     [not found]                 ` <1437598864.5211.41.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-23 16:58                   ` Joerg Roedel
2015-07-23 16:58                     ` Joerg Roedel

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=20150716170356.GC10969@8bytes.org \
    --to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
    --cc=alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jiang.liu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@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.