File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1860,14 +1860,10 @@ impl IgvmDirectiveHeader {
18601860 . and_then ( |x| x. get ( ..PAGE_SIZE_4K as usize ) )
18611861 . ok_or ( BinaryHeaderError :: InvalidDataSize ) ?;
18621862
1863- // Copy the VMSA bytes into the VMSA, and validate the remaining bytes are 0 .
1863+ // Copy the VMSA bytes into the VMSA.
18641864 // todo: zerocopy: as of 0.8, can recover from allocation failure
18651865 let mut vmsa = SevVmsa :: new_box_zeroed ( ) . unwrap ( ) ;
1866- let ( vmsa_slice, remaining) = data. split_at ( size_of :: < SevVmsa > ( ) ) ;
1867- vmsa. as_mut_bytes ( ) . copy_from_slice ( vmsa_slice) ;
1868- if remaining. iter ( ) . any ( |b| * b != 0 ) {
1869- return Err ( BinaryHeaderError :: InvalidVmsa ) ;
1870- }
1866+ vmsa. as_mut_bytes ( ) . copy_from_slice ( data) ;
18711867
18721868 IgvmDirectiveHeader :: SnpVpContext {
18731869 gpa : header. gpa . into ( ) ,
Original file line number Diff line number Diff line change @@ -324,4 +324,7 @@ pub struct SevVmsa {
324324
325325 // YMM high registers
326326 pub ymm_registers : [ SevXmmRegister ; 16 ] ,
327+
328+ // Pad to 4KB
329+ pub vmsa_padding : [ u8 ; 2448 ] ,
327330}
You can’t perform that action at this time.
0 commit comments