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 v3 03/12] iommu/amd: Introduce per device DTE update function
Date: Mon, 6 Nov 2023 13:54:56 -0400 [thread overview]
Message-ID: <20231106175456.GS4634@ziepe.ca> (raw)
In-Reply-To: <20231016104351.5749-4-vasant.hegde@amd.com>
On Mon, Oct 16, 2023 at 10:43:42AM +0000, Vasant Hegde wrote:
> @@ -1679,6 +1680,24 @@ static void domain_flush_np_cache(struct protection_domain *domain,
> }
>
>
> +/* Update and flush DTE for the given device */
> +void amd_iommu_dev_update_dte(struct iommu_dev_data *dev_data, bool set)
> +{
> + struct amd_iommu *iommu = get_amd_iommu_from_dev(dev_data->dev);
> +
> + if (!iommu)
> + return;
Can't be null
> + if (set)
> + set_dte_entry(iommu, dev_data);
> + else
> + clear_dte_entry(iommu, dev_data->devid);
> +
> + clone_aliases(iommu, dev_data->dev);
> +
> + device_flush_dte(dev_data);
This should take in iommu too..
> +}
Makes sense though
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
My other note was to basically do this:
void amd_iommu_dev_update_dte(struct iommu_dev_data *dev_data, const struct amd_dte *dte)
Where the caller functions would generate the DTE content instead of
having ste_dte_entry try to reverse engineer which caller is calling
it.
Jason
next prev parent reply other threads:[~2023-11-06 17:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 10:43 [PATCH v3 00/12] iommu/amd: SVA Support (Part 4) - SVA and IOPF Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 01/12] iommu/amd: Rename amd_iommu_v2_supported() as amd_iommu_pasid_supported() Vasant Hegde
2023-11-06 17:50 ` Jason Gunthorpe
2023-10-16 10:43 ` [PATCH v3 02/12] iommu/amd: Do not override PASID entry in GCR3 table Vasant Hegde
2023-11-06 17:51 ` Jason Gunthorpe
2023-11-07 6:26 ` Vasant Hegde
2023-11-07 13:34 ` Jason Gunthorpe
2023-10-16 10:43 ` [PATCH v3 03/12] iommu/amd: Introduce per device DTE update function Vasant Hegde
2023-11-06 17:54 ` Jason Gunthorpe [this message]
2023-11-07 6:47 ` Vasant Hegde
2023-11-07 13:36 ` Jason Gunthorpe
2023-10-16 10:43 ` [PATCH v3 04/12] iommu/amd: Add support for enabling/disabling IOMMU features Vasant Hegde
2023-11-06 17:55 ` Jason Gunthorpe
2023-10-16 10:43 ` [PATCH v3 05/12] iommu/amd: Initial SVA support for AMD IOMMU Vasant Hegde
2023-11-06 23:18 ` Jason Gunthorpe
2023-12-20 11:00 ` Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 06/12] iommu/amd: Add support to enable/disable PASID feature Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 07/12] iommu/amd: Move PPR-related functions into ppr.c Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 08/12] iommu/amd: Define per-IOMMU iopf_queue Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 09/12] iommu/amd: Add support for page response Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 10/12] iommu/amd: Add support for add/remove device for IOPF Vasant Hegde
2023-10-16 10:43 ` [PATCH v3 11/12] iommu/amd: Add IO page fault notifier handler Vasant Hegde
2023-11-06 23:20 ` Jason Gunthorpe
2023-11-07 6:42 ` Vasant Hegde
2023-11-07 13:35 ` Jason Gunthorpe
2023-10-16 10:43 ` [PATCH v3 12/12] iommu/amd: Introduce logic to enable/disable IOPF 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=20231106175456.GS4634@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.