vmx.c (50a82b0eb88c108d1ebc73a97f5b81df0d5918e0) vmx.c (b4f69df0f65e97fec439130a0d0a8b9c7cc02df2)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Kernel-based Virtual Machine driver for Linux
4 *
5 * This module enables machines with Intel VT-x extensions to run virtual
6 * machines without emulation or binary translation.
7 *
8 * Copyright (C) 2006 Qumranet, Inc.

--- 2034 unchanged lines hidden (view full) ---

2043 [msr_info->index - MSR_IA32_SGXLEPUBKEYHASH0];
2044 break;
2045 case KVM_FIRST_EMULATED_VMX_MSR ... KVM_LAST_EMULATED_VMX_MSR:
2046 if (!guest_can_use(vcpu, X86_FEATURE_VMX))
2047 return 1;
2048 if (vmx_get_vmx_msr(&vmx->nested.msrs, msr_info->index,
2049 &msr_info->data))
2050 return 1;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Kernel-based Virtual Machine driver for Linux
4 *
5 * This module enables machines with Intel VT-x extensions to run virtual
6 * machines without emulation or binary translation.
7 *
8 * Copyright (C) 2006 Qumranet, Inc.

--- 2034 unchanged lines hidden (view full) ---

2043 [msr_info->index - MSR_IA32_SGXLEPUBKEYHASH0];
2044 break;
2045 case KVM_FIRST_EMULATED_VMX_MSR ... KVM_LAST_EMULATED_VMX_MSR:
2046 if (!guest_can_use(vcpu, X86_FEATURE_VMX))
2047 return 1;
2048 if (vmx_get_vmx_msr(&vmx->nested.msrs, msr_info->index,
2049 &msr_info->data))
2050 return 1;
2051#ifdef CONFIG_KVM_HYPERV
2051 /*
2052 * Enlightened VMCS v1 doesn't have certain VMCS fields but
2053 * instead of just ignoring the features, different Hyper-V
2054 * versions are either trying to use them and fail or do some
2055 * sanity checking and refuse to boot. Filter all unsupported
2056 * features out.
2057 */
2058 if (!msr_info->host_initiated && guest_cpuid_has_evmcs(vcpu))
2059 nested_evmcs_filter_control_msr(vcpu, msr_info->index,
2060 &msr_info->data);
2052 /*
2053 * Enlightened VMCS v1 doesn't have certain VMCS fields but
2054 * instead of just ignoring the features, different Hyper-V
2055 * versions are either trying to use them and fail or do some
2056 * sanity checking and refuse to boot. Filter all unsupported
2057 * features out.
2058 */
2059 if (!msr_info->host_initiated && guest_cpuid_has_evmcs(vcpu))
2060 nested_evmcs_filter_control_msr(vcpu, msr_info->index,
2061 &msr_info->data);
2062#endif
2061 break;
2062 case MSR_IA32_RTIT_CTL:
2063 if (!vmx_pt_mode_is_host_guest())
2064 return 1;
2065 msr_info->data = vmx->pt_desc.guest.ctl;
2066 break;
2067 case MSR_IA32_RTIT_STATUS:
2068 if (!vmx_pt_mode_is_host_guest())

--- 6633 unchanged lines hidden ---
2063 break;
2064 case MSR_IA32_RTIT_CTL:
2065 if (!vmx_pt_mode_is_host_guest())
2066 return 1;
2067 msr_info->data = vmx->pt_desc.guest.ctl;
2068 break;
2069 case MSR_IA32_RTIT_STATUS:
2070 if (!vmx_pt_mode_is_host_guest())

--- 6633 unchanged lines hidden ---