about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* cheri: elf: make l_addr a capabilitySzabolcs Nagy2022-08-052-2/+9
| | | | | | | | l_addr should be a capability on Morello. This is synchronized with the same variable in gdb. Use elfptr_t when ElfW(Addr) represents a runtime pointer that may be dereferenced.
* cheri: elf: Add new a_type entriesCarlos Eduardo Seo2022-08-051-0/+6
| | | | | | The Morello Pure Capability kernel uABI defines new a_type entries: https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-capability-kernel-user-Linux-ABI-specification#auxiliary-vector-auxv
* elf: add EF_AARCH64_CHERI_PURECAPSzabolcs Nagy2022-08-051-0/+3
|
* elf: add Arm Morello relocations to elf.hCarlos Eduardo Seo2022-08-051-0/+21
|
* cheri: fix __minimal_mallocSzabolcs Nagy2022-08-051-1/+4
| | | | | The linker created _end symbol does not have the right bounds, so don't try to reuse leftover memory at the end of the .data section.
* cheri: fix static linking TLS setupCarlos Eduardo Seo2022-08-051-1/+1
| | | | Use l_addr provenance for TLS initimage.
* cheri: fix static linking early allocationSzabolcs Nagy2022-08-051-1/+1
| | | | Store mmap result to intptr_t instead of long.
* TODO(gcc): cheri: work around a gcc bug in _dl_setup_stack_chk_guardSzabolcs Nagy2022-08-051-0/+4
| | | | | | | | | | | morello purecap gcc in some cases inlines 16byte memcpy as a capability load, which is wrong if the source or dest may be unaligned. stack guard only needs random for the address portion since only that part is compared, so 8 byte is enough with 64 bit addresses, but the current code is only right on little endian systems. TODO: drop when gcc is fixed
* cheri: don't use dl_random for pointer manglingSzabolcs Nagy2022-08-051-0/+5
| | | | | | | | Pointer mangling cannot be supported on capability architectures. And there is not enough bytes in dl_random for 128 bit pointers. Stack guard is still loaded from dl_random: stack protection is unlikely to be useful on a capability architecture, but it works.
* TODO(relro): cheri: make __attribute_relro a nopSzabolcs Nagy2022-08-051-1/+5
| | | | | relro does not work in the libc, because capabilities are readonly even before the page protection is applied.
* TODO(ddc): aarch64: morello: purecap support in the CSUCarlos Eduardo Seo2022-08-053-0/+357
| | | | | | | | | | | Purecap ABI versions of start.S, crti.S and crtn.S. TODO: must not use ddc but caps from auxv TODO: start.S: dynamic linked case is now detected by x0 != 0 (ld.so passes __rtld_fini there), but the value of c0 on entry is not abi, just that it has to be passed back to the libc start code in c5, so ideally the linker should be fixed to reliably emit __rela_dyn_start when a static exe must self relocate.
* cheri: aarch64: Add header for CHERI permissionsCarlos Eduardo Seo2022-08-051-0/+66
| | | | | | | | | New file containing the capability permission bits. The capability permission bits are defined in the Arm Architecture Reference Manual Suplement- Morello for A-Profile Architecture: https://developer.arm.com/documentation/ddi0606/latest
* TODO(uapi): aarch64: morello: use non-ifunc gettimeofdaySzabolcs Nagy2022-08-051-1/+3
| | | | TODO: Remove this once morello has vdso gettimeofday.
* TODO(uapi): aarch64: morello: make brk always failSzabolcs Nagy2022-08-051-0/+25
| | | | TODO: drop this once linux brk always fails.
* TODO(uapi): cheri: fix clone_argsSzabolcs Nagy2022-08-052-0/+27
| | | | | | | Current clone_args does not support 128 bit pointers. TODO: the fix is incomplete (missing clone3 abi checks) and has to be aligned with purecap clone3 struct layout.
* aarch64: morello: fix missing variadic argument in fcntlSzabolcs Nagy2022-08-053-2/+12
| | | | | | | | | | In fcntl va_arg is currently used even if the caller did not pass any variadic arguments. This is undefined behaviour and does not work with the Morello purecap ABI, so use a helper macro. When the argument is missing, the result of the helper macro is arbitrary as it will be ignored by the kernel, we just have to ensure it does not cause a runtime crash.
* aarch64: morello: fix vforkSzabolcs Nagy2022-08-051-1/+1
| | | | | No need to set the child stack to sp, 0 means the parent stack is used. This avoids purecap specific ifdefs in vfork.
* aarch64: morello: add purecap syscall supportCarlos Eduardo Seo2022-08-054-16/+185
| | | | | | Support the Morello Linux purecap syscall ABI. The macro definitions are moved to a morello specific sysdep.h to avoid cluttering the aarch64 one.
* aarch64: fix VDSO setup to only apply to known ABIsSzabolcs Nagy2022-08-051-1/+3
| | | | New syscall ABI requires different VDSO support code.
* TODO(api): cheri: fix syscall return typeSzabolcs Nagy2022-08-051-1/+7
| | | | | TODO: this affects API (syscall return type is long) so breaks portability and requires doc updates.
* aarch64: morello: string: memcpySzabolcs Nagy2022-08-051-0/+486
| | | | from arm optimized-routines morello branch.
* aarch64: morello: string: memsetSzabolcs Nagy2022-08-051-0/+154
| | | | memset from arm optimized-routines morello branch.
* aarch64: morello: string: dummy c memcmpSzabolcs Nagy2022-08-051-0/+38
|
* aarch64: morello: string: dummy c memchrSzabolcs Nagy2022-08-051-0/+33
|
* aarch64: morello: string: dummy c memrchrSzabolcs Nagy2022-08-051-0/+32
|
* aarch64: morello: purecap rawmemchrCarlos Eduardo Seo2022-08-051-0/+43
| | | | Modified rawmemchr to support Arm Morello Capabilities.
* aarch64: morello: string: dummy c strchrnulSzabolcs Nagy2022-08-051-0/+30
|
* aarch64: morello: string: dummy c strlenSzabolcs Nagy2022-08-051-0/+30
|
* aarch64: morello: string: dummy c strnlenSzabolcs Nagy2022-08-051-0/+31
|
* aarch64: morello: string: dummy c strcpy and stpcpySzabolcs Nagy2022-08-052-0/+62
|
* aarch64: morello: string: dummy c strcmpSzabolcs Nagy2022-08-051-0/+30
|
* aarch64: morello: string: dummy c strncmpSzabolcs Nagy2022-08-051-0/+32
|
* aarch64: morello: string: dummy c strchrSzabolcs Nagy2022-08-051-0/+33
|
* aarch64: morello: string: dummy c strrchrSzabolcs Nagy2022-08-051-0/+29
|
* aarch64: morello: string: dummy c strspnSzabolcs Nagy2022-08-051-0/+40
| | | | avoids out of bound access of the generic implementation.
* aarch64: morello: string: dummy c strcspnSzabolcs Nagy2022-08-051-0/+35
| | | | avoids out of bounds access of the generic implementation.
* aarch64: morello: update sysdep.h for purecap ABICarlos Eduardo Seo2022-08-051-2/+18
| | | | Add macro definitions for purecap ABI in sysdep.h.
* TODO(spec): cheri: __LP64__ is not defined for purecap ABICarlos Eduardo Seo2022-08-053-3/+3
| | | | | | TODO: there is no good ABI macro to check, for now we assume __CHERI_PURE_CAPABILITY__ implies 64 bit long, 64 bit address and 128 bit pointer.
* cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERISzabolcs Nagy2022-08-052-0/+16
| | | | | | | | | | The CHERI pure capability programming model for C requires special definition of {u}intptr_t. Only the pure capability model is supported for hosted compilation, but for freestanding compilation there is limited support for other (hybrid capability) programming models too, which require new {u}intcap_t type definitions.
* aarch64: morello: use separate c++-types.dataSzabolcs Nagy2022-08-052-0/+67
| | | | | The c++ mangling ABI for intptr_t and pthread_t are different on morello.
* aarch64: morello: use separate localplt data for morelloSzabolcs Nagy2022-08-052-0/+15
| | | | There is no longer PLT reference to matherr in libm.
* aarch64: morello: Add separate lp64 and morello linux abilistsSzabolcs Nagy2022-08-0528-2/+3347
| | | | The base symbol version is 2.36.
* aarch64: morello: Add purecap abi-variants on linuxSzabolcs Nagy2022-08-051-2/+6
|
* aarch64: morello: configure change for purecap abiSzabolcs Nagy2022-08-052-13/+67
| | | | | | | Detect default-abi and add aarch64-purecap make variable. Purecap abi sets HIDDEN_VAR_NEEDS_DYNAMIC_RELOC and unsets SUPPORT_STATIC_PIE.
* aarch64: morello: Use separate lp64 and morello sysdep directoriesSzabolcs Nagy2022-08-051-1/+6
| | | | | | | | | Provide separate directories for lp64 and purecap abi related sysdep functionality. purecap may be better name than morello, but we started with morello and that is more future compatible with alternative cheri-like extensions on top of aarch64.
* aarch64: morello: add purecap support to build-many-glibcs.pySzabolcs Nagy2022-08-051-1/+17
| | | | | | | | | | | | | | | | | aarch64-linux-gnu compiler is a lp64,purecap multilib gcc and supported glibc variants: aarch64-linux-gnu aarch64-linux-gnu-purecap aarch64-linux-gnu-purecap-nopie aarch64-linux-gnu_purecap compiler is a default purecap gcc, with supported glibc variants: aarch64-linux-gnu_purecap aarch64-linux-gnu_purecap-nopie purecap libgomp and libitm builds fail so disabled for now.
* aarch64: Use fewer ifdefs in bits/fcntl.hSzabolcs Nagy2022-08-051-2/+0
| | | | This simplifies adding the Morello purecap abi target.
* aarch64: cleanup MOVL definition in sysdep.hSzabolcs Nagy2022-08-051-4/+4
| | | | PTR_REG is for ILP32, there is no point using it under __LP64__.
* libio: adjust _IO_FILE / _IO_FILE_complete for 128 bit pointersSzabolcs Nagy2022-08-051-1/+3
| | | | | | The size of the reserved space has to be adjusted because it underflows with 16 byte pointers. With the new value there should be enough space for 2 more pointers in the struct on CHERI targets.
* cheri: Fix elf/tst-dlmodcount testSzabolcs Nagy2022-08-051-1/+1
| | | | | switch statement does not work for intptr_t, use a large int type that's guaranteed to work.