lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Aug 2018 09:09:38 +0800
From:   Kenneth Lee <liguozhu@...ilicon.com>
To:     Joerg Roedel <joro@...tes.org>
CC:     Kenneth Lee <nek.in.cn@...il.com>,
        Jonathan Corbet <corbet@....net>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        Alex Williamson <alex.williamson@...hat.com>,
        Hao Fang <fanghao11@...wei.com>,
        Zhou Wang <wangzhou1@...ilicon.com>,
        Zaibo Xu <xuzaibo@...wei.com>,
        Philippe Ombredanne <pombredanne@...b.com>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        <linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-crypto@...r.kernel.org>, <iommu@...ts.linux-foundation.org>,
        <kvm@...r.kernel.org>, <linux-accelerators@...ts.ozlabs.org>,
        Lu Baolu <baolu.lu@...ux.intel.com>,
        Sanjay Kumar <sanjay.k.kumar@...el.com>, <linuxarm@...wei.com>
Subject: Re: [RFC PATCH 2/7] iommu: Add share domain interface in iommu for
 spimdev

On Wed, Aug 08, 2018 at 11:13:54AM +0200, Joerg Roedel wrote:
> Date: Wed, 8 Aug 2018 11:13:54 +0200
> From: Joerg Roedel <joro@...tes.org>
> To: Kenneth Lee <nek.in.cn@...il.com>
> CC: Jonathan Corbet <corbet@....net>, Herbert Xu
>  <herbert@...dor.apana.org.au>, "David S . Miller" <davem@...emloft.net>,
>  Alex Williamson <alex.williamson@...hat.com>, Kenneth Lee
>  <liguozhu@...ilicon.com>, Hao Fang <fanghao11@...wei.com>, Zhou Wang
>  <wangzhou1@...ilicon.com>, Zaibo Xu <xuzaibo@...wei.com>, Philippe
>  Ombredanne <pombredanne@...b.com>, Greg Kroah-Hartman
>  <gregkh@...uxfoundation.org>, Thomas Gleixner <tglx@...utronix.de>,
>  linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
>  linux-crypto@...r.kernel.org, iommu@...ts.linux-foundation.org,
>  kvm@...r.kernel.org, linux-accelerators@...ts.ozlabs.org, Lu Baolu
>  <baolu.lu@...ux.intel.com>, Sanjay Kumar <sanjay.k.kumar@...el.com>,
>  linuxarm@...wei.com
> Subject: Re: [RFC PATCH 2/7] iommu: Add share domain interface in iommu for
>  spimdev
> User-Agent: NeoMutt/20170421 (1.8.2)
> Message-ID: <20180808091354.ppqgineql3pufwwr@...tes.org>
> 
> On Wed, Aug 01, 2018 at 06:22:16PM +0800, Kenneth Lee wrote:
> > From: Kenneth Lee <liguozhu@...ilicon.com>
> > 
> > This patch add sharing interface for a iommu_group. The new interface:
> > 
> > 	iommu_group_share_domain()
> > 	iommu_group_unshare_domain()
> > 
> > can be used by some virtual iommu_group (such as iommu_group for spimdev)
> > to share their parent's iommu_group.
> > 
> > When the domain of the group is shared, it cannot be changed before
> > unshared.  In the future, notification can be added if update is required.
> 
> >From the description or the patch I don't really get why this is needed.
> Please update the description and make a case for this API addition.
> 

Yes, I will add more description in next version.

The idea here is:

1. iommu_domain is the setting of the IOMMU(the unit) of an iommu_group.

2. The iommu_group originally uses a default domain or a created one (e.g. by vfio)
   as its effective domain. There is only one user for a domain. If a device is
   bound to vfio driver, it uses the new created domain. And if it is unbound from
   vfio driver, it is switched back to the default domain.

3. But for spimdev, we create an mdev which share it parent device's IOMMU. That
   means, the parent device (along with its iommu group) will continue use its
   iommu_domain, and the mdev will use the same at the same time.

4. This API, is to tell the iommu_group that the domain is shared by the
   spimdev. And it should be changed before it is unshared.

Cheers

> 
> 	Joerg

-- 
			-Kenneth(Hisilicon)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ