Commit 7a87225a authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton
Browse files

x86: remove PG_uncached

Convert x86 to use PG_arch_2 instead of PG_uncached and remove
PG_uncached.

Link: https://lkml.kernel.org/r/20240821193445.2294269-11-willy@infradead.org


Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 02e1960a
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
#
# Feature name:          PG_uncached
#         Kconfig:       ARCH_USES_PG_UNCACHED
#         description:   arch supports the PG_uncached page flag
#
    -----------------------
    |         arch |status|
    -----------------------
    |       alpha: | TODO |
    |         arc: | TODO |
    |         arm: | TODO |
    |       arm64: | TODO |
    |        csky: | TODO |
    |     hexagon: | TODO |
    |   loongarch: | TODO |
    |        m68k: | TODO |
    |  microblaze: | TODO |
    |        mips: | TODO |
    |       nios2: | TODO |
    |    openrisc: | TODO |
    |      parisc: | TODO |
    |     powerpc: | TODO |
    |       riscv: | TODO |
    |        s390: | TODO |
    |          sh: | TODO |
    |       sparc: | TODO |
    |          um: | TODO |
    |         x86: |  ok  |
    |      xtensa: | TODO |
    -----------------------
+2 −1
Original line number Diff line number Diff line
@@ -2100,7 +2100,8 @@ config ARM64_MTE
	depends on ARM64_PAN
	select ARCH_HAS_SUBPAGE_FAULTS
	select ARCH_USES_HIGH_VMA_FLAGS
	select ARCH_USES_PG_ARCH_X
	select ARCH_USES_PG_ARCH_2
	select ARCH_USES_PG_ARCH_3
	help
	  Memory Tagging (part of the ARMv8.5 Extensions) provides
	  architectural support for run-time, always-on detection of
+1 −4
Original line number Diff line number Diff line
@@ -1799,6 +1799,7 @@ config X86_PAT
	def_bool y
	prompt "x86 PAT support" if EXPERT
	depends on MTRR
	select ARCH_USES_PG_ARCH_2
	help
	  Use PAT attributes to setup page level cache control.

@@ -1810,10 +1811,6 @@ config X86_PAT

	  If unsure, say Y.

config ARCH_USES_PG_UNCACHED
	def_bool y
	depends on X86_PAT

config X86_UMIP
	def_bool y
	prompt "User Mode Instruction Prevention" if EXPERT
+4 −4
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ __setup("debugpat", pat_debug_setup);

#ifdef CONFIG_X86_PAT
/*
 * X86 PAT uses page flags arch_1 and uncached together to keep track of
 * X86 PAT uses page flags arch_1 and arch_2 together to keep track of
 * memory type of pages that have backing page struct.
 *
 * X86 PAT supports 4 different memory types:
@@ -118,9 +118,9 @@ __setup("debugpat", pat_debug_setup);

#define _PGMT_WB		0
#define _PGMT_WC		(1UL << PG_arch_1)
#define _PGMT_UC_MINUS		(1UL << PG_uncached)
#define _PGMT_WT		(1UL << PG_uncached | 1UL << PG_arch_1)
#define _PGMT_MASK		(1UL << PG_uncached | 1UL << PG_arch_1)
#define _PGMT_UC_MINUS		(1UL << PG_arch_2)
#define _PGMT_WT		(1UL << PG_arch_2 | 1UL << PG_arch_1)
#define _PGMT_MASK		(1UL << PG_arch_2 | 1UL << PG_arch_1)
#define _PGMT_CLEAR_MASK	(~_PGMT_MASK)

static inline enum page_cache_mode get_page_memtype(struct page *pg)
+3 −5
Original line number Diff line number Diff line
@@ -206,18 +206,16 @@ u64 stable_page_flags(const struct page *page)
		u |= kpf_copy_bit(page->flags, KPF_HWPOISON,	PG_hwpoison);
#endif

#ifdef CONFIG_ARCH_USES_PG_UNCACHED
	u |= kpf_copy_bit(k, KPF_UNCACHED,	PG_uncached);
#endif

	u |= kpf_copy_bit(k, KPF_RESERVED,	PG_reserved);
	u |= kpf_copy_bit(k, KPF_OWNER_2,	PG_owner_2);
	u |= kpf_copy_bit(k, KPF_PRIVATE,	PG_private);
	u |= kpf_copy_bit(k, KPF_PRIVATE_2,	PG_private_2);
	u |= kpf_copy_bit(k, KPF_OWNER_PRIVATE,	PG_owner_priv_1);
	u |= kpf_copy_bit(k, KPF_ARCH,		PG_arch_1);
#ifdef CONFIG_ARCH_USES_PG_ARCH_X
#ifdef CONFIG_ARCH_USES_PG_ARCH_2
	u |= kpf_copy_bit(k, KPF_ARCH_2,	PG_arch_2);
#endif
#ifdef CONFIG_ARCH_USES_PG_ARCH_3
	u |= kpf_copy_bit(k, KPF_ARCH_3,	PG_arch_3);
#endif

Loading