hypervisor: Don't create temporary vector for boot MSRs

The MSRs are constant at boot time so rather than creating a vector in
the boot_msr_entries() method instead reaturn a reference to static MSR
array data.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford
2025-11-26 12:28:05 +00:00
parent a91235dab1
commit 4abebc9e56
5 changed files with 7 additions and 9 deletions

View File

@@ -3088,7 +3088,7 @@ mod unit_tests {
// tenth one (i.e the one with index msr_index::MSR_IA32_MISC_ENABLE has the data we
// expect.
let entry_vec = vcpu.boot_msr_entries();
assert_eq!(entry_vec.as_slice()[9], msrs.as_slice()[0]);
assert_eq!(entry_vec[9], msrs.as_slice()[0]);
}
#[test]