[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f87e897e-028f-43a7-9557-e65778267fc8@amd.com>
Date: Tue, 7 Jan 2025 17:45:38 +0530
From: Vasant Hegde <vasant.hegde@....com>
To: Alejandro Jimenez <alejandro.j.jimenez@...cle.com>,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Cc: joro@...tes.org, suravee.suthikulpanit@....com, will@...nel.org,
jgg@...dia.com, joao.m.martins@...cle.com, boris.ostrovsky@...cle.com
Subject: Re: [PATCH 1/1] iommu/amd: Preserve default DTE fields when updating
Host Page Table Root
Hi Alejandro, Suravee,
On 1/7/2025 12:44 AM, Alejandro Jimenez wrote:
> When updating the page table root field on the DTE, avoid overwriting any
> bits that are already set. The earlier call to make_clear_dte() writes
> default values that all DTEs must have set (currently DTE[V]), and those
> must be preserved.
>
> Currently this doesn't cause problems since the page table root update is
> the first field that is set after make_clear_dte() is called, and
> DTE_FLAG_V is set again later along with the permission bits (IR/IW).
> Remove this redundant assignment too.
Good catch!
> > Fixes: fd5dff9de4be ("iommu/amd: Modify set_dte_entry() to use 256-bit DTE
helpers")
> Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@...cle.com>
> ---
> drivers/iommu/amd/iommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index 20177e18eb0d..a8c17b602c95 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -2052,12 +2052,12 @@ static void set_dte_entry(struct amd_iommu *iommu,
> make_clear_dte(dev_data, dte, &new);
This fix is fine. But with all changes we have done in this code does, do we
really need make_clear_dte()?
How about removing `make_clear_dte()` and moving DTE_FLAG_V to
write_dte_lower128() ?
-Vasant
Powered by blists - more mailing lists