return true;
}
+static void clear_hsave_pa(void *arg)
+{
+ wrmsrq(MSR_VM_HSAVE_PA, 0);
+}
+
void snp_prepare(void)
{
u64 val;
on_each_cpu(mfd_reconfigure, (void *)1, 1);
on_each_cpu(snp_enable, NULL, 1);
+ /* SNP_INIT requires MSR_VM_HSAVE_PA to be cleared on all CPUs. */
+ on_each_cpu(clear_hsave_pa, NULL, 1);
+
cpus_read_unlock();
}
EXPORT_SYMBOL_FOR_MODULES(snp_prepare, "ccp");
return __sev_init_locked(psp_ret);
}
-static void snp_set_hsave_pa(void *arg)
-{
- wrmsrq(MSR_VM_HSAVE_PA, 0);
-}
-
/* Hypervisor Fixed pages API interface */
static void snp_hv_fixed_pages_state_update(struct sev_device *sev,
enum snp_hv_fixed_pages_state page_state)
snp_prepare();
- /* SNP_INIT requires MSR_VM_HSAVE_PA to be cleared on all CPUs. */
- on_each_cpu(snp_set_hsave_pa, NULL, 1);
-
/*
* Starting in SNP firmware v1.52, the SNP_INIT_EX command takes a list
* of system physical address ranges to convert into HV-fixed page