RE: [PATCH v4 5/5] x86/hyperv: VTL support for Hyper-V
From: Michael Kelley (LINUX)
Date: Fri Apr 07 2023 - 12:00:54 EST
From: Saurabh Sengar <ssengar@xxxxxxxxxxxxxxxxxxx> Sent: Tuesday, April 4, 2023 2:01 AM
>
> Virtual Trust Levels (VTL) helps enable Hyper-V Virtual Secure Mode (VSM)
> feature. VSM is a set of hypervisor capabilities and enlightenments
> offered to host and guest partitions which enable the creation and
> management of new security boundaries within operating system software.
> VSM achieves and maintains isolation through VTLs.
>
> Add early initialization for Virtual Trust Levels (VTL). This includes
> initializing the x86 platform for VTL and enabling boot support for
> secondary CPUs to start in targeted VTL context. For now, only enable
> the code for targeted VTL level as 2.
>
> When starting an AP at a VTL other than VTL0, the AP must start directly
> in 64-bit mode, bypassing the usual 16-bit -> 32-bit -> 64-bit mode
> transition sequence that occurs after waking up an AP with SIPI whose
> vector points to the 16-bit AP startup trampoline code.
>
> Signed-off-by: Saurabh Sengar <ssengar@xxxxxxxxxxxxxxxxxxx>
> ---
> [V4]
> - replace initial_stack with current->thread.sp as per recent upstream changes
>
> arch/x86/hyperv/Makefile | 1 +
> arch/x86/hyperv/hv_vtl.c | 227 ++++++++++++++++++++++++++++++++
> arch/x86/include/asm/mshyperv.h | 10 ++
> arch/x86/kernel/cpu/mshyperv.c | 1 +
> 4 files changed, 239 insertions(+)
> create mode 100644 arch/x86/hyperv/hv_vtl.c
>
Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>