FAILED: patch "[PATCH] KVM: x86/pmu: Disallow legacy LBRs if architectural LBRs are" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 098f4c061ea10b777033b71c10bd9fd706820ee9
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023050609-dust-unequal-f736@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
098f4c061ea1 ("KVM: x86/pmu: Disallow legacy LBRs if architectural LBRs are available") bec46859fb9d ("KVM: x86: Track supported PERF_CAPABILITIES in kvm_caps") 0b9ca98b7229 ("perf/x86/core: Zero @lbr instead of returning -1 in x86_perf_get_lbr() stub")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 098f4c061ea10b777033b71c10bd9fd706820ee9 Mon Sep 17 00:00:00 2001
From: Sean Christopherson <[email protected]>
Date: Sat, 28 Jan 2023 00:14:27 +0000
Subject: [PATCH] KVM: x86/pmu: Disallow legacy LBRs if architectural LBRs are
available
Disallow enabling LBR support if the CPU supports architectural LBRs. Traditional LBR support is absent on CPU models that have architectural LBRs, and KVM doesn't yet support arch LBRs, i.e. KVM will pass through non-existent MSRs if userspace enables LBRs for the guest.
arch/x86/kvm/vmx/vmx.c +5 -3
@@ -7793,9 +7793,11 @@ static u64 vmx_get_perf_capabilities(void)if (boot_cpu_has (X86_FEATURE_PDCM ))rdmsrl (MSR_IA32_PERF_CAPABILITIES , host_perf_cap); -x86_perf_get_lbr (&lbr); -if (lbr.nr) - perf_cap |= host_perf_cap &PMU_CAP_LBR_FMT ; +if (!cpu_feature_enabled (X86_FEATURE_ARCH_LBR )) { +x86_perf_get_lbr (&lbr); +if (lbr.nr) + perf_cap |= host_perf_cap &PMU_CAP_LBR_FMT ; + }if (vmx_pebs_supported ()) { perf_cap |= host_perf_cap &PERF_CAP_PEBS_MASK ;