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

Refactor AArch64 VCPU registers related code in hypervisor #4298

Merged
merged 3 commits into from Jul 14, 2022

Conversation

michael2012z
Copy link
Member

Part of the PR prepares for #3980

Refactor VCPU registers related code in hypervisor crate:

  • Rename (set_)core_registers to get/set_regs, aligning to the equivalent functions on X86. Now we have following registers related functions:
    • get/set_regs (X86_64 & AArch64): Access general purposed registers
    • get/set_sregs (X86_64 only): Access special registers
    • get/set_sys_regs (AArch64 only): Access some system registers. (Now this group of function can not be aligned to get/set_sregs on X86_64, they are quite different.)
  • Improve the name and parameter setting of (set_)system_registers.
  • Replace #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] with #[cfg(target_arch = "aarch64")]. Because we do not support arm now; and some usages were not precise.

@michael2012z michael2012z requested a review from a team as a code owner July 11, 2022 05:42
Copy link
Member

@liuw liuw left a comment

Choose a reason for hiding this comment

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

The first two patches look to be purely code movement and the last on is trivially correct.

On AArch64, the function `core_registers` and `set_core_registers` are
the same thing of `get/set_regs` on x86_64. Now the names are aligned.
This will benefit supporting `gdb`.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
Function `system_registers` took mutable vector reference and modified
the vector content. Now change the definition to `get/set` style.
And rename to `get/set_sys_regs` to align with other functions.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
Some `arch_target = "arm"' usages on VCPU related code are not correct.
And we don't support 32-bit ARM architecture.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
@MrXinWang MrXinWang enabled auto-merge (rebase) July 14, 2022 14:55
@MrXinWang MrXinWang merged commit f0ad7fc into cloud-hypervisor:main Jul 14, 2022
@michael2012z michael2012z deleted the aarch64-refactor-regs branch July 15, 2022 01:20
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.

None yet

5 participants