-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initializes AArch64 supports on Linux (#997)
- Loading branch information
1 parent
8d11ba0
commit 80c2b3a
Showing
8 changed files
with
162 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
use crate::vmm::hv::{CpuStates, Pstate, Sctlr, Tcr}; | ||
use std::os::fd::OwnedFd; | ||
use thiserror::Error; | ||
|
||
/// Implementation of [`Cpu::States`] for KVM. | ||
pub struct KvmStates<'a> { | ||
cpu: &'a mut OwnedFd, | ||
} | ||
|
||
impl<'a> KvmStates<'a> { | ||
pub fn from_cpu(cpu: &'a mut OwnedFd) -> Result<Self, StatesError> { | ||
Ok(KvmStates { cpu }) | ||
} | ||
} | ||
|
||
impl<'a> CpuStates for KvmStates<'a> { | ||
type Err = StatesError; | ||
|
||
fn set_pstate(&mut self, v: Pstate) { | ||
todo!() | ||
} | ||
|
||
fn set_sctlr(&mut self, v: Sctlr) { | ||
todo!() | ||
} | ||
|
||
fn set_mair_el1(&mut self, attrs: u64) { | ||
todo!() | ||
} | ||
|
||
fn set_tcr(&mut self, v: Tcr) { | ||
todo!() | ||
} | ||
|
||
fn set_ttbr0_el1(&mut self, baddr: usize) { | ||
todo!() | ||
} | ||
|
||
fn set_ttbr1_el1(&mut self, baddr: usize) { | ||
todo!() | ||
} | ||
|
||
fn set_sp_el1(&mut self, v: usize) { | ||
todo!() | ||
} | ||
|
||
fn set_pc(&mut self, v: usize) { | ||
todo!() | ||
} | ||
|
||
fn set_x0(&mut self, v: usize) { | ||
todo!() | ||
} | ||
|
||
fn set_x1(&mut self, v: usize) { | ||
todo!() | ||
} | ||
|
||
fn commit(self) -> Result<(), Self::Err> { | ||
todo!() | ||
} | ||
} | ||
|
||
/// Implementation of [`CpuStates::Err`]. | ||
#[derive(Debug, Error)] | ||
pub enum StatesError {} |
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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