goto error;
}
+ /* Enable synthetic processor features */
+ WHV_SYNTHETIC_PROCESSOR_FEATURES_BANKS synthetic_features;
+ memset(&synthetic_features, 0, sizeof(WHV_SYNTHETIC_PROCESSOR_FEATURES_BANKS));
+ synthetic_features.BanksCount = 1;
+
+ synthetic_features.Bank0.HypervisorPresent = 1;
+ synthetic_features.Bank0.Hv1 = 1;
+ synthetic_features.Bank0.AccessVpRunTimeReg = 1;
+ synthetic_features.Bank0.AccessPartitionReferenceCounter = 1;
+ synthetic_features.Bank0.AccessPartitionReferenceTsc = 1;
+ synthetic_features.Bank0.AccessHypercallRegs = 1;
+ synthetic_features.Bank0.AccessVpIndex = 1;
+ synthetic_features.Bank0.AccessHypercallRegs = 1;
+ synthetic_features.Bank0.TbFlushHypercalls = 1;
+ synthetic_features.Bank0.AccessSynicRegs = 1;
+ synthetic_features.Bank0.AccessSyntheticTimerRegs = 1;
+ synthetic_features.Bank0.AccessIntrCtrlRegs = 1;
+ synthetic_features.Bank0.SyntheticClusterIpi = 1;
+ synthetic_features.Bank0.DirectSyntheticTimers = 1;
+
+ /*
+ * On ARM64, have enlightenments off by default
+ * as they're not needed for performance.
+ */
+ if (whpx->hyperv_enlightenments_required) {
+ hr = whp_dispatch.WHvSetPartitionProperty(
+ whpx->partition,
+ WHvPartitionPropertyCodeSyntheticProcessorFeaturesBanks,
+ &synthetic_features,
+ sizeof(WHV_SYNTHETIC_PROCESSOR_FEATURES_BANKS));
+ if (FAILED(hr)) {
+ error_report("WHPX: Failed to set synthetic features, hr=%08lx", hr);
+ ret = -EINVAL;
+ goto error;
+ }
+ }
+
hr = whp_dispatch.WHvSetupPartition(whpx->partition);
if (FAILED(hr)) {
error_report("WHPX: Failed to setup partition, hr=%08lx", hr);