All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org, mtosatti@redhat.com
Subject: Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.
Date: Wed, 06 Jun 2012 11:04:03 +0300	[thread overview]
Message-ID: <4FCF0EF3.9060509@redhat.com> (raw)
In-Reply-To: <20120605171919.GH20236@redhat.com>

On 06/05/2012 08:19 PM, Gleb Natapov wrote:
> On Tue, Jun 05, 2012 at 07:07:39PM +0300, Avi Kivity wrote:
>> > +
>> > +	count = (PAGE_SIZE - offset_in_page(linear_addr))/size;
>> > +
>> > +	if (count == 0) /* 'in' crosses page boundry */
>> > +		return EMULATE_FAIL;
>> > +
>> > +	count = min(count, rcx);
>> > +
>> > +	r = __kvm_fast_string_pio_in(vcpu, size, port, linear_addr, count);
>> > +
>> > +	if (r != EMULATE_DO_MMIO)
>> > +		return r;
>> > +
>> > +	vcpu->arch.fast_string_pio_ctxt.linear_addr = linear_addr;
>> > +	vcpu->arch.complete_userspace_io = complete_fast_string_pio;
>> > +	return EMULATE_DO_MMIO;
>> > +}
>> > +EXPORT_SYMBOL_GPL(kvm_fast_string_pio_in);
>> 
>> Perhaps a better way to do it is to move the code into the emulator,
>> which already handles all the checks and masks, and just avoid
>> x86_decode_insn()/x86_emulate_insn().
>> 
> I do not see how it would be better. Emulator works on different data
> structures that should be prepared and the only functions that we can
> reuse (as far as I see) are register_address_increment() and ad_mask()
> anyway.

Also linearize().  Remember the hardware segment checks are only applied
to the first iteration.

-- 
error compiling committee.c: too many arguments to function

      reply	other threads:[~2012-06-06  8:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 14:08 [PATCH 0/2] improve speed of "rep ins" emulation Gleb Natapov
2012-05-23 14:08 ` [PATCH 1/2] Provide userspace IO exit completion callback Gleb Natapov
2012-05-23 14:08 ` [PATCH 2/2] Provide fast path for "rep ins" emulation if possible Gleb Natapov
2012-05-23 14:40   ` Avi Kivity
2012-05-23 14:49     ` Avi Kivity
2012-05-24 10:34       ` Roedel, Joerg
2012-05-24 10:36         ` Avi Kivity
2012-05-24 10:54           ` Roedel, Joerg
2012-06-05 17:27             ` Alexander Graf
2012-06-05 17:36               ` Gleb Natapov
2012-06-05 17:41                 ` Alexander Graf
2012-06-05 17:50                   ` Gleb Natapov
2012-06-05 18:17                     ` Gleb Natapov
2012-06-05 17:57                   ` Gleb Natapov
2012-06-06  9:28                     ` Roedel, Joerg
2012-06-05 16:07   ` Avi Kivity
2012-06-05 17:19     ` Gleb Natapov
2012-06-06  8:04       ` Avi Kivity [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=4FCF0EF3.9060509@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@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 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.