2023-04-20 08:14:15

by Jerry Snitselaar

[permalink] [raw]
Subject: [PATCH] iommu: amd: Use page mode macros in fetch_pte

Use the page mode macros instead of magic numbers in fetch_pte.

Cc: Robin Murphy <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Suravee Suthikulpanit <[email protected]>
Cc: Joerg Roedel <[email protected]>
Signed-off-by: Jerry Snitselaar <[email protected]>
---
drivers/iommu/amd/io_pgtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/amd/io_pgtable.c b/drivers/iommu/amd/io_pgtable.c
index ace0e9b8b913..61a99d715b23 100644
--- a/drivers/iommu/amd/io_pgtable.c
+++ b/drivers/iommu/amd/io_pgtable.c
@@ -310,8 +310,8 @@ static u64 *fetch_pte(struct amd_io_pgtable *pgtable,
return NULL;

/* Large PTE */
- if (PM_PTE_LEVEL(*pte) == 7 ||
- PM_PTE_LEVEL(*pte) == 0)
+ if (PM_PTE_LEVEL(*pte) == PAGE_MODE_7_LEVEL ||
+ PM_PTE_LEVEL(*pte) == PAGE_MODE_NONE)
break;

/* No level skipping support yet */
--
2.38.1


2023-04-21 06:55:17

by Vasant Hegde

[permalink] [raw]
Subject: Re: [PATCH] iommu: amd: Use page mode macros in fetch_pte

On 4/20/2023 1:37 PM, Jerry Snitselaar wrote:
> Use the page mode macros instead of magic numbers in fetch_pte.
>
> Cc: Robin Murphy <[email protected]>
> Cc: Will Deacon <[email protected]>
> Cc: Suravee Suthikulpanit <[email protected]>
> Cc: Joerg Roedel <[email protected]>
> Signed-off-by: Jerry Snitselaar <[email protected]>

Thanks for the fix.

Reviewed-by: Vasant Hegde <[email protected]>

-Vasant



> ---
> drivers/iommu/amd/io_pgtable.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/amd/io_pgtable.c b/drivers/iommu/amd/io_pgtable.c
> index ace0e9b8b913..61a99d715b23 100644
> --- a/drivers/iommu/amd/io_pgtable.c
> +++ b/drivers/iommu/amd/io_pgtable.c
> @@ -310,8 +310,8 @@ static u64 *fetch_pte(struct amd_io_pgtable *pgtable,
> return NULL;
>
> /* Large PTE */
> - if (PM_PTE_LEVEL(*pte) == 7 ||
> - PM_PTE_LEVEL(*pte) == 0)
> + if (PM_PTE_LEVEL(*pte) == PAGE_MODE_7_LEVEL ||
> + PM_PTE_LEVEL(*pte) == PAGE_MODE_NONE)
> break;
>
> /* No level skipping support yet */

2023-05-22 15:34:34

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH] iommu: amd: Use page mode macros in fetch_pte

On Thu, Apr 20, 2023 at 01:07:18AM -0700, Jerry Snitselaar wrote:
> drivers/iommu/amd/io_pgtable.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.