From nobody Mon May 6 00:38:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1634875826373742.2043596425796; Thu, 21 Oct 2021 21:10:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.214570.373365 (Exim 4.92) (envelope-from ) id 1mdlse-0006cW-Oq; Fri, 22 Oct 2021 04:10:08 +0000 Received: by outflank-mailman (output) from mailman id 214570.373365; Fri, 22 Oct 2021 04:10:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mdlse-0006bg-Il; Fri, 22 Oct 2021 04:10:08 +0000 Received: by outflank-mailman (input) for mailman id 214570; Thu, 21 Oct 2021 18:15:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mdcbF-00047r-Kp for xen-devel@lists.xenproject.org; Thu, 21 Oct 2021 18:15:33 +0000 Received: from mga01.intel.com (unknown [192.55.52.88]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ded26fba-329a-11ec-8389-12813bfff9fa; Thu, 21 Oct 2021 18:15:28 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 11:15:19 -0700 Received: from lucas-s2600cw.jf.intel.com ([10.165.21.202]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 11:15:19 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ded26fba-329a-11ec-8389-12813bfff9fa X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="252606742" X-IronPort-AV: E=Sophos;i="5.87,170,1631602800"; d="scan'208";a="252606742" X-IronPort-AV: E=Sophos;i="5.87,170,1631602800"; d="scan'208";a="527582106" From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , Boris Ostrovsky , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org, Daniel Vetter Subject: [PATCH 1/2] drm/i915/gem: stop using PAGE_KERNEL_IO Date: Thu, 21 Oct 2021 11:15:10 -0700 Message-Id: <20211021181511.1533377-2-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211021181511.1533377-1-lucas.demarchi@intel.com> References: <20211021181511.1533377-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1634875827437100002 Content-Type: text/plain; charset="utf-8" PAGE_KERNEL_IO is only defined for x86 and nowadays is the same as PAGE_KERNEL. It was different for some time, OR'ing a `_PAGE_IOMAP` flag in commit be43d72835ba ("x86: add _PAGE_IOMAP pte flag for IO mappings"). This got removed in commit f955371ca9d3 ("x86: remove the Xen-specific _PAGE_IOMAP PTE flag"), so today they are just the same. This is the same that was done in commit ac96b5566926 ("io-mapping.h: s/PAGE_KERNEL_IO/PAGE_KERNEL/"). There is a subsequent commit with 'Fixes: ac96b5566926 ("io-mapping.h: s/PAGE_KERNEL_IO/PAGE_KERNEL/")' - but that is not relevant here since is it's actually fixing the different names for pgprot_writecombine(), which we also don't have today since all archs expose pgprot_writecombine(). Microblaze, mentioned in that discussion, gained pgprot_writecombine() in commit 97ccedd793ac ("microblaze: Provide pgprot_device/writecombine macros for nommu"). So, just use PAGE_KERNEL, and just use pgprot_writecombine(). Signed-off-by: Lucas De Marchi Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211020090625.1037517-= 1-lucas.demarchi@intel.com Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) --- drivers/gpu/drm/i915/gem/i915_gem_pages.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i9= 15/gem/i915_gem_pages.c index 8eb1c3a6fc9c..68fe1837ef54 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c @@ -289,7 +289,7 @@ static void *i915_gem_object_map_page(struct drm_i915_g= em_object *obj, pgprot =3D PAGE_KERNEL; break; case I915_MAP_WC: - pgprot =3D pgprot_writecombine(PAGE_KERNEL_IO); + pgprot =3D pgprot_writecombine(PAGE_KERNEL); break; } =20 @@ -333,7 +333,7 @@ static void *i915_gem_object_map_pfn(struct drm_i915_ge= m_object *obj, i =3D 0; for_each_sgt_daddr(addr, iter, obj->mm.pages) pfns[i++] =3D (iomap + addr) >> PAGE_SHIFT; - vaddr =3D vmap_pfn(pfns, n_pfn, pgprot_writecombine(PAGE_KERNEL_IO)); + vaddr =3D vmap_pfn(pfns, n_pfn, pgprot_writecombine(PAGE_KERNEL)); if (pfns !=3D stack) kvfree(pfns); =20 --=20 2.33.1 From nobody Mon May 6 00:38:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16348758259811022.0629097401016; Thu, 21 Oct 2021 21:10:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.214572.373370 (Exim 4.92) (envelope-from ) id 1mdlsf-0006iy-2Z; Fri, 22 Oct 2021 04:10:09 +0000 Received: by outflank-mailman (output) from mailman id 214572.373370; Fri, 22 Oct 2021 04:10:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mdlse-0006fO-Qv; Fri, 22 Oct 2021 04:10:08 +0000 Received: by outflank-mailman (input) for mailman id 214572; Thu, 21 Oct 2021 18:15:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mdcbK-00047r-L5 for xen-devel@lists.xenproject.org; Thu, 21 Oct 2021 18:15:38 +0000 Received: from mga01.intel.com (unknown [192.55.52.88]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id deddc37e-329a-11ec-8389-12813bfff9fa; Thu, 21 Oct 2021 18:15:29 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 11:15:19 -0700 Received: from lucas-s2600cw.jf.intel.com ([10.165.21.202]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 11:15:19 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: deddc37e-329a-11ec-8389-12813bfff9fa X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="252606745" X-IronPort-AV: E=Sophos;i="5.87,170,1631602800"; d="scan'208";a="252606745" X-IronPort-AV: E=Sophos;i="5.87,170,1631602800"; d="scan'208";a="527582109" From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Peter Zijlstra , Boris Ostrovsky , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org, Daniel Vetter Subject: [PATCH 2/2] x86/mm: nuke PAGE_KERNEL_IO Date: Thu, 21 Oct 2021 11:15:11 -0700 Message-Id: <20211021181511.1533377-3-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211021181511.1533377-1-lucas.demarchi@intel.com> References: <20211021181511.1533377-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1634875827439100003 Content-Type: text/plain; charset="utf-8" PAGE_KERNEL_IO is only defined for x86 and nowadays is the same as PAGE_KERNEL. It was different for some time, OR'ing a `_PAGE_IOMAP` flag in commit be43d72835ba ("x86: add _PAGE_IOMAP pte flag for IO mappings"). This got removed in commit f955371ca9d3 ("x86: remove the Xen-specific _PAGE_IOMAP PTE flag"), so today they are just the same. With the last users outside arch/x86 being remove we can now remove PAGE_KERNEL_IO. Signed-off-by: Lucas De Marchi Acked-by: Andy Lutomirski Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/fixmap.h | 2 +- arch/x86/include/asm/pgtable_types.h | 7 ------- arch/x86/mm/ioremap.c | 2 +- arch/x86/xen/setup.c | 2 +- include/asm-generic/fixmap.h | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index d0dcefb5cc59..5e186a69db10 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@ -173,7 +173,7 @@ static inline void __set_fixmap(enum fixed_addresses id= x, * supported for MMIO addresses, so make sure that the memory encryption * mask is not part of the page attributes. */ -#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_IO_NOCACHE +#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE =20 /* * Early memremap routines used for in-place encryption. The mappings crea= ted diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pg= table_types.h index 40497a9020c6..a87224767ff3 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -199,10 +199,6 @@ enum page_cache_mode { #define __PAGE_KERNEL_WP (__PP|__RW| 0|___A|__NX|___D| 0|___G| __WP) =20 =20 -#define __PAGE_KERNEL_IO __PAGE_KERNEL -#define __PAGE_KERNEL_IO_NOCACHE __PAGE_KERNEL_NOCACHE - - #ifndef __ASSEMBLY__ =20 #define __PAGE_KERNEL_ENC (__PAGE_KERNEL | _ENC) @@ -223,9 +219,6 @@ enum page_cache_mode { #define PAGE_KERNEL_LARGE_EXEC __pgprot_mask(__PAGE_KERNEL_LARGE_EXEC | _E= NC) #define PAGE_KERNEL_VVAR __pgprot_mask(__PAGE_KERNEL_VVAR | _ENC) =20 -#define PAGE_KERNEL_IO __pgprot_mask(__PAGE_KERNEL_IO) -#define PAGE_KERNEL_IO_NOCACHE __pgprot_mask(__PAGE_KERNEL_IO_NOCACHE) - #endif /* __ASSEMBLY__ */ =20 /* xwr */ diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 026031b3b782..3102dda4b152 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -243,7 +243,7 @@ __ioremap_caller(resource_size_t phys_addr, unsigned lo= ng size, * make sure the memory encryption attribute is enabled in the * resulting mapping. */ - prot =3D PAGE_KERNEL_IO; + prot =3D PAGE_KERNEL; if ((io_desc.flags & IORES_MAP_ENCRYPTED) || encrypted) prot =3D pgprot_encrypted(prot); =20 diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 8bfc10330107..5dc0771a50f3 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -435,7 +435,7 @@ static unsigned long __init xen_set_identity_and_remap_= chunk( for (pfn =3D start_pfn; pfn <=3D max_pfn_mapped && pfn < end_pfn; pfn++) (void)HYPERVISOR_update_va_mapping( (unsigned long)__va(pfn << PAGE_SHIFT), - mfn_pte(pfn, PAGE_KERNEL_IO), 0); + mfn_pte(pfn, PAGE_KERNEL), 0); =20 return remap_pfn; } diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h index 8cc7b09c1bc7..f1b0c6f3d0be 100644 --- a/include/asm-generic/fixmap.h +++ b/include/asm-generic/fixmap.h @@ -54,7 +54,7 @@ static inline unsigned long virt_to_fix(const unsigned lo= ng vaddr) #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE #endif #ifndef FIXMAP_PAGE_IO -#define FIXMAP_PAGE_IO PAGE_KERNEL_IO +#define FIXMAP_PAGE_IO PAGE_KERNEL #endif #ifndef FIXMAP_PAGE_CLEAR #define FIXMAP_PAGE_CLEAR __pgprot(0) --=20 2.33.1