From: Jason Gunthorpe <jgg@ziepe.ca>
To: Vasant Hegde <vasant.hegde@amd.com>
Cc: iommu@lists.linux.dev, joro@8bytes.org,
suravee.suthikulpanit@amd.com, wei.huang2@amd.com,
jsnitsel@redhat.com
Subject: Re: [PATCH v2 06/10] iommu/amd: Refactor helper function for setting / clearing GCR3
Date: Tue, 10 Oct 2023 11:38:29 -0300 [thread overview]
Message-ID: <20231010143829.GA55194@ziepe.ca> (raw)
In-Reply-To: <497df4d9-2203-ad36-a5d1-97570b327a49@amd.com>
On Tue, Oct 10, 2023 at 11:32:53AM +0530, Vasant Hegde wrote:
> __amd_iommu_flush_tlb() flushes both domain ID and all devices within the domain
> for the given PASID. So it works fine. All these functions are reworked as part
> of invalidation series. Hence this function is not relevant anymore.
But the replacement has the same issue:
static int domain_flush_tlb_range(struct protection_domain *pdom,
ioasid_t pasid, u64 address, size_t size)
{
struct iommu_cmd cmd;
int i, ret = 0;
bool gn = is_pasid_valid(pasid);
build_inv_iommu_pages(&cmd, address, size, pdom->id, pasid, gn);
^^^^^^^^^^^^^^^
(btw I have no issue/comments with the invalidate series, it just
doesn't go far enough to correctly support the iommu core's PASID ops)
> > Nothing guarantees that domain->id is per-device. It is emphatically
> > not, it is per-domain. It happens to act like it is per-device when
> > using the DMA API, as DMA API does not share domains across
> > groups. However iommufd does share domains and so this is not a
> > correct assumption.
>
> That's exactly why I have been saying for SVA I don't need
> per-device-domain ID. Current code works fine. Anyway, I will add
> this support in v3.
The threshold for upstream is more than "works fine" in some limited
testing.
It needs to correctly implement the driver op APIs we have defined in
the core code. In this regard it does not "work fine", you can see it
by code inspection that it is not producing a correct cache tag in the
IOTLB for domains attached via op->set_dev_pasid()
So, lets see v3.
Jason
next prev parent reply other threads:[~2023-10-10 14:38 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 17:40 [PATCH v2 00/10] iommu/amd: SVA Support (part 3) - refactor support for GCR3 table Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 01/10] iommu/amd: Use struct protection_domain in helper functions Vasant Hegde
2023-08-23 16:42 ` Jason Gunthorpe
2023-08-24 6:12 ` Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 02/10] iommu/amd: Introduce get_amd_iommu_from_dev() Vasant Hegde
2023-09-13 14:42 ` Jason Gunthorpe
2023-09-14 8:21 ` Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 03/10] iommu/amd: Introduce struct protection_domain.pd_mode Vasant Hegde
2023-09-13 14:42 ` Jason Gunthorpe
2023-08-16 17:40 ` [PATCH v2 04/10] iommu/amd: Introduce per-device GCR3 table Vasant Hegde
2023-09-13 14:43 ` Jason Gunthorpe
2023-09-14 8:24 ` Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 05/10] iommu/amd: Use protection_domain.flags to check page table mode Vasant Hegde
2023-09-13 14:43 ` Jason Gunthorpe
2023-08-16 17:40 ` [PATCH v2 06/10] iommu/amd: Refactor helper function for setting / clearing GCR3 Vasant Hegde
2023-09-13 15:12 ` Jason Gunthorpe
2023-09-27 6:21 ` Vasant Hegde
2023-09-27 16:45 ` Jason Gunthorpe
2023-10-10 6:02 ` Vasant Hegde
2023-10-10 14:38 ` Jason Gunthorpe [this message]
2023-10-13 15:45 ` Vasant Hegde
2023-10-13 16:01 ` Jason Gunthorpe
2023-08-16 17:40 ` [PATCH v2 07/10] iommu/amd: Refactor helper function for attaching / detaching device Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 08/10] iommu/amd: Refactor protection_domain helper functions Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 09/10] iommu/amd: Refactor GCR3 table " Vasant Hegde
2023-08-16 17:40 ` [PATCH v2 10/10] iommu/amd: Remove unused GCR3 table parameters from struct protection_domain 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=20231010143829.GA55194@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=jsnitsel@redhat.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=vasant.hegde@amd.com \
--cc=wei.huang2@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.