All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>, gleb@kernel.org
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Break kvm_for_each_vcpu loop after finding the VP_INDEX
Date: Thu, 27 Feb 2014 19:26:03 +0100	[thread overview]
Message-ID: <530F833B.7090607@redhat.com> (raw)
In-Reply-To: <20140227150831.cadb1e95.yoshikawa_takuya_b1@lab.ntt.co.jp>

Il 27/02/2014 07:08, Takuya Yoshikawa ha scritto:
> No need to scan the entire VCPU array.
>
> Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
> ---
>  BTW, this looks like hyperv support forces us to stick to the current
>  implementation which stores VCPUs in an array, or at least something
>  we can index them; not a good thing.
>
>  arch/x86/kvm/x86.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 4cca458..773eba7 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2328,9 +2328,12 @@ static int get_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
>  	case HV_X64_MSR_VP_INDEX: {
>  		int r;
>  		struct kvm_vcpu *v;
> -		kvm_for_each_vcpu(r, v, vcpu->kvm)
> -			if (v == vcpu)
> +		kvm_for_each_vcpu(r, v, vcpu->kvm) {
> +			if (v == vcpu) {
>  				data = r;
> +				break;
> +			}
> +		}
>  		break;
>  	}
>  	case HV_X64_MSR_EOI:
>

Applying to kvm/queue, thanks.

Paolo

      reply	other threads:[~2014-02-27 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  6:08 [PATCH] KVM: x86: Break kvm_for_each_vcpu loop after finding the VP_INDEX Takuya Yoshikawa
2014-02-27 18:26 ` Paolo Bonzini [this message]

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=530F833B.7090607@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=yoshikawa_takuya_b1@lab.ntt.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.