Skip to content

Conversation

@ZR233
Copy link

@ZR233 ZR233 commented Aug 13, 2025

Add aarch64 el2 trap handle support.

@ZR233
Copy link
Author

ZR233 commented Aug 13, 2025

@equation314 ci fixed.

@chyyuu chyyuu requested review from aarkegz, equation314, hky1999, shilei-massclouds and yfblock and removed request for equation314 September 5, 2025 03:28
@hky1999
Copy link
Contributor

hky1999 commented Sep 5, 2025

Does this PR bring virtualization support back into Arceos again? @aarkegz

If we want to integrate hypervisor into ArceOS, maybe we should refer to ARM/KVM with ARM VHE support?

access_flags |= PageFaultFlags::USER;
}
let vaddr = va!(FAR_EL1.get() as usize);
let vaddr = va!(elx!(FAR.get()) as usize);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will elx!(FAR).get() be a better syntax?


#[cfg(feature = "arm-el2")]
#[unsafe(no_mangle)]
fn handle_sync_exception(tf: &mut TrapFrame) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to merge these two handle_sync_exceptions? As they are very similar.

///
/// This function is marked as `naked` to avoid the compiler generating a prologue/epilogue,
#[unsafe(naked)]
pub unsafe extern "C" fn enter_guest() -> ! {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Registers as the argument.

///
/// This function is marked as `naked` to avoid the compiler generating a prologue/epilogue,
#[unsafe(naked)]
pub unsafe extern "C" fn enter_guest() -> ! {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a structure like UspaceContext to put this function?

#[cfg(not(feature = "arm-el2"))]
{
paste::paste! {
aarch64_cpu::registers::[<$name _EL1>].$e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this method: rust-lang/rust#124225

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 this pull request may close these issues.

4 participants