mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
um: Remove obsolete fixmap support
It was added to support highmem. But since the highmem support has
been removed by commit a98a6d864d
("um: Remove broken highmem
support"), it is no longer needed. Remove it to simplify the code.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20241128081939.2216246-3-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
aa36314c2d
commit
5bfc4a3a0a
3 changed files with 5 additions and 71 deletions
|
@ -1,56 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __UM_FIXMAP_H
|
||||
#define __UM_FIXMAP_H
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/archparam.h>
|
||||
#include <asm/page.h>
|
||||
#include <linux/threads.h>
|
||||
|
||||
/*
|
||||
* 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 <asm-generic/fixmap.h>
|
||||
|
||||
#endif
|
|
@ -8,8 +8,6 @@
|
|||
#ifndef __UM_PGTABLE_H
|
||||
#define __UM_PGTABLE_H
|
||||
|
||||
#include <asm/fixmap.h>
|
||||
|
||||
#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
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgalloc.h>
|
||||
#include <as-layout.h>
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue