hypervisor: mshv: Only set unimplemented MSR for x86 partition

This partition property is only supported for x86 partition. Thus,
reduce the scope of it.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
Jinank Jain 2024-05-23 08:35:25 +05:30 committed by Rob Bradford
parent 036e7e3797
commit 94fe22da62

View File

@ -304,6 +304,7 @@ impl hypervisor::Hypervisor for MshvHypervisor {
// to override this behavior with a more suitable option i.e., ignore // to override this behavior with a more suitable option i.e., ignore
// writes from the guest and return zero in attempt to read unimplemented // writes from the guest and return zero in attempt to read unimplemented
// MSR. // MSR.
#[cfg(target_arch = "x86_64")]
fd.set_partition_property( fd.set_partition_property(
hv_partition_property_code_HV_PARTITION_PROPERTY_UNIMPLEMENTED_MSR_ACTION, hv_partition_property_code_HV_PARTITION_PROPERTY_UNIMPLEMENTED_MSR_ACTION,
hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_IGNORE_WRITE_READ_ZERO as u64, hv_unimplemented_msr_action_HV_UNIMPLEMENTED_MSR_ACTION_IGNORE_WRITE_READ_ZERO as u64,