Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/x86/include/pmap.h,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/x86/include/pmap.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.76.2.6 retrieving revision 1.77 diff -u -p -r1.76.2.6 -r1.77 --- src/sys/arch/x86/include/pmap.h 2018/12/26 14:01:45 1.76.2.6 +++ src/sys/arch/x86/include/pmap.h 2018/05/08 17:20:44 1.77 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.76.2.6 2018/12/26 14:01:45 pgoyette Exp $ */ +/* $NetBSD: pmap.h,v 1.77 2018/05/08 17:20:44 maxv Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -75,8 +75,6 @@ #define pl2_pi(VA) (((VA_SIGN_POS(VA)) & L2_MASK) >> L2_SHIFT) #define pl3_pi(VA) (((VA_SIGN_POS(VA)) & L3_MASK) >> L3_SHIFT) #define pl4_pi(VA) (((VA_SIGN_POS(VA)) & L4_MASK) >> L4_SHIFT) -#define pl_pi(va, lvl) \ - (((VA_SIGN_POS(va)) & ptp_masks[(lvl)-1]) >> ptp_shifts[(lvl)-1]) /* * pl*_i: generate index into pde/pte arrays in virtual space @@ -88,9 +86,9 @@ #define pl3_i(VA) (((VA_SIGN_POS(VA)) & L3_FRAME) >> L3_SHIFT) #define pl4_i(VA) (((VA_SIGN_POS(VA)) & L4_FRAME) >> L4_SHIFT) #define pl_i(va, lvl) \ - (((VA_SIGN_POS(va)) & ptp_frames[(lvl)-1]) >> ptp_shifts[(lvl)-1]) + (((VA_SIGN_POS(va)) & ptp_masks[(lvl)-1]) >> ptp_shifts[(lvl)-1]) -#define pl_i_roundup(va, lvl) pl_i((va)+ ~ptp_frames[(lvl)-1], (lvl)) +#define pl_i_roundup(va, lvl) pl_i((va)+ ~ptp_masks[(lvl)-1], (lvl)) /* * PTP macros: @@ -151,31 +149,10 @@ struct bootspace { /* Virtual address of the page directory. */ vaddr_t pdir; - /* Area dedicated to kernel modules (amd64 only). */ - vaddr_t smodule; + /* End of the area dedicated to kernel modules (amd64 only). */ vaddr_t emodule; }; -#define SLAREA_USER 0 -#define SLAREA_PTE 1 -#define SLAREA_MAIN 2 -#define SLAREA_PCPU 3 -#define SLAREA_DMAP 4 -#define SLAREA_HYPV 5 -#define SLAREA_ASAN 6 -#define SLAREA_KERN 7 -#define SLSPACE_NAREAS 8 - -struct slotspace { - struct { - size_t sslot; /* start slot */ - size_t nslot; /* # of slots */ - bool active; /* area is active */ - } area[SLSPACE_NAREAS]; -}; - -extern struct slotspace slotspace; - #ifndef MAXGDTSIZ #define MAXGDTSIZ 65536 /* XXX */ #endif @@ -259,12 +236,6 @@ struct pmap { ptp mapped */ uint64_t pm_ncsw; /* for assertions */ struct vm_page *pm_gc_ptp; /* pages from pmap g/c */ - - /* Used by NVMM. */ - int (*pm_enter)(struct pmap *, vaddr_t, paddr_t, vm_prot_t, u_int); - void (*pm_remove)(struct pmap *, vaddr_t, vaddr_t); - void (*pm_tlb_flush)(struct pmap *); - void *pm_data; }; /* macro to access pm_pdirpa slots */ @@ -346,6 +317,10 @@ void pmap_ldt_cleanup(struct lwp *); void pmap_ldt_sync(struct pmap *); void pmap_kremove_local(vaddr_t, vsize_t); +void pmap_emap_enter(vaddr_t, paddr_t, vm_prot_t); +void pmap_emap_remove(vaddr_t, vsize_t); +void pmap_emap_sync(bool); + #define __HAVE_PMAP_PV_TRACK 1 void pmap_pv_init(void); void pmap_pv_track(paddr_t, psize_t); @@ -364,7 +339,6 @@ bool pmap_is_curpmap(struct pmap *); #ifndef __HAVE_DIRECT_MAP void pmap_vpage_cpu_init(struct cpu_info *); #endif -vaddr_t slotspace_rand(int, size_t, size_t); vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */ @@ -392,6 +366,8 @@ void pmap_tlb_shootdown(pmap_t, vaddr_t void pmap_tlb_shootnow(void); void pmap_tlb_intr(void); +#define __HAVE_PMAP_EMAP + #define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */ #define PMAP_FORK /* turn on pmap_fork interface */ @@ -559,8 +535,6 @@ int pmap_enter_ma(struct pmap *, vaddr_t bool pmap_extract_ma(pmap_t, vaddr_t, paddr_t *); void pmap_free_ptps(struct vm_page *); -paddr_t pmap_get_physpage(void); - /* * Hooks for the pool allocator. */ @@ -568,7 +542,7 @@ paddr_t pmap_get_physpage(void); #ifdef __HAVE_PCPU_AREA extern struct pcpu_area *pcpuarea; -#define PDIR_SLOT_PCPU 510 +#define PDIR_SLOT_PCPU 384 #define PMAP_PCPU_BASE (VA_SIGN_NEG((PDIR_SLOT_PCPU * NBPD_L4))) #endif @@ -577,6 +551,13 @@ extern struct pcpu_area *pcpuarea; extern vaddr_t pmap_direct_base; extern vaddr_t pmap_direct_end; +#define L4_SLOT_DIRECT 456 +#define PDIR_SLOT_DIRECT L4_SLOT_DIRECT + +#define NL4_SLOT_DIRECT 32 + +#define PMAP_DIRECT_DEFAULT_BASE (VA_SIGN_NEG((L4_SLOT_DIRECT * NBPD_L4))) + #define PMAP_DIRECT_BASE pmap_direct_base #define PMAP_DIRECT_END pmap_direct_end