Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_volatile on aarch64 may not properly set ESR #142

Open
qwandor opened this issue Jun 10, 2024 · 0 comments
Open

write_volatile on aarch64 may not properly set ESR #142

qwandor opened this issue Jun 10, 2024 · 0 comments

Comments

@qwandor
Copy link
Collaborator

qwandor commented Jun 10, 2024

With the new version of LLVM in rustc 1.78.0, pointer::write_volatile can sometimes get optimised into something like str w9, [x0], #4. This writes to the MMIO memory as expected, but suppresses the syndrome register (e.g. ESR_EL1) update, which at least in the case of KVM with crosvm prevents the VMM from servicing the fault as it relies on the ESR for this.

This could arguably be considered a bug in rustc as write_volatile is explicitly intended for MMIO, but we may want to consider working around this in the meantime by using inline assembly for volatile memory access on aarch64.

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

No branches or pull requests

1 participant