linux/arch/x86/hyperv
Saurabh Sengar f2a55d08d7 x86/hyperv: Restrict get_vtl to only VTL platforms
When Linux runs in a non-default VTL (CONFIG_HYPERV_VTL_MODE=y),
get_vtl() must never fail as its return value is used in negotiations
with the host. In the more generic case, (CONFIG_HYPERV_VTL_MODE=n) the
VTL is always zero so there's no need to do the hypercall.

Make get_vtl() BUG() in case of failure and put the implementation under
"if IS_ENABLED(CONFIG_HYPERV_VTL_MODE)" to avoid the call altogether in
the most generic use case.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/1695182675-13405-1-git-send-email-ssengar@linux.microsoft.com
2023-09-22 18:40:53 +00:00
..
hv_apic.c hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
hv_init.c x86/hyperv: Restrict get_vtl to only VTL platforms 2023-09-22 18:40:53 +00:00
hv_proc.c drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status 2021-04-21 09:49:19 +00:00
hv_spinlock.c x86/apic: Wrap IPI calls into helper functions 2023-08-09 12:00:55 -07:00
hv_vtl.c * Rework apic callbacks, getting rid of unnecessary ones and 2023-08-30 10:44:46 -07:00
irqdomain.c genirq: Return a const cpumask from irq_data_get_affinity_mask 2022-07-07 09:38:04 +01:00
ivm.c hyperv-next for v6.6 2023-09-04 11:26:29 -07:00
Makefile x86/hyperv: VTL support for Hyper-V 2023-04-18 17:29:52 +00:00
mmu.c x86/hyperv: Improve code for referencing hyperv_pcpu_input_arg 2023-06-28 17:53:25 +00:00
nested.c x86/hyperv: Improve code for referencing hyperv_pcpu_input_arg 2023-06-28 17:53:25 +00:00