[lldb][AArch64][Linux] Add support for the Permission Overlay Extension (POE) (#177145) This change adds initial support for managing the Permission Overlay Extension (POE). This extension allows userspace programs to change memory permissions without making a sycall. This is used to implement Linux's memory protection keys (https://docs.kernel.org/core-api/protection-keys.html) on AArch64. Overview of POE: * Page table entries have a set of permissions. To change these, a program would have to use a syscall which adds overhead. * 3 bits of the page table entry are used for a protection key 0-7. * POE adds a new register "por" (POR_EL0 in the manual) which stores 4-bit sets of permissions. * The protection key is an index into this por register. * Permissions in POR are applied on top of the page table permissions, but may only remove permissions. For example, if you overlay read/execute over read/write, the result is read. Since execute was not in the page table permissions. * This register can be modified without leaving userspace, making permission changes faster. To help debug this, I have made the following changes to LLDB: * Ability to read and write the por register. * Save and restore of por when running expressions. * Register field definitions to print the por permissions in a human readable form. * Recognition of memory protection key faults as a distinct type of SIGSEGV (this will apply to Linux on any architecture). There are a few more features to add around memory region information, that will be in follow up changes. As will documentation and release notes for all the POE features.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.