RE: [PATCH V2] x86/hyperv: Rename hv_isolation_type_snp/en_snp() to isol_type_snp_paravisor/enlightened()

From: Dexuan Cui
Date: Fri Jul 28 2023 - 02:04:54 EST


> From: Tianyu Lan <ltykernel@xxxxxxxxx>
> Sent: Wednesday, July 26, 2023 5:49 AM
> Subject: [PATCH V2] x86/hyperv: Rename hv_isolation_type_snp/en_snp() to
> isol_type_snp_paravisor/enlightened()
>
> From: Tianyu Lan <tiala@xxxxxxxxxxxxx>
>
> Rename hv_isolation_type_snp and hv_isolation_type_en_snp()
> to make them much intuitiver.
>
> Suggested-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
> Signed-off-by: Tianyu Lan <tiala@xxxxxxxxxxxxx>

Can we make the names a little shorter by replacing "isol_type" with "cvm"?
e.g. hv_isolation_type_en_snp --> hv_cvm_snp_enlightened,
hv_isolation_type_snp --> hv_cvm_snp_paravisor.

IMO hv_cvm_snp_enlightened is better than hv_isol_type_snp_enlightened?

BTW, I'm not sure if we really want hv_isol_type_snp_enlightened()
and hv_isol_type_snp_paravisor().

I think probably we can use
"hv_cvm_snp() && !hyperv_paravisor_present" and
"hv_cvm_snp() && hyperv_paravisor_present" instead, respectively.

A lot of usage of hv_isol_type_snp_paravisor() in drivers/hv/hv.c and
arch/x86/kernel/cpu/mshyperv.c will need to be changed to
hyperv_paravisor_present for TDX VMs with paravisor.

Some of the hv_isol_type_snp_enlightened() usage will need to be
changed for TDX VMs without paravisor.

Can we hold off the patch before the fully enlightened SNP patches
and the TDX patches are accepted? IMO it's better to have the core
logic to be accepted first and then we can do clean-up later.

I have a drafted patch for TDX HCL support here:
https://github.com/dcui/linux/commit/9893873bdef6f1e5574f784ed6e1d9d5bc54f1d8
(the patch introduces a global variable " hyperv_paravisor_present")
I'm further polishing the patches and will post soon.

Thanks,
Dexuan