Re: [PATCH 2/2] Provide fast path for "rep ins" emulation if possible.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux