From: Sasha Levin Date: Tue, 14 May 2019 00:49:42 +0000 (-0400) Subject: remove two broken kvm patches from 5.0 X-Git-Tag: v5.1.2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd56da8a1cb4618a7033367bc928244d4f2ec1d6;p=thirdparty%2Fkernel%2Fstable-queue.git remove two broken kvm patches from 5.0 Signed-off-by: Sasha Levin --- diff --git a/queue-5.0/kvm-nvmx-expose-rdpmc-exiting-only-when-guest-suppor.patch b/queue-5.0/kvm-nvmx-expose-rdpmc-exiting-only-when-guest-suppor.patch deleted file mode 100644 index 8af5b9e2310..00000000000 --- a/queue-5.0/kvm-nvmx-expose-rdpmc-exiting-only-when-guest-suppor.patch +++ /dev/null @@ -1,83 +0,0 @@ -From b2f60a8fdcd51dddc0245e1e6dce33d3e2064b4a Mon Sep 17 00:00:00 2001 -From: Liran Alon -Date: Mon, 25 Mar 2019 21:09:17 +0200 -Subject: KVM: nVMX: Expose RDPMC-exiting only when guest supports PMU - -[ Upstream commit e51bfdb68725dc052d16241ace40ea3140f938aa ] - -Issue was discovered when running kvm-unit-tests on KVM running as L1 on -top of Hyper-V. - -When vmx_instruction_intercept unit-test attempts to run RDPMC to test -RDPMC-exiting, it is intercepted by L1 KVM which it's EXIT_REASON_RDPMC -handler raise #GP because vCPU exposed by Hyper-V doesn't support PMU. -Instead of unit-test expectation to be reflected with EXIT_REASON_RDPMC. - -The reason vmx_instruction_intercept unit-test attempts to run RDPMC -even though Hyper-V doesn't support PMU is because L1 expose to L2 -support for RDPMC-exiting. Which is reasonable to assume that is -supported only in case CPU supports PMU to being with. - -Above issue can easily be simulated by modifying -vmx_instruction_intercept config in x86/unittests.cfg to run QEMU with -"-cpu host,+vmx,-pmu" and run unit-test. - -To handle issue, change KVM to expose RDPMC-exiting only when guest -supports PMU. - -Reported-by: Saar Amar -Reviewed-by: Mihai Carabas -Reviewed-by: Jim Mattson -Signed-off-by: Liran Alon -Signed-off-by: Paolo Bonzini -Signed-off-by: Sasha Levin ---- - arch/x86/kvm/vmx/vmx.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c -index da6fdd5434a17..8f0426d46ba3c 100644 ---- a/arch/x86/kvm/vmx/vmx.c -+++ b/arch/x86/kvm/vmx/vmx.c -@@ -6982,6 +6982,30 @@ static void nested_vmx_entry_exit_ctls_update(struct kvm_vcpu *vcpu) - } - } - -+static bool guest_cpuid_has_pmu(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_cpuid_entry2 *entry; -+ union cpuid10_eax eax; -+ -+ entry = kvm_find_cpuid_entry(vcpu, 0xa, 0); -+ if (!entry) -+ return false; -+ -+ eax.full = entry->eax; -+ return (eax.split.version_id > 0); -+} -+ -+static void nested_vmx_procbased_ctls_update(struct kvm_vcpu *vcpu) -+{ -+ struct vcpu_vmx *vmx = to_vmx(vcpu); -+ bool pmu_enabled = guest_cpuid_has_pmu(vcpu); -+ -+ if (pmu_enabled) -+ vmx->nested.msrs.procbased_ctls_high |= CPU_BASED_RDPMC_EXITING; -+ else -+ vmx->nested.msrs.procbased_ctls_high &= ~CPU_BASED_RDPMC_EXITING; -+} -+ - static void update_intel_pt_cfg(struct kvm_vcpu *vcpu) - { - struct vcpu_vmx *vmx = to_vmx(vcpu); -@@ -7070,6 +7094,7 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) - if (nested_vmx_allowed(vcpu)) { - nested_vmx_cr_fixed1_bits_update(vcpu); - nested_vmx_entry_exit_ctls_update(vcpu); -+ nested_vmx_procbased_ctls_update(vcpu); - } - - if (boot_cpu_has(X86_FEATURE_INTEL_PT) && --- -2.20.1 - diff --git a/queue-5.0/kvm-x86-raise-gp-when-guest-vcpu-do-not-support-pmu.patch b/queue-5.0/kvm-x86-raise-gp-when-guest-vcpu-do-not-support-pmu.patch deleted file mode 100644 index e2e5f81191a..00000000000 --- a/queue-5.0/kvm-x86-raise-gp-when-guest-vcpu-do-not-support-pmu.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 203d4ce96d1c7e027a30a3eeb5a623834bbf0d26 Mon Sep 17 00:00:00 2001 -From: Liran Alon -Date: Mon, 25 Mar 2019 21:10:17 +0200 -Subject: KVM: x86: Raise #GP when guest vCPU do not support PMU - -[ Upstream commit 672ff6cff80ca43bf3258410d2b887036969df5f ] - -Before this change, reading a VMware pseduo PMC will succeed even when -PMU is not supported by guest. This can easily be seen by running -kvm-unit-test vmware_backdoors with "-cpu host,-pmu" option. - -Reviewed-by: Mihai Carabas -Signed-off-by: Liran Alon -Signed-off-by: Paolo Bonzini -Signed-off-by: Sasha Levin ---- - arch/x86/kvm/pmu.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c -index 58ead7db71a31..e39741997893a 100644 ---- a/arch/x86/kvm/pmu.c -+++ b/arch/x86/kvm/pmu.c -@@ -281,9 +281,13 @@ static int kvm_pmu_rdpmc_vmware(struct kvm_vcpu *vcpu, unsigned idx, u64 *data) - int kvm_pmu_rdpmc(struct kvm_vcpu *vcpu, unsigned idx, u64 *data) - { - bool fast_mode = idx & (1u << 31); -+ struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); - struct kvm_pmc *pmc; - u64 ctr_val; - -+ if (!pmu->version) -+ return 1; -+ - if (is_vmware_backdoor_pmc(idx)) - return kvm_pmu_rdpmc_vmware(vcpu, idx, data); - --- -2.20.1 - diff --git a/queue-5.0/series b/queue-5.0/series index 0d9a70f4de5..03d88d78d9f 100644 --- a/queue-5.0/series +++ b/queue-5.0/series @@ -48,8 +48,6 @@ x86-build-lto-fix-truncated-.bss-with-fdata-sections.patch x86-mm-prevent-bogus-warnings-with-noexec-off.patch x86-reboot-efi-use-efi-reboot-for-acer-travelmate-x5.patch kvm-nvmx-always-use-early-vmcs-check-when-ept-is-dis.patch -kvm-x86-raise-gp-when-guest-vcpu-do-not-support-pmu.patch -kvm-nvmx-expose-rdpmc-exiting-only-when-guest-suppor.patch kvm-fix-spectrev1-gadgets.patch kvm-x86-avoid-misreporting-level-triggered-irqs-as-e.patch tools-lib-traceevent-fix-missing-equality-check-for-.patch