hypervisor: x86: provide a generic MsrEntry structure

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-07-19 21:41:00 +00:00
committed by Liu Wei
parent 4d2cc3778f
commit f21fc1dcb6
7 changed files with 81 additions and 23 deletions

View File

@@ -161,7 +161,6 @@ macro_rules! msr {
MsrEntry {
index: $msr,
data: 0x0,
..Default::default()
}
};
}
@@ -171,7 +170,6 @@ macro_rules! msr_data {
MsrEntry {
index: $msr,
data: $data,
..Default::default()
}
};
}
@@ -319,3 +317,9 @@ impl LapicState {
.expect("Failed to write klapic register")
}
}
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
pub struct MsrEntry {
pub index: u32,
pub data: u64,
}