From nobody Wed Dec 17 11:45:49 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B29AEC77B73 for ; Thu, 20 Apr 2023 08:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234199AbjDTIIT (ORCPT ); Thu, 20 Apr 2023 04:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234328AbjDTIIQ (ORCPT ); Thu, 20 Apr 2023 04:08:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D25011A for ; Thu, 20 Apr 2023 01:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681978049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oiFbyJM/OVQzht3NVRAuOeDRCZOh3MADqrY1DUOhLSk=; b=W44CJRy1XCEmXAOJfq1j1i8m5ot2mGt1/2t049S0Ole+PcZSGboZCJuxwb2GlCXXMFv63r VDYWN4Kpvf9W3bXUOJrvR3NTCF9eE/evJ8DPK5/SLV8lXGBRNdRstU8eWoiGots2GWHAsc T1tAdKarT5V7HKV1cCBJLXaqi5xpAGI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-180-oMS7FFhqMkiBaKPbv7BaSg-1; Thu, 20 Apr 2023 04:07:25 -0400 X-MC-Unique: oMS7FFhqMkiBaKPbv7BaSg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B9BB329AB405; Thu, 20 Apr 2023 08:07:24 +0000 (UTC) Received: from cantor.redhat.com (unknown [10.2.16.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA9DD1121315; Thu, 20 Apr 2023 08:07:23 +0000 (UTC) From: Jerry Snitselaar To: iommu@lists.linux.dev Cc: linux-kernel@vger.kernel.org, Robin Murphy , Will Deacon , Suravee Suthikulpanit , Joerg Roedel Subject: [PATCH] iommu: amd: Use page mode macros in fetch_pte Date: Thu, 20 Apr 2023 01:07:18 -0700 Message-Id: <20230420080718.523132-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use the page mode macros instead of magic numbers in fetch_pte. Cc: Robin Murphy Cc: Will Deacon Cc: Suravee Suthikulpanit Cc: Joerg Roedel Signed-off-by: Jerry Snitselaar Reviewed-by: Vasant Hegde --- 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; =20 /* Large PTE */ - if (PM_PTE_LEVEL(*pte) =3D=3D 7 || - PM_PTE_LEVEL(*pte) =3D=3D 0) + if (PM_PTE_LEVEL(*pte) =3D=3D PAGE_MODE_7_LEVEL || + PM_PTE_LEVEL(*pte) =3D=3D PAGE_MODE_NONE) break; =20 /* No level skipping support yet */ --=20 2.38.1