Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'uml-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux

Pull UML updates from Richard Weinberger:

- hostfs: Convert to writepages

- many cleanups: removal of dead macros, missing __init

* tag 'uml-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux:
um: Remove unused asm/archparam.h header
um: Include missing headers in asm/pgtable.h
hostfs: Convert to writepages
um: rtc: use RTC time when calculating the alarm
um: Remove unused user_context function
um: Remove unused THREAD_NAME_LEN macro
um: Remove unused PGD_BOUND macro
um: Mark setup_env_path as __init
um: Mark install_fatal_handler as __init
um: Mark set_stklim as __init
um: Mark get_top_address as __init
um: Mark parse_cache_line as __init
um: Mark parse_host_cpu_flags as __init
um: Count iomem_size only once in physmem calculation
um: Remove obsolete fixmap support
um: Remove unused MODULES_LEN macro

+43 -140
+5 -2
arch/um/drivers/rtc_kern.c
··· 51 51 52 52 static int uml_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) 53 53 { 54 + struct timespec64 ts; 54 55 unsigned long long secs; 55 56 56 57 if (!enable && !uml_rtc_alarm_enabled) ··· 59 58 60 59 uml_rtc_alarm_enabled = enable; 61 60 62 - secs = uml_rtc_alarm_time - ktime_get_real_seconds(); 61 + read_persistent_clock64(&ts); 62 + secs = uml_rtc_alarm_time - ts.tv_sec; 63 63 64 64 if (time_travel_mode == TT_MODE_OFF) { 65 65 if (!enable) { ··· 75 73 76 74 if (enable) 77 75 time_travel_add_event_rel(&uml_rtc_alarm_event, 78 - secs * NSEC_PER_SEC); 76 + secs * NSEC_PER_SEC - 77 + ts.tv_nsec); 79 78 } 80 79 81 80 return 0;
-56
arch/um/include/asm/fixmap.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __UM_FIXMAP_H 3 - #define __UM_FIXMAP_H 4 - 5 - #include <asm/processor.h> 6 - #include <asm/archparam.h> 7 - #include <asm/page.h> 8 - #include <linux/threads.h> 9 - 10 - /* 11 - * Here we define all the compile-time 'special' virtual 12 - * addresses. The point is to have a constant address at 13 - * compile time, but to set the physical address only 14 - * in the boot process. We allocate these special addresses 15 - * from the end of virtual memory (0xfffff000) backwards. 16 - * Also this lets us do fail-safe vmalloc(), we 17 - * can guarantee that these special addresses and 18 - * vmalloc()-ed addresses never overlap. 19 - * 20 - * these 'compile-time allocated' memory buffers are 21 - * fixed-size 4k pages. (or larger if used with an increment 22 - * highger than 1) use fixmap_set(idx,phys) to associate 23 - * physical memory with fixmap indices. 24 - * 25 - * TLB entries of such buffers will not be flushed across 26 - * task switches. 27 - */ 28 - 29 - /* 30 - * on UP currently we will have no trace of the fixmap mechanizm, 31 - * no page table allocations, etc. This might change in the 32 - * future, say framebuffers for the console driver(s) could be 33 - * fix-mapped? 34 - */ 35 - enum fixed_addresses { 36 - __end_of_fixed_addresses 37 - }; 38 - 39 - extern void __set_fixmap (enum fixed_addresses idx, 40 - unsigned long phys, pgprot_t flags); 41 - 42 - /* 43 - * used by vmalloc.c. 44 - * 45 - * Leave one empty page between vmalloc'ed areas and 46 - * the start of the fixmap, and leave one page empty 47 - * at the top of mem.. 48 - */ 49 - 50 - #define FIXADDR_TOP (TASK_SIZE - 2 * PAGE_SIZE) 51 - #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 52 - #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 53 - 54 - #include <asm-generic/fixmap.h> 55 - 56 - #endif
+3 -4
arch/um/include/asm/pgtable.h
··· 8 8 #ifndef __UM_PGTABLE_H 9 9 #define __UM_PGTABLE_H 10 10 11 - #include <asm/fixmap.h> 11 + #include <asm/page.h> 12 + #include <linux/mm_types.h> 12 13 13 14 #define _PAGE_PRESENT 0x001 14 15 #define _PAGE_NEEDSYNC 0x002 ··· 49 48 50 49 #define VMALLOC_OFFSET (__va_space) 51 50 #define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) 52 - #define PKMAP_BASE ((FIXADDR_START - LAST_PKMAP * PAGE_SIZE) & PMD_MASK) 53 - #define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) 51 + #define VMALLOC_END (TASK_SIZE-2*PAGE_SIZE) 54 52 #define MODULES_VADDR VMALLOC_START 55 53 #define MODULES_END VMALLOC_END 56 - #define MODULES_LEN (MODULES_VADDR - MODULES_END) 57 54 58 55 #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) 59 56 #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
+4 -11
arch/um/kernel/mem.c
··· 9 9 #include <linux/mm.h> 10 10 #include <linux/swap.h> 11 11 #include <linux/slab.h> 12 - #include <asm/fixmap.h> 13 12 #include <asm/page.h> 14 13 #include <asm/pgalloc.h> 15 14 #include <as-layout.h> ··· 73 74 kmalloc_ok = 1; 74 75 } 75 76 77 + #if IS_ENABLED(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) 76 78 /* 77 79 * Create a page table and place a pointer to it in a middle page 78 80 * directory entry. ··· 152 152 153 153 static void __init fixaddr_user_init( void) 154 154 { 155 - #ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA 156 155 long size = FIXADDR_USER_END - FIXADDR_USER_START; 157 156 pte_t *pte; 158 157 phys_t p; ··· 173 174 pte = virt_to_kpte(vaddr); 174 175 pte_set_val(*pte, p, PAGE_READONLY); 175 176 } 176 - #endif 177 177 } 178 + #endif 178 179 179 180 void __init paging_init(void) 180 181 { 181 182 unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 }; 182 - unsigned long vaddr; 183 183 184 184 empty_zero_page = (unsigned long *) memblock_alloc_low(PAGE_SIZE, 185 185 PAGE_SIZE); ··· 189 191 max_zone_pfn[ZONE_NORMAL] = end_iomem >> PAGE_SHIFT; 190 192 free_area_init(max_zone_pfn); 191 193 192 - /* 193 - * Fixed mappings, only the page table structure has to be 194 - * created - mappings will be set by set_fixmap(): 195 - */ 196 - vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; 197 - fixrange_init(vaddr, FIXADDR_TOP, swapper_pg_dir); 198 - 194 + #if IS_ENABLED(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) 199 195 fixaddr_user_init(); 196 + #endif 200 197 } 201 198 202 199 /*
-8
arch/um/kernel/process.c
··· 213 213 /* Is in_interrupt() really needed? */ 214 214 } 215 215 216 - int user_context(unsigned long sp) 217 - { 218 - unsigned long stack; 219 - 220 - stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER); 221 - return stack != (unsigned long) current_thread_info(); 222 - } 223 - 224 216 extern exitcall_t __uml_exitcall_begin, __uml_exitcall_end; 225 217 226 218 void do_uml_exitcalls(void)
+6 -6
arch/um/kernel/um_arch.c
··· 264 264 265 265 #define MIN_VMALLOC (32 * 1024 * 1024) 266 266 267 - static void parse_host_cpu_flags(char *line) 267 + static void __init parse_host_cpu_flags(char *line) 268 268 { 269 269 int i; 270 270 for (i = 0; i < 32*NCAPINTS; i++) { ··· 272 272 set_cpu_cap(&boot_cpu_data, i); 273 273 } 274 274 } 275 - static void parse_cache_line(char *line) 275 + 276 + static void __init parse_cache_line(char *line) 276 277 { 277 278 long res; 278 279 char *to_parse = strstr(line, ":"); ··· 289 288 } 290 289 } 291 290 292 - static unsigned long get_top_address(char **envp) 291 + static unsigned long __init get_top_address(char **envp) 293 292 { 294 293 unsigned long top_addr = (unsigned long) &top_addr; 295 294 int i; ··· 377 376 iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; 378 377 379 378 max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC; 380 - 381 - if (physmem_size + iomem_size > max_physmem) { 382 - physmem_size = max_physmem - iomem_size; 379 + if (physmem_size > max_physmem) { 380 + physmem_size = max_physmem; 383 381 os_info("Physical memory size shrunk to %llu bytes\n", 384 382 physmem_size); 385 383 }
+3 -5
arch/um/os-Linux/main.c
··· 19 19 #include <um_malloc.h> 20 20 #include "internal.h" 21 21 22 - #define PGD_BOUND (4 * 1024 * 1024) 23 22 #define STACKSIZE (8 * 1024 * 1024) 24 - #define THREAD_NAME_LEN (256) 25 23 26 24 long elf_aux_hwcap; 27 25 28 - static void set_stklim(void) 26 + static void __init set_stklim(void) 29 27 { 30 28 struct rlimit lim; 31 29 ··· 46 48 exit(1); 47 49 } 48 50 49 - static void install_fatal_handler(int sig) 51 + static void __init install_fatal_handler(int sig) 50 52 { 51 53 struct sigaction action; 52 54 ··· 71 73 72 74 #define UML_LIB_PATH ":" OS_LIB_PATH "/uml" 73 75 74 - static void setup_env_path(void) 76 + static void __init setup_env_path(void) 75 77 { 76 78 char *new_path = NULL; 77 79 char *old_path = NULL;
-20
arch/x86/um/asm/archparam.h
··· 1 - /* 2 - * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) 3 - * Copyright 2003 PathScale, Inc. 4 - * Licensed under the GPL 5 - */ 6 - 7 - #ifndef __UM_ARCHPARAM_H 8 - #define __UM_ARCHPARAM_H 9 - 10 - #ifdef CONFIG_X86_32 11 - 12 - #ifdef CONFIG_X86_PAE 13 - #define LAST_PKMAP 512 14 - #else 15 - #define LAST_PKMAP 1024 16 - #endif 17 - 18 - #endif 19 - 20 - #endif
-2
arch/x86/um/shared/sysdep/ptrace.h
··· 74 74 #define UPT_FAULTINFO(r) (&(r)->faultinfo) 75 75 #define UPT_IS_USER(r) ((r)->is_user) 76 76 77 - extern int user_context(unsigned long sp); 78 - 79 77 extern int arch_init_registers(int pid); 80 78 81 79 #endif /* __SYSDEP_X86_PTRACE_H */
+22 -26
fs/hostfs/hostfs_kern.c
··· 410 410 .fsync = hostfs_fsync, 411 411 }; 412 412 413 - static int hostfs_writepage(struct page *page, struct writeback_control *wbc) 413 + static int hostfs_writepages(struct address_space *mapping, 414 + struct writeback_control *wbc) 414 415 { 415 - struct address_space *mapping = page->mapping; 416 416 struct inode *inode = mapping->host; 417 - char *buffer; 418 - loff_t base = page_offset(page); 419 - int count = PAGE_SIZE; 420 - int end_index = inode->i_size >> PAGE_SHIFT; 421 - int err; 417 + struct folio *folio = NULL; 418 + loff_t i_size = i_size_read(inode); 419 + int err = 0; 422 420 423 - if (page->index >= end_index) 424 - count = inode->i_size & (PAGE_SIZE-1); 421 + while ((folio = writeback_iter(mapping, wbc, folio, &err))) { 422 + loff_t pos = folio_pos(folio); 423 + size_t count = folio_size(folio); 424 + char *buffer; 425 + int ret; 425 426 426 - buffer = kmap_local_page(page); 427 + if (count > i_size - pos) 428 + count = i_size - pos; 427 429 428 - err = write_file(HOSTFS_I(inode)->fd, &base, buffer, count); 429 - if (err != count) { 430 - if (err >= 0) 431 - err = -EIO; 432 - mapping_set_error(mapping, err); 433 - goto out; 430 + buffer = kmap_local_folio(folio, 0); 431 + ret = write_file(HOSTFS_I(inode)->fd, &pos, buffer, count); 432 + kunmap_local(buffer); 433 + folio_unlock(folio); 434 + if (ret != count) { 435 + err = ret < 0 ? ret : -EIO; 436 + mapping_set_error(mapping, err); 437 + } 434 438 } 435 - 436 - if (base > inode->i_size) 437 - inode->i_size = base; 438 - 439 - err = 0; 440 - 441 - out: 442 - kunmap_local(buffer); 443 - unlock_page(page); 444 439 445 440 return err; 446 441 } ··· 501 506 } 502 507 503 508 static const struct address_space_operations hostfs_aops = { 504 - .writepage = hostfs_writepage, 509 + .writepages = hostfs_writepages, 505 510 .read_folio = hostfs_read_folio, 506 511 .dirty_folio = filemap_dirty_folio, 507 512 .write_begin = hostfs_write_begin, 508 513 .write_end = hostfs_write_end, 514 + .migrate_folio = filemap_migrate_folio, 509 515 }; 510 516 511 517 static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st)