Skip to content

Core abort on Aarch64 #842

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

Closed
NailAgliev opened this issue Jun 2, 2023 · 4 comments · Fixed by #843
Closed

Core abort on Aarch64 #842

NailAgliev opened this issue Jun 2, 2023 · 4 comments · Fixed by #843

Comments

@NailAgliev
Copy link

NailAgliev commented Jun 2, 2023

Hello!

I`m struck with problem of getting core exception when my efi app being run.
Exception occurs when newly introduced function install_configuration_table being called. @RaitoBezarius #821

I got ESR of value 0x96000004. I`m not so confident about my knowlage in armv8 arch but as i understand it correctly abort was caused by reading memory from efi runtime that mapped to efi application.

I found solution to my problem and now call is successful.

I`m new to rust so i asking for help verifying validity of my solution before creating PR.

install_configuration_table: unsafe extern "efiapi" fn(
        guid_entry: &Guid, <<<< i added &
        table_ptr: *const c_void
    ) -> Status,
pub unsafe fn install_configuration_table(
        &self,
        guid_entry: &Guid, <<<< i added &
        table_ptr: *const c_void,
    ) -> Result {
        (self.install_configuration_table)(guid_entry, table_ptr).to_result()
    }
@medhefgo
Copy link
Contributor

medhefgo commented Jun 2, 2023

Yikes, the function sig is definitely wrong. It should indeed take a &Guid.

@NailAgliev
Copy link
Author

Should I create PR or this can be fixed more quickly by manteiners?

nicholasbishop pushed a commit that referenced this issue Jun 4, 2023
Interestingly, this crashes on aarch64 but works on x86_64. Likely,
the x86_64 calling convention used still passes the Guid struct by
pointer, while the aarch64 passes it by value (or in an unexpected
registers) causing a crash.

This also adds a test case to verify this works correctly now.

Fixes: #842
@NailAgliev
Copy link
Author

Great work! Thanks for the quick follow-up. Can someone hint at when this change may appear in crates?

@nicholasbishop
Copy link
Member

Just pushed new releases to crates.io :) Thanks for the bug report!

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 a pull request may close this issue.

3 participants