From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: [PATCH 8/9] KVM: x86 emulator: fix RDPMC privilege check Date: Sun, 30 Oct 2011 18:53:43 +0200 Message-ID: <1319993624-20247-9-git-send-email-gleb@redhat.com> References: <1319993624-20247-1-git-send-email-gleb@redhat.com> Cc: avi@redhat.com, mtosatti@redhat.com, linux-kernel@redhat.com, mingo@elte.hu, a.p.zijlstra@chello.nl, acme@ghostprotocols.net To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47438 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934232Ab1J3QyD (ORCPT ); Sun, 30 Oct 2011 12:54:03 -0400 In-Reply-To: <1319993624-20247-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Avi Kivity RDPMC is only privileged if CR4.PCE=0. check_rdpmc() already implements this, so all we need to do is drop the Priv flag. Signed-off-by: Avi Kivity Signed-off-by: Gleb Natapov --- arch/x86/kvm/emulate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 8547958..c0ee85b 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3254,7 +3254,7 @@ static struct opcode twobyte_table[256] = { DI(ImplicitOps | Priv, wrmsr), IIP(ImplicitOps, em_rdtsc, rdtsc, check_rdtsc), DI(ImplicitOps | Priv, rdmsr), - DIP(ImplicitOps | Priv, rdpmc, check_rdpmc), + DIP(ImplicitOps, rdpmc, check_rdpmc), I(ImplicitOps | VendorSpecific, em_sysenter), I(ImplicitOps | Priv | VendorSpecific, em_sysexit), N, N, -- 1.7.5.3