From 26fd8ef0ae2f9097f896769551ab02fdfcdc1b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E7=9D=BF?= Date: Fri, 15 Aug 2025 14:28:34 +0800 Subject: [PATCH 1/3] feat: Add `.code64` directive to naked assembly for VMX entry and exit --- src/vmx/vcpu.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vmx/vcpu.rs b/src/vmx/vcpu.rs index 35cebe4..26d86bf 100644 --- a/src/vmx/vcpu.rs +++ b/src/vmx/vcpu.rs @@ -878,6 +878,7 @@ macro_rules! vmx_entry_with { ($instr:literal) => { unsafe { naked_asm!( + ".code64", save_regs_to_stack!(), // save host status "mov [rdi + {host_stack_size}], rsp", // save current RSP to Vcpu::host_stack_top "mov rsp, rdi", // set RSP to guest regs area @@ -922,6 +923,7 @@ impl VmxVcpu { unsafe extern "C" fn vmx_exit(&mut self) -> usize { unsafe { naked_asm!( + ".code64", save_regs_to_stack!(), // save guest status, after this, rsp points to the `VmxVcpu` "mov rsp, [rsp + {host_stack_top}]", // set RSP to Vcpu::host_stack_top restore_regs_from_stack!(), // restore host status From 22e2cb5ce50994053500180ab3cd9da772352a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E7=9D=BF?= Date: Fri, 15 Aug 2025 16:36:06 +0800 Subject: [PATCH 2/3] fix: deps --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d5989f5..e0bdb86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,11 +28,11 @@ page_table_entry = "0.5" memory_addr = "0.4" crate_interface = "0.1" -axaddrspace = { git = "https://github.com/arceos-hypervisor/axaddrspace.git" } +axaddrspace = "0.1" axvcpu = { git = "https://github.com/arceos-hypervisor/axvcpu.git" } x86_vlapic = { git = "https://github.com/arceos-hypervisor/x86_vlapic.git" } axdevice_base = { git = "https://github.com/arceos-hypervisor/axdevice_crates.git" } -axvisor_api = { git = "https://github.com/arceos-hypervisor/axvisor_api.git" } +axvisor_api = "0.1" spin = { version = "0.9", default-features = false } From 023b994b733fa064d796c22b19f41bf2bf132c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E7=9D=BF?= Date: Mon, 18 Aug 2025 09:15:38 +0800 Subject: [PATCH 3/3] fix: update dependencies to use version numbers instead of git references --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e0bdb86..4b5f545 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,12 +29,12 @@ memory_addr = "0.4" crate_interface = "0.1" axaddrspace = "0.1" -axvcpu = { git = "https://github.com/arceos-hypervisor/axvcpu.git" } -x86_vlapic = { git = "https://github.com/arceos-hypervisor/x86_vlapic.git" } -axdevice_base = { git = "https://github.com/arceos-hypervisor/axdevice_crates.git" } +axvcpu = "0.1" +x86_vlapic = "0.1" +axdevice_base = "0.1" axvisor_api = "0.1" -spin = { version = "0.9", default-features = false } +spin = { version = "0.10", default-features = false } [features] default = ["vmx"]