Download raw body.
uvm_map: kill ifdef __i386__
On Sun, Nov 09, 2025 at 10:31:25AM +0000, Martin Pieuchot wrote:
> There's a specific uvm_map_setup_md() for i386 but it does exactly the
> same as other 32 bits architectures.
>
> I386 is no longer the main architecture and I doubt anyone will
> resurrect these experiments. But if that happens it is easy to
> reintroduce a custom uvm_map_setup_md().
>
> For now I'd like to remove this #ifdef.
>
> ok?
diff between the i386 and 32-bit versions:
@@ -14,10 +14,7 @@ uvm_map_setup_md(struct vm_map *map)
min = VMMAP_MIN_ADDR;
#if 0 /* Cool stuff, not yet */
- /* Executable code is special. */
- map->uaddr_exe = uaddr_rnd_create(min, I386_MAX_EXE_ADDR);
- /* Place normal allocations beyond executable mappings. */
- map->uaddr_any[3] = uaddr_pivot_create(2 * I386_MAX_EXE_ADDR, max);
+ map->uaddr_any[3] = uaddr_pivot_create(min, max);
#else /* Crappy stuff, for now */
map->uaddr_any[0] = uaddr_rnd_create(min, max);
#endif
can the pivot code also be removed?
>
> Index: uvm/uvm_map.c
> ===================================================================
> RCS file: /cvs/src/sys/uvm/uvm_map.c,v
> diff -u -p -r1.347 uvm_map.c
> --- uvm/uvm_map.c 23 Sep 2025 08:00:48 -0000 1.347
> +++ uvm/uvm_map.c 5 Oct 2025 16:00:08 -0000
> @@ -5386,37 +5386,7 @@ RBT_GENERATE_AUGMENT(uvm_map_addr, vm_ma
> /*
> * MD code: vmspace allocator setup.
> */
> -
> -#ifdef __i386__
> -void
> -uvm_map_setup_md(struct vm_map *map)
> -{
> - vaddr_t min, max;
> -
> - min = map->min_offset;
> - max = map->max_offset;
> -
> - /*
> - * Ensure the selectors will not try to manage page 0;
> - * it's too special.
> - */
> - if (min < VMMAP_MIN_ADDR)
> - min = VMMAP_MIN_ADDR;
> -
> -#if 0 /* Cool stuff, not yet */
> - /* Executable code is special. */
> - map->uaddr_exe = uaddr_rnd_create(min, I386_MAX_EXE_ADDR);
> - /* Place normal allocations beyond executable mappings. */
> - map->uaddr_any[3] = uaddr_pivot_create(2 * I386_MAX_EXE_ADDR, max);
> -#else /* Crappy stuff, for now */
> - map->uaddr_any[0] = uaddr_rnd_create(min, max);
> -#endif
> -
> -#ifndef SMALL_KERNEL
> - map->uaddr_brk_stack = uaddr_stack_brk_create(min, max);
> -#endif /* !SMALL_KERNEL */
> -}
> -#elif __LP64__
> +#if __LP64__
> void
> uvm_map_setup_md(struct vm_map *map)
> {
> @@ -5442,7 +5412,7 @@ uvm_map_setup_md(struct vm_map *map)
> map->uaddr_brk_stack = uaddr_stack_brk_create(min, max);
> #endif /* !SMALL_KERNEL */
> }
> -#else /* non-i386, 32 bit */
> +#else /* 32 bit */
> void
> uvm_map_setup_md(struct vm_map *map)
> {
>
>
>
uvm_map: kill ifdef __i386__