Patch "KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-x86-pmu-don-t-truncate-the-perfevtseln-msr-when-.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 50d24326c9d0811af198b6310a146f454306165d
Author: Jim Mattson <jmattson@xxxxxxxxxx>
Date:   Wed Feb 2 17:48:12 2022 -0800

    KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event
    
    [ Upstream commit b8bfee85f1307426e0242d654f3a14c06ef639c5 ]
    
    AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of
    a PerfEvtSeln MSR. Don't drop the high nybble when setting up the
    config field of a perf_event_attr structure for a call to
    perf_event_create_kernel_counter().
    
    Fixes: ca724305a2b0 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM")
    Reported-by: Stephane Eranian <eranian@xxxxxxxxxx>
    Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
    Message-Id: <20220203014813.2130559-1-jmattson@xxxxxxxxxx>
    Reviewed-by: David Dunn <daviddunn@xxxxxxxxxx>
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
index 3b3ccf5b11064..944137ed1f901 100644
--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -95,7 +95,7 @@ static void kvm_perf_overflow_intr(struct perf_event *perf_event,
 }
 
 static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
-				  unsigned config, bool exclude_user,
+				  u64 config, bool exclude_user,
 				  bool exclude_kernel, bool intr,
 				  bool in_tx, bool in_tx_cp)
 {
@@ -173,7 +173,8 @@ static bool pmc_resume_counter(struct kvm_pmc *pmc)
 
 void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel)
 {
-	unsigned config, type = PERF_TYPE_RAW;
+	u64 config;
+	u32 type = PERF_TYPE_RAW;
 	struct kvm *kvm = pmc->vcpu->kvm;
 	struct kvm_pmu_event_filter *filter;
 	int i;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux