RE: [PATCH 3/4 v5] iommu/fsl: Add iommu domain attributes required by fsl PAMU driver.

2012-12-02 Thread Sethi Varun-B16395
Ping!!

 -Original Message-
 From: Sethi Varun-B16395
 Sent: Monday, November 26, 2012 10:55 AM
 To: joerg.roe...@amd.com
 Cc: Sethi Varun-B16395; iommu@lists.linux-foundation.org; linuxppc-
 d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Wood Scott-B07421;
 Tabi Timur-B04825
 Subject: RE: [PATCH 3/4 v5] iommu/fsl: Add iommu domain attributes
 required by fsl PAMU driver.
 
 Hi Joerg,
 Any comments? Can we apply this patch?
 
 Regards
 Varun
 
  -Original Message-
  From: Sethi Varun-B16395
  Sent: Tuesday, November 20, 2012 7:25 PM
  To: joerg.roe...@amd.com; iommu@lists.linux-foundation.org; linuxppc-
  d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Wood Scott-B07421;
  Tabi Timur-B04825
  Cc: Sethi Varun-B16395
  Subject: [PATCH 3/4 v5] iommu/fsl: Add iommu domain attributes
  required by fsl PAMU driver.
 
  Added the following domain attributes required by FSL PAMU driver:
  1. Subwindows field added to the iommu domain geometry attribute.
  2. Added new iommu stash attribute, which allows setting of the
 LIODN specific stash id parameter through IOMMU API.
  3. Added an attribute for enabling/disabling DMA to a particular
 memory window.
 
  Signed-off-by: Varun Sethi varun.se...@freescale.com
  ---
  changes in v5:
  - Updated description of the subwindows field.
  changes in v4:
  - Updated comment explaining subwindows(as mentioned by Scott).
  change in v3:
  -renamed the stash attribute targets
   include/linux/iommu.h |   43
 +++
   1 files changed, 43 insertions(+), 0 deletions(-)
 
  diff --git a/include/linux/iommu.h b/include/linux/iommu.h index
  f3b99e1..7ca1cda 100644
  --- a/include/linux/iommu.h
  +++ b/include/linux/iommu.h
  @@ -44,6 +44,41 @@ struct iommu_domain_geometry {
  dma_addr_t aperture_start; /* First address that can be mapped */
  dma_addr_t aperture_end;   /* Last address that can be mapped
  */
  bool force_aperture;   /* DMA only allowed in mappable range?
  */
  +
  +   /*
  +* A geometry mapping can be created in one of the following ways
  +* for an IOMMU:
  +* 1. A single contiguous window
  +* 2. Through arbritary paging throughout the aperture.
  +* 3. Using multiple subwindows
  +*
  +* In absence of arbritary paging, subwindows allow for supporting
  +* physically discontiguous mappings.
  +*
  +* This attribute indicates number of DMA subwindows supported by
  +* the geometry. If there is a single window that maps the entire
  +* geometry, attribute must be set to 1. A value of 0 implies
  +* that this mechanism is not used at all(normal paging is used).
  +* Value other than* 0 or 1 indicates the actual number of
  +* subwindows.
  +*/
  +   u32 subwindows;
  +};
  +
  +/* cache stash targets */
  +#define IOMMU_ATTR_CACHE_L1 1
  +#define IOMMU_ATTR_CACHE_L2 2
  +#define IOMMU_ATTR_CACHE_L3 3
  +
  +/* This attribute corresponds to IOMMUs capable of generating
  + * a stash transaction. A stash transaction is typically a
  + * hardware initiated prefetch of data from memory to cache.
  + * This attribute allows configuring stashig specific parameters
  + * in the IOMMU hardware.
  + */
  +struct iommu_stash_attribute {
  +   u32 cpu;/* cpu number */
  +   u32 cache;  /* cache to stash to: L1,L2,L3 */
   };
 
   struct iommu_domain {
  @@ -60,6 +95,14 @@ struct iommu_domain {  enum iommu_attr {
  DOMAIN_ATTR_MAX,
  DOMAIN_ATTR_GEOMETRY,
  +   /* Set the IOMMU hardware stashing
  +* parameters.
  +*/
  +   DOMAIN_ATTR_STASH,
  +   /* Explicity enable/disable DMA for a
  + * particular memory window.
  + */
  +   DOMAIN_ATTR_ENABLE,
   };
 
   #ifdef CONFIG_IOMMU_API
  --
  1.7.4.1


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


Re: Supermicro X9SRL-F - channel enumeration error ACPI/firmware bug question

2012-12-02 Thread Joerg Roedel
On Thu, Nov 29, 2012 at 08:38:53PM -0700, Bjorn Helgaas wrote:
 That's essentially the patch at
 https://bugzilla.redhat.com/show_bug.cgi?id=757166#c16, which in my
 opinion is too ugly to consider.  But fortunately, I'm not the
 maintainer for any IOMMU drivers.

There is a quirk infrastructure for those kinds of broken devices in
drivers/pci/quirks.c. Have a look into the function
pci_get_dma_source(). This function is used by the IOMMU drivers to
create the correct mappings.


Joerg


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


Re: [PATCH 3/4 v5] iommu/fsl: Add iommu domain attributes required by fsl PAMU driver.

2012-12-02 Thread Tabi Timur-B04825
Joerg Roedel wrote:
 When you add implementation specific attributes please add some
 indication to the names that it is only for PAMU. DOMAIN_ATTR_STASH
 sounds too generic.

We were thinking that maybe this attribute could be useful to other IOMMUs 
in the future.  Stashing is not a concept that would only work on 
Freescale processors.

But we'll change it if you insist.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


RE: [PATCH 1/1] iommuv2/amd: Enable Performance Counters On Family 15h Models 10h-1Fh

2012-12-02 Thread Kinney, Steven
Hi Joerg,

  I didn't want to expose the internals of the IOMMU, so I 
decided to export the function(s) so that the perf IOMMUv2 PMU can make call(s) 
into the IOMMU core to request PC resources.  The perf_event_amd_iommuv2.h 
defines the prototype for the added PC functionality.  I have the perf IOMMUv2 
PMU working and counting IOMMUv2 PC events using this interface, but if  you 
have a suggestion to make this implementation more robust, I will accommodate 
the suggestion.  Also, if it would be helpful, I can submit the perf IOMMUv2 
PMU patches.  

BTW, I am resubmitting this patch since I caught a function signature error; 
was changing the code based on Boris's suggestion(s) and forgot to add the 
variable type (bool) concerning the 'is_write' parameter.

Hope all is well with you and the team; we miss you guys!

Regards,

Steve

-Original Message-
From: Joerg Roedel [mailto:j...@8bytes.org] 
Sent: Sunday, December 02, 2012 7:30 AM
To: Kinney, Steven
Cc: Joerg Roedel; Kukjin Kim; Stephen Warren; Jiri Kosina; 
linux-ker...@vger.kernel.org; iommu@lists.linux-foundation.org
Subject: Re: [PATCH 1/1] iommuv2/amd: Enable Performance Counters On Family 15h 
Models 10h-1Fh

On Mon, Nov 26, 2012 at 04:00:25PM -0600, Steven Kinney wrote:
 From: Steven L. Kinney steven.kin...@amd.com
 
 Add Kernel configuration selection for AMD IOMMUv2 performance 
 counters.

How can the counters be used?


Joerg




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