-
Notifications
You must be signed in to change notification settings - Fork 13
refactor: adapt axvm refactor #46
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
Draft
ZR233
wants to merge
30
commits into
master
Choose a base branch
from
rewrite2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
refactor: add page level detect and remove feature
…e and run_guest functions
…it for interrupt handling
…mplement CpuHal trait
This was
linked to
issues
Dec 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant refactoring and modernization to the
arm_vcpucrate, focusing on improved modularity, architectural clarity, and compatibility with theaxvm_typesworkspace. The most important changes include a redesign of per-CPU and vCPU abstractions to remove generic parameters, the addition of a newAxVCpuExitReasonenum for VM exit handling, a new HAL (Hardware Abstraction Layer) interface for CPU operations, updates to dependencies and metadata, and adjustments to build and CI configurations for theaarch64-unknown-none-softfloattarget.Architectural Refactoring and HAL Abstraction
AxVCpuHal) fromAarch64PerCpuandAarch64VCpu, simplifying their usage and initialization. Introduced a new traitCpuHaland related initialization logic inlib.rsfor hardware abstraction, along with default NOP implementations and safe singleton initialization. ([[1]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-cfbd13fb57529c6ffb629101fb244d55a2746c59484e7a9978342c34995c3b8eL1-R32),[[2]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-cfbd13fb57529c6ffb629101fb244d55a2746c59484e7a9978342c34995c3b8eL78-R70),[[3]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-c81313374d24e5697ee5c347b11fc7b156830230764577b85c5180a3ef7f1ecdL1-R14),[[4]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-c81313374d24e5697ee5c347b11fc7b156830230764577b85c5180a3ef7f1ecdL40-R52),[[5]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R13-R24),[[6]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R39-R82))handle_irq), eliminating the need for per-CPU function pointers orOnceCell. ([[1]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-1b3d9f91d532261d2032e8f484185b3c4bc5377fb42b19e780b751e936dd33e1L284-R285),[[2]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-1b3d9f91d532261d2032e8f484185b3c4bc5377fb42b19e780b751e936dd33e1R9-R19))VM Exit Reason Standardization
AxVCpuExitReasonenum tosrc/exit.rs, capturing all major categories of VM exits (I/O, system events, power management, multiprocessing, errors, etc.) in a forward-compatible, extensible manner. ([src/exit.rsR1-R191](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-df574c6f1903e886ddf07734496e1891b71f4507e4988e334d907b74dcb2b006R1-R191))AxVCpuExitReasonand types fromaxvm_types. ([[1]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-1b3d9f91d532261d2032e8f484185b3c4bc5377fb42b19e780b751e936dd33e1R9-R19),[[2]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-c81313374d24e5697ee5c347b11fc7b156830230764577b85c5180a3ef7f1ecdL1-R14))Dependency and Metadata Updates
axaddrspaceand related crates toaxvm_typesfor address and device types, updating all usages accordingly. ([[1]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-1b3d9f91d532261d2032e8f484185b3c4bc5377fb42b19e780b751e936dd33e1R9-R19),[[2]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-799cbab61f90a6e923db567539632f95c9b72c073f817328c18a6b196220e929L1-R3),[[3]](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-c81313374d24e5697ee5c347b11fc7b156830230764577b85c5180a3ef7f1ecdL1-R14))Cargo.tomlto add categories and keywords, adjust dependencies (e.g., updateaarch64-cputo 11.0), and reorganize metadata for clarity and workspace compatibility. ([Cargo.tomlL2-L35](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L2-L35))Build and CI Improvements
.cargo/config.tomlto set the default build target toaarch64-unknown-none-softfloat. ([.cargo/config.tomlR1-R2](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-9a4f3e4537ebb7474452d131b0d969d89a51286f4269aac5ef268e712be17268R1-R2))[.github/workflows/ci.ymlL47-R59](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fL47-R59))Exception and Debug Logging Enhancements
FAR_EL2,HPFAR_EL2,SPSR_EL2) for better debugging. ([src/exception.rsR294-R303](https://github.com/arceos-hypervisor/arm_vcpu/pull/46/files#diff-1b3d9f91d532261d2032e8f484185b3c4bc5377fb42b19e780b751e936dd33e1R294-R303))These changes collectively modernize the codebase, improve maintainability, and prepare the crate for further development and integration in the
arceos-hypervisorecosystem.