All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: Fix kvmclock initialization on !CONFIG_KVM_GUEST
Date: Thu, 16 Aug 2012 16:57:47 -0300	[thread overview]
Message-ID: <20120816195747.GA10759@amt.cnet> (raw)
In-Reply-To: <87393o1c8q.fsf@devron.myhome.or.jp>

On Wed, Aug 15, 2012 at 11:05:57PM +0900, OGAWA Hirofumi wrote:
> 
> If !CONFIG_KVM_GUEST, kvm_smp_prepare_boot_cpu() is not defined. So,
> kvm_register_clock("primary cpu clock") in kvm_smp_prepare_boot_cpu()
> is not called.
> 
> The detail of problem is hv_clock percpu usage. hv_clock is percpu
> variable, but kvmclock_init() is called _before_ initializing percpu
> area, and doesn't update address after initialized percpu area.
> 
> So, host kvm modify the memory area _before_ initializing percpu. This
> became the cause of strange memory corruption on guest OS.
> 
> 
> This fixes it by adding kvm_smp_prepare_boot_cpu().  [we might be
> better to kill the usage before percpu initialization.]
> 
> Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

The distinction between CONFIG_KVM_CLOCK and CONFIG_KVM_GUEST is 
not so clear anymore, as this bug demonstrates.

There is no point in having a separate config option, therefore i
propose to merge the two (see other reply) instead.


  reply	other threads:[~2012-08-16 20:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 14:05 [PATCH] kvm: Fix kvmclock initialization on !CONFIG_KVM_GUEST OGAWA Hirofumi
2012-08-16 19:57 ` Marcelo Tosatti [this message]
2012-08-17  0:10   ` OGAWA Hirofumi
2012-08-17 17:54     ` Marcelo Tosatti
2012-08-18  0:17       ` OGAWA Hirofumi
2012-08-16 20:00 ` [PATCH] x86: KVM guest: merge CONFIG_KVM_CLOCK into CONFIG_KVM_GUEST Marcelo Tosatti

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=20120816195747.GA10759@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=kvm@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.