Linux IOMMU Development
 help / color / mirror / Atom feed
From: Vasant Hegde <vasant.hegde@amd.com>
To: Robin Murphy <robin.murphy@arm.com>,
	joro@8bytes.org, iommu@lists.linux.dev
Cc: suravee.suthikulpanit@amd.com
Subject: Re: [PATCH v2 3/6] iommu/amd: Initial support for AMD IOMMU v2 page table
Date: Thu, 21 Jul 2022 16:22:46 +0530	[thread overview]
Message-ID: <e19166d6-d6f7-87da-bd93-1ec6119e0e1c@amd.com> (raw)
In-Reply-To: <3d30d93b-ec12-46b3-576b-c3ac8ebb799f@arm.com>

Hi Robin,


On 7/15/2022 5:25 PM, Robin Murphy wrote:
> On 2022-07-13 06:30, Vasant Hegde wrote:
> [...]
>> +static struct io_pgtable *v2_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
>> +{
>> +    struct amd_io_pgtable *pgtable = io_pgtable_cfg_to_data(cfg);
>> +    struct protection_domain *pdom = (struct protection_domain *)cookie;
>> +    int ret;
>> +
>> +    pgtable->pgd = alloc_pgtable_page();
>> +    if (!pgtable->pgd)
>> +        return NULL;
>> +
>> +    ret = amd_iommu_domain_set_gcr3(&pdom->domain, 0, iommu_virt_to_phys(pgtable->pgd));
>> +    if (ret)
>> +        goto err_free_pgd;
>> +
>> +    pgtable->iop.ops.map          = iommu_v2_map_page;
>> +    pgtable->iop.ops.unmap        = iommu_v2_unmap_page;
> 
> It would be good to use this opportunity to convert AMD over to map_pages/unmap_pages - not only for the future goal of removing map/unmap (it's not worth maintaining two interfaces where one is a trivial subset of the other), but also since it should be appreciably more efficient for you in practice, especially for v2 with the more limited set of basic page sizes.
> 

Makes sense. I will work on this and post v3 soon.

Thanks
-Vasant


  reply	other threads:[~2022-07-21 10:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  5:30 [PATCH v2 0/6] iommu/amd: Add Generic IO Page Table Framework Support for v2 Page Table Vasant Hegde
2022-07-13  5:30 ` [PATCH v2 1/6] iommu/amd: Refactor amd_iommu_domain_enable_v2 to remove locking Vasant Hegde
2022-07-13  5:30 ` [PATCH v2 2/6] iommu/amd: Update sanity check when enable PRI/ATS for IOMMU v1 table Vasant Hegde
2022-07-13  5:30 ` [PATCH v2 3/6] iommu/amd: Initial support for AMD IOMMU v2 page table Vasant Hegde
2022-07-15 11:55   ` Robin Murphy
2022-07-21 10:52     ` Vasant Hegde [this message]
2022-07-13  5:30 ` [PATCH v2 4/6] iommu/amd: Add support for Guest IO protection Vasant Hegde
2022-07-13  5:30 ` [PATCH v2 5/6] iommu/amd: Add support for using AMD IOMMU v2 page table for DMA-API Vasant Hegde
2022-07-13  5:30 ` [PATCH v2 6/6] iommu/amd: Add command-line option to enable different page table Vasant Hegde
2022-07-15  8:49 ` [PATCH v2 0/6] iommu/amd: Add Generic IO Page Table Framework Support for v2 Page Table Joerg Roedel
2022-07-21 10:48   ` Vasant Hegde

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=e19166d6-d6f7-87da-bd93-1ec6119e0e1c@amd.com \
    --to=vasant.hegde@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.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