From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH v2 28/30] KVM: x86 emulator: restart string instruction without going back to a guest.
Date: Mon, 15 Mar 2010 12:07:56 +0200 [thread overview]
Message-ID: <20100315100756.GH4294@redhat.com> (raw)
In-Reply-To: <4B9E0450.4090403@redhat.com>
On Mon, Mar 15, 2010 at 11:56:32AM +0200, Avi Kivity wrote:
> On 03/15/2010 11:44 AM, Gleb Natapov wrote:
> >On Mon, Mar 15, 2010 at 09:44:26AM +0200, Avi Kivity wrote:
> >>On 03/14/2010 08:06 PM, Gleb Natapov wrote:
> >>>>Suggest simply reentering every N executions.
> >>>>
> >>>This restart mechanism is, in fact, needed for ins read ahead to work.
> >>>After reading ahead from IO port we need to avoid entering decoder
> >>>until entire cache is consumed otherwise decoder will clear cache and
> >>>data will be lost. So we can't just enter guest in arbitrary times, only
> >>>when read ahead cache is empty. Since read ahead is never done across
> >>>page boundary this is save place to re-enter guest.
> >>Please make the two depend on each other directly then. We can't
> >>expect the reader of the emulator code know that.
> >>
> >We can document that. I wouldn't want to have different conditions for
> >guest re-entry for different opcodes.
>
> We now have a write buffer size of one. It's just a matter of
> making the emulator know the size of the buffer (extra parameter to
> ->write_emulated).
>
The buffer is maintained inside emulator, so emulator knows about it and
can check it, but then for all other string instruction except INS we will
re-enter guest on each iteration.
> >>Have the emulator ask the buffer when it is empty.
> >>
> >It will be always empty for all string ops except INS.
> >
>
> Or we can make the buffer larger for everyone (outside this patchset
> though).
>
I am not sure what do you mean here. INS read ahead and MMIO read cache are
different beasts. Former is needed to speed-up string pio reads, later
(not yet implemented) is needed to reread previous MMIO read results in
case instruction emulation is restarted due to need to exit to userspace.
MMIO read cache need to be invalidated on each iteration of string
instruction.
--
Gleb.
next prev parent reply other threads:[~2010-03-15 10:07 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-14 16:20 [PATCH v2 00/30] emulator cleanup Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 01/30] KVM: x86 emulator: Fix DstAcc decoding Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 02/30] KVM: x86 emulator: fix RCX access during rep emulation Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 03/30] KVM: x86 emulator: check return value against correct define Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 04/30] KVM: Remove pointer to rflags from realmode_set_cr parameters Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 05/30] KVM: Provide callback to get/set control registers in emulator ops Gleb Natapov
2010-03-15 13:06 ` Andre Przywara
2010-03-15 13:11 ` Gleb Natapov
2010-03-15 13:13 ` Avi Kivity
2010-03-14 16:20 ` [PATCH v2 06/30] KVM: remove realmode_lmsw function Gleb Natapov
2010-03-15 11:02 ` Andre Przywara
2010-03-15 11:41 ` Avi Kivity
2010-03-14 16:20 ` [PATCH v2 07/30] KVM: Provide x86_emulate_ctxt callback to get current cpl Gleb Natapov
2010-03-15 13:16 ` Andre Przywara
2010-03-15 13:21 ` Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 08/30] KVM: Provide current eip as part of emulator context Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 09/30] KVM: x86 emulator: fix mov r/m, sreg emulation Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 10/30] KVM: x86 emulator: fix 0f 01 /5 emulation Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 11/30] KVM: x86 emulator: 0f (20|21|22|23) ignore mod bits Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 12/30] KVM: x86 emulator: inject #UD on access to non-existing CR Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 13/30] KVM: x86 emulator: fix mov dr to inject #UD when needed Gleb Natapov
2010-03-14 16:20 ` [PATCH v2 14/30] KVM: x86 emulator: fix return values of syscall/sysenter/sysexit emulations Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 15/30] KVM: x86 emulator: do not call writeback if msr access fails Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 16/30] KVM: x86 emulator: If LOCK prefix is used dest arg should be memory Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 17/30] KVM: x86 emulator: cleanup grp3 return value Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 18/30] KVM: x86 emulator: Provide more callbacks for x86 emulator Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 19/30] KVM: x86 emulator: Emulate task switch in emulator.c Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 20/30] KVM: x86 emulator: Use load_segment_descriptor() instead of kvm_load_segment_descriptor() Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 21/30] KVM: Use task switch from emulator.c Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 22/30] KVM: x86 emulator: populate OP_MEM operand during decoding Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 23/30] KVM: x86 emulator: add decoding of X,Y parameters from Intel SDM Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 24/30] KVM: x86 emulator: during rep emulation decrement ECX only if emulation succeeded Gleb Natapov
2010-03-14 16:42 ` Avi Kivity
2010-03-14 16:21 ` [PATCH v2 25/30] KVM: x86 emulator: fix in/out emulation Gleb Natapov
2010-03-14 16:54 ` Avi Kivity
2010-03-14 17:35 ` Gleb Natapov
2010-03-15 7:41 ` Avi Kivity
2010-03-15 7:44 ` Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 26/30] KVM: x86 emulator: Move string pio emulation into emulator.c Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 27/30] KVM: x86 emulator: remove saved_eip Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 28/30] KVM: x86 emulator: restart string instruction without going back to a guest Gleb Natapov
2010-03-14 16:56 ` Avi Kivity
2010-03-14 18:06 ` Gleb Natapov
2010-03-15 7:44 ` Avi Kivity
2010-03-15 9:44 ` Gleb Natapov
2010-03-15 9:56 ` Avi Kivity
2010-03-15 10:07 ` Gleb Natapov [this message]
2010-03-15 10:15 ` Avi Kivity
2010-03-15 10:19 ` Gleb Natapov
2010-03-15 10:24 ` Avi Kivity
2010-03-15 10:33 ` Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 29/30] KVM: x86 emulator: introduce pio in string read ahead Gleb Natapov
2010-03-14 16:21 ` [PATCH v2 30/30] KVM: small kvm_arch_vcpu_ioctl_run() cleanup Gleb Natapov
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=20100315100756.GH4294@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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