Skip to content

Cleanup and update core.sys.linux.sys.mman - #24559

Open
FinalEvilution wants to merge 1 commit into
dlang:masterfrom
FinalEvilution:linux-mman-clean-update
Open

FinalEvilution wants to merge 1 commit into
dlang:masterfrom
FinalEvilution:linux-mman-clean-update

Conversation

@FinalEvilution

Copy link
Copy Markdown
Contributor

Cleaned up and restructured mman.d, found some bugs, deprecated
some old flags, added a whole bunch of missing flags and removed
and updated some flags as well (see BREAKING CHANGES.)

MAP_FIXED for Alpha and HPPA_Any should be fixed in the posix mman.d
but I'd like to deal with that later.

Closes #17304

Removed uses of _GNU_SOURCE and _DEFAULT_SOURCE.
Both are set to true in core/sys/linux/config.d

Removed the PROT_* flags enum section from Alpha and HPPA_Any.
The PROT_NONE, PROT_READ, PROT_WRITE and PROT_EXEC are already
defined in core/sys/posix/sys/mman.d and use the same values.
The PROT_GROWSDOWN and PROT_GROWSUP are shared by all architectures.
and use the same values as well.

Removed MADV_SOFT_OFFLINE from MIPS32 and MIPS64 (this ones my fault.)

Fixed MAP_FIXED being incorectly set to 0x10 instead of 0x100 for the Alpha architecture.
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/alpha/bits/mman.h;hb=HEAD#l52
https://github.com/torvalds/linux/blob/master/arch/alpha/include/uapi/asm/mman.h#L15

Fixed MAP_TYPE being incorectly set to 0x0f instead of 0x2b for the
HPPA and HPPA64 architectures.
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/hppa/bits/mman.h;hb=HEAD#l44
https://github.com/torvalds/linux/blob/master/arch/parisc/include/uapi/asm/mman.h#L14

Deprecated MAP_VARIABLE for the HPPA/HPPA64 architectures.
Support was removed from glibc on 2023-06-05
https://sourceware.org/git/?p=glibc.git;a=commit;h=be9b883ddd12acd2baa517fd1b5b8c8be22f733a
torvalds/linux@71bdea6

Deprecated MADV_SPACEAVAIL, MADV_VPS_PURGE and MADV_VPS_INHERIT for the HPPA/HPPA64 architectures.
Support was removed from glibc on Nov 21, 2017
https://sourceware.org/git/?p=glibc.git;a=commit;h=922bb78c0c074aaeaa9f0312195b717674ed7430

Added the PROT_BTI and PROT_MTE flags for AArch64.

Added the MAP_SHARED_VALIDATE and MAP_DROPPABLE flags to all architectures.

Added the MAP_SYNC flag to ARM, AArch64, IA64, S390, SystemZ, M68K,
PPC, PPC64, SH, SPARC, SPARC64, X86 and X86_64.

Added the MAP_FIXED_NOREPLACE to all architectures.

Added the MAP_STACK and MAP_HUGETLB to HPPA and HPPA64.

Added the MAP_ABOVE4G to X86 and X86_64.

Added the MADV_SOFT_OFFLINE flag to HPPA and HPPA64.

Added the following MADV_* flags to HPPA, HPPA64 and Alpha.
MADV_WIPEONFORK
MADV_KEEPONFORK
MADV_COLD
MADV_PAGEOUT
MADV_POPULATE_READ
MADV_POPULATE_WRITE
MADV_DONTNEED_LOCKED
MADV_COLLAPSE
MADV_GUARD_INSTALL
MADV_GUARD_REMOVE

Added the following MADV_* flags to HPPA and HPPA64.
MADV_DODUMP
MADV_HWPOISON

Added the following MAP_HUGE_* flags to all architectures.
MAP_HUGE_16KB
MAP_HUGE_64KB
MAP_HUGE_512KB
MAP_HUGE_1MB
MAP_HUGE_2MB
MAP_HUGE_8MB
MAP_HUGE_16MB
MAP_HUGE_32MB
MAP_HUGE_256MB
MAP_HUGE_512MB
MAP_HUGE_1GB
MAP_HUGE_2GB
MAP_HUGE_16GB

Added the MCL_ONFAULT flag to all architectures.

Added the MREMAP_DONTUNMAP flag to all architectures.

Added the SHADOW_STACK_SET_TOKEN flag to X86_64.

BREAKING CHANGES.

Removed the previously deprecated MADV_*_PAGES from HPPA and HPPA64

Updated the MADV_MERGEABLE, MADV_UNMERGEABLE, MADV_HUGEPAGE,
MADV_NOHUGEPAGE and MADV_DONTDUMP flags on the HPPA/HPPA64 architecture
to match glibc and the kernel.
glibc Feb 25, 2023
https://sourceware.org/git/?p=glibc.git;a=commit;h=79ea63f0053904401021178d55dd4c364eeec131
"
In the Linux kernel for the hppa/parisc architecture some of the
MADV_XXX constants were changed to have the same values as the other
architectures. New programs compiled with this glibc version and which
use the madvise call will require at least Linux kernel version 6.2,
alternatively stable kernels from versions 6.1.6, 5.15.87, 5.10.163,
5.4.228, 4.19.270 or 4.14.303.
"
torvalds/linux@71bdea6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core.sys.linux.sys.mman out of date

1 participant