public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Wei Huang <wei@redhat.com>
Cc: kvm@vger.kernel.org, gleb@kernel.org, pbonzini@redhat.com,
	joro@8bytes.org
Subject: Re: [PATCH V3 4/4] KVM: x86/vPMU: Enable PMU handling for AMD PERFCTRn and EVNTSELn MSRs
Date: Wed, 22 Apr 2015 19:23:15 +0200	[thread overview]
Message-ID: <20150422172311.GC6838@potion.brq.redhat.com> (raw)
In-Reply-To: <1429338232-11938-5-git-send-email-wei@redhat.com>

2015-04-18 02:23-0400, Wei Huang:
> This patch enables AMD guest VM to access (R/W) PMU related MSRs, which
> include PERFCTR[0..3] and EVNTSEL[0..3].
> 
> Signed-off-by: Wei Huang <wei@redhat.com>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> @@ -2268,27 +2268,17 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
>  	 * which we perfectly emulate ;-). Any other value should be at least
>  	 * reported, some guests depend on them.

(This comment is a bit outdated now too.)

>  	 */
> -	case MSR_K7_EVNTSEL0:
> -	case MSR_K7_EVNTSEL1:
> -	case MSR_K7_EVNTSEL2:
> -	case MSR_K7_EVNTSEL3:
> -		if (data != 0)
> -			vcpu_unimpl(vcpu, "unimplemented perfctr wrmsr: "
> -				    "0x%x data 0x%llx\n", msr, data);
> -		break;
> -	/* at least RHEL 4 unconditionally writes to the perfctr registers,
> -	 * so we ignore writes to make it happy.
> -	 */
> @@ -2513,6 +2503,12 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
>  	case MSR_K7_EVNTSEL0:
>  	case MSR_K7_EVNTSEL1:
>  	case MSR_K7_EVNTSEL2:
|  	case MSR_K7_EVNTSEL3:
|  	case MSR_K7_PERFCTR0:
>  	case MSR_K7_PERFCTR1:
>  	case MSR_K7_PERFCTR2:
>  	case MSR_K7_PERFCTR3:

(As we depend on continuous ranges anyway, the GCCism comes to mind:
 'case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR3:')

>  	case MSR_P6_PERFCTR0:
>  	case MSR_P6_PERFCTR1:
>  	case MSR_P6_EVNTSEL0:

  reply	other threads:[~2015-04-22 17:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-18  6:23 [PATCH V3 0/4] KVM vPMU support for AMD CPUs Wei Huang
2015-04-18  6:23 ` [PATCH V3 1/4] KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch Wei Huang
2015-04-18  6:23 ` [PATCH V3 2/4] KVM: x86/vPMU: Create vPMU interface for VMX and SVM Wei Huang
2015-04-22 17:20   ` Radim Krčmář
2015-04-18  6:23 ` [PATCH V3 3/4] KVM: x86/vPMU: Implement AMD vPMU code for KVM Wei Huang
2015-04-22 17:22   ` Radim Krčmář
2015-04-18  6:23 ` [PATCH V3 4/4] KVM: x86/vPMU: Enable PMU handling for AMD PERFCTRn and EVNTSELn MSRs Wei Huang
2015-04-22 17:23   ` Radim Krčmář [this message]
2015-04-21 16:38 ` [PATCH V3 0/4] KVM vPMU support for AMD CPUs Radim Krčmář
2015-04-22 17:28 ` Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150422172311.GC6838@potion.brq.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=gleb@kernel.org \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox