From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>, kvm <kvm@vger.kernel.org>,
Gleb Natapov <gleb@redhat.com>
Subject: Re: VMX and save/restore guest in virtual-8086 mode
Date: Thu, 8 Apr 2010 11:47:14 -0300 [thread overview]
Message-ID: <20100408144714.GB20713@amt.cnet> (raw)
In-Reply-To: <4BBD8BBB.3060308@siemens.com>
On Thu, Apr 08, 2010 at 09:54:35AM +0200, Jan Kiszka wrote:
> >>>> The following patch fixes it, but it has some drawbacks:
> >>>>
> >>>> - cpu_synchronize_state+writeback is noticeably slow with tpr patching,
> >>>> this makes it slower.
> >>>>
> >>>>
> >>> Isn't it a very rare event?
> >>>
> >> It has to be - otherwise the decision to go for full sync and individual
> >> get/set IOCTL would have been wrong. What happens during tpr patching?
> >>
> >>
> >
> > tpr patching listens for instructions which access the tpr and patches
> > them to a call instruction (targeting some hacky code in the bios).
> > Since there are a limited number of such instructions (20-30 IIRC) you
> > expect tpr patching to happen very rarely.
>
> Then I wonder why it is noticeable.
While switching kvm-tpr-opt.c from explicit {get,put}_{s}regs
to cpu_synchronize_state+writeback i noticed WinXP.32 boot
became visually slower. For some reason, the delay introduced by
cpu_synchronize_state+writeback forbids patching certain instructions
for longer periods, or somehow allows Windows to use unpatched
instructions more often </guess>. End result was 4x more patching (from
700 to 4000, roughly). Confirmed it was a timing issue by introducing
delays to original {get,put}_{s}regs version.
The particular tpr case is no big deal since as mentioned its a short
lived period, but for things like Kemari this might be an issue. But
this is another discussion.
prev parent reply other threads:[~2010-04-08 14:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 20:24 VMX and save/restore guest in virtual-8086 mode Marcelo Tosatti
2010-04-07 20:46 ` Avi Kivity
2010-04-08 7:22 ` Jan Kiszka
2010-04-08 7:29 ` Avi Kivity
2010-04-08 7:54 ` Jan Kiszka
2010-04-08 8:05 ` Avi Kivity
2010-04-08 14:16 ` Marcelo Tosatti
2010-04-08 14:47 ` Avi Kivity
2010-04-08 14:56 ` Jan Kiszka
2010-04-08 14:47 ` Marcelo Tosatti [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=20100408144714.GB20713@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=jan.kiszka@siemens.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox