lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Apr 2023 01:07:18 -0700
From:   Jerry Snitselaar <jsnitsel@...hat.com>
To:     iommu@...ts.linux.dev
Cc:     linux-kernel@...r.kernel.org, Robin Murphy <robin.murphy@....com>,
        Will Deacon <will@...nel.org>,
        Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
        Joerg Roedel <joro@...tes.org>
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 <robin.murphy@....com>
Cc: Will Deacon <will@...nel.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: Joerg Roedel <joro@...tes.org>
Signed-off-by: Jerry Snitselaar <jsnitsel@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ