public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: "Kay, Allen M" <allen.m.kay@intel.com>
Cc: kvm@vger.kernel.org, Amit Shah <amit.shah@qumranet.com>,
	Muli Ben-Yehuda <MULI@il.ibm.com>,
	Ben-Ami Yassour <benami@il.ibm.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Chris Wright <chrisw@redhat.com>,
	"Han, Weidong" <weidong.han@intel.com>
Subject: Re: [PATCH 2/4][VTD] modifications to intel-iommu.c.
Date: Fri, 20 Jun 2008 21:13:03 +0300	[thread overview]
Message-ID: <485BF32F.7010007@qumranet.com> (raw)
In-Reply-To: <1FE6DD409037234FAB833C420AA843EC018831CF@orsmsx424.amr.corp.intel.com>

Kay, Allen M wrote:
> Modification to intel-iommu.c to support vt-d page table and context
> table mapping in kvm.  Mods to dmar.c and iova.c are due to header file
> moves to include/linux.
>   

> diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
> index f941f60..a58a5b0 100644
> --- a/drivers/pci/dmar.c
> +++ b/drivers/pci/dmar.c
> @@ -26,8 +26,8 @@
>  
>  #include <linux/pci.h>
>  #include <linux/dmar.h>
> -#include "iova.h"
> -#include "intel-iommu.h"
> +#include <linux/iova.h>
> +#include <linux/intel-iommu.h>

This should have been done in the file movement patch to avoid breaking 
the build. 

>
>  
> +void kvm_intel_iommu_domain_exit(struct dmar_domain *domain)

This should be a generic API, not a kvm specific one.

> +{
> +    u64 end;
> +
> +    /* Domain 0 is reserved, so dont process it */
> +    if (!domain)
> +        return;

'domain' here is a pointer, not an identifier.

>
> +int kvm_intel_iommu_context_mapping(
> +    struct dmar_domain *domain, struct pci_dev *pdev)
> +{
> +    int rc;
> +    rc = domain_context_mapping(domain, pdev);
> +    return rc;
> +}
> +EXPORT_SYMBOL_GPL(kvm_intel_iommu_context_mapping);

What does the return value mean?

> +
> +int kvm_intel_iommu_page_mapping(
> +    struct dmar_domain *domain, dma_addr_t iova,
> +    u64 hpa, size_t size, int prot)
> +{
> +    int rc;
> +    rc = domain_page_mapping(domain, iova, hpa, size, prot);
> +    return rc;
> +}
> +EXPORT_SYMBOL_GPL(kvm_intel_iommu_page_mapping);

The function name makes it sound like it's retrieving information.  If 
it does something, put a verb in there.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


  parent reply	other threads:[~2008-06-20 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10  0:41 [PATCH 2/4][VTD] modifications to intel-iommu.c Kay, Allen M
2008-06-10 10:14 ` Muli Ben-Yehuda
2008-06-20 18:13 ` Avi Kivity [this message]
2008-06-21  4:42   ` 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=485BF32F.7010007@qumranet.com \
    --to=avi@qumranet.com \
    --cc=MULI@il.ibm.com \
    --cc=allen.m.kay@intel.com \
    --cc=amit.shah@qumranet.com \
    --cc=anthony@codemonkey.ws \
    --cc=benami@il.ibm.com \
    --cc=chrisw@redhat.com \
    --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