WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2/3] iommu: exports set_entry

To: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/3] iommu: exports set_entry
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Thu, 18 Nov 2010 11:54:14 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
Delivery-date: Thu, 18 Nov 2010 03:55:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20101115180015.GC10475@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20101115180015.GC10475@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
At 18:00 +0000 on 15 Nov (1289844015), Jean Guyader wrote:
> diff -r 93ae9939b4a5 xen/drivers/passthrough/iommu.c
> --- a/xen/drivers/passthrough/iommu.c Mon Nov 15 11:52:14 2010 +0000
> +++ b/xen/drivers/passthrough/iommu.c Mon Nov 15 11:53:59 2010 +0000
> @@ -418,6 +418,23 @@
>          ops->suspend();
>  }
>  
> +int iommu_set_entry(struct domain *d, unsigned long gfn, unsigned long mfn,
> +                    unsigned int flags, int map)
> +{
> +    const struct iommu_ops *ops = iommu_get_ops();
> +    if ( iommu_enabled )
> +        return ops->set_entry(d, gfn, mfn, flags, map);

Needs a check that set_entry() isn't NULL or it'll crash on AMD IOMMUs.

> +    return -1;
> +}
> +
> +int iommu_flush_iotlb(struct domain *d, unsigned long gfn, unsigned int nr)
> +{
> +    const struct iommu_ops *ops = iommu_get_ops();
> +    if ( iommu_enabled )
> +        return ops->flush_iotlb(d, gfn, nr);

Likewise.

> +    return -1;
> +}
> +
>  /*
>   * Local variables:
>   * mode: C
> diff -r 93ae9939b4a5 xen/drivers/passthrough/vtd/iommu.c
> --- a/xen/drivers/passthrough/vtd/iommu.c     Mon Nov 15 11:52:14 2010 +0000
> +++ b/xen/drivers/passthrough/vtd/iommu.c     Mon Nov 15 11:53:59 2010 +0000
> @@ -2197,6 +2197,8 @@
>      .read_msi_from_ire = msi_msg_read_remap_rte,
>      .suspend = vtd_suspend,
>      .resume = vtd_resume,
> +    .set_entry = intel_iommu_set_entry,
> +    .flush_iotlb = intel_iommu_flush_iotlb
>  };
>  
>  /*
> diff -r 93ae9939b4a5 xen/include/xen/iommu.h
> --- a/xen/include/xen/iommu.h Mon Nov 15 11:52:14 2010 +0000
> +++ b/xen/include/xen/iommu.h Mon Nov 15 11:53:59 2010 +0000
> @@ -84,6 +84,10 @@
>                     unsigned int flags);
>  int iommu_unmap_page(struct domain *d, unsigned long gfn);
>  
> +int iommu_set_entry(struct domain *d, unsigned long gfn, unsigned long mfn,
> +                    unsigned int flags, int map);
> +int iommu_flush_iotlb(struct domain *d, unsigned long gfn, unsigned int nr);
> +
>  void iommu_domain_teardown(struct domain *d);
>  int hvm_do_IRQ_dpci(struct domain *d, unsigned int irq);
>  int dpci_ioport_intercept(ioreq_t *p);
> @@ -130,6 +134,9 @@
>      unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
>      void (*suspend)(void);
>      void (*resume)(void);
> +    int (*set_entry)(struct domain *d, unsigned long gfn, unsigned long mfn,
> +                     unsigned int flags, int map);
> +    int (*flush_iotlb)(struct domain *d, unsigned long gfn, unsigned int nr);
>  };
>  
>  void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, 
> unsigned int value);

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel


-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>