From 343ec3ccf99a86fb9c67a7b0372e9b7a745f0640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E7=9D=BF?= Date: Tue, 9 Sep 2025 10:35:26 +0800 Subject: [PATCH] feat: add gpt level api --- Cargo.toml | 2 +- src/percpu.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 174b683..d5878b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "axvcpu" authors = ["aarkegz "] -version = "0.1.1" +version = "0.1.2" edition = "2024" categories = ["virtualization", "no-std"] description = "Virtual CPU abstraction for ArceOS hypervisor" diff --git a/src/percpu.rs b/src/percpu.rs index baf748f..3e24260 100644 --- a/src/percpu.rs +++ b/src/percpu.rs @@ -16,6 +16,10 @@ pub trait AxArchPerCpu: Sized { fn hardware_enable(&mut self) -> AxResult; /// Disable hardware virtualization on the current CPU. fn hardware_disable(&mut self) -> AxResult; + /// Return max guest page table levels used by the architecture. + fn max_guest_page_table_levels(&self) -> usize { + 4 + } } /// Host per-CPU states to run the guest.