Skip to content

Commit 312649d

Browse files
committed
Adding test scenario for crash MSR updates
Signed-off-by: Gudaram, Meghana <meghana.gudaram@intel.com>
1 parent bc7d11d commit 312649d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/migtd/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ vmcall-interrupt = []
8080
vmcall-vsock = ["vsock/vmcall-vsock"]
8181
vmcall-raw = ["vmcall_raw"]
8282
oneshot-apic = []
83+
test-crashmsr = []
8384
test_heap_size = ["td-benchmark", "td-payload/test_heap_size"]
8485
test_stack_size = ["td-benchmark"]
8586
test_disable_ra_and_accept_all = ["attestation/test", "tdx-tdcall-emu?/test_mock_report"] # Dangerous: can only be used for test purpose to bypass the remote attestation

src/migtd/src/bin/migtd/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use alloc::vec::Vec;
1818
use log::info;
1919
#[cfg(feature = "vmcall-raw")]
2020
use log::{debug, Level};
21+
#[cfg(all(feature = "test-crashmsr", feature = "vmcall-raw"))]
22+
use migtd::driver::vmcall_raw::panic_with_guest_crash_reg_report;
2123
use migtd::event_log::*;
2224
#[cfg(not(feature = "vmcall-raw"))]
2325
use migtd::migration::data::MigrationInformation;
@@ -130,6 +132,10 @@ pub fn runtime_main() {
130132
}
131133
}
132134

135+
// Test scenario for crash MSR updates
136+
#[cfg(all(feature = "test-crashmsr", feature = "vmcall-raw"))]
137+
panic_with_guest_crash_reg_report(0xFF, b"Test Crash MSR updates");
138+
133139
// Handle the migration request from VMM
134140
handle_pre_mig();
135141
}

0 commit comments

Comments
 (0)