All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	qemu-devel@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [PATCH for-1.4 qom-cpu 2/9] target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index
Date: Wed, 23 Jan 2013 12:26:33 +0200	[thread overview]
Message-ID: <20130123102633.GO31120@redhat.com> (raw)
In-Reply-To: <1358886309-26258-3-git-send-email-ehabkost@redhat.com>

On Tue, Jan 22, 2013 at 06:25:02PM -0200, Eduardo Habkost wrote:
> The CPU ID in KVM is supposed to be the APIC ID, so change the
> KVM_CREATE_VCPU call to match it. The current behavior didn't break
> anything yet because today the APIC ID is assumed to be equal to the CPU
> index, but this won't be true in the future.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Gleb Natapov <gleb@redhat.com>

> ---
> Cc: kvm@vger.kernel.org
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Gleb Natapov <gleb@redhat.com>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> 
> Changes v2:
>  - Change only i386 code (kvm_arch_vcpu_id())
> 
> Changes v3:
>  - Get CPUState as argument instead of CPUArchState
> ---
>  target-i386/kvm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index 5f3f789..c440809 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -411,9 +411,10 @@ static void cpu_update_state(void *opaque, int running, RunState state)
>      }
>  }
>  
> -unsigned long kvm_arch_vcpu_id(CPUState *cpu)
> +unsigned long kvm_arch_vcpu_id(CPUState *cs)
>  {
> -    return cpu->cpu_index;
> +    X86CPU *cpu = X86_CPU(cs);
> +    return cpu->env.cpuid_apic_id;
>  }
>  
>  int kvm_arch_init_vcpu(CPUState *cs)
> -- 
> 1.8.1

--
			Gleb.

  reply	other threads:[~2013-01-23 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1358886309-26258-1-git-send-email-ehabkost@redhat.com>
2013-01-22 20:25 ` [PATCH for-1.4 qom-cpu 1/9] kvm: Create kvm_arch_vcpu_id() function Eduardo Habkost
2013-01-23 10:26   ` Gleb Natapov
2013-01-22 20:25 ` [PATCH for-1.4 qom-cpu 2/9] target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index Eduardo Habkost
2013-01-23 10:26   ` Gleb Natapov [this message]
2013-01-23 16:12     ` [Qemu-devel] " Andreas Färber

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=20130123102633.GO31120@redhat.com \
    --to=gleb@redhat.com \
    --cc=afaerber@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.