Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp433621rwr; Thu, 20 Apr 2023 01:14:15 -0700 (PDT) X-Google-Smtp-Source: AKy350azt9DsjHZwAFAeL5Xly46Qh0GooBhqAi7DO8H6pc9WxVPECCcCwvUoY+vgwFzzvR/5Z/V4 X-Received: by 2002:a05:6a00:ac3:b0:63d:2382:4948 with SMTP id c3-20020a056a000ac300b0063d23824948mr480929pfl.25.1681978454990; Thu, 20 Apr 2023 01:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681978454; cv=none; d=google.com; s=arc-20160816; b=wG9NAekcvmD0SHGQhzVKWmndVxJ4sGRdx/Qtq/5sep33v9GDn4nf2SbP2MwE3wMHMf prt8/XpU6cuKcqROIKEkfX+iLKXJh57elN1U+fL+eiUB34pF89uJppGHCVApNcbRQrlT R+rSxYl3ERq/oTylIki1jEi7fCZDAukEOkPgjyvcxH6MyDNtjB3DW/LfCMLjbMhoP2Gp 7aB460yoQFAQJg1M/qzWu/eDHnF+MNuvzWhDbXXiBodCys2v40o/iD7luQt4ZRQrNzU5 K293QE+zRVigasUA5nBPJTsag4DMVi/+QKnI8BCPUL4ouHC5382LQhDN6YLtEgWShzcW ziSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oiFbyJM/OVQzht3NVRAuOeDRCZOh3MADqrY1DUOhLSk=; b=WN0OxZw4tapyjFnkPUNF9leyjBLinelMk6jL8hZXiodi47i9tLtwto5so7u8Nw4xMU +UEi3O9bU5RMsgHfU5rNU+0z6HcQBM06AkMcIPg+TGdflq74lyG9qYNCsQLnhqsvfqxJ Df8FRtaF1HKCksiWpaXkM53ZRCdiGt1tJ+jF2nT/ygpCt6mRhmqGiVwNb8yWR2KlIXkx FNhWI0x6Z04+3hX8Fmei+6EgpQkIHSTS+xHWqT/oIHz0TxfpQfdFuU5sM/DPZHBnn7qP rpfGNWBtFz/kX2XKYSJZkc6upp47rtzpCHqPfdo90YXUslWQYjsthFQ1pm8ZCO8KntTi VZ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W44CJRy1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k23-20020a6568d7000000b00503a029385asi914253pgt.849.2023.04.20.01.14.01; Thu, 20 Apr 2023 01:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W44CJRy1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234081AbjDTIIS (ORCPT + 99 others); Thu, 20 Apr 2023 04:08:18 -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: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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