X-Git-Url: https://git.proxmox.com/?p=pve-kernel.git;a=blobdiff_plain;f=patches%2Fkernel%2F0013-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-N.patch;h=54a3fdb8d65ac7959f458af404318dd420168fff;hp=9617a1ac2df454c189c44b9446d87fec512a6ec7;hb=3adc532101a386a39e0e9d65998df7fd8ecc942e;hpb=9e25396c90effb58fc3fd72ebc44c56f732bd537 diff --git a/patches/kernel/0013-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-N.patch b/patches/kernel/0013-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-N.patch index 9617a1a..54a3fdb 100644 --- a/patches/kernel/0013-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-N.patch +++ b/patches/kernel/0013-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-N.patch @@ -36,10 +36,10 @@ Signed-off-by: Fabian Grünbichler 1 file changed, 106 insertions(+), 44 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c -index cb044cd17790..d2168203bddc 100644 +index 5edf05ce45de..146caacd8fdd 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c -@@ -203,6 +203,10 @@ struct loaded_vmcs { +@@ -204,6 +204,10 @@ struct loaded_vmcs { bool nmi_known_unmasked; unsigned long vmcs_host_cr3; /* May not match real cr3 */ unsigned long vmcs_host_cr4; /* May not match real cr4 */ @@ -50,7 +50,7 @@ index cb044cd17790..d2168203bddc 100644 struct list_head loaded_vmcss_on_cpu_link; }; -@@ -1289,6 +1293,11 @@ static inline bool cpu_has_vmx_invpcid(void) +@@ -1290,6 +1294,11 @@ static inline bool cpu_has_vmx_invpcid(void) SECONDARY_EXEC_ENABLE_INVPCID; } @@ -62,7 +62,7 @@ index cb044cd17790..d2168203bddc 100644 static inline bool cpu_has_vmx_wbinvd_exit(void) { return vmcs_config.cpu_based_2nd_exec_ctrl & -@@ -1340,11 +1349,6 @@ static inline bool nested_cpu_has2(struct vmcs12 *vmcs12, u32 bit) +@@ -1341,11 +1350,6 @@ static inline bool nested_cpu_has2(struct vmcs12 *vmcs12, u32 bit) (vmcs12->secondary_vm_exec_control & bit); } @@ -74,7 +74,7 @@ index cb044cd17790..d2168203bddc 100644 static inline bool nested_cpu_has_preemption_timer(struct vmcs12 *vmcs12) { return vmcs12->pin_based_vm_exec_control & -@@ -3686,9 +3690,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) +@@ -3687,9 +3691,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) &_vmexit_control) < 0) return -EIO; @@ -87,7 +87,7 @@ index cb044cd17790..d2168203bddc 100644 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PINBASED_CTLS, &_pin_based_exec_control) < 0) return -EIO; -@@ -5548,7 +5552,8 @@ static void enable_irq_window(struct kvm_vcpu *vcpu) +@@ -5549,7 +5553,8 @@ static void enable_irq_window(struct kvm_vcpu *vcpu) static void enable_nmi_window(struct kvm_vcpu *vcpu) { @@ -97,7 +97,7 @@ index cb044cd17790..d2168203bddc 100644 enable_irq_window(vcpu); return; } -@@ -5588,6 +5593,19 @@ static void vmx_inject_nmi(struct kvm_vcpu *vcpu) +@@ -5589,6 +5594,19 @@ static void vmx_inject_nmi(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); @@ -117,7 +117,7 @@ index cb044cd17790..d2168203bddc 100644 ++vcpu->stat.nmi_injections; vmx->loaded_vmcs->nmi_known_unmasked = false; -@@ -5606,6 +5624,8 @@ static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu) +@@ -5607,6 +5625,8 @@ static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu) struct vcpu_vmx *vmx = to_vmx(vcpu); bool masked; @@ -126,7 +126,7 @@ index cb044cd17790..d2168203bddc 100644 if (vmx->loaded_vmcs->nmi_known_unmasked) return false; masked = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_NMI; -@@ -5617,13 +5637,20 @@ static void vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked) +@@ -5618,13 +5638,20 @@ static void vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked) { struct vcpu_vmx *vmx = to_vmx(vcpu); @@ -154,7 +154,7 @@ index cb044cd17790..d2168203bddc 100644 } static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) -@@ -5631,6 +5658,10 @@ static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) +@@ -5632,6 +5659,10 @@ static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) if (to_vmx(vcpu)->nested.nested_run_pending) return 0; @@ -165,7 +165,7 @@ index cb044cd17790..d2168203bddc 100644 return !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & (GUEST_INTR_STATE_MOV_SS | GUEST_INTR_STATE_STI | GUEST_INTR_STATE_NMI)); -@@ -6359,6 +6390,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) +@@ -6360,6 +6391,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) * AAK134, BY25. */ if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) && @@ -173,7 +173,7 @@ index cb044cd17790..d2168203bddc 100644 (exit_qualification & INTR_INFO_UNBLOCK_NMI)) vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); -@@ -6833,7 +6865,7 @@ static struct loaded_vmcs *nested_get_current_vmcs02(struct vcpu_vmx *vmx) +@@ -6834,7 +6866,7 @@ static struct loaded_vmcs *nested_get_current_vmcs02(struct vcpu_vmx *vmx) } /* Create a new VMCS */ @@ -182,7 +182,7 @@ index cb044cd17790..d2168203bddc 100644 if (!item) return NULL; item->vmcs02.vmcs = alloc_vmcs(); -@@ -7850,6 +7882,7 @@ static int handle_pml_full(struct kvm_vcpu *vcpu) +@@ -7851,6 +7883,7 @@ static int handle_pml_full(struct kvm_vcpu *vcpu) * "blocked by NMI" bit has to be set before next VM entry. */ if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) && @@ -190,7 +190,7 @@ index cb044cd17790..d2168203bddc 100644 (exit_qualification & INTR_INFO_UNBLOCK_NMI)) vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); -@@ -8567,6 +8600,25 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) +@@ -8568,6 +8601,25 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) return 0; }