Open
Description
Rustc does not recognize ttbr0_el2 as a valid armv8 system register.
ttbr0_el2 is used by hypervisors to configure page tables for the lower half of memory, typically used for userspace.
#![no_std]
use core::arch::asm;
static PT: [u64; 512] = [0; 512];
pub fn main() {
unsafe {
asm!("msr {pt}, ttbr0_el2", pt = in(reg) &PT as *const _ );
}
}
This fails to compile with the error:
error: expected writable system register or pstate
--> <source>:8:15
|
8 | asm!("msr {pt}, ttbr0_el2", pt = in(reg) &PT as *const _ );
| ^
|
note: instantiated into assembly here
--> <inline asm>:1:6
|
1 | msr x8, ttbr0_el2
| ^
error: aborting due to previous error
Compiler returned: 1
Here is a live example on godbolt:
https://godbolt.org/z/3jsGEd59a
My rustc version is:
$ rustc --version
rustc 1.63.0-nightly (e71440575 2022-06-02)
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Inline assembly (`asm!(…)`)Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Armv8-A or later processors in AArch64 modeRelevant to the compiler team, which will review and decide on the PR/issue.