From: Mark McLoughlin <markmc@redhat.com>
To: "Han, Weidong" <weidong.han@intel.com>
Cc: "'Avi Kivity'" <avi@redhat.com>,
"Woodhouse, David" <david.woodhouse@intel.com>,
"'Jesse Barnes'" <jbarnes@virtuousgeek.org>,
"Yu, Fenghua" <fenghua.yu@intel.com>,
"'iommu@lists.linux-foundation.org'"
<iommu@lists.linux-foundation.org>,
"'kvm@vger.kernel.org'" <kvm@vger.kernel.org>
Subject: Re: [PATCH 08/13] allocation and free functions of virtual machine domain
Date: Thu, 04 Dec 2008 17:13:00 +0000 [thread overview]
Message-ID: <1228410780.3732.143.camel@blaa> (raw)
In-Reply-To: <715D42877B251141A38726ABF5CABF2C018BF0598E@pdsmsx503.ccr.corp.intel.com>
On Tue, 2008-12-02 at 22:22 +0800, Han, Weidong wrote:
> Signed-off-by: Weidong Han <weidong.han@intel.com>
> ---
> drivers/pci/intel-iommu.c | 104 ++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 103 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index b00a8f2..e96b3bc 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -947,6 +947,7 @@ static int iommu_init_domains(struct intel_iommu *iommu)
>
>
> static void domain_exit(struct dmar_domain *domain);
> +static void vm_domain_exit(struct dmar_domain *domain);
>
> void free_dmar_iommu(struct intel_iommu *iommu)
> {
> @@ -957,8 +958,13 @@ void free_dmar_iommu(struct intel_iommu *iommu)
> for (; i < cap_ndoms(iommu->cap); ) {
> domain = iommu->domains[i];
> clear_bit(i, iommu->domain_ids);
> - if (--domain->iommu_count == 0)
> +
> + if (domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE) {
> + if (--domain->iommu_count == 0)
> + vm_domain_exit(domain);
> + } else
> domain_exit(domain);
> +
Again, these new functions are copies of existing code with minor
modifications. I'd much rather see the existing code refactored and then
modified to handle the DOMAIN_FLAG_VIRTUAL_MACHINE case.
Cheers,
Mark.
next prev parent reply other threads:[~2008-12-04 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 14:22 [PATCH 08/13] allocation and free functions of virtual machine domain Han, Weidong
2008-12-04 17:13 ` Mark McLoughlin [this message]
2008-12-04 23:17 ` Joerg Roedel
2008-12-05 9:20 ` Mark McLoughlin
2008-12-05 9:33 ` Han, Weidong
2008-12-05 16:48 ` Avi Kivity
2008-12-05 19:22 ` 'Joerg Roedel'
2008-12-06 2:14 ` Han, Weidong
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=1228410780.3732.143.camel@blaa \
--to=markmc@redhat.com \
--cc=avi@redhat.com \
--cc=david.woodhouse@intel.com \
--cc=fenghua.yu@intel.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jbarnes@virtuousgeek.org \
--cc=kvm@vger.kernel.org \
--cc=weidong.han@intel.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