File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ impl Default for TdxReport {
186
186
#[ repr( C , align( 1024 ) ) ]
187
187
struct TdxReportBuf ( TdxReport ) ;
188
188
189
+ #[ repr( C , align( 64 ) ) ]
190
+ struct AdditionalDataBuf ( [ u8 ; TD_REPORT_ADDITIONAL_DATA_SIZE ] ) ;
191
+
189
192
/// Create a TDREPORT_STRUCT structure that contains the measurements/configuration
190
193
/// information of the guest TD, measurements/configuration information of the Intel
191
194
/// TDX module and a REPORTMACSTRUCT
@@ -194,12 +197,13 @@ struct TdxReportBuf(TdxReport);
194
197
pub fn tdcall_report (
195
198
additional_data : & [ u8 ; TD_REPORT_ADDITIONAL_DATA_SIZE ] ,
196
199
) -> Result < TdxReport , TdCallError > {
197
- let mut buf = TdxReportBuf ( TdxReport :: default ( ) ) ;
200
+ let mut report_buf = TdxReportBuf ( TdxReport :: default ( ) ) ;
201
+ let additional_data_buf = AdditionalDataBuf ( * additional_data) ;
198
202
199
203
let mut args = TdcallArgs {
200
204
rax : TDCALL_TDREPORT ,
201
- rcx : & mut buf as * mut _ as u64 ,
202
- rdx : additional_data . as_ptr ( ) as u64 ,
205
+ rcx : & mut report_buf as * mut _ as u64 ,
206
+ rdx : & additional_data_buf as * const _ as u64 ,
203
207
..Default :: default ( )
204
208
} ;
205
209
@@ -208,7 +212,7 @@ pub fn tdcall_report(
208
212
return Err ( args. r10 . into ( ) ) ;
209
213
}
210
214
211
- Ok ( buf . 0 )
215
+ Ok ( report_buf . 0 )
212
216
}
213
217
214
218
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments