Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions src/migtd/src/bin/migtd/cvmemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn parse_commandline_args() {
}
"rebind-prepare" => {
log::info!(
"Setting up rebind-prepare flow (EnableLogArea → GetMigtdData → StartRebinding)\n"
"Setting up rebind-prepare flow (EnableLogArea → GetTDReport → StartRebinding)\n"
);
set_emulated_start_rebinding(
mig_request_id,
Expand All @@ -403,7 +403,7 @@ fn parse_commandline_args() {
}
"rebind-finalize" => {
log::info!(
"Setting up rebind-finalize flow (EnableLogArea → GetMigtdData → StartRebinding)\n"
"Setting up rebind-finalize flow (EnableLogArea → GetTDReport → StartRebinding)\n"
);
set_emulated_start_rebinding(
mig_request_id,
Expand Down Expand Up @@ -642,36 +642,6 @@ fn handle_pre_mig_emu() -> i32 {
return status_code;
}
}
#[cfg(all(feature = "policy_v2"))]
WaitForRequestResponse::GetMigtdData(wfr_info) => {
use migtd::migration::session::get_migtd_data;

log::info!(migration_request_id = wfr_info.mig_request_id; "Processing GetMigtdData request\n");
let mut data = Vec::new();
let status = get_migtd_data(
&wfr_info.reportdata,
&mut data,
wfr_info.mig_request_id,
)
.await
.map(|_| MigrationResult::Success)
.unwrap_or_else(|e| e);

let status_code_u8 = status as u8;
let _ = report_status(
status_code_u8,
wfr_info.mig_request_id,
&data,
)
.await;
if status_code_u8 == MigrationResult::Success as u8 {
log::trace!(migration_request_id = wfr_info.mig_request_id; "Successfully completed get migtd data\n");
} else {
log::error!(migration_request_id = wfr_info.mig_request_id;
"Failure during get migtd data status code: {:x}\n", status_code_u8);
}
// Continue to process next request
}
}
}
Err(e) => {
Expand Down
21 changes: 0 additions & 21 deletions src/migtd/src/bin/migtd/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,27 +588,6 @@ fn handle_pre_mig() {
log::trace!(migration_request_id = wfr_info.mig_request_id; "ReportStatus for Enable LogArea completed\n");
REQUESTS.lock().remove(&wfr_info.mig_request_id);
}
#[cfg(feature = "policy_v2")]
WaitForRequestResponse::GetMigtdData(wfr_info) => {
log::trace!(migration_request_id = wfr_info.mig_request_id; "Processing GetMigtdData request\n");
let status = get_migtd_data(
&wfr_info.reportdata,
&mut data,
wfr_info.mig_request_id,
)
.await
.map(|_| MigrationResult::Success)
.unwrap_or_else(|e| e);
if status == MigrationResult::Success {
log::trace!(migration_request_id = wfr_info.mig_request_id; "Successfully completed get migtd data\n");
} else {
log::error!(migration_request_id = wfr_info.mig_request_id; "Failure during get migtd data status code: {:x}\n", status.clone() as u8);
}
let _ =
report_status(status as u8, wfr_info.mig_request_id, &data).await;
log::trace!(migration_request_id = wfr_info.mig_request_id; "ReportStatus for get migtd data completed.\n");
REQUESTS.lock().remove(&wfr_info.mig_request_id);
}
}
}
#[cfg(any(feature = "test_stack_size", feature = "test_heap_size"))]
Expand Down
2 changes: 0 additions & 2 deletions src/migtd/src/migration/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ pub enum WaitForRequestResponse {
StartRebinding(MigtdMigrationInformation),
GetTdReport(ReportInfo),
EnableLogArea(EnableLogAreaInfo),
#[cfg(feature = "policy_v2")]
GetMigtdData(MigtdDataInfo),
}

pub struct MigrationInformation {
Expand Down
25 changes: 1 addition & 24 deletions src/migtd/src/migration/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ pub enum DataStatusOperation {
StartRebinding = 2,
GetTDReport = 3,
EnableLogArea = 4,
GetMigtdData = 5,
}

#[cfg(feature = "vmcall-raw")]
Expand All @@ -84,7 +83,6 @@ impl TryFrom<u8> for DataStatusOperation {
2 => Ok(Self::StartRebinding),
3 => Ok(Self::GetTDReport),
4 => Ok(Self::EnableLogArea),
5 => Ok(Self::GetMigtdData),
unknown => Err(unknown),
}
}
Expand Down Expand Up @@ -232,7 +230,7 @@ fn process_buffer(buffer: &[u8]) -> RequestDataBufferHeader {

#[cfg(feature = "vmcall-raw")]
fn calculate_shared_page_nums(reqbufferhdrlen: usize) -> Result<usize> {
// The response payload for GetMigtdData is just the raw 512-byte TDINFO_STRUCT.
// The response payload for GetTDReport is just the raw 512-byte TDINFO_STRUCT.
let policy_size = crate::config::get_policy()
.ok_or(MigrationResult::InvalidParameter)?
.len();
Expand Down Expand Up @@ -434,27 +432,6 @@ fn parse_request(
WaitForRequestResponse::EnableLogArea(info)
})
}
DataStatusOperation::GetMigtdData => {
#[cfg(all(feature = "vmcall-raw", feature = "policy_v2"))]
{
decode_and_dispatch!(MigtdDataInfo, |info| WaitForRequestResponse::GetMigtdData(
info
))
}
#[cfg(not(all(feature = "vmcall-raw", feature = "policy_v2")))]
{
log_request_error!(
request_id,
"wait_for_request: unsupported operation {:?} received\n",
op
);
reject_request(
pending_error_report,
request_id,
MigrationResult::UnsupportedOperationError,
)
}
}
}
}

Expand Down
Loading