public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: amd: Use page mode macros in fetch_pte
@ 2023-04-20  8:07 Jerry Snitselaar
  2023-04-21  6:27 ` Vasant Hegde
  2023-05-22 15:18 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Jerry Snitselaar @ 2023-04-20  8:07 UTC (permalink / raw)
  To: iommu
  Cc: linux-kernel, Robin Murphy, Will Deacon, Suravee Suthikulpanit,
	Joerg Roedel

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

Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: amd: Use page mode macros in fetch_pte
  2023-04-20  8:07 [PATCH] iommu: amd: Use page mode macros in fetch_pte Jerry Snitselaar
@ 2023-04-21  6:27 ` Vasant Hegde
  2023-05-22 15:18 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Vasant Hegde @ 2023-04-21  6:27 UTC (permalink / raw)
  To: Jerry Snitselaar, iommu
  Cc: linux-kernel, Robin Murphy, Will Deacon, Suravee Suthikulpanit,
	Joerg Roedel

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 <robin.murphy@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>

Thanks for the fix.

Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>

-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 */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: amd: Use page mode macros in fetch_pte
  2023-04-20  8:07 [PATCH] iommu: amd: Use page mode macros in fetch_pte Jerry Snitselaar
  2023-04-21  6:27 ` Vasant Hegde
@ 2023-05-22 15:18 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2023-05-22 15:18 UTC (permalink / raw)
  To: Jerry Snitselaar
  Cc: iommu, linux-kernel, Robin Murphy, Will Deacon,
	Suravee Suthikulpanit

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-22 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20  8:07 [PATCH] iommu: amd: Use page mode macros in fetch_pte Jerry Snitselaar
2023-04-21  6:27 ` Vasant Hegde
2023-05-22 15:18 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox