Re: [PATCH] KVM: APIC: avoid instruction emulation for EOI writes

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

 



On 08/29/2011 01:24 PM, Jan Kiszka wrote:
>
>   static int handle_apic_access(struct kvm_vcpu *vcpu)
>   {
>  +	unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
>  +	int access_type, offset;
>  +
>  +	access_type = (exit_qualification>>  12)&  0xf;
>  +	offset = exit_qualification&  0xfff;
>  +	/*
>  +	 * Sane guest uses MOV instead of string operations to
>  +	 * write EOI, with written value not cared. So make a
>  +	 * short-circuit here by avoiding heavy instruction
>  +	 * emulation.
>  +	 */

Is there no cheap way to validate this assumption and fall back to the
slow path in case it doesn't apply? E.g. reading the first instruction
byte and matching it against a whitelist? Even if the ignored scenarios
are highly unlikely, I think we so far tried hard to provide both fast
and accurate results to the guest in all cases.


Just reading the first byte requires a guest page table walk. This is probably the highest cost in emulation (which also requires a walk for the data access).

--
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