All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Apply paravirt to all vcpu
Date: Tue, 22 Nov 2011 18:36:37 +0000	[thread overview]
Message-ID: <4ECBEBB5.9040500@freescale.com> (raw)
In-Reply-To: <1321955703-1628-1-git-send-email-yu.liu@freescale.com>

On 11/22/2011 05:27 AM, Alexander Graf wrote:
> 
> 
> 
> 
> On 22.11.2011, at 12:19, Liu Yu-B13201 <B13201@freescale.com> wrote:
> 
>>
>>
>>> -----Original Message-----
>>> From: Alexander Graf [mailto:agraf@suse.de] 
>>> Sent: Tuesday, November 22, 2011 7:14 PM
>>> To: Liu Yu-B13201
>>> Cc: <kvm-ppc@vger.kernel.org>; Liu Yu-B13201
>>> Subject: Re: [PATCH] KVM: PPC: Apply paravirt to all vcpu
>>>
>>>
>>> On 22.11.2011, at 10:55, Liu Yu <yu.liu@freescale.com> wrote:
>>>
>>>> Previously, only primary vcpu get enabled paravirt.
>>>
>>> Please fix it the other way around. Thd hypercall is CPU 
>>> local and should stay that way, so we have to call it on each 
>>> vcpu inside the guest.
>>>
>>
>> The guest kernel already use on_each_cpu()
>> But seems it doesn't work.
>> The place primary cpu do hypercall is still in early_init
>> where secondary cpus don't get kicked.
> 
> Ouch. Then let's go with this approach and
> 
> a) update the hypercall documentation
> b) change the guest code to not loop through all cpus
> c) flush the tlb cache on all vcpus from the hc handler

It's currently only our internal tree that does it from early_init (as
part of the idle paravirt patch, to avoid races -- though I can't recall
now what the problematic race is there).  It should have been changed
for the SPRG4-7 paravirt as well.  We don't want a secondary CPU to take
an exception and save something into a paravirt SPRG, but read from the
hardware SPRG, due to the patching being incomplete.

An alternative would be to still do it after secondaries are up, but
instead of just doing the hcall in kvm_map_magic_page, all but one cpu
would be held in a loop with interrupts off until the patching is complete.

Or just always use the supervisor version of SPRG4-7 for kernel access,
whether reading or writing -- this should always trap in PR-mode.

-Scott


  parent reply	other threads:[~2011-11-22 18:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22  9:55 [PATCH] KVM: PPC: Apply paravirt to all vcpu Liu Yu
2011-11-22 11:13 ` Alexander Graf
2011-11-22 11:19 ` Liu Yu-B13201
2011-11-22 11:27 ` Alexander Graf
2011-11-22 18:36 ` Scott Wood [this message]
2011-11-22 20:44 ` Alexander Graf
2011-11-22 21:11 ` Yoder Stuart-B08248
2011-11-22 21:27 ` Alexander Graf
2011-11-22 21:45 ` Yoder Stuart-B08248
2011-11-22 22:02 ` Scott Wood
2011-11-25  6:52 ` Liu Yu-B13201
2011-11-25 10:00 ` Alexander Graf

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=4ECBEBB5.9040500@freescale.com \
    --to=scottwood@freescale.com \
    --cc=kvm-ppc@vger.kernel.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.