Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 270c6c79 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity
Browse files

KVM: x86 emulator: correctly mask pmc index bits in RDPMC instruction emulation



Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 565f3be2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ int kvm_pmu_read_pmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data)
	struct kvm_pmc *counters;
	u64 ctr;

	pmc &= (3u << 30) - 1;
	pmc &= ~(3u << 30);
	if (!fixed && pmc >= pmu->nr_arch_gp_counters)
		return 1;
	if (fixed && pmc >= pmu->nr_arch_fixed_counters)