Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp886428pxb; Thu, 21 Oct 2021 11:20:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiWu4Y/iuLM30AcUCPqgnD78Pt9THsJAKuTDeHDTcOu8BzgWFo+Pp7NA3eDhdLz04DHXcK X-Received: by 2002:a17:906:5689:: with SMTP id am9mr9167716ejc.416.1634840430399; Thu, 21 Oct 2021 11:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634840430; cv=none; d=google.com; s=arc-20160816; b=B4OJiuZvUZVHIQyZ3QfmgsobxXnf6TXarbYgFMWxu0cQAfj6AeGxsGAA6c1fZX5C2P xAK4Nc9t4V5ITfPaRsROp8Q2BepmBnA0ALZHIaZkvBBUPIRfpL1+jhITy1Jh9Pqy1Vud 98wZ2B81Fkery4Up1XCmwBWrEkq0jJmIfycNx73sTXSURrgxgd+lyIJbfDlGehFqnpBZ sFm3qydfhPRX1RVAHqgqcAUVYL4C97O0WPawMCN3kGJ17kcZxdufUQnwK7ZhUeie7hLw jMN290gTitSrR/biGBDlERJbto1gw/DmZ6R1QKWpF1aMM/iF+hufmmSKp/zJqLeKYvoz 948w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=byW0cAs8iy2e27PK42qgf3z3jJva1xfEnS1FNzLpmq4=; b=UcISlIAogUxLyBjmAOOpC5TGVXSu3F+xG0FmV9rmCLLbgVWwYFrbxi4uQKwxtJY/Gf mRF5IWxKkjr8hydC+N5ADhyYtGZ/gPnmhVAtKsxDjbPQozKFeI+4lX5PJNQhJX+YUfMj SQXZOJcmTKTh5B0yYcNZKq2S4w7ds4UmGKxZ5Kkl28gkDapBTw3DhlGum/PgN5ReO+un LOUqs7GmibDJXMPZm59IIQ/SCZerzvetMT7r5SyDayU3jP8Z8ak3JdxZQBbkN5T6bIrh K659bMgRli2nTCDZel2vSWo/GNB3d7sIwkdyZOv95NgZvnvF7n3w93GZrKvToVft2HEk 9gyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq16si10010600ejc.29.2021.10.21.11.20.04; Thu, 21 Oct 2021 11:20:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231664AbhJUSRn (ORCPT + 99 others); Thu, 21 Oct 2021 14:17:43 -0400 Received: from mga14.intel.com ([192.55.52.115]:33021 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbhJUSRj (ORCPT ); Thu, 21 Oct 2021 14:17:39 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="229377372" X-IronPort-AV: E=Sophos;i="5.87,170,1631602800"; d="scan'208";a="229377372" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 11:15:20 -0700 X-IronPort-AV: E=Sophos;i="5.87,170,1631602800"; d="scan'208";a="527582109" 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 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: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 idx, * 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 /* * Early memremap routines used for in-place encryption. The mappings created diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_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) -#define __PAGE_KERNEL_IO __PAGE_KERNEL -#define __PAGE_KERNEL_IO_NOCACHE __PAGE_KERNEL_NOCACHE - - #ifndef __ASSEMBLY__ #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 | _ENC) #define PAGE_KERNEL_VVAR __pgprot_mask(__PAGE_KERNEL_VVAR | _ENC) -#define PAGE_KERNEL_IO __pgprot_mask(__PAGE_KERNEL_IO) -#define PAGE_KERNEL_IO_NOCACHE __pgprot_mask(__PAGE_KERNEL_IO_NOCACHE) - #endif /* __ASSEMBLY__ */ /* 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 long size, * make sure the memory encryption attribute is enabled in the * resulting mapping. */ - prot = PAGE_KERNEL_IO; + prot = PAGE_KERNEL; if ((io_desc.flags & IORES_MAP_ENCRYPTED) || encrypted) prot = pgprot_encrypted(prot); 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 = start_pfn; pfn <= 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); 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 long 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) -- 2.33.1