Skip to content

Commit ce4ce80

Browse files
committed
feat: 重命名 MemoryKind 枚举中的 Passthrough 为 Reserved,增强内存区域描述
1 parent b735d46 commit ce4ce80

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/config.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ pub use axvmconfig::{
1313

1414
use crate::vhal::cpu::CpuId;
1515

16-
/// A part of `AxVMConfig`, which represents a `VCpu`.
17-
#[derive(Clone, Copy, Debug, Default)]
18-
pub struct AxVCpuConfig {
19-
// pub arch_config: AxArchVCpuConfig,
20-
/// The entry address in GPA for the Bootstrap Processor (BSP).
21-
pub bsp_entry: GuestPhysAddr,
22-
/// The entry address in GPA for the Application Processor (AP).
23-
pub ap_entry: GuestPhysAddr,
24-
}
25-
2616
#[derive(Debug, Default, Clone)]
2717
pub struct VMImageConfig {
2818
pub gpa: Option<GuestPhysAddr>,
@@ -44,11 +34,11 @@ pub struct VMImagesConfig {
4434

4535
#[derive(Debug, Clone)]
4636
pub enum MemoryKind {
47-
/// Use identical memory regions
37+
/// Use identical memory regions, i.e., HPA == GPA
4838
Identical { size: usize },
49-
/// Use memory regions mapped from host physical address
50-
Passthrough { hpa: HostPhysAddr, size: usize },
51-
/// Use fixed memory regions
39+
/// Use host reserved memory regions, i.e., HPA == GPA
40+
Reserved { hpa: HostPhysAddr, size: usize },
41+
/// Use fixed address memory regions, i.e., HPA != GPA
5242
Vmem { gpa: GuestPhysAddr, size: usize },
5343
}
5444

src/vm/addrspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl VmAddrSpace {
9191
)
9292
.unwrap();
9393
}
94-
MemoryKind::Passthrough { hpa, size } => {
94+
MemoryKind::Reserved { hpa, size } => {
9595
hva = phys_to_virt(*hpa);
9696
_gpa = GuestPhysAddr::from_usize(hva.as_usize());
9797
_size = *size;

0 commit comments

Comments
 (0)