| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c (pmap_page_table_page_dealloc): define it only on
the Xen platform. Best not to delete page_alloc, so we know how to do
so if need be.
i386/intel/pmap.c:1265:1: warning: 'pmap_page_table_page_dealloc' defined but not used [-Wunused-function]
1265 | pmap_page_table_page_dealloc(vm_offset_t pa)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
i386/intel/pmap.c:1171:1: warning: 'pmap_page_table_page_alloc' defined but not used [-Wunused-function]
1171 | pmap_page_table_page_alloc(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Message-ID: <20241020190744.2522-3-jbranso@dismail.de>
|
|
|
|
|
|
|
|
|
|
| |
We should only set USER
- for user processes maps
- for 32bit Xen support
This was not actually posing problem since in 32bit segmentation
protects us, and in 64bit the l4 entry for the kernel is already set.
But better be safe than sorry.
|
|
|
|
| |
Suggested-by: Damien Zammit <damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a parameter called keep_map_locked to vm_map_lookup()
that allows the function to return with the map locked.
This is to prepare for fixing a bug with gsync where the map
is locked twice by mistake.
Co-Authored-By: Sergey Bugaev <bugaevc@gmail.com>
Message-ID: <20240222082410.422869-3-damien@zamaudio.com>
|
| |
|
| |
|
|
|
|
| |
This also makes the code more coherent with other levels.
|
|
|
|
| |
This is convenient when tracking buffer overflows
|
|
|
|
|
| |
We need to extend the frame number to 64bit before converting to
address.
|
| |
|
| |
|
|
|
|
|
| |
Checking the range of addresses for operations on the kernel_pmap is
quite cheap, and allows to catch oddities quite early enough.
|
|
|
|
|
|
| |
l is used to skip over the area mapped by a whole pde. It was clipped to
e, but if e is already near the end of virtual memory, l will
wrap-around to 0, and mayhem entails.
|
| |
|
|
|
|
| |
So as to catch trying to dereference -1
|
| |
|
| |
|
|
|
|
| |
It is however usually aligned on l3 limit.
|
|
|
|
|
|
| |
We do need to go through the whole page table, to release the pdpt-s and
pdet-s that map the kernel. Only the ptpt-s that map the kernel are shared
between tasks.
|
|
|
|
|
|
| |
222020cff440 ("pmap: dynamically allocate the whole user page tree map")
made the pde array sparse, but missed updating pmap_protect accordingly:
we have to re-lookup for the pde on each PDE_MAPPED_SIZE section.
|
|
|
|
| |
Message-Id: <20230805154913.2003121-1-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c: add the check for LINUX_DEV; we could also check
for !__x86_64__, as this config would break ther kernel map by
removing the BIOS mem map, needed by the console and keyboard
drivers, but hopefully we won't need to enable Linux drivers on
x86_64.
Message-Id: <20230526184801.753581-2-luca@orpolo.org>
|
| |
|
|
|
|
| |
Notably, ptes_per_vm_page is meaninful for the pte level anyway.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c: switch to dynamic allocation of all the page tree
map levels for the user-space address range, using a separate kmem
cache for each level. This allows to extend the usable memory space
on x86_64 to use more than one L3 page for user space. The kernel
address map is left untouched for now as it needs a different
initialization.
* i386/intel/pmap.h: remove hardcoded user pages and add macro to
recontruct the page-to-virtual mapping
Message-Id: <20230521085758.365640-1-luca@orpolo.org>
|
| |
|
|
|
|
|
|
| |
* i386/intel/pmap.c: remove #error and allow compilation, keeping a
reminder to fix the pmap module.
Message-Id: <20230227204501.2492152-2-luca@orpolo.org>
|
|
|
|
|
|
|
| |
* i386/include/mach/i386/vm_param.h: extend the vm constants to ULL on
x86_64 to avoid a shift overflow warning
* i386/intel/pmap.c: fix cast and unused variables
Message-Id: <20230216213318.2048699-1-luca@orpolo.org>
|
|
|
|
|
|
| |
They are used temporarily without CPU exchanges, and may need to be used
concurrently so 2 slots only would not be enough anyway. This also saves
having to lock for them.
|
|
|
|
|
| |
We need to avoid the kernel optimizing away the reads from
memory. Use a standard relaxing instruction for that.
|
|
|
|
|
|
| |
These are used only temporarily by the current processor only, so we don't
need to notify other processors about them. We however then should flush TLB
at allocation, to make sure we don't have some remnant.
|
|
|
|
|
| |
We need to avoid the kernel optimizing away the read from
pmap->cpus_using. Use a standard relaxing instruction for that.
|
|
|
|
|
|
|
| |
MARK_CPU_ACTIVE already knows to flush TLB when a cpu comes out of idle.
However, add memory barriers to be sure that setting cpu_update_needed is
seen before testing for cpus_idle.
|
| |
|
|
|
|
| |
Message-Id: <20230213084919.1157074-5-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230213084919.1157074-3-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/vm_param.h: adjust constants to the new kernel map
- the boothdr.S code already sets up a temporary map to higher
addresses, so we can use INIT_VM_MIN_KERNEL_ADDRESS as in xen
- increase the kernel map size to accomodate for bigger structures
and more memory
- adjust kernel max address and directmap limit
* i386/i386at/biosmem.c: enable directmap check also on x86_64
* i386/include/mach/i386/vm_param.h: increase user virtual memory
limit as it's not conflicting with the kernel's anymore
* i386/intel/pmap.h: adjust lin2pdenum_cont() and INTEL_PTE_PFN to the
new kernel map
* x86_64/Makefrag.am: change KERNEL_MAP_BASE to be above 4G, and
according to mcmodel=kernel. This will allow to use the full memory
address space.
Message-Id: <20230212172818.1511405-10-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/vm_param.h: temporariliy fix kernel upper address
* i386/intel/pmap.c: split kernel and user L3 map initialization. For
simplicity in handling the different configurations, on 32-bit
(+PAE) the name PDPNUM_KERNEL is used in place of PDPNUM, while only
on x86_64 the PDPNUM_USER and PDPNUM_KERNEL are treated differently.
Also, change iterating over PTP tables in case the kernel map is not
right after the user map.
* i386/intel/pmap.h: define PDPNUM_USER and PDPNUM_KERNEL and move
PDPSHIFT to simplify ifdefs.
Message-Id: <20230212172818.1511405-9-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/vm_param.h: add VM_MAX/MIN_USER_ADDRESS to kernel headers.
* i386/i386/db_interface.c
* i386/i386/ldt.c
* i386/i386/pcb.c
* i386/intel/pmap.c
* kern/task.c: replace VM_MAX/MIN_ADDRESS with VM_MAX/MIN_USER_ADDRESS
Message-Id: <20230212172818.1511405-7-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This is a preparation to run the kernel on high addresses, where the
user vm region and the kernel vm region will use different L3 page
tables.
* i386/intel/pmap.c: on x86_64, retrieve the value of pdpbase from the
L4 table, and add the pmap_pdp() helper (useful also for PAE).
* i386/intel/pmap.h: remove pdpbase on x86_64.
Message-Id: <20230212172818.1511405-6-luca@orpolo.org>
|
|
|
|
|
| |
* i386/intel/pmap.c: move it to pmap_bootstrap_pae()
Message-Id: <20230212172818.1511405-5-luca@orpolo.org>
|
|
|
|
|
| |
* i386/intel/pmap.c: move it to pmap_bootstrap_xen()
Message-Id: <20230212172818.1511405-4-luca@orpolo.org>
|
| |
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c: start walking the page table tree from the L4
table instead of the PDP table in pmap_pte() and pmap_pde(),
preparing for the kernel to run on high addresses.
Message-Id: <20230212172818.1511405-2-luca@orpolo.org>
|
|
|
|
|
|
|
| |
* i386/intel/pmap.c: allocate the L4 page table from a dedicate kmem
cache instead of the generic kernel map.
Also improve readability of nested ifdef's.
Message-Id: <20230212170313.1501404-4-luca@orpolo.org>
|
|
|
|
| |
(this is actually a no-op for i386)
|
| |
|
|
|
|
| |
Message-Id: <20230203100133.835589-1-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230201100519.784297-2-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* i386/i386/io_map.c: code is unused.
* i386/i386/io_perm.c: include mig prototypes.
* i386/i386/mp_desc.c: Deleted interrupt_stack_alloc since it is not
used.
* i386/i386/seg.h: Moved descriptor structs to i386/include/mach/i386/mach_i386_types.h
as that represents the interface types for RPCs.
Defined aliases for real_descriptor since those are used by the i386 RPCs. Inlined many
functions here too and removed seg.c.
* i386/i386/seg.c: Removed. All the functions are inline now.
* i386/i386/trap.c: Use static.
* i386/i386/trap.h: Define missing prototypes.
* i386/i386/tss.h: Use static inline for ltr.
* i386/i386/user_ldt.c: Include mig prototypes.
* i386/include/mach/i386/mach_i386.defs: Define real_descriptor_t types
since those are used in the RPC definition. Now both prototypes and
definitions will match.
* i386/include/mach/i386/mach_i386_types.h: Move struct descriptor
from seg.h since we need those for the RPC interfaces. Removed include
of io_perm.h since it generates circular includes otherwise.
* i386/intel/pmap.c: pmap_map is unused. Added static qualifier for
several functions.
* i386/intel/pmap.h: pmap_update_interrupt declared for non-SMP and SMP.
Message-Id: <Y89+R2VekOQK4IUo@jupiter.lan>
|