From aa36314c2d08c47fe835e60c6cf72bf5d0ed4d68 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:19:37 +0800 Subject: [PATCH 01/16] um: Remove unused MODULES_LEN macro It's not used anywhere. And its definition doesn't seem right. Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128081939.2216246-2-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/include/asm/pgtable.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 0bd60afcc37d..80338fca160d 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -52,7 +52,6 @@ extern unsigned long end_iomem; #define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) #define MODULES_VADDR VMALLOC_START #define MODULES_END VMALLOC_END -#define MODULES_LEN (MODULES_VADDR - MODULES_END) #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) From 5bfc4a3a0af3dcf53516e5f0dd9a2649bcd05bad Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:19:38 +0800 Subject: [PATCH 02/16] um: Remove obsolete fixmap support It was added to support highmem. But since the highmem support has been removed by commit a98a6d864d3b ("um: Remove broken highmem support"), it is no longer needed. Remove it to simplify the code. Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128081939.2216246-3-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/include/asm/fixmap.h | 56 ----------------------------------- arch/um/include/asm/pgtable.h | 5 +--- arch/um/kernel/mem.c | 15 +++------- 3 files changed, 5 insertions(+), 71 deletions(-) delete mode 100644 arch/um/include/asm/fixmap.h diff --git a/arch/um/include/asm/fixmap.h b/arch/um/include/asm/fixmap.h deleted file mode 100644 index 2efac5827188..000000000000 --- a/arch/um/include/asm/fixmap.h +++ /dev/null @@ -1,56 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __UM_FIXMAP_H -#define __UM_FIXMAP_H - -#include -#include -#include -#include - -/* - * Here we define all the compile-time 'special' virtual - * addresses. The point is to have a constant address at - * compile time, but to set the physical address only - * in the boot process. We allocate these special addresses - * from the end of virtual memory (0xfffff000) backwards. - * Also this lets us do fail-safe vmalloc(), we - * can guarantee that these special addresses and - * vmalloc()-ed addresses never overlap. - * - * these 'compile-time allocated' memory buffers are - * fixed-size 4k pages. (or larger if used with an increment - * highger than 1) use fixmap_set(idx,phys) to associate - * physical memory with fixmap indices. - * - * TLB entries of such buffers will not be flushed across - * task switches. - */ - -/* - * on UP currently we will have no trace of the fixmap mechanizm, - * no page table allocations, etc. This might change in the - * future, say framebuffers for the console driver(s) could be - * fix-mapped? - */ -enum fixed_addresses { - __end_of_fixed_addresses -}; - -extern void __set_fixmap (enum fixed_addresses idx, - unsigned long phys, pgprot_t flags); - -/* - * used by vmalloc.c. - * - * Leave one empty page between vmalloc'ed areas and - * the start of the fixmap, and leave one page empty - * at the top of mem.. - */ - -#define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE) -#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) -#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) - -#include - -#endif diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 80338fca160d..9be6daca95be 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -8,8 +8,6 @@ #ifndef __UM_PGTABLE_H #define __UM_PGTABLE_H -#include - #define _PAGE_PRESENT 0x001 #define _PAGE_NEEDSYNC 0x002 #define _PAGE_RW 0x020 @@ -48,8 +46,7 @@ extern unsigned long end_iomem; #define VMALLOC_OFFSET (__va_space) #define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define PKMAP_BASE ((FIXADDR_START - LAST_PKMAP * PAGE_SIZE) & PMD_MASK) -#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) +#define VMALLOC_END (TASK_SIZE-2*PAGE_SIZE) #define MODULES_VADDR VMALLOC_START #define MODULES_END VMALLOC_END diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 53248ed04771..8a0e74ad00d1 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -74,6 +73,7 @@ void __init mem_init(void) kmalloc_ok = 1; } +#if IS_ENABLED(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) /* * Create a page table and place a pointer to it in a middle page * directory entry. @@ -152,7 +152,6 @@ static void __init fixrange_init(unsigned long start, unsigned long end, static void __init fixaddr_user_init( void) { -#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA long size = FIXADDR_USER_END - FIXADDR_USER_START; pte_t *pte; phys_t p; @@ -174,13 +173,12 @@ static void __init fixaddr_user_init( void) pte = virt_to_kpte(vaddr); pte_set_val(*pte, p, PAGE_READONLY); } -#endif } +#endif void __init paging_init(void) { unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 }; - unsigned long vaddr; empty_zero_page = (unsigned long *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); @@ -191,14 +189,9 @@ void __init paging_init(void) max_zone_pfn[ZONE_NORMAL] = end_iomem >> PAGE_SHIFT; free_area_init(max_zone_pfn); - /* - * Fixed mappings, only the page table structure has to be - * created - mappings will be set by set_fixmap(): - */ - vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; - fixrange_init(vaddr, FIXADDR_TOP, swapper_pg_dir); - +#if IS_ENABLED(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) fixaddr_user_init(); +#endif } /* From 06e0e6295957592cfceaa21124a49b55c98470c9 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:19:39 +0800 Subject: [PATCH 03/16] um: Count iomem_size only once in physmem calculation When calculating max_physmem, we've already factored in the space used by iomem. We don't need to subtract it again. Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128081939.2216246-4-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/kernel/um_arch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 8037a967225d..c82e26baefc4 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -376,9 +376,8 @@ int __init linux_main(int argc, char **argv, char **envp) iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC; - - if (physmem_size + iomem_size > max_physmem) { - physmem_size = max_physmem - iomem_size; + if (physmem_size > max_physmem) { + physmem_size = max_physmem; os_info("Physical memory size shrunk to %llu bytes\n", physmem_size); } From 70240b5d1f5be2a9d37e43e6dc355d07681d2bbc Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:29 +0800 Subject: [PATCH 04/16] um: Mark parse_host_cpu_flags as __init It's only invoked during boot from get_host_cpu_features(). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-2-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/kernel/um_arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index c82e26baefc4..d1d438016a14 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -264,7 +264,7 @@ EXPORT_SYMBOL(end_iomem); #define MIN_VMALLOC (32 * 1024 * 1024) -static void parse_host_cpu_flags(char *line) +static void __init parse_host_cpu_flags(char *line) { int i; for (i = 0; i < 32*NCAPINTS; i++) { From bcd89fd8f5f6caf440a52aa3822316f12bc0732d Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:30 +0800 Subject: [PATCH 05/16] um: Mark parse_cache_line as __init It's only invoked during boot from get_host_cpu_features(). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-3-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/kernel/um_arch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index d1d438016a14..c48cef206828 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -272,7 +272,8 @@ static void __init parse_host_cpu_flags(char *line) set_cpu_cap(&boot_cpu_data, i); } } -static void parse_cache_line(char *line) + +static void __init parse_cache_line(char *line) { long res; char *to_parse = strstr(line, ":"); From ae62ae7994a0f453b1566d04ec090cf1bd534675 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:31 +0800 Subject: [PATCH 06/16] um: Mark get_top_address as __init It's only invoked during boot from linux_main(). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-4-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/kernel/um_arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index c48cef206828..79ea97d4797e 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -289,7 +289,7 @@ static void __init parse_cache_line(char *line) } } -static unsigned long get_top_address(char **envp) +static unsigned long __init get_top_address(char **envp) { unsigned long top_addr = (unsigned long) &top_addr; int i; From f0c76bc82d4544bde874497e830b2c9fa04bafe1 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:32 +0800 Subject: [PATCH 07/16] um: Mark set_stklim as __init It's only invoked during boot from main(). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-5-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/os-Linux/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 0afcdeb8995b..cf9697aa17f3 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -25,7 +25,7 @@ long elf_aux_hwcap; -static void set_stklim(void) +static void __init set_stklim(void) { struct rlimit lim; From c2fdfd779717bf1d4bb569c7cb64502143144cad Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:33 +0800 Subject: [PATCH 08/16] um: Mark install_fatal_handler as __init It's only invoked during boot from main(). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-6-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/os-Linux/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index cf9697aa17f3..3f394f25e059 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -48,7 +48,7 @@ static void last_ditch_exit(int sig) exit(1); } -static void install_fatal_handler(int sig) +static void __init install_fatal_handler(int sig) { struct sigaction action; From 0c5258efd69b73bd12f3e68cfe72e1396fdb857c Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:34 +0800 Subject: [PATCH 09/16] um: Mark setup_env_path as __init It's only invoked during boot from main(). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-7-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/os-Linux/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 3f394f25e059..3f0be24b3633 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -73,7 +73,7 @@ static void __init install_fatal_handler(int sig) #define UML_LIB_PATH ":" OS_LIB_PATH "/uml" -static void setup_env_path(void) +static void __init setup_env_path(void) { char *new_path = NULL; char *old_path = NULL; From 3c68810e150b80b9282e854142922b39489a54a5 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:35 +0800 Subject: [PATCH 10/16] um: Remove unused PGD_BOUND macro It's no longer used since commit 11100b1dfb6e ("uml: delete unused code"). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-8-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/os-Linux/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 3f0be24b3633..13f3bfeb6378 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -19,7 +19,6 @@ #include #include "internal.h" -#define PGD_BOUND (4 * 1024 * 1024) #define STACKSIZE (8 * 1024 * 1024) #define THREAD_NAME_LEN (256) From c5e78b8d408add9d3562c7c44a727336ecb5d48b Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:36 +0800 Subject: [PATCH 11/16] um: Remove unused THREAD_NAME_LEN macro It's no longer used since commit 42fda66387da ("uml: throw out CONFIG_MODE_TT"). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-9-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/os-Linux/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 13f3bfeb6378..3c63ce19e3bf 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -20,7 +20,6 @@ #include "internal.h" #define STACKSIZE (8 * 1024 * 1024) -#define THREAD_NAME_LEN (256) long elf_aux_hwcap; From 7ee1e43a5f493a1332af3ac668cc2a87515c1622 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 28 Nov 2024 16:31:37 +0800 Subject: [PATCH 12/16] um: Remove unused user_context function It's no longer used since commit 6aa802ce6acc ("uml: throw out CHOOSE_MODE"). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20241128083137.2219830-10-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/kernel/process.c | 8 -------- arch/x86/um/shared/sysdep/ptrace.h | 2 -- 2 files changed, 10 deletions(-) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 30bdc0a87dc8..e5a2d4d897e0 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -213,14 +213,6 @@ int __uml_cant_sleep(void) { /* Is in_interrupt() really needed? */ } -int user_context(unsigned long sp) -{ - unsigned long stack; - - stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER); - return stack != (unsigned long) current_thread_info(); -} - extern exitcall_t __uml_exitcall_begin, __uml_exitcall_end; void do_uml_exitcalls(void) diff --git a/arch/x86/um/shared/sysdep/ptrace.h b/arch/x86/um/shared/sysdep/ptrace.h index 2dd4ca6713f8..8f7476ff6e95 100644 --- a/arch/x86/um/shared/sysdep/ptrace.h +++ b/arch/x86/um/shared/sysdep/ptrace.h @@ -74,8 +74,6 @@ struct uml_pt_regs { #define UPT_FAULTINFO(r) (&(r)->faultinfo) #define UPT_IS_USER(r) ((r)->is_user) -extern int user_context(unsigned long sp); - extern int arch_init_registers(int pid); #endif /* __SYSDEP_X86_PTRACE_H */ From 579e7fd383ff3f7a4f685489f8fe18cfd8659074 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 17 Dec 2024 21:49:06 +0100 Subject: [PATCH 13/16] um: rtc: use RTC time when calculating the alarm The kernel realtime and the current RTC time may have a (small) offset. Should the kernel time be slightly in the future, then the timeout is zero. This is problematic in time-travel mode, as a zero timeout can be correctly configured and time never advances. Replace the kernel realtime read with a read of the actual persistent RTC clock. Also, for time-travel, calculate the exact nanoseconds needed for the clock to advance. Signed-off-by: Benjamin Berg Co-developed-by: Avraham Stern Link: https://patch.msgid.link/20241217204906.1408011-1-benjamin@sipsolutions.net Signed-off-by: Johannes Berg --- arch/um/drivers/rtc_kern.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/rtc_kern.c b/arch/um/drivers/rtc_kern.c index 134a58f93c85..9158c936c128 100644 --- a/arch/um/drivers/rtc_kern.c +++ b/arch/um/drivers/rtc_kern.c @@ -51,6 +51,7 @@ static int uml_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int uml_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) { + struct timespec64 ts; unsigned long long secs; if (!enable && !uml_rtc_alarm_enabled) @@ -58,7 +59,8 @@ static int uml_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) uml_rtc_alarm_enabled = enable; - secs = uml_rtc_alarm_time - ktime_get_real_seconds(); + read_persistent_clock64(&ts); + secs = uml_rtc_alarm_time - ts.tv_sec; if (time_travel_mode == TT_MODE_OFF) { if (!enable) { @@ -73,7 +75,8 @@ static int uml_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) if (enable) time_travel_add_event_rel(¨_rtc_alarm_event, - secs * NSEC_PER_SEC); + secs * NSEC_PER_SEC - + ts.tv_nsec); } return 0; From af10dd16655339a48178221fc4b73fbf171dd739 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Fri, 20 Dec 2024 05:14:58 +0000 Subject: [PATCH 14/16] hostfs: Convert to writepages If we add a migrate_folio operation, we can convert the writepage operation to writepages. The large folio support here is illusory; we would need to kmap each page in turn for proper support. But we do remove a few hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Link: https://patch.msgid.link/20241220051500.1919389-1-willy@infradead.org Signed-off-by: Johannes Berg --- fs/hostfs/hostfs_kern.c | 48 +++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 7e51d2cec64b..844c45253452 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -410,38 +410,33 @@ static const struct file_operations hostfs_dir_fops = { .fsync = hostfs_fsync, }; -static int hostfs_writepage(struct page *page, struct writeback_control *wbc) +static int hostfs_writepages(struct address_space *mapping, + struct writeback_control *wbc) { - struct address_space *mapping = page->mapping; struct inode *inode = mapping->host; - char *buffer; - loff_t base = page_offset(page); - int count = PAGE_SIZE; - int end_index = inode->i_size >> PAGE_SHIFT; - int err; + struct folio *folio = NULL; + loff_t i_size = i_size_read(inode); + int err = 0; - if (page->index >= end_index) - count = inode->i_size & (PAGE_SIZE-1); + while ((folio = writeback_iter(mapping, wbc, folio, &err))) { + loff_t pos = folio_pos(folio); + size_t count = folio_size(folio); + char *buffer; + int ret; - buffer = kmap_local_page(page); + if (count > i_size - pos) + count = i_size - pos; - err = write_file(HOSTFS_I(inode)->fd, &base, buffer, count); - if (err != count) { - if (err >= 0) - err = -EIO; - mapping_set_error(mapping, err); - goto out; + buffer = kmap_local_folio(folio, 0); + ret = write_file(HOSTFS_I(inode)->fd, &pos, buffer, count); + kunmap_local(buffer); + folio_unlock(folio); + if (ret != count) { + err = ret < 0 ? ret : -EIO; + mapping_set_error(mapping, err); + } } - if (base > inode->i_size) - inode->i_size = base; - - err = 0; - - out: - kunmap_local(buffer); - unlock_page(page); - return err; } @@ -506,11 +501,12 @@ static int hostfs_write_end(struct file *file, struct address_space *mapping, } static const struct address_space_operations hostfs_aops = { - .writepage = hostfs_writepage, + .writepages = hostfs_writepages, .read_folio = hostfs_read_folio, .dirty_folio = filemap_dirty_folio, .write_begin = hostfs_write_begin, .write_end = hostfs_write_end, + .migrate_folio = filemap_migrate_folio, }; static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st) From 3e9807aa6481304c5e992c4451976ab02c58f5ec Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Mon, 13 Jan 2025 23:32:17 +0800 Subject: [PATCH 15/16] um: Include missing headers in asm/pgtable.h Formerly, asm/pgtable.h relied on the implicit inclusion of asm/page.h and linux/mm_types.h via asm/fixmap.h. With the removal of asm/fixmap.h, these headers need to be included explicitly in asm/pgtable.h now. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202501131814.E6CxjulL-lkp@intel.com/ Fixes: 5bfc4a3a0af3 ("um: Remove obsolete fixmap support") Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20250113153218.3331321-2-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/um/include/asm/pgtable.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 9be6daca95be..5601ca98e8a6 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -8,6 +8,9 @@ #ifndef __UM_PGTABLE_H #define __UM_PGTABLE_H +#include +#include + #define _PAGE_PRESENT 0x001 #define _PAGE_NEEDSYNC 0x002 #define _PAGE_RW 0x020 From 2d2b61ae38bd91217ea7cc5bc700a2b9e75b3937 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Mon, 13 Jan 2025 23:32:18 +0800 Subject: [PATCH 16/16] um: Remove unused asm/archparam.h header This header is no longer used after the removal of fixmap support in commit 5bfc4a3a0af3 ("um: Remove obsolete fixmap support"). Signed-off-by: Tiwei Bie Link: https://patch.msgid.link/20250113153218.3331321-3-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg --- arch/x86/um/asm/archparam.h | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 arch/x86/um/asm/archparam.h diff --git a/arch/x86/um/asm/archparam.h b/arch/x86/um/asm/archparam.h deleted file mode 100644 index c17cf68dda0f..000000000000 --- a/arch/x86/um/asm/archparam.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) - * Copyright 2003 PathScale, Inc. - * Licensed under the GPL - */ - -#ifndef __UM_ARCHPARAM_H -#define __UM_ARCHPARAM_H - -#ifdef CONFIG_X86_32 - -#ifdef CONFIG_X86_PAE -#define LAST_PKMAP 512 -#else -#define LAST_PKMAP 1024 -#endif - -#endif - -#endif