mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: AMX state snapshot and restore support
The TILE data state of AMX may require 8KB+ space, calling the legacy KVM_GET_XSAVE will encounter an error since KVM_GET_XSAVE only can get 4KB space. This patch adds KVM_GET_XSAVE2 support to allow snapping more data. Fixes: #7533 Signed-off-by: Songqian Li <sionli@tencent.com>
This commit is contained in:
committed by
Rob Bradford
parent
5c5f33050c
commit
4b4954ff86
@@ -315,12 +315,19 @@ pub struct MsrEntry {
|
||||
pub struct XsaveState {
|
||||
#[serde_as(as = "[_; 1024usize]")]
|
||||
pub region: [u32; 1024usize],
|
||||
|
||||
// extra data to support xsave2
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub extra: Vec<u32>,
|
||||
}
|
||||
|
||||
impl Default for XsaveState {
|
||||
fn default() -> Self {
|
||||
// SAFETY: this is plain old data structure
|
||||
unsafe { ::std::mem::zeroed() }
|
||||
Self {
|
||||
// SAFETY: this is plain old data structure
|
||||
region: unsafe { std::mem::zeroed() },
|
||||
extra: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user