@@ -402,7 +417,14 @@ int hv_common_cpu_die(unsigned int cpu)Why is it unsafe to free 'mem' if ret == 0? Also, why don't we want to
local_irq_restore(flags);
- kfree(mem);
+ if (hv_isolation_type_en_snp()) {
+ ret = set_memory_encrypted((unsigned long)mem, pgcount);
+ if (ret)
+ pr_warn("Hyper-V: Failed to encrypt input arg on cpu%d: %d\n",
+ cpu, ret);
+ /* It's unsafe to free 'mem'. */
+ return 0;
proparate non-zero 'ret' from here to fail CPU offlining?