public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Christoffer Dall <c.dall@virtualopensystems.com>,
	kvm@vger.kernel.org, Marc.Zyngier@arm.com, agraf@suse.de,
	kvm-ppc@vger.kernel.org, avi@redhat.com,
	tech@virtualopensystems.com
Subject: Re: [PATCH v2] KVM: Factor out kvm_vcpu_kick to arch-generic code
Date: Mon, 6 Feb 2012 18:22:28 -0200	[thread overview]
Message-ID: <20120206202228.GA23796@amt.cnet> (raw)
In-Reply-To: <4F3032AC.10809@web.de>

On Mon, Feb 06, 2012 at 09:06:04PM +0100, Jan Kiszka wrote:
> On 2012-02-06 19:25, Marcelo Tosatti wrote:
> >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> >> index c38efd7..a1761ff 100644
> >> --- a/arch/x86/kvm/x86.c
> >> +++ b/arch/x86/kvm/x86.c
> >> @@ -2252,7 +2252,6 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
> >>  		kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
> >>  		if (vcpu->cpu != cpu)
> >>  			kvm_migrate_timers(vcpu);
> >> -		vcpu->cpu = cpu;
> >>  	}
> > 
> > This is wrong, kvm_sched_in fails to see vcpu->cpu properly. Please
> > keep vcpu->cpu assignment in arch code.
> 
> True, but then kvm_sched_in is a better place for this assignment (as
> it's central), no?
> 
> Jan

Not necessarily. Arch code might want to have:

kvm_arch_vcpu_load()
{
	cpu = smp_processor_id();

	if (vcpu->cpu != cpu) {
		localize vcpu to cpu
		vcpu->cpu = cpu
	}

	call functions which use vcpu->cpu
}


  reply	other threads:[~2012-02-06 20:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25  4:27 [PATCH v2] KVM: Factor out kvm_vcpu_kick to arch-generic code Christoffer Dall
2012-02-06 18:25 ` Marcelo Tosatti
2012-02-06 20:06   ` Jan Kiszka
2012-02-06 20:22     ` Marcelo Tosatti [this message]
2012-02-08 16:52   ` Alexander Graf
2012-02-08 20:30     ` Christoffer Dall

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=20120206202228.GA23796@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=c.dall@virtualopensystems.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=tech@virtualopensystems.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