# SPDX-License-Identifier: GPL-2.0

menu "Microsoft Hyper-V guest support"

config HYPERV
	tristate "Microsoft Hyper-V client drivers"
	depends on (X86 && X86_LOCAL_APIC && HYPERVISOR_GUEST) \
		|| (ACPI && ARM64 && !CPU_BIG_ENDIAN)
	select PARAVIRT
	select X86_HV_CALLBACK_VECTOR if X86
	select OF_EARLY_FLATTREE if OF
	help
	  Select this option to run Linux as a Hyper-V client operating
	  system.

config HYPERV_VTL_MODE
	bool "Enable Linux to boot in VTL context"
	depends on X86_64 && HYPERV
	depends on SMP
	default n
	help
	  Virtual Secure Mode (VSM) is a set of hypervisor capabilities and
	  enlightenments offered to host and guest partitions which enables
	  the creation and management of new security boundaries within
	  operating system software.

	  VSM achieves and maintains isolation through Virtual Trust Levels
	  (VTLs). Virtual Trust Levels are hierarchical, with higher levels
	  being more privileged than lower levels. VTL0 is the least privileged
	  level, and currently only other level supported is VTL2.

	  Select this option to build a Linux kernel to run at a VTL other than
	  the normal VTL0, which currently is only VTL2.  This option
	  initializes the x86 platform for VTL2, and adds the ability to boot
	  secondary CPUs directly into 64-bit context as required for VTLs other
	  than 0.  A kernel built with this option must run at VTL2, and will
	  not run as a normal guest.

	  If unsure, say N


config HV_SECURE_VTL
	bool "Microsoft Hyper-V VTL1 driver"
	depends on !MTRR
	depends on !X86_MPARSE
	depends on HYPERV_VTL_MODE
	default n
	help
	  Select this option to enable Linux kernel as secure kernel running in VTL1.
	  If unsure, say N.

config HYPERV_VSM
	tristate "Microsoft Hyper-V VSM driver"
	depends on HYPERV
	help
	  Select this option to enable Hyper-V Virtual Secure Mode.
	  Enabling this option will load a secure kernel in VTL1 and
	  establish an interface between VTL0 and VTL1 to request for
	  VSM services.

config HYPERV_VSM_DISABLE_IMG_VERIFY
	bool "Disable Image Verification for VSM binaries"
	depends on HYPERV_VSM
	help
	  Select this option to disable VSM Secure Boot.
	  Enabling this option will disable verifying the integrity and
	  authenticity of the VSM secure kernel and loader. Enable this
	  option only when debugging VSM. If this option is set, the
	  system can be vulnerable to an attacker changing/replacing the
	  secure kernel and/or loader.

config HYPERV_TIMER
	def_bool HYPERV && X86

config HYPERV_UTILS
	tristate "Microsoft Hyper-V Utilities driver"
	depends on HYPERV && CONNECTOR && NLS
	depends on PTP_1588_CLOCK_OPTIONAL
	help
	  Select this option to enable the Hyper-V Utilities.

config HYPERV_BALLOON
	tristate "Microsoft Hyper-V Balloon driver"
	depends on HYPERV
	select PAGE_REPORTING
	help
	  Select this option to enable Hyper-V Balloon driver.

config MSHV_ROOT
	tristate "Microsoft Hyper-V root partition APIs driver"
	depends on HYPERV
	select EVENTFD
	select IRQ_BYPASS_MANAGER
	help
	  Select this option when running as the root partition on Microsoft
	  Hypervisor, to enable interfaces for managing guest virtual
	  machines.

	  The interfaces are provided via a device named /dev/mshv.

	  To compile this as a module, choose M here.

	  If unsure, say N.

config MSHV_DIAG
	tristate "Interface to get diagnostic logs from Microsoft Hypervisor: /dev/mshv_diag"
	depends on HYPERV
	help
	  Grants access to Diagnostic(error) logs from Microsoft Hypervisor via char
	  device interface.

	  To compile this as a module, choose M here.

	  If unsure, say N.

config HYPERV_VSM
        tristate "Microsoft Hyper-V VSM driver"
        depends on HYPERV
        help
          Select this option to enable Hyper-V Virtual Secure Mode.
          Enabling this option will load a secure kernel in VTL1 and
          establish an interface between VTL0 and VTL1 to request for
          VSM services.

endmenu
